From 84c34d23916f46a6d89f0699f78ecd7428201cdb Mon Sep 17 00:00:00 2001 From: Terence Parr Date: Sat, 1 Dec 2012 16:23:44 -0800 Subject: [PATCH] make code slightly more obvious. --- tool/src/org/antlr/v4/codegen/ParserFactory.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tool/src/org/antlr/v4/codegen/ParserFactory.java b/tool/src/org/antlr/v4/codegen/ParserFactory.java index d26eddf35..7dd8a861e 100644 --- a/tool/src/org/antlr/v4/codegen/ParserFactory.java +++ b/tool/src/org/antlr/v4/codegen/ParserFactory.java @@ -328,14 +328,14 @@ public class ParserFactory extends DefaultOutputModelFactory { public void defineImplicitLabel(GrammarAST ast, LabeledOp op) { Decl d; - Rule r = g.getRule(ast.getText()); if ( ast.getType()==ANTLRParser.SET || ast.getType()==ANTLRParser.WILDCARD ) { String implLabel = gen.target.getImplicitSetLabel(String.valueOf(ast.token.getTokenIndex())); d = getTokenLabelDecl(implLabel); ((TokenDecl)d).isImplicit = true; } - else if ( r!=null ) { + else if ( ast.getType()==ANTLRParser.RULE_REF ) { // a rule reference? + Rule r = g.getRule(ast.getText()); String implLabel = gen.target.getImplicitRuleLabel(ast.getText()); String ctxName = gen.target.getRuleFunctionContextStructName(r);