forked from jasder/antlr
ParserInterpreter handles RecognitionException in the same way as the generated code
This commit is contained in:
parent
ddbd7086b8
commit
daf793b1c1
|
@ -156,7 +156,16 @@ public class ParserInterpreter extends Parser {
|
|||
break;
|
||||
|
||||
default :
|
||||
visitState(p);
|
||||
try {
|
||||
visitState(p);
|
||||
}
|
||||
catch (RecognitionException e) {
|
||||
setState(atn.ruleToStopState[p.ruleIndex].stateNumber);
|
||||
getContext().exception = e;
|
||||
getErrorHandler().reportError(this, e);
|
||||
getErrorHandler().recover(this, e);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue