sync abstract method

void sync(
  1. Parser recognizer
)

This method provides the error handler with an opportunity to handle syntactic or semantic errors in the input stream before they result in a RecognitionException.

The generated code currently contains calls to {@link #sync} after entering the decision state of a closure block ({@code (...)*} or {@code (...)+}).

For an implementation based on Jim Idle's "magic sync" mechanism, see {@link DefaultErrorStrategy#sync}.

@see DefaultErrorStrategy#sync

@param recognizer the parser instance @ if an error is detected by the error strategy but cannot be automatically recovered at the current state in the parsing process

Implementation

void sync(Parser recognizer);