[antlr-interest] generated code for tree walker...

Pady Srinivasan padysrini at hotmail.com
Fri Jan 2 07:33:33 PST 2009


If I have a rule as

rule
A : ^(TOK ({$b}=> B | .) )

The code generated ( in method A() )...

if ( DOWN && b )
  alt = 1;  // handle B
else if ( UP )  // this never happens
  alt = 2;  // handle .
else
    NVAE

Shoudnt the "else if (UP)" be "else if ( DOWN )" since you are at the 
beginning of the subtree "TOK" ? As a test, I changed the generated code to 
the later, and my tests work fine. Can somebody point to me what is the 
issue with the rule grammar ?

Thx

-- pady




More information about the antlr-interest mailing list