@Override
	public void reportError(Parser recognizer,
							RecognitionException e)
	{
		// if we've already reported an error and have not matched a token
		// yet successfully, don't report any errors.
		if (inErrorRecoveryMode(recognizer)) {
//			System.err.print("[SPURIOUS] ");
			return; // don't report spurious errors
		}
		beginErrorCondition(recognizer);
		if ( e instanceof NoViableAltException ) {
			reportNoViableAlternative(recognizer, (NoViableAltException) e);
		}
		else if ( e instanceof InputMismatchException ) {
			reportInputMismatch(recognizer, (InputMismatchException)e);
		}
		else if ( e instanceof FailedPredicateException ) {
			reportFailedPredicate(recognizer, (FailedPredicateException)e);
		}
		else {
			System.err.println("unknown recognition error type: "+e.getClass().getName());
			recognizer.notifyErrorListeners(e.getOffendingToken(), e.getMessage(), e);
		}
	}
{@inheritDoc}

<p>The default implementation returns immediately if the handler is already
in error recovery mode. Otherwise, it calls {@link #beginErrorCondition}
and dispatches the reporting task based on the runtime type of {@code e}
according to the following table.</p>

<ul>
<li>{@link NoViableAltException}: Dispatches the call to
{@link #reportNoViableAlternative}</li>
<li>{@link InputMismatchException}: Dispatches the call to
{@link #reportInputMismatch}</li>
<li>{@link FailedPredicateException}: Dispatches the call to
{@link #reportFailedPredicate}</li>
<li>All other types: calls {@link Parser#notifyErrorListeners} to report
the exception</li>
</ul>
runtime/Java/src/org/antlr/v4/runtime/DefaultErrorStrategy.java