コード例 #1
0
ファイル: Parser.java プロジェクト: antlr/antlr4
  public void notifyErrorListeners(Token offendingToken, String msg, RecognitionException e) {
    _syntaxErrors++;
    int line = -1;
    int charPositionInLine = -1;
    line = offendingToken.getLine();
    charPositionInLine = offendingToken.getCharPositionInLine();

    ANTLRErrorListener listener = getErrorListenerDispatch();
    listener.syntaxError(this, offendingToken, line, charPositionInLine, msg, e);
  }
コード例 #2
0
 @Override
 public void syntaxError(
     Recognizer<?, ?> recognizer,
     Object offendingSymbol,
     int line,
     int charPositionInLine,
     String msg,
     RecognitionException e) {
   for (ANTLRErrorListener listener : delegates) {
     listener.syntaxError(recognizer, offendingSymbol, line, charPositionInLine, msg, e);
   }
 }
コード例 #3
0
 @Override
 public void reportContextSensitivity(
     Parser recognizer,
     DFA dfa,
     int startIndex,
     int stopIndex,
     int prediction,
     ATNConfigSet configs) {
   for (ANTLRErrorListener listener : delegates) {
     listener.reportContextSensitivity(
         recognizer, dfa, startIndex, stopIndex, prediction, configs);
   }
 }
コード例 #4
0
 @Override
 public void reportAttemptingFullContext(
     Parser recognizer,
     DFA dfa,
     int startIndex,
     int stopIndex,
     BitSet conflictingAlts,
     ATNConfigSet configs) {
   for (ANTLRErrorListener listener : delegates) {
     listener.reportAttemptingFullContext(
         recognizer, dfa, startIndex, stopIndex, conflictingAlts, configs);
   }
 }
コード例 #5
0
 @Override
 public void reportAmbiguity(
     Parser recognizer,
     DFA dfa,
     int startIndex,
     int stopIndex,
     boolean exact,
     BitSet ambigAlts,
     ATNConfigSet configs) {
   for (ANTLRErrorListener listener : delegates) {
     listener.reportAmbiguity(recognizer, dfa, startIndex, stopIndex, exact, ambigAlts, configs);
   }
 }