How can I handle '-' (minus sign) in my identifiers or keywords?

Terence Parr

Think about how you would do it by hand. You would have to know when there is a hyphen and then make sure that if there is a hyphen you don't return an IDENTIFIER. Make a lexical rule that matches both and then have an action determine which token type to return.