Re: LL1 program ???

jamz@my-dejanews.com
24 Jul 1998 12:23:24 -0400

          From comp.compilers

Related articles
[2 earlier articles]
Re: LL1 program ??? joachim.durchholz@munich.netsurf.de (Joachim Durchholz) (1998-07-03)
Re: LL1 program ??? janaki@csa.iisc.ernet.in (Janaki S) (1998-07-10)
Re: LL1 program ??? napi@cel.mimos.my (1998-07-11)
Re: LL1 program ??? joachim.durchholz@munich.netsurf.de (Joachim Durchholz) (1998-07-13)
Re: LL1 program ??? rod.bates@boeing.com (Rodney M. Bates) (1998-07-20)
Re: LL1 program ??? leichter@smarts.com (Jerry Leichter) (1998-07-21)
Re: LL1 program ??? jamz@my-dejanews.com (1998-07-24)
| List of all articles for this month |
From: jamz@my-dejanews.com
Newsgroups: comp.compilers
Date: 24 Jul 1998 12:23:24 -0400
Organization: Deja News - The Leader in Internet Discussion
References: 98-07-009 98-07-033 98-07-098 98-07-110 98-07-129
Keywords: parse, PCCTS

    "Rodney M. Bates" <rod.bates@boeing.com> wrote:
> This also relates to the question of what constitutes an abstract
> syntax tree and how does it relate to a derivation tree. Again, I
> think I have a good intuition about this, but I don't know how to
> describe it formally. I suspect that grammar rewrites which preserve
> what we want them to might give the same or similar ASTs, if it were
> somehow defined what that meant.
>
> I think the theory of formal languages it missing some things, if it
> is to be a basis for writing compilers etc. Or am I missing some
> things?


One toolkit which might interest you is the ANTLR toolkit from
www.antlr.org. Lot's of the features in it were inspired by the lack
of practical methods from the theory side of parsing. It has had a
long history of use and has incorporated many features from feedback
on big projects. ANTLR 2 was a complete rewrite from scratch and is
very clean.


For compilers and translators, I find its grammar inheritence very
useful. Typically one pass through the tree will only change a small
part of the syntax, if it changes any syntax at all. It really
depends on how close your input language is to the output language.
It also uses the same basic parsing model for lexing, parsing, and
tree parsing, which makes it easier to learn. The biggest advantage,
though, is that it generates human-readable code, so you can easily
see what it is doing from the rules you wrote.


There are many good papers on the site which describe why the author
considers his approach more practical than a lot of the theory which
is out there.


Have fun,


Monty
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.