I have the following code in my .g4 file.
@lexer::members{
public static final int WHITESPACE = 1;
public static final int COMMENTS = 2;
}
WS : (' '|'\t'|'\f')+ -> channel(WHITESPACE)
;
COMMENT
: '//' ~('\n'|'\r')* -> channel(COMMENTS)
;
LINE_COMMENT
: '/*' .*? '*/' NEWLINE? -> channel(WHITESPACE)
;
I'm getting the following errors:
warning(155): Shiro.g4:239:34: rule 'WS' contains a lexer command with an unrecognized constant value; lexer interpreters may produce incorrect output
warning(155): Shiro.g4:243:38: rule 'COMMENT' contains a lexer command with an unrecognized constant value; lexer interpreters may produce incorrect output
warning(155): Shiro.g4:247:42: rule 'LINE_COMMENT' contains a lexer command with an unrecognized constant value; lexer interpreters may produce incorrect output
This is the technique described by Terrence in the ANTLR4 book to put tokens on separate channels. Why am I getting these warnings? Should I be concerned?