ANTLR - Distinguish 'IS NOT NULL' from 'IS NULL'
问题 How can I differentiate ' IS NOT NULL ' from ' IS NULL '? 'IS' and 'IS NOT' are defined in a parser rule, and 'NULL' in another rule, and the second follows the first. What happens is that when I write 'IS NULL', the Parser is excepting 'IS NOT NULL' because both second words begin with 'N' . How can I distinguish both? Grammar File query : expr EOF -> ^(QUERY expr) ; expr : logical_expr ; logical_expr : equality_expr (logical_op^ equality_expr)* ; equality_expr : ID equality_op atom -> ^