[antlr-interest] Lexer problem

Brent Yates brent.yates at gmail.com
Mon Mar 10 22:15:46 PDT 2008


Tom,
D'oh!  Good catch on the WS rule.  There is an obvious ambiguity in the
alternatives due to the fact that I want to do something special when the
ID='aaa' or 'bbb'.  I understand (now) what you are saying about the
predicate being redundant.  That being the case, how do I get alts1 and 2 to
match when the ID='aaa' or ID='bbb' and to not fall into alt3 if they don't
match completely?  Oh, I know this would be eaiser in the parser section,
but I need to do this in the lexer.  Alts1 and alts2 are special tokens
whose actions affect future lexing.  It is too late by the time the parser
runs.  Do I have to add target specific code to the actions of alt3 to check
to see if alts2 and alts3 "fell through"?

Thanks!

Brent Yates
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080311/dfd1a2ec/attachment.html 


More information about the antlr-interest mailing list