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;
|
break;
|
||||||
|
|
||||||
default :
|
default :
|
||||||
|
try {
|
||||||
visitState(p);
|
visitState(p);
|
||||||
|
}
|
||||||
|
catch (RecognitionException e) {
|
||||||
|
setState(atn.ruleToStopState[p.ruleIndex].stateNumber);
|
||||||
|
getContext().exception = e;
|
||||||
|
getErrorHandler().reportError(this, e);
|
||||||
|
getErrorHandler().recover(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue