/** Given a collapsed block of alts (a set of atoms), pull out * the set and return it. */ protected IntSet getCollapsedBlockAsSet(State blk) { State s0 = blk; if ( s0!=null && s0.transition(0)!=null ) { State s1 = s0.transition(0).target; if ( s1!=null && s1.transition(0)!=null ) { Label label = s1.transition(0).label; if ( label.isSet() ) { return label.getSet(); } } } return null; }
/** Given a collapsed block of alts (a set of atoms), pull out * the set and return it. */ protected IntSet getCollapsedBlockAsSet(State blk) { State s0 = blk; if ( s0!=null && s0.transition(0)!=null ) { State s1 = s0.transition(0).target; if ( s1!=null && s1.transition(0)!=null ) { Label label = s1.transition(0).label; if ( label.isSet() ) { return label.getSet(); } } } return null; }
/** Given a collapsed block of alts (a set of atoms), pull out * the set and return it. */ protected IntSet getCollapsedBlockAsSet(State blk) { State s0 = blk; if ( s0!=null && s0.transition(0)!=null ) { State s1 = s0.transition(0).target; if ( s1!=null && s1.transition(0)!=null ) { Label label = s1.transition(0).label; if ( label.isSet() ) { return label.getSet(); } } } return null; }
/** Given a collapsed block of alts (a set of atoms), pull out * the set and return it. */ protected IntSet getCollapsedBlockAsSet(State blk) { State s0 = blk; if ( s0!=null && s0.transition(0)!=null ) { State s1 = s0.transition(0).target; if ( s1!=null && s1.transition(0)!=null ) { Label label = s1.transition(0).label; if ( label.isSet() ) { return label.getSet(); } } } return null; }
class StateManager { State actualState = new BaseState(); void processEvent(Event event) { actualState = actualState.transition(event); } }
Transition t = startState.transition(i); DFAState edgeTarget = (DFAState)t.target; if ( states.contains(edgeTarget) &&
Transition t = startState.transition(i); DFAState edgeTarget = (DFAState)t.target; if ( states.contains(edgeTarget) &&
Transition t = startState.transition(i); DFAState edgeTarget = (DFAState)t.target; if ( states.contains(edgeTarget) &&
Transition t = startState.transition(i); DFAState edgeTarget = (DFAState)t.target; if ( states.contains(edgeTarget) &&
/** In stateNumberTranslator, get a map from State to new, normalized * state number. Used by walkSerializingFA to make sure any two * identical state machines will serialize the same way. */ protected void walkFANormalizingStateNumbers(State s) { if ( s==null ) { ErrorManager.internalError("null state s"); return; } if ( stateNumberTranslator.get(s)!=null ) { return; // already did this state } // assign a new state number for this node if there isn't one stateNumberTranslator.put(s, Utils.integer(stateCounter)); stateCounter++; // visit nodes pointed to by each transition; for (int i = 0; i < s.getNumberOfTransitions(); i++) { Transition edge = (Transition) s.transition(i); walkFANormalizingStateNumbers(edge.target); // keep walkin' // if this transition is a rule reference, the node "following" this state // will not be found and appear to be not in graph. Must explicitly jump // to it, but don't "draw" an edge. if ( edge instanceof RuleClosureTransition ) { walkFANormalizingStateNumbers(((RuleClosureTransition) edge).followState); } } }
/** In stateNumberTranslator, get a map from State to new, normalized * state number. Used by walkSerializingFA to make sure any two * identical state machines will serialize the same way. */ protected void walkFANormalizingStateNumbers(State s) { if ( s==null ) { ErrorManager.internalError("null state s"); return; } if ( stateNumberTranslator.get(s)!=null ) { return; // already did this state } // assign a new state number for this node if there isn't one stateNumberTranslator.put(s, Utils.integer(stateCounter)); stateCounter++; // visit nodes pointed to by each transition; for (int i = 0; i < s.getNumberOfTransitions(); i++) { Transition edge = s.transition(i); walkFANormalizingStateNumbers(edge.target); // keep walkin' // if this transition is a rule reference, the node "following" this state // will not be found and appear to be not in graph. Must explicitly jump // to it, but don't "draw" an edge. if ( edge instanceof RuleClosureTransition ) { walkFANormalizingStateNumbers(((RuleClosureTransition) edge).followState); } } }
/** In stateNumberTranslator, get a map from State to new, normalized * state number. Used by walkSerializingFA to make sure any two * identical state machines will serialize the same way. */ protected void walkFANormalizingStateNumbers(State s) { if ( s==null ) { ErrorManager.internalError("null state s"); return; } if ( stateNumberTranslator.get(s)!=null ) { return; // already did this state } // assign a new state number for this node if there isn't one stateNumberTranslator.put(s, Utils.integer(stateCounter)); stateCounter++; // visit nodes pointed to by each transition; for (int i = 0; i < s.getNumberOfTransitions(); i++) { Transition edge = s.transition(i); walkFANormalizingStateNumbers(edge.target); // keep walkin' // if this transition is a rule reference, the node "following" this state // will not be found and appear to be not in graph. Must explicitly jump // to it, but don't "draw" an edge. if ( edge instanceof RuleClosureTransition ) { walkFANormalizingStateNumbers(((RuleClosureTransition) edge).followState); } } }
Transition edge = s.transition(i); StringBuilder buf = new StringBuilder(); buf.append(stateStr);
Transition edge = s.transition(i); StringBuilder buf = new StringBuilder(); buf.append(stateStr);
/** In stateNumberTranslator, get a map from State to new, normalized * state number. Used by walkSerializingFA to make sure any two * identical state machines will serialize the same way. */ protected void walkFANormalizingStateNumbers(State s) { if ( s==null ) { ErrorManager.internalError("null state s"); return; } if ( stateNumberTranslator.get(s)!=null ) { return; // already did this state } // assign a new state number for this node if there isn't one stateNumberTranslator.put(s, Utils.integer(stateCounter)); stateCounter++; // visit nodes pointed to by each transition; for (int i = 0; i < s.getNumberOfTransitions(); i++) { Transition edge = (Transition) s.transition(i); walkFANormalizingStateNumbers(edge.target); // keep walkin' // if this transition is a rule reference, the node "following" this state // will not be found and appear to be not in graph. Must explicitly jump // to it, but don't "draw" an edge. if ( edge instanceof RuleClosureTransition ) { walkFANormalizingStateNumbers(((RuleClosureTransition) edge).followState); } } }
Transition edge = (Transition) s.transition(i); StringBuffer buf = new StringBuffer(); buf.append(stateStr);
Transition edge = (Transition) s.transition(i); StringBuffer buf = new StringBuffer(); buf.append(stateStr);
Transition edge = s.transition(i); if ( edge instanceof RuleClosureTransition ) { RuleClosureTransition rr = ((RuleClosureTransition)edge);
Transition edge = (Transition) s.transition(i); if ( edge instanceof RuleClosureTransition ) { RuleClosureTransition rr = ((RuleClosureTransition)edge);
Transition edge = s.transition(i); if ( edge instanceof RuleClosureTransition ) { RuleClosureTransition rr = ((RuleClosureTransition)edge);