From 85f2a87840379d2dee785e076429a2be51368499 Mon Sep 17 00:00:00 2001 From: parrt Date: Fri, 4 Nov 2016 16:07:45 -0700 Subject: [PATCH] rm recognizerName field where possible --- .../org/antlr/v4/codegen/model/LeftRecursiveRuleFunction.java | 4 ---- tool/src/org/antlr/v4/codegen/model/RuleFunction.java | 2 -- tool/src/org/antlr/v4/codegen/model/RuleSempredFunction.java | 3 --- 3 files changed, 9 deletions(-) diff --git a/tool/src/org/antlr/v4/codegen/model/LeftRecursiveRuleFunction.java b/tool/src/org/antlr/v4/codegen/model/LeftRecursiveRuleFunction.java index 73155f440..adbc3a623 100644 --- a/tool/src/org/antlr/v4/codegen/model/LeftRecursiveRuleFunction.java +++ b/tool/src/org/antlr/v4/codegen/model/LeftRecursiveRuleFunction.java @@ -42,8 +42,6 @@ import org.antlr.v4.tool.Rule; import org.antlr.v4.tool.ast.GrammarAST; public class LeftRecursiveRuleFunction extends RuleFunction { - public String recognizerName; - public LeftRecursiveRuleFunction(OutputModelFactory factory, LeftRecursiveRule r) { super(factory, r); @@ -74,7 +72,5 @@ public class LeftRecursiveRuleFunction extends RuleFunction { struct.addDecl(d); // stick in overall rule's ctx } } - - recognizerName = factory.getGrammar().getRecognizerName(); } } diff --git a/tool/src/org/antlr/v4/codegen/model/RuleFunction.java b/tool/src/org/antlr/v4/codegen/model/RuleFunction.java index 75cd3fe0c..25d6d0f79 100644 --- a/tool/src/org/antlr/v4/codegen/model/RuleFunction.java +++ b/tool/src/org/antlr/v4/codegen/model/RuleFunction.java @@ -81,7 +81,6 @@ public class RuleFunction extends OutputModelObject { public Rule rule; public AltLabelStructDecl[] altToContext; public boolean hasLookaheadBlock; - public String recognizerName; @ModelElement public List code; @ModelElement public OrderedHashSet locals; // TODO: move into ctx? @@ -139,7 +138,6 @@ public class RuleFunction extends OutputModelObject { } startState = factory.getGrammar().atn.ruleToStartState[r.index]; - recognizerName = factory.getGrammar().getRecognizerName(); } public void addContextGetters(OutputModelFactory factory, Rule r) { diff --git a/tool/src/org/antlr/v4/codegen/model/RuleSempredFunction.java b/tool/src/org/antlr/v4/codegen/model/RuleSempredFunction.java index 9ac99b796..2b1f6a1c9 100644 --- a/tool/src/org/antlr/v4/codegen/model/RuleSempredFunction.java +++ b/tool/src/org/antlr/v4/codegen/model/RuleSempredFunction.java @@ -34,10 +34,7 @@ import org.antlr.v4.codegen.OutputModelFactory; import org.antlr.v4.tool.Rule; public class RuleSempredFunction extends RuleActionFunction { - public String recognizerName; - public RuleSempredFunction(OutputModelFactory factory, Rule r, String ctxType) { super(factory, r, ctxType); - recognizerName = factory.getGrammar().getRecognizerName(); } }