[antlr-interest] confused about the trained monkey

Don Reba don_reba at inbox.ru
Thu Jun 5 16:04:46 PDT 2008


> When looping constructs are involved, the lexer currently tends to 
> behave as LL(1).  So it's not going to look ahead past all those 
> "not 'b'"s.
> 
> If the left edge of lexer rules (involving loops) is ambiguous, 
> you'll need to manually resolve the ambiguity yourself.  Generally 
> this is done by merging the rules together and adding predicates 
> to do additional lookahead.


Thank you. That explains it. Merging the rules together, then manually emitting the tokens seems like a good solution.


More information about the antlr-interest mailing list