rename method

This commit is contained in:
Terence Parr 2012-06-01 18:06:48 -07:00
parent 59af8ab76b
commit 8481979f69
1 changed files with 4 additions and 6 deletions

View File

@ -29,10 +29,10 @@
package org.antlr.v4.analysis; package org.antlr.v4.analysis;
import org.antlr.v4.misc.Utils;
import org.antlr.v4.runtime.atn.DecisionState; import org.antlr.v4.runtime.atn.DecisionState;
import org.antlr.v4.runtime.atn.LL1Analyzer; import org.antlr.v4.runtime.atn.LL1Analyzer;
import org.antlr.v4.runtime.misc.IntervalSet; import org.antlr.v4.runtime.misc.IntervalSet;
import org.antlr.v4.misc.Utils;
import org.antlr.v4.tool.Grammar; import org.antlr.v4.tool.Grammar;
import java.util.ArrayList; import java.util.ArrayList;
@ -52,15 +52,13 @@ public class AnalysisPipeline {
if ( lr.listOfRecursiveCycles.size()>0 ) return; // bail out if ( lr.listOfRecursiveCycles.size()>0 ) return; // bail out
// BUILD DFA FOR EACH DECISION // BUILD DFA FOR EACH DECISION
if ( !g.isLexer() ) processParserOrTreeParser(); if ( !g.isLexer() ) processParser();
} }
void processParserOrTreeParser() { void processParser() {
g.decisionLOOK = g.decisionLOOK = new ArrayList<IntervalSet[]>(g.atn.getNumberOfDecisions()+1);
new ArrayList<IntervalSet[]>(g.atn.getNumberOfDecisions()+1);
for (DecisionState s : g.atn.decisionToState) { for (DecisionState s : g.atn.decisionToState) {
g.tool.log("LL1", "\nDECISION "+s.decision+" in rule "+g.getRule(s.ruleIndex).name); g.tool.log("LL1", "\nDECISION "+s.decision+" in rule "+g.getRule(s.ruleIndex).name);
LL1Analyzer anal = new LL1Analyzer(g.atn); LL1Analyzer anal = new LL1Analyzer(g.atn);
IntervalSet[] look = anal.getDecisionLookahead(s); IntervalSet[] look = anal.getDecisionLookahead(s);
g.tool.log("LL1", "look=" + Arrays.toString(look)); g.tool.log("LL1", "look=" + Arrays.toString(look));