Re: ANN: Ada source code decorator



Simon Wright <simon@xxxxxxxxxxxx> writes:

Stephen Leake <stephen_leake@xxxxxxx> writes:

Simon Wright <simon@xxxxxxxxxxxx> writes:

Georg Bauhaus <bauhaus@xxxxxxxxxxxxx> writes:

(* XML - time permitting, using Simon Wright's ASIS based GIs.)

Although that work was useful, a lot more needs to be done on it to
make it anywhere near complete. It would be a lot easier if ASIS
(the standard) was open-source.

The ASIS _standard_ is open-source; it consists of Ada specs giving
the API.

The GNAT implementation is also open-source.

So what is missing?

Something to make it clear what the actual structure is. I found it
very hard indeed to understand what the API was trying to tell me;

Perhaps there needs to be more user-friendly documentation of the ASIS
structure.

for example, a qualified name a.b.c is stored in something like

(a (b (c)))

which you can understand a compiler using,

Well, yes; ASIS is designed to represent the information a compiler
knows. So it helps to be able to think like a compiler :).

rather than

<name>
<component>a</component>
<component>b</component>
<component>c</component>
</name>

Well, this has nothing to do with being "open source".

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.

So it will be very difficult to get agreement on a _standard_ XML
representation of Ada source code. But it's probably worth trying.

and asis2xml would _definitely_ produce the latter (I forget whether
it actually does at this stage).

http://www.pushface.org/asis2xml/ says the structure output by
asis2xml follows that of ASIS, so I'd be surprised if it did what you
describe above.

I would argue that an XML structure that is as close as possible to
the ASIS structure would be the best one to standardize.

When you (Simon Wright), as the author of asis2xml, decided to change
the representation of a qualified name as above, what criteria were
you using to determine the "right" structure?

How would that transformation handle expressions like

Array_1 (i).Function_Pointer_2 (x, y, z).Component

?

When using ASIS to implement a non-trivial source processing
algorithm, the first step is to transform the ASIS-defined structure
into one that is better for your algorithm; that's what auto_text_io
does (my ASIS tool). Even if you start from an ASIS-equivalent XML
representation, that will still be true.

--
-- Stephe
.



Relevant Pages

  • ANN: ASIS2XML 20041024a
    ... ASIS2XML converts a unit's ASIS representation into XML, ... it relies on GNAT; ... Not every ASIS feature is supported yet. ...
    (comp.lang.ada)
  • ANNOUNCE: Avatox 1.0 is now available
    ... Avatox 1.0 (Ada, Via Asis, To Xml) is an application that traverses an Ada compilation unit and outputs the ASIS representation of that unit structured as an XML document. ...
    (comp.lang.ada)
  • Re: ANN: Ada source code decorator
    ... compiler has to provide functions to access that knowledge. ... The point of ASIS is to provide a standard way to access information ... version of ASIS will specify the format, using XML. ...
    (comp.lang.ada)
  • ANNOUNCE: Avatox 1.2 Now Available
    ... Avatox (Ada, Via Asis, To Xml) is an application that traverses an Ada compilation unit and outputs the ASIS representation of that unit structured as an XML document. ...
    (comp.lang.ada)
  • Re: ANN: Ada source code decorator
    ... It would be completely unnatural in XML to represent the concept of a ... But if there are a few standard transformations from the ASIS ... type Base is abstract tagged private; ... type Base is abstract tagged record ...
    (comp.lang.ada)