recover method
Instead of recovering from exception e
, re-throw it wrapped
in a ParseCancellationException so it is not caught by the
rule function catches. Use {@link Exception#getCause()} to get the
original RecognitionException.
Implementation
@override
void recover(Parser recognizer, RecognitionException e) {
for (var context = recognizer.context;
context != null;
context = context.parent) {
context.exception = e;
}
throw ParseCancellationException(e.message);
}