[antlr-interest] LPG WAS Retaining comments

Olivier Lefevre lefevrol at yahoo.com
Tue Mar 18 15:46:42 PDT 2008


Andy Tripp wrote:
> Olivier Lefevre wrote:
>> Another possible answer is that a parse tree is what you get by default, 
> 
> Not with ANTLR, you don't. There's one call to the parser to get the
> AST, and a whole different approach to getting the parse tree.

OK but by "taking charge" I meant shaping the tree yourself: when using 
ParseTreeBuilder, you are not doing that since it's a built-in. I still 
think it useful to think of the parse tree as something the tool will build 
for you automatically (if you ask it to) whereas the AST is something _you_ 
must build, making _all_ the decisions.

-- O.L.




More information about the antlr-interest mailing list