Brent Yates wrote:
Assuming a standard LINE comment form such as:I'll clarify a bit here. This would probably work fine if you had just the one rule that said EOF could be in it. So, if you cannot modify the input, then your best bet is to exclude the NL from being part of the comment token, rather than look for the EOF condition, which is probably what you want anyway: SL_COMMENT : '//' ( ~('\r'|'\n'))* {$channel=HIDDEN;} ; NL : '\r'? '\n' {$channel = HIDDEN;} ; The lexer should stop at EOF anyway and I do not think you will get an error. Jim --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "il-antlr-interest" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/il-antlr-interest?hl=en -~----------~----~----~----~------~----~------~--~--- |
List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address
