diff --git a/tool/src/org/antlr/v4/codegen/ActionTranslator.java b/tool/src/org/antlr/v4/codegen/ActionTranslator.java index 5b3659d63..84ed0311f 100644 --- a/tool/src/org/antlr/v4/codegen/ActionTranslator.java +++ b/tool/src/org/antlr/v4/codegen/ActionTranslator.java @@ -177,6 +177,15 @@ public class ActionTranslator implements ActionSplitterListener { chunks.add(new QRetValueRef(getRuleLabel(x.getText()), y.getText())); break; } case PREDEFINED_RULE: + if ( factory.getCurrentRuleFunction()!=null && + factory.getCurrentRuleFunction().name.equals(x.getText()) ) + { + chunks.add(getRulePropertyRef(y)); + } + else { + chunks.add(getRulePropertyRef(x, y)); + } + break; case TOKEN: chunks.add(getTokenPropertyRef(x, y)); break;