From: Simon Wright <simon@pushface.org>
Subject: Re: ANN: Ada source code decorator
Date: Sat, 27 May 2006 18:38:53 +0100
Date: 2006-05-27T18:38:53+01:00 [thread overview]
Message-ID: <m2y7wn4bbm.fsf@grendel.local> (raw)
In-Reply-To: uodxj1yaa.fsf@acm.org
Stephen Leake <stephen_leake@acm.org> writes:
> There seems to be a lot missing. Remember that I have never used XML
> in an application, but my impression was that it's supposed to be a
> self-documenting format.
About as much as Ada is ..
> So, for example, I would expect the various
> identifiers to be labeled more specifically; "variable_identifier",
> "type_identifier". Or have names that match the ASIS query that
> returned them.
The scheme I adopted was to use the ASIS enumeration names as far as
possible: a snippet of the code is
case Asis.Elements.Element_Kind (Element) is
when A_Defining_Name => -- Asis.Declarations
State.Current :=
DOM.Core.Nodes.Append_Child
(State.Current,
DOM.Core.Documents.Create_Element
(State.Document,
To_Tag_Name
(Defining_Name_Kinds'Image
(Asis.Elements.Defining_Name_Kind (Element)))));
Tmp :=
DOM.Core.Nodes.Append_Child
(State.Current,
DOM.Core.Documents.Create_Text_Node
(State.Document,
+Asis.Declarations.Defining_Name_Image (Element)));
where To_Tag_Name strips a leading A_ or An_. So if -- for example, I
don't know if this is exactly right -- my output contained
<defining_identifier>Basis</defining_identifier> that would be because
I got an element of Element_Kind = A_Defining_Name with
Defining_Name_Kind = A_Defining_Identifier. Perhaps I should have said
eg
<defining_name.defining_identifier>?
or, probably better,
<defining_name kind="defining_identifier">?
prev parent reply other threads:[~2006-05-27 17:38 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-23 10:59 ANN: Ada source code decorator Georg Bauhaus
2006-05-23 21:01 ` Simon Wright
2006-05-25 0:28 ` Stephen Leake
2006-05-25 4:54 ` Jeffrey R. Carter
2006-05-25 12:36 ` Georg Bauhaus
2006-05-25 13:48 ` Stephen Leake
2006-05-25 16:16 ` Manuel Collado
2006-05-26 5:54 ` Martin Krischik
2006-05-26 11:08 ` Georg Bauhaus
2006-05-26 20:35 ` Simon Wright
2006-05-27 8:59 ` Martin Krischik
2006-05-27 11:25 ` Georg Bauhaus
2006-05-27 12:13 ` Martin Krischik
2006-05-27 12:06 ` Simon Wright
2006-05-30 17:50 ` Martin Dowie
2006-05-25 19:53 ` Simon Wright
2006-05-26 11:24 ` Stephen Leake
2006-05-26 21:01 ` Simon Wright
2006-05-27 11:51 ` Stephen Leake
2006-05-27 17:38 ` Simon Wright [this message]
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox