public void reset() { stateToRecursionOverflowConfigurationsMap.clear(); } }
/** Many imports are illegal such as lexer into a tree grammar */ public boolean validImport(Grammar delegate) { List<Integer> validDelegators = validDelegations.get(delegate.type); return validDelegators!=null && validDelegators.contains(this.type); }
/** If a recursion overflow is resolve with predicates, then we need * to shut off the warning that would be generated. */ public void removeRecursiveOverflowState(DFAState d) { Integer stateI = Utils.integer(d.stateNumber); stateToRecursionOverflowConfigurationsMap.remove(stateI); }
new MultiMap<Integer, NFAConfiguration>(); for (int i = 0; i < numConfigs; i++) { NFAConfiguration configuration = nfaConfigurations.get(i); Integer stateI = Utils.integer(configuration.state); stateToConfigListMap.map(stateI, configuration); Set<Integer> states = stateToConfigListMap.keySet(); int numPotentialConflicts = 0; for (Integer stateI : states) { boolean thisStateHasPotentialProblem = false; List<NFAConfiguration> configsForState = stateToConfigListMap.get(stateI); int alt=0; int numConfigsForState = configsForState.size(); stateToConfigListMap.put(stateI, null); List<NFAConfiguration> configsForState = stateToConfigListMap.get(stateI);
/** Took too long to analyze a DFA */ public boolean analysisOverflowed() { return stateToRecursionOverflowConfigurationsMap.size()>0; }
public void reportRecursionOverflow(DFAState d, NFAConfiguration recursionNFAConfiguration) { // track the state number rather than the state as d will change // out from underneath us; hash wouldn't return any value // left-recursion is detected in start state. Since we can't // call resolveNondeterminism() on the start state (it would // not look k=1 to get min single token lookahead), we must // prevent errors derived from this state. Avoid start state if ( d.stateNumber > 0 ) { Integer stateI = Utils.integer(d.stateNumber); stateToRecursionOverflowConfigurationsMap.map(stateI, recursionNFAConfiguration); } }
protected void issueRecursionWarnings() { stateToRecursionOverflowConfigurationsMap.keySet();
initAltRelatedInfo(); unreachableAlts = null; for (Map.Entry<IntervalSet, List<Integer>> entry : edgeMap.entrySet()) { IntervalSet edge = entry.getKey(); List<Integer> alts = entry.getValue();
new MultiMap<Integer, NFAConfiguration>(); for (int i = 0; i < numConfigs; i++) { NFAConfiguration configuration = (NFAConfiguration) nfaConfigurations.get(i); Integer stateI = Utils.integer(configuration.state); stateToConfigListMap.map(stateI, configuration); Set states = stateToConfigListMap.keySet(); int numPotentialConflicts = 0; for (Iterator it = states.iterator(); it.hasNext();) { Integer stateI = (Integer) it.next(); boolean thisStateHasPotentialProblem = false; List configsForState = (List)stateToConfigListMap.get(stateI); int alt=0; int numConfigsForState = configsForState.size(); stateToConfigListMap.put(stateI, null); List configsForState = (List)stateToConfigListMap.get(stateI);
/** Took too long to analyze a DFA */ public boolean analysisOverflowed() { return stateToRecursionOverflowConfigurationsMap.size()>0; }
public void reportRecursionOverflow(DFAState d, NFAConfiguration recursionNFAConfiguration) { // track the state number rather than the state as d will change // out from underneath us; hash wouldn't return any value // left-recursion is detected in start state. Since we can't // call resolveNondeterminism() on the start state (it would // not look k=1 to get min single token lookahead), we must // prevent errors derived from this state. Avoid start state if ( d.stateNumber > 0 ) { Integer stateI = Utils.integer(d.stateNumber); stateToRecursionOverflowConfigurationsMap.map(stateI, recursionNFAConfiguration); } }
protected void issueRecursionWarnings() { stateToRecursionOverflowConfigurationsMap.keySet();
initAltRelatedInfo(); unreachableAlts = null; for (Map.Entry<IntervalSet, List<Integer>> entry : edgeMap.entrySet()) { IntervalSet edge = entry.getKey(); List<Integer> alts = entry.getValue();
new MultiMap<Integer, NFAConfiguration>(); for (int i = 0; i < numConfigs; i++) { NFAConfiguration configuration = nfaConfigurations.get(i); Integer stateI = Utils.integer(configuration.state); stateToConfigListMap.map(stateI, configuration); Set<Integer> states = stateToConfigListMap.keySet(); int numPotentialConflicts = 0; for (Integer stateI : states) { boolean thisStateHasPotentialProblem = false; List<NFAConfiguration> configsForState = stateToConfigListMap.get(stateI); int alt=0; int numConfigsForState = configsForState.size(); stateToConfigListMap.put(stateI, null); List<NFAConfiguration> configsForState = stateToConfigListMap.get(stateI);
/** Many imports are illegal such as lexer into a tree grammar */ public boolean validImport(Grammar delegate) { List<Integer> validDelegators = validDelegations.get(delegate.type); return validDelegators!=null && validDelegators.contains(this.type); }