[antlr-interest] reset method on a tree parser

Michael Bedward michael.bedward at gmail.com
Tue Mar 31 22:05:16 PDT 2009


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 ?

cheers
Michael


More information about the antlr-interest mailing list