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.

0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



About | Sitemap | Contact