[antlr-interest] generated code for tree walker...
Pady Srinivasan
padysrini at hotmail.com
Sun Jan 4 18:07:43 PST 2009
Anybody have any ideas/thoughts on my posting below ?
Thx
-- pady
----- Original Message -----
From: "Pady Srinivasan" <padysrini at hotmail.com>
To: <antlr-interest at antlr.org>
Sent: Friday, January 02, 2009 10:33 AM
Subject: [antlr-interest] generated code for tree walker...
>
> If I have a rule as
>
> rA
> : ^(TOK ({$b}=> rB | .) )
>
> The code generated ( in method rA() )...
>
> if ( DOWN && b )
> alt = 1; // handle rB
> 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
>
>
>
> 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