[antlr-interest] grammar guessing.

Ric Klaren ric.klaren at gmail.com
Tue Apr 5 14:46:06 PDT 2005


Bharath Sundararaman wrote:
> I retraced the rules all the way back to the top-most rule which had a
> (foo)=>bar rule. I changed the rule to avoid the guessing and it works
> now.
> 
> About your init action comment, it unfortunately doesn't help me because
> 
> var{...}: v:IDENT (subscripts[#v]); requires work to be performed on
> 'v', which is visible only after the initialization ends.

The Token v = LT(1) accesses the same token as v would have become in 
non guessing mode. Read the generated code and you'll see.

Cheers,

Ric


More information about the antlr-interest mailing list