I have the following grammar that parses the string "x2" successfully
as two different tokens:
OPERATOR = "x"
NUMBER = <<[0-9]*>>
WHITESPACE = <<[ \t\n\r]+>> %ignore%
Value = OPERATOR NUMBER ;
When I add the token definition IDENTIFIER = <<[a-zA-Z][a-zA-Z0-9-_]*>>
the string "x2" results in a parse error, since it is parsed as a single
IDENTIFIER token. Is there something that I can do to prevent this?
> Is there something that I can do to prevent this?
this is a classical problem in languages that have operators that look like identifiers. Not much you can do from the grammar side. Have the user insert WHITESPACE between OPERATOR and NUMBER, though...
Diese Signatur besteht zu 100% aus wiederverwendeten Pixeln.