[antlr-interest] ParseTreeBuilder example?

Hamilton Link helink at sandia.gov
Fri May 23 14:52:11 PDT 2008


The "How can I build parse trees not ASTs?" page...
http://www.antlr.org/wiki/pages/viewpage.action?pageId=1760

shows an example of creating a ParseTreeBuilder and then passing it into 
the FooParser two-argument constructor.

Unfortunately, as far as I can tell the two-arg constructor takes a 
TokenStream and a RecognizerSharedState... and ParseTreeBuilder doesn't 
inherit from RecognizerSharedState.

So, is the example on this web page bogus?  When did it work and when 
will it work again, because at the moment I don't see how it could 
possibly work as advertised.  (Mind you I'm not _all_ that concerned, as 
I can't even build ASTs quite yet.)  If someone could correct the 
example or explain the example that'd be great.

thanks,
hamilton



More information about the antlr-interest mailing list