[antlr-interest] Need help with lexer rules
John B. Brodie
jbb at acm.org
Mon Aug 15 14:44:58 PDT 2005
>Thank you John that's it!
>...a protected RG rule and this:
>TERMINATING_RG:
> RG ( WS )* ( LG | ( VOCAB ( VOCAB | WS )* LG ) { $setType(TEXT); } )?
>;
Sorry I think I still have an error, I think that as written above the
setType action will only happen on the second alt inside the ()? you
could test that theory by trying the string "RG LG" as a test...
Need to add, I think, another set of grouping ()'s:
TERMINATING_RG:
RG ( WS )* ( ( LG | ( VOCAB ( VOCAB | WS )* LG ) ) { $setType(TEXT); } )?
;
>Sorry for going off the list,
no problem. just so long as we have answered your question(s)...
Sorry it took me sooooo many attempts to get it right for you.
-jbb
More information about the antlr-interest
mailing list