added null chk

[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9759]
This commit is contained in:
parrt 2011-12-27 14:32:19 -08:00
parent bb960e3c37
commit 9853061093
1 changed files with 4 additions and 0 deletions

View File

@ -227,6 +227,10 @@ public class ParserATNFactory implements ATNFactory {
public Handle _ruleRef(GrammarAST node) {
Rule r = g.getRule(node.getText());
if ( r==null ) {
g.tool.errMgr.toolError(ErrorType.INTERNAL_ERROR, "Rule "+node.getText()+" undefined");
return null;
}
RuleStartState start = atn.ruleToStartState[r.index];
ATNState left = newState(node);
ATNState right = newState(node);