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=unavailable autolearn_force=no version=3.4.4 Path: border1.nntp.dca.giganews.com!nntp.giganews.com!ottix-news.ottix.net!newsswitch.lcs.mit.edu!nntp.TheWorld.com!.POSTED!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Kickstarter for beginning work on a new open-source Compiler Date: Fri, 21 Mar 2014 12:07:39 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <5151491a-14c3-4138-bcb5-f29108aeefb9@googlegroups.com> <801079196416966973.679877laguest-archeia.com@nntp.aioe.org> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls7.std.com 1395418065 18782 192.74.137.71 (21 Mar 2014 16:07:45 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Fri, 21 Mar 2014 16:07:45 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:HZmUDpQPAbsrL4lLSOGiB7JABKA= Xref: number.nntp.dca.giganews.com comp.lang.ada:185273 Date: 2014-03-21T12:07:39-04:00 List-Id: Simon Wright writes: > Yes, I saw it in ASIS GPL 2013. I was specially interested in the > ability to re-generate code from (possibly-modified) XML; but perhaps > this is only for testing purposes? That's the xml2gnat tool, which back-translates XML into Ada. It was originally developed for testing purposes: Ada-->XML--Ada ought to produce an Ada program that has identical output to the original. Then I rewrote the pretty-printer (gnatpp) to use that same Ada-generating code. gnatpp does not use XML, but almost all of the code in xml2gnat is shared by gnatpp. You could use xml2gnat on modified XML, but you would have to make sure the XML looks like what gnat2xml would generate from some legal Ada. Validating it against the schema using xmllint would help with that. But nobody at AdaCore has ever done that; we use xml2gnat purely for testing gnat2xml. For example, we run all the executable ACATS tests that way (translate the test into XML, then back into Ada, then compile and run the generated Ada, and the output should be identical to the output of the original ACATS test, with the usual "===== PASSED ================" message). The first version of xml2gnat left out all the comments, which aren't needed for the above kind of testing. But of course gnatpp can't leave out comments, so now xml2gnat also includes the comments, using the same shared code. > I was somewhat put off by what seemed to be unneeded verbosity: the code > fragment above starts > ... Looks like the gnat2xml output contains more information, so I'm not surprised it's more verbose. The source locations, for example, take up a lot of space. > I guess you use the _ql in because that's > the result of a Query called Context_Clause_Elements that returns a > List; ... Yes, "_q" is for "query returning a non-list", and "_ql" is for "query returning a list". All the names are taken directly from ASIS names, with systematic changes (like removing the annoying "A_" or "An_" from element type names). > ...I didn't think the user needed to know that, so used just > (and I wonder whether it'd have been better to omit > an empty context clause list altogether). Well, leaving out empty things makes it more compact, but probably makes XML-processing tools have more special cases. > This exercise has revealed a bug: I've left out all mention of private > parts! That's going to take some fixing ... Interesting. ;-) - Bob