From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,d2fdf39976bd1585 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!news4.google.com!news.glorb.com!peer1.news.newnet.co.uk!194.159.246.34.MISMATCH!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: ANN: Ada source code decorator Date: Fri, 26 May 2006 22:01:37 +0100 Organization: Pushface Message-ID: References: <447306ee$0$11066$9b4e6d93@newsread4.arcor-online.net> NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1148677302 10486 62.49.19.209 (26 May 2006 21:01:42 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Fri, 26 May 2006 21:01:42 +0000 (UTC) Cancel-Lock: sha1:9/MqmxVcIWiQ363OWw09bLyJ1+U= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (darwin) Xref: g2news2.google.com comp.lang.ada:4523 Date: 2006-05-26T22:01:37+01:00 List-Id: Stephen Leake writes: > Simon Wright writes: > >> Stephen Leake writes: >>> 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. Yes. You have to understand what an API is _about_. >> 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 >> >> >> a >> b >> c >> > > 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. 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. > So it will be very difficult to get agreement on a _standard_ XML > representation of Ada source code. But it's probably worth trying. Indeed. >> 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. Well, it does what seemed like a good idea at the time :-) -- ie, what worked. > 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 It would probably be fairly close. But the argument list would be mapped to an XML sequence, I'm sure. > 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. Yes. 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 Basis Base Op B Base Base V Boolean which probably makes more sense to you than to me. I can get some of it, of course, but -- for example -- what other sorts of traits are there and what do they actually mean?