I have this grammar:
KEY
: [a-zA-Z\u0160\u0161\u00C0-\u00FF][a-zA-Z_0-9\-\''\u0160\u0161\u00C0-\u00FF]*
;
Reading a ISO-8859-15 encoded text file
new ANTLRFileStream(fileName, "ISO-8859-15")
with the string Milešovka. Why is š giving a token recognition error?
Trace:
line 110:6 token recognition error at: ''exit field, LT(1)={
EDIT: I am using antlr 4.5.1 (and have tested 4.4 - same issue).
I think the problem might be in a way you use to generate parser. I'm not sure what exactly could go wrong, but I managed to do a working example with your symbol, that uses maven to generate grammar.
pom.xml
LexerGrammar.g
ParserGrammar.g
Full example code is here