comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: Kickstarter for beginning work on a new open-source Compiler
Date: Fri, 21 Mar 2014 12:07:39 -0400
Date: 2014-03-21T12:07:39-04:00	[thread overview]
Message-ID: <wccvbv7ilh0.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: lywqfo37ic.fsf@pushface.org

Simon Wright <simon@pushface.org> 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 <context_clause_elements_ql/> 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
> <context_clauses/> (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


  reply	other threads:[~2014-03-21 16:07 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-18 23:23 ANN: Kickstarter for beginning work on a new open-source Compiler Shark8
2014-03-19  9:06 ` Maciej Sobczak
2014-03-19 13:02   ` Peter Chapin
2014-03-19 13:48     ` Dmitry A. Kazakov
2014-03-19 22:11       ` Randy Brukardt
2014-03-20 14:56         ` Robert A Duff
2014-03-19 21:59     ` Randy Brukardt
2014-03-19 22:03     ` Randy Brukardt
2014-03-20 20:41       ` Shark8
2014-03-20 23:04         ` Randy Brukardt
2014-03-20  0:12     ` Luke A. Guest
2014-03-20  0:36       ` Peter Chapin
2014-03-20  0:52         ` Luke A. Guest
2014-03-20 12:10       ` Simon Wright
2014-03-20 12:45         ` Luke A. Guest
2014-03-20 13:22           ` Simon Wright
2014-03-20 14:13             ` Luke A. Guest
2014-03-20 14:17             ` J-P. Rosen
2014-03-21  2:13               ` Lucretia
2014-03-21  5:23                 ` J-P. Rosen
2014-03-21  5:33                   ` Lucretia
2014-03-21  6:43                     ` J-P. Rosen
2014-03-21 22:51                     ` Randy Brukardt
2014-03-22  1:13                       ` Luke A. Guest
2014-03-22  6:27                       ` Tero Koskinen
2014-03-22  7:02                         ` J-P. Rosen
2014-03-24 20:50                           ` Randy Brukardt
2014-03-24 22:42                             ` Qun-Ying
2014-03-25 15:16                               ` Tero Koskinen
2014-03-20 15:27         ` Robert A Duff
2014-03-20 21:06           ` Simon Wright
2014-03-21 16:07             ` Robert A Duff [this message]
2014-03-23 17:52               ` Simon Wright
2014-03-19 14:25 ` ANN: " Stephen Leake
2014-03-19 19:55   ` Shark8
2014-03-19 22:28     ` Randy Brukardt
2014-03-20 17:55       ` Shark8
2014-03-20 17:53         ` Dmitry A. Kazakov
2014-03-19 22:49     ` Brian Drummond
2014-03-20 10:21     ` Lucretia
2014-03-20 23:35     ` Stephen Leake
2014-03-21  8:17       ` Simon Wright
2014-03-23 21:14         ` erlo
2014-03-23 22:36           ` Simon Wright
2014-03-24 20:31             ` erlo
2014-03-19 21:04 ` Alan Browne
2014-03-19 22:22   ` Randy Brukardt
2014-03-20 20:30   ` Shark8
2014-03-21  2:18     ` Lucretia
2014-03-21 21:51       ` Shark8
2014-03-22  5:48         ` J-P. Rosen
2014-03-22  6:01           ` Jeffrey Carter
2014-03-24 21:03             ` Randy Brukardt
2014-03-22  9:14           ` Ludovic Brenta
2014-03-22 10:15             ` Pascal Obry
2014-03-22 10:25             ` Dirk Craeynest
2014-03-22 12:41               ` Niklas Holsti
2014-03-22 14:59                 ` Dirk Craeynest
2014-03-22 16:20                   ` Niklas Holsti
2014-03-22 17:05                     ` Ludovic Brenta
2014-03-24  6:41           ` Shark8
2014-03-24  6:16             ` Luke A. Guest
2014-03-22  8:38         ` ANN: " Dmitry A. Kazakov
2014-03-22 19:28       ` Stephen Leake
2014-03-22 20:39         ` Shark8
2014-03-24  1:16           ` Stephen Leake
2014-03-24  6:40             ` Shark8
2014-03-25 20:04               ` Stephen Leake
2014-03-25 20:30                 ` Dmitry A. Kazakov
2014-03-20 21:35 ` gautier_niouzes
2014-03-21 22:19   ` Shark8
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox