[antlr-interest] Re: AST vs parse trees

micheal_jor open.zone at virgin.net
Mon Nov 10 18:46:51 PST 2003


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

> > 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.
> 
> Actually I specifically remove ; and } etc... if you look at the java.g 
> file.  An AST should have the minimum necessary information in there. :)

That the point I was making Ter. By default, ANTLR generates trees
that need "pruning" to get an optimized AST with only the minimum
neccesary information. Not necessarily a bad thing, as long as the
pruning can be specified in a action-language-agnostic manner.

Any opinion on the visitor-generation idea/suggestion?

Cheers,

Micheal



 

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




More information about the antlr-interest mailing list