[email protected] wrote:
> The last line, b., doesn't match the MC_INCORRECT token because there's
> no newline after it. Is there an easy way to match this in ANTLR?
Yes. I had the same problem when matching the end of a //-style comment,
and solved it like this:
fragment ENDOFLINE
: NEWLINE
| { input.LA(1) == EOF }?
;
(If this were a non-fragment rule, it would be a problem that it can
sometimes match no characters, but since it's a fragment, that's OK.)
--
David-Sarah Hopwood ⚥ http://davidsarah.livejournal.com
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---