I have this "warning(125): :32:5: implicit definition of token MISSING_STATEMENT in parser". But i can't catch warning in my error listener:
public class MyBaseErrorListener extends BaseErrorListener {
public boolean compilerError = false;
@Override
public void syntaxError(final Recognizer<?, ?> recognizer, final Object offendingSymbol, final int line, final int position, final String msg, final RecognitionException e) {
compilerError = true;
ModuleLib.log("ERROR :" + line + ":" + position + ": " + msg);
}
public void reportAmbiguity(Parser recognizer, DFA dfa, int startIndex, int stopIndex, boolean exact, BitSet ambigAlts, ATNConfigSet configs) {
ModuleLib.log("reportAmbiguity");
}
public void reportAttemptingFullContext(Parser recognizer, DFA dfa, int startIndex, int stopIndex, BitSet conflictingAlts, ATNConfigSet configs) {
ModuleLib.log("reportAttemptingFullContext");
}
public void reportContextSensitivity(Parser recognizer, DFA dfa, int startIndex, int stopIndex, int prediction, ATNConfigSet configs) {
ModuleLib.log("reportContextSensitivity");
}
}
CommonTokenStream tokenStream = new CommonTokenStream(lexer);
ParserInterpreter parser = grammar.createParserInterpreter(tokenStream);
parser.getInterpreter().setPredictionMode(PredictionMode.LL);
parser.removeErrorListeners();
parser.addErrorListener(errorListener);
String startRule = "assemble";
Rule start = grammar.getRule(startRule);
ParserRuleContext parserRuleContext = parser.parse(start.index);