public NFAState newState() { NFAState n = new NFAState(nfa); int state = nfa.getNewNFAStateNumber(); n.stateNumber = state; nfa.addState(n); n.enclosingRule = currentRule; return n; }
closure(dfa.nfa.getState(c.state), c.alt, c.context,
public NFAFactory(NFA nfa) { nfa.setFactory(this); this.nfa = nfa; }
return; nfa = new NFA(this); factory = new NFAFactory(nfa);
return; nfa = new NFA(this); factory = new NFAFactory(nfa);
closure(dfa.nfa.getState(c.state), c.alt, c.context,
public NFAState newState() { NFAState n = new NFAState(nfa); int state = nfa.getNewNFAStateNumber(); n.stateNumber = state; nfa.addState(n); n.enclosingRule = currentRule; return n; }
public NFAFactory(NFA nfa) { nfa.setFactory(this); this.nfa = nfa; }
/** Define all the rule begin/end NFAStates to solve forward reference * issues. Critical for composite grammars too. * This is normally called on all root/delegates manually and then * buildNFA() is called afterwards because the NFA construction needs * to see rule start/stop states from potentially every grammar. Has * to be have these created a priori. Testing routines will often * just call buildNFA(), which forces a call to this method if not * done already. Works ONLY for single noncomposite grammars. */ public void createRuleStartAndStopNFAStates() { //System.out.println("### createRuleStartAndStopNFAStates "+getGrammarTypeString()+" grammar "+name+" NFAs"); if ( nfa!=null ) { return; } nfa = new NFA(this); factory = new NFAFactory(nfa); Collection<Rule> rules = getRules(); for (Rule r : rules) { String ruleName = r.name; NFAState ruleBeginState = factory.newState(); ruleBeginState.setDescription("rule "+ruleName+" start"); ruleBeginState.enclosingRule = r; r.startState = ruleBeginState; NFAState ruleEndState = factory.newState(); ruleEndState.setDescription("rule "+ruleName+" end"); ruleEndState.setAcceptState(true); ruleEndState.enclosingRule = r; r.stopState = ruleEndState; } }
closure(dfa.nfa.getState(c.state), c.alt, c.context,
public NFAState newState() { NFAState n = new NFAState(nfa); int state = nfa.getNewNFAStateNumber(); n.stateNumber = state; nfa.addState(n); n.enclosingRule = currentRule; return n; }
public NFAFactory(NFA nfa) { nfa.setFactory(this); this.nfa = nfa; }
/** Define all the rule begin/end NFAStates to solve forward reference * issues. Critical for composite grammars too. * This is normally called on all root/delegates manually and then * buildNFA() is called afterwards because the NFA construction needs * to see rule start/stop states from potentially every grammar. Has * to be have these created a priori. Testing routines will often * just call buildNFA(), which forces a call to this method if not * done already. Works ONLY for single noncomposite grammars. */ public void createRuleStartAndStopNFAStates() { //System.out.println("### createRuleStartAndStopNFAStates "+getGrammarTypeString()+" grammar "+name+" NFAs"); if ( nfa!=null ) { return; } nfa = new NFA(this); factory = new NFAFactory(nfa); Collection<Rule> rules = getRules(); for (Rule r : rules) { String ruleName = r.name; NFAState ruleBeginState = factory.newState(); ruleBeginState.setDescription("rule "+ruleName+" start"); ruleBeginState.enclosingRule = r; r.startState = ruleBeginState; NFAState ruleEndState = factory.newState(); ruleEndState.setDescription("rule "+ruleName+" end"); ruleEndState.setAcceptState(true); ruleEndState.enclosingRule = r; r.stopState = ruleEndState; } }
closure(dfa.nfa.getState(c.state), c.alt, c.context,
public NFAState newState() { NFAState n = new NFAState(nfa); int state = nfa.getNewNFAStateNumber(); n.stateNumber = state; nfa.addState(n); n.enclosingRule = currentRule; return n; }
public NFAFactory(NFA nfa) { nfa.setFactory(this); this.nfa = nfa; }
for (int i = 0; i < configs.size(); i++) { NFAConfiguration c = configs.get(i); NFAState ruleInvocationState = dfa.nfa.getState(c.state); Transition transition0 = ruleInvocationState.transition[0]; RuleClosureTransition ref = (RuleClosureTransition)transition0;
for (int i = 0; i < configs.size(); i++) { NFAConfiguration c = (NFAConfiguration) configs.get(i); NFAState ruleInvocationState = dfa.nfa.getState(c.state); Transition transition0 = ruleInvocationState.transition[0]; RuleClosureTransition ref = (RuleClosureTransition)transition0;
for (int i = 0; i < configs.size(); i++) { NFAConfiguration c = (NFAConfiguration) configs.get(i); NFAState ruleInvocationState = dfa.nfa.getState(c.state); Transition transition0 = ruleInvocationState.transition[0]; RuleClosureTransition ref = (RuleClosureTransition)transition0;
for (int i = 0; i < configs.size(); i++) { NFAConfiguration c = configs.get(i); NFAState ruleInvocationState = dfa.nfa.getState(c.state); Transition transition0 = ruleInvocationState.transition[0]; RuleClosureTransition ref = (RuleClosureTransition)transition0;