From 717af9c371d15b96fc2051d319432fa0e104a0f4 Mon Sep 17 00:00:00 2001 From: Terence Parr Date: Sun, 5 Aug 2012 09:34:20 -0700 Subject: [PATCH] remove useless code --- tool/src/org/antlr/v4/parse/BlockSetTransformer.g | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tool/src/org/antlr/v4/parse/BlockSetTransformer.g b/tool/src/org/antlr/v4/parse/BlockSetTransformer.g index b646a4de6..4761ddc2f 100644 --- a/tool/src/org/antlr/v4/parse/BlockSetTransformer.g +++ b/tool/src/org/antlr/v4/parse/BlockSetTransformer.g @@ -23,7 +23,6 @@ import org.antlr.v4.runtime.misc.IntervalSet; @members { public String currentRuleName; public GrammarAST currentAlt; -public Set rewriteElems = new HashSet(); public Grammar g; public BlockSetTransformer(TreeNodeStream input, Grammar g) { this(input, new RecognizerSharedState()); @@ -40,7 +39,7 @@ topdown setAlt : {inContext("RULE BLOCK")}? - ALT {currentAlt = $start; rewriteElems.clear();} + ALT {currentAlt = $start;} ; // (BLOCK (ALT (+ (BLOCK (ALT INT) (ALT ID))))) @@ -74,8 +73,7 @@ setElement[boolean inLexer] @after { GrammarTransformPipeline.setGrammarPtr(g, $tree); } - : {!rewriteElems.contains($start.getText())}? - ( a=STRING_LITERAL {!inLexer || CharSupport.getCharValueFromGrammarCharLiteral($a.getText())!=-1}? + : ( a=STRING_LITERAL {!inLexer || CharSupport.getCharValueFromGrammarCharLiteral($a.getText())!=-1}? | {!inLexer}?=> TOKEN_REF | {inLexer}?=> ^(RANGE a=STRING_LITERAL b=STRING_LITERAL) {CharSupport.getCharValueFromGrammarCharLiteral($a.getText())!=-1 &&