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: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Parsing Ada? Date: Wed, 03 Jun 2015 12:04:34 +0100 Organization: A noiseless patient Spider Message-ID: References: <87pp5es5u4.fsf@adaheads.sparre-andersen.dk> <85mw0hte8w.fsf@stephe-leake.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="3bd306b9e9949526c2d1303d55d7ecbf"; logging-data="24741"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/ltS4jx/h3E0gCaBgpzooYtVtzn+gJMX4=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (darwin) Cancel-Lock: sha1:tCRu2hMQ9ME1bCIhfLWiL3DaBHo= sha1:1X+u8JhWW1tYxEoUtsm8+9tWBrs= Xref: news.eternal-september.org comp.lang.ada:26157 Date: 2015-06-03T12:04:34+01:00 List-Id: Stephen Leake writes: > Note that ASIS does not produce a parse tree either; it just gives you > structured access to the source. ASIS code tends to feel like a > recursive descent parser (at least, for the tools I've written in > ASIS). You might find ASIS2XML[1] helpful (it doesn't attempt to retain comments, and really only retains textual information (that is, it retains the name in an entity reference but not the links to the referenced entity). Also, could do some cleanup of compound identifiers - it retains the ASIS structure; so "with Ada.Characters.Handling;" becomes Ada Characters Handling Also Avatox[2]. The ASIS GPL 2014 source distribution contains a tool gnat2xml which doesn't appear to be installed automatically. I didn't like the schema very much, can't remember why now! You'd probably use xslt to work with the generated XML. [1] https://sourceforge.net/projects/asis2xml/ [2] Original site unavailable. See the ASIS GPL 2014 distro, tools/gnat2xml for READMEs; I have a copy of avatox-1.8.tgz if you want.