[antlr-interest] Re: Anyone tried this ANTLR-inspired CC?

micheal_jor open.zone at virgin.net
Mon Nov 10 18:29:39 PST 2003


--- In antlr-interest at yahoogroups.com, Terence Parr <parrt at c...> wrote:

> >> Howdy.  This is the old AST versus parse tree argument...Parse trees
> >> are easy to generate (i.e., no cost to developer) but have way too 
> >> much
> >> noise for tree transformation and also are sensitive to grammar
> >> construction whereas ASTs are the canonical repr for a particular
> >> language.
> >
> > Hmmm. If you are saying ANTLR generates a CST (aka. parse tree or
> > concrete syntax tree) by default and the JJTree way is to generate an
> > AST, you may be right Ter.
> 
> Actually, antlr likes ASTs not parse trees though you could of course 
> build one.  In essence, I'm saying that ANTLR likes
> 
>    +
>   /  \
> 3  4
> 
> for "3+4" without any rule nodes in there like a parse tree has.

Hmmm. That had the old grey matter twitching for a while ;-)

OK. I needed to be clearer. In practical terms, ANTLR neither
generates a CST nor an AST by default. It generates something in
between. Sure the internal rule nodes are missing but, lots of other
noise like semicolons and closing braces are present. Now, they have
their uses (~100% lossless tranformations being one example) but they
still represent noise in an optimized AST.

Cheers,

Micheal



 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 




More information about the antlr-interest mailing list