Remove unused/commented methods
This commit is contained in:
parent
112810db28
commit
8839d6b185
|
@ -120,34 +120,6 @@ public abstract class PredictionContext implements Iterable<SingletonPredictionC
|
|||
return 5 * 5 * 7 + 5 * parentHashCode + returnStateHashCode;
|
||||
}
|
||||
|
||||
/** Two contexts conflict() if they are equals() or one is a stack suffix
|
||||
* of the other. For example, contexts [21 12 $] and [21 9 $] do not
|
||||
* conflict, but [21 $] and [21 12 $] do conflict. Note that I should
|
||||
* probably not show the $ in this case. There is a dummy node for each
|
||||
* stack that just means empty; $ is a marker that's all.
|
||||
*
|
||||
* This is used in relation to checking conflicts associated with a
|
||||
* single NFA state's configurations within a single DFA state.
|
||||
* If there are configurations s and t within a DFA state such that
|
||||
* s.state=t.state && s.alt != t.alt && s.ctx conflicts t.ctx then
|
||||
* the DFA state predicts more than a single alt--it's nondeterministic.
|
||||
* Two contexts conflict if they are the same or if one is a suffix
|
||||
* of the other.
|
||||
*
|
||||
* When comparing contexts, if one context has a stack and the other
|
||||
* does not then they should be considered the same context. The only
|
||||
* way for an NFA state p to have an empty context and a nonempty context
|
||||
* is the case when closure falls off end of rule without a call stack
|
||||
* and re-enters the rule with a context. This resolves the issue I
|
||||
* discussed with Sriram Srinivasan Feb 28, 2005 about not terminating
|
||||
* fast enough upon nondeterminism.
|
||||
*
|
||||
* UPDATE FOR GRAPH STACK; no suffix
|
||||
*/
|
||||
// public boolean conflictsWith(PredictionContext other) {
|
||||
// return this.equals(other);
|
||||
// }
|
||||
|
||||
// dispatch
|
||||
public static PredictionContext merge(
|
||||
PredictionContext a, PredictionContext b,
|
||||
|
|
|
@ -73,31 +73,6 @@ public class DFA {
|
|||
this.decision = decision;
|
||||
}
|
||||
|
||||
/** Find the path in DFA from s0 to s, returning list of states encountered (inclusively) */
|
||||
// public List<DFAState> getPathToState(DFAState finalState, TokenStream input, int start, int stop) {
|
||||
// if ( s0==null ) return null;
|
||||
// List<DFAState> states = new ArrayList<DFAState>();
|
||||
// states.add(s0);
|
||||
// DFAState p = s0;
|
||||
// int i = start;
|
||||
// Token t = input.get(i);
|
||||
// while ( p != finalState && i<stop ) {
|
||||
// int la = t.getType();
|
||||
// if ( p.edges == null || la >= p.edges.length || la < -1 || p.edges[la+1] == null ) {
|
||||
// return states;
|
||||
// }
|
||||
// DFAState target = p.edges[la+1];
|
||||
// if ( target == ATNSimulator.ERROR ) {
|
||||
// return states;
|
||||
// }
|
||||
// states.add(target);
|
||||
// p = target;
|
||||
// i++;
|
||||
// t = input.get(i);
|
||||
// }
|
||||
// return states;
|
||||
// }
|
||||
|
||||
public List<Set<ATNState>> getATNStatesAlongPath(ParserATNSimulator atn,
|
||||
List<DFAState> dfaStates,
|
||||
TokenStream input, int start, int stop)
|
||||
|
|
Loading…
Reference in New Issue