I have grammar:
grammar qwe; query : COLUMN OPERATOR value EOF ; COLUMN : [a-z_]+ ; OPERATOR : ('='|'>'|'<') ; STRING_LITERAL : [a-zA-Z_]+ ; value : STRING_LITERAL ; WS : [ trn]+ -> skip ;
The problem with that is that
value lexer rules are identical. This causes errors:
How could I rewrite the grammar to make it work without error messages?
You can’t have two equal lexer rules, of course. In this case it seems that you should remove the COLUMN rule and treat it as a value, if there’s really nothing that distinguishes them.
Another option would be to consider a rule for COLUMN with a number of reserved words, if that’s applicable.