I am trying to highlight all the tokens in the text and should match all Ascii and Unicode characters, so here is how I laid them out.
fragment CHAR : ('A'..'Z') | ('a'..'z');
fragment DIGIT : ('0'..'9');
fragment UNICODE : '\u0000'..'\u00FF';
Now, if I write my token rule as:
TOKEN : (CHAR|DIGIT|UNICODE)+;
I get "The solution can match an input, for example," A ".." Z ", using several alternatives: 1, 3 As a result, alternative 3 was disabled for this input" "The solution can match an input, for example," 0 ".." 9 " using several alternatives: 2, 3 As a result, alternative 3 was disabled for this input "
And nothing happens: And also, if I write it as
TOKEN : (UNICODE)+;
Nothing matches.
Is there any way to do this.
Lezan