List of usage examples for org.antlr.v4.runtime DiagnosticErrorListener DiagnosticErrorListener
public DiagnosticErrorListener(boolean exactOnly)
From source file:org.elasticsearch.xpack.sql.parser.SqlParser.java
License:Open Source License
private void debug(SqlBaseParser parser) { // when debugging, use the exact prediction mode (needed for diagnostics as well) parser.getInterpreter().setPredictionMode(PredictionMode.SLL); parser.addParseListener(parser.new TraceListener()); parser.addErrorListener(new DiagnosticErrorListener(false) { @Override/*w w w.ja va 2 s .c o m*/ public void reportAttemptingFullContext(Parser recognizer, DFA dfa, int startIndex, int stopIndex, BitSet conflictingAlts, ATNConfigSet configs) { } @Override public void reportContextSensitivity(Parser recognizer, DFA dfa, int startIndex, int stopIndex, int prediction, ATNConfigSet configs) { } }); }