From e0521400cbf47a078eafbf8581a7fac244df0cf9 Mon Sep 17 00:00:00 2001 From: parrt Date: Sat, 5 Nov 2016 06:28:58 -0700 Subject: [PATCH] rm need for isRuleContext in templates; refer to underlying grammar object. --- .../resources/org/antlr/v4/tool/templates/codegen/Go/Go.stg | 6 +++--- tool/src/org/antlr/v4/codegen/model/RuleActionFunction.java | 2 -- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/tool/resources/org/antlr/v4/tool/templates/codegen/Go/Go.stg b/tool/resources/org/antlr/v4/tool/templates/codegen/Go/Go.stg index 0c69f251c..def26314f 100644 --- a/tool/resources/org/antlr/v4/tool/templates/codegen/Go/Go.stg +++ b/tool/resources/org/antlr/v4/tool/templates/codegen/Go/Go.stg @@ -276,7 +276,7 @@ func (l *) Action(localctx antlr.RuleContext, ruleIndex, actionIndex switch ruleIndex { : - + l._Action(localctx, actionIndex) var t *Context = nil @@ -304,7 +304,7 @@ func (l *) Sempred(localctx antlr.RuleContext, ruleIndex, predIndex switch ruleIndex { : - + return l._Sempred(localctx, predIndex) var t *Context = nil @@ -330,7 +330,7 @@ func (l *) Sempred(localctx antlr.RuleContext, ruleIndex, predIndex * overriding implementation impossible to maintain. */ RuleActionFunction(r, actions) ::= << -func (l *) _Action(localctx antlr.RuleContext*, actionIndex int) { +func (l *) _Action(localctx antlr.RuleContext*, actionIndex int) { switch actionIndex { : diff --git a/tool/src/org/antlr/v4/codegen/model/RuleActionFunction.java b/tool/src/org/antlr/v4/codegen/model/RuleActionFunction.java index a11b3ac4d..8e6546237 100644 --- a/tool/src/org/antlr/v4/codegen/model/RuleActionFunction.java +++ b/tool/src/org/antlr/v4/codegen/model/RuleActionFunction.java @@ -38,7 +38,6 @@ import java.util.LinkedHashMap; public class RuleActionFunction extends OutputModelObject { public String name; public String ctxType; - public boolean isRuleContext; public int ruleIndex; /** Map actionIndex to Action */ @@ -49,7 +48,6 @@ public class RuleActionFunction extends OutputModelObject { super(factory); name = r.name; ruleIndex = r.index; - isRuleContext = ctxType.equals("RuleContext"); this.ctxType = ctxType; } }