[antlr-interest] My recursive tree walker won't

Terence Parr parrt at cs.usfca.edu
Sat Dec 9 13:38:22 PST 2006


On Dec 5, 2006, at 8:25 PM, Cameron Ross wrote:

> I've found the problem...
>
> I was explicitly exporting the vocabulary from the parser and not  
> the tree parser.  This caused two token files to be created with  
> inconsistent type values for the WORD token.  This was causing my  
> tree parser recursion problems.
>
> In resolving this problem I ended up with a warning on the parser  
> grammar that I was redefining the PWORD token (which I'm pretty  
> sure I'm not).  I resolved the problem by simply removing the token  
> section and the PWORD token does in fact appear to be defined  
> elsewhere, but I have no idea as to where.  Any thoughts are  
> greatly appreciated.

Hi Cameron,

I designed things so that you should be able to generate a token list  
from the parser and load that into the tree parser:

tree grammar tp;

options {tokenVocab=p;}

...

  Is that not the behavior you find?

Ter



More information about the antlr-interest mailing list