[antlr-interest] reset method on a tree parser

Johannes Luber jaluber at gmx.de
Wed Apr 1 00:56:47 PDT 2009


Michael Bedward schrieb:
> OK, a with a bit more delving I found the problem was caused by the
> CommonTreeNodeStream stream being emptied after the first run of the
> tree walker, so calling reset didn't achieve much.  This differs from
> ANTLR 3.1.1 behaviour but doesn't seem to be in the release notes for
> 3.1.2 or 3.1.3 (someone please let me know if I'm missing the
> obvious).
> 
> Give the tree walker a BufferedTreeNodeStream stream instead of
> CommonTreeNodeStream seems to fix the problem.  Is this now the
> correct practice where a tree walker is to be invoked repeatedly ?

The Java target renamed the original CommonTokenStream to
BufferedTokenStream. This change seems to affect more people than
anticipated. It should have been documented more thouroughly.

Johannes
> 
> cheers
> Michael
> 
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address
> 



More information about the antlr-interest mailing list