Negated lexer rules/tokens
问题 I am trying to match (and ignore) c-style block comments. To me the sequence is (1) /* followed by (2) anything other than /* or */ until (3) */ . BLOCK_COMMENT_START : "/*" ; BLOCK_COMMENT_END : "*/" ; BLOCK_COMMENT : BLOCK_COMMENT_START ( ~( BLOCK_COMMENT_START | BLOCK_COMMENT_END ) )* BLOCK_COMMENT_END { // again, we want to skip the entire match from the lexer stream $setType( Token.SKIP ); } ; But Antlr does not think like I do ;) sql-stmt.g:121:34: This subrule cannot be inverted. Only