Why does my lexer throw an unexpected char exception in the middle of my comment or string rule containing a wildcard?
Created May 7, 2012
Terence Parr Most likely you need a charVocabulary option to specify the set of characters you expect. The wildcard or ~ operator make no sense unless you bound the set of possible characters. For example,
SL_COMMENT options { paraphrase="SL_COMMENT"; } : "//" (~' ')* ' ' { $setType(Token.SKIP()); newline(); } ;Won't work because ~' ' is only the '/' char. Add something like:
charVocabulary = '3'..'377';See options documentation for more info.