public override void Recover(Parser recognizer, RecognitionException e)
{
int errIndex = recognizer.InputStream.Index;
if (firstErrorTokenIndex == -1)
{
firstErrorTokenIndex = errIndex; // latch
}
// System.err.println("recover: error at " + errIndex);
IIntStream input = recognizer.InputStream;
if (input.Index < input.Size - 1)
{ // don't consume() eof
recognizer.Consume(); // just kill this bad token and let it continue.
}
}