From: Stephen Leake <stephen_leake@acm.org>
Subject: Re: ANN: Ada source code decorator
Date: Sat, 27 May 2006 07:51:09 -0400
Date: 2006-05-27T07:51:09-04:00 [thread overview]
Message-ID: <uodxj1yaa.fsf@acm.org> (raw)
In-Reply-To: m27j485wlq.fsf@grendel.local
Simon Wright <simon@pushface.org> writes:
> Stephen Leake <stephen_leake@acm.org> writes:
>
>> Simon Wright <simon@pushface.org> writes:
>>
>>> Stephen Leake <stephen_leake@acm.org> writes:
>
>> You are arguing that the particular structure defined in the ASIS spec
>> is not one you would use for your particular application.
>>
>> That is certainly your choice. Everyone else will also have a
>> particular choice; probably different. I suspect the choice of
>> structure depends heavily on the algorithm you want to implement.
>
> It would be completely unnatural in XML to represent the concept of a
> name with components as a nested structure. For a start, the XPath
> expressions involved will be unmanageable.
Hmm. Taken purely at face value, that tells me that XML is not a
suitable representation for Ada :).
But if there are a few standard transformations from the ASIS
structure to the XML structure, that would be ok.
> For info, the output from
>
> generic
> package Basis is
> type Base is abstract tagged private;
> procedure Op (B : Base) is abstract;
> private
> type Base is abstract tagged record
> V : Boolean;
> end record;
> end Basis;
>
> was
>
> <asis>
> <generic_package_declaration>
> <defining_identifier>Basis</defining_identifier>
> <private_type_declaration kind="abstract_private_trait">
> <defining_identifier>Base</defining_identifier>
> <tagged_private_type_definition kind="abstract_private_trait">
> </tagged_private_type_definition>
> </private_type_declaration>
> <procedure_declaration kind="abstract_trait">
> <defining_identifier>Op</defining_identifier>
> <parameter_specification kind="ordinary_trait"
> mode="default_in_mode">
> <defining_identifier>B</defining_identifier>
> <identifier>Base</identifier>
> </parameter_specification>
> </procedure_declaration>
> <ordinary_type_declaration>
> <defining_identifier>Base</defining_identifier>
> <type_definition>
> <tagged_record_type_definition kind="abstract_trait">
> </tagged_record_type_definition>
> <record_definition>
> <component_declaration>
> <defining_identifier>V</defining_identifier>
> <component_definition kind="ordinary_trait" size="8">
> <subtype_indication>
> <identifier>Boolean</identifier>
> </subtype_indication>
> </component_definition>
> </component_declaration>
> </record_definition>
> </type_definition>
> </ordinary_type_declaration>
> </generic_package_declaration>
> </asis>
>
> which probably makes more sense to you than to me.
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. 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.
I guess if there was an XML grammar to go along with this, that would
specify that information.
> I can get some of it, of course, but -- for example -- what other
> sorts of traits are there and what do they actually mean?
That does require a better ASIS manual.
This looks like a good start on an XML tool for Ada; I'll keep it in
mind if I ever start using XML :).
--
-- Stephe
next prev parent reply other threads:[~2006-05-27 11:51 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 [this message]
2006-05-27 17:38 ` Simon Wright
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox