[antlr-interest] ParseTreeBuilder example?

Leon Su leon.antlr at mac.com
Wed May 28 13:01:06 PDT 2008


Hi,

You may miss the -debug commandline option.
try: java org.antlr.Tool -debug P.g

Leon

On May 23, 2008, at 2:52 PM, Hamilton Link wrote:

> 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