public void process() { // LEFT-RECURSION CHECK LeftRecursionDetector lr = new LeftRecursionDetector(g, g.atn); lr.check(); if ( !lr.listOfRecursiveCycles.isEmpty() ) return; // bail out if (g.isLexer()) { processLexer(); } else { // BUILD DFA FOR EACH DECISION processParser(); } }
Rule r = g.getRule(rt.ruleIndex); if ( rulesVisitedPerRuleCheck.contains((RuleStartState)t.target) ) { addRulesToCycle(enclosingRule, r); boolean nullable = check(r, t.target, new HashSet<ATNState>()); stateReachesStopState |= check(enclosingRule, rt.followState, visitedStates); stateReachesStopState |= check(enclosingRule, t.target, visitedStates);
public void check() { for (RuleStartState start : atn.ruleToStartState) { //System.out.print("check "+start.rule.name); rulesVisitedPerRuleCheck.clear(); rulesVisitedPerRuleCheck.add(start); //FASerializer ser = new FASerializer(atn.g, start); //System.out.print(":\n"+ser+"\n"); check(g.getRule(start.ruleIndex), start, new HashSet<ATNState>()); } //System.out.println("cycles="+listOfRecursiveCycles); if ( !listOfRecursiveCycles.isEmpty() ) { g.tool.errMgr.leftRecursionCycles(g.fileName, listOfRecursiveCycles); } }
Rule r = g.getRule(rt.ruleIndex); if ( rulesVisitedPerRuleCheck.contains((RuleStartState)t.target) ) { addRulesToCycle(enclosingRule, r); boolean nullable = check(r, t.target, new HashSet<ATNState>()); stateReachesStopState |= check(enclosingRule, rt.followState, visitedStates); stateReachesStopState |= check(enclosingRule, t.target, visitedStates);
public void check() { for (RuleStartState start : atn.ruleToStartState) { //System.out.print("check "+start.rule.name); rulesVisitedPerRuleCheck.clear(); rulesVisitedPerRuleCheck.add(start); //FASerializer ser = new FASerializer(atn.g, start); //System.out.print(":\n"+ser+"\n"); check(g.getRule(start.ruleIndex), start, new HashSet<ATNState>()); } //System.out.println("cycles="+listOfRecursiveCycles); if ( !listOfRecursiveCycles.isEmpty() ) { g.tool.errMgr.leftRecursionCycles(g.fileName, listOfRecursiveCycles); } }
public void process() { // LEFT-RECURSION CHECK LeftRecursionDetector lr = new LeftRecursionDetector(g, g.atn); lr.check(); if ( !lr.listOfRecursiveCycles.isEmpty() ) return; // bail out if (g.isLexer()) { processLexer(); } else { // BUILD DFA FOR EACH DECISION processParser(); } }
Rule r = g.getRule(rt.ruleIndex); if ( rulesVisitedPerRuleCheck.contains((RuleStartState)t.target) ) { addRulesToCycle(enclosingRule, r); boolean nullable = check(r, t.target, new HashSet<ATNState>()); stateReachesStopState |= check(enclosingRule, rt.followState, visitedStates); stateReachesStopState |= check(enclosingRule, t.target, visitedStates);
public void check() { for (RuleStartState start : atn.ruleToStartState) { //System.out.print("check "+start.rule.name); rulesVisitedPerRuleCheck.clear(); rulesVisitedPerRuleCheck.add(start); //FASerializer ser = new FASerializer(atn.g, start); //System.out.print(":\n"+ser+"\n"); check(g.getRule(start.ruleIndex), start, new HashSet<ATNState>()); } //System.out.println("cycles="+listOfRecursiveCycles); if ( !listOfRecursiveCycles.isEmpty() ) { g.tool.errMgr.leftRecursionCycles(g.fileName, listOfRecursiveCycles); } }
public void process() { // LEFT-RECURSION CHECK LeftRecursionDetector lr = new LeftRecursionDetector(g, g.atn); lr.check(); if ( !lr.listOfRecursiveCycles.isEmpty() ) return; // bail out if (g.isLexer()) { processLexer(); } else { // BUILD DFA FOR EACH DECISION processParser(); } }
Rule r = g.getRule(rt.ruleIndex); if ( rulesVisitedPerRuleCheck.contains((RuleStartState)t.target) ) { addRulesToCycle(enclosingRule, r); boolean nullable = check(r, t.target, new HashSet<ATNState>()); stateReachesStopState |= check(enclosingRule, rt.followState, visitedStates); stateReachesStopState |= check(enclosingRule, t.target, visitedStates);
public void check() { for (RuleStartState start : atn.ruleToStartState) { //System.out.print("check "+start.rule.name); rulesVisitedPerRuleCheck.clear(); rulesVisitedPerRuleCheck.add(start); //FASerializer ser = new FASerializer(atn.g, start); //System.out.print(":\n"+ser+"\n"); check(g.getRule(start.ruleIndex), start, new HashSet<ATNState>()); } //System.out.println("cycles="+listOfRecursiveCycles); if ( !listOfRecursiveCycles.isEmpty() ) { g.tool.errMgr.leftRecursionCycles(g.fileName, listOfRecursiveCycles); } }
public void process() { // LEFT-RECURSION CHECK LeftRecursionDetector lr = new LeftRecursionDetector(g, g.atn); lr.check(); if ( !lr.listOfRecursiveCycles.isEmpty() ) return; // bail out if (g.isLexer()) { processLexer(); } else { // BUILD DFA FOR EACH DECISION processParser(); } }
Rule r = g.getRule(rt.ruleIndex); if ( rulesVisitedPerRuleCheck.contains((RuleStartState)t.target) ) { addRulesToCycle(enclosingRule, r); boolean nullable = check(r, t.target, new HashSet<ATNState>()); stateReachesStopState |= check(enclosingRule, rt.followState, visitedStates); stateReachesStopState |= check(enclosingRule, t.target, visitedStates);
public void check() { for (RuleStartState start : atn.ruleToStartState) { //System.out.print("check "+start.rule.name); rulesVisitedPerRuleCheck.clear(); rulesVisitedPerRuleCheck.add(start); //FASerializer ser = new FASerializer(atn.g, start); //System.out.print(":\n"+ser+"\n"); check(g.getRule(start.ruleIndex), start, new HashSet<ATNState>()); } //System.out.println("cycles="+listOfRecursiveCycles); if ( !listOfRecursiveCycles.isEmpty() ) { g.tool.errMgr.leftRecursionCycles(g.fileName, listOfRecursiveCycles); } }
public void process() { // LEFT-RECURSION CHECK LeftRecursionDetector lr = new LeftRecursionDetector(g, g.atn); lr.check(); if ( !lr.listOfRecursiveCycles.isEmpty() ) return; // bail out if (g.isLexer()) { processLexer(); } else { // BUILD DFA FOR EACH DECISION processParser(); } }