diff --git a/runtime/Java/src/org/antlr/v4/runtime/ANTLRErrorStrategy.java b/runtime/Java/src/org/antlr/v4/runtime/ANTLRErrorStrategy.java index 166a954a5..f391e735b 100644 --- a/runtime/Java/src/org/antlr/v4/runtime/ANTLRErrorStrategy.java +++ b/runtime/Java/src/org/antlr/v4/runtime/ANTLRErrorStrategy.java @@ -48,9 +48,11 @@ public interface ANTLRErrorStrategy { /** Resynchronize the parser by consuming tokens until we find one * in the resynchronization set--loosely the set of tokens that can follow - * the current rule. + * the current rule. The exception contains info you might want to + * use to recover better. */ - void recover(BaseRecognizer recognizer); + void recover(BaseRecognizer recognizer, + RecognitionException e); /** Make sure that the current lookahead symbol is consistent with * what were expecting at this point in the ATN. You can call this diff --git a/runtime/Java/src/org/antlr/v4/runtime/DefaultANTLRErrorStrategy.java b/runtime/Java/src/org/antlr/v4/runtime/DefaultANTLRErrorStrategy.java index fdc9cc152..dadabeee7 100644 --- a/runtime/Java/src/org/antlr/v4/runtime/DefaultANTLRErrorStrategy.java +++ b/runtime/Java/src/org/antlr/v4/runtime/DefaultANTLRErrorStrategy.java @@ -103,7 +103,7 @@ public class DefaultANTLRErrorStrategy implements ANTLRErrorStrategy { * token that the match() routine could not recover from. */ @Override - public void recover(BaseRecognizer recognizer) { + public void recover(BaseRecognizer recognizer, RecognitionException e) { // System.out.println("recover in "+recognizer.getRuleInvocationStack()+ // " index="+recognizer.getInputStream().index()+ // ", lastErrorIndex="+