int decisionType = dfa.getNFADecisionStartState().decisionStateType; if ( dfa.isGreedy() && (decisionType==NFAState.OPTIONAL_BLOCK_START || decisionType==NFAState.LOOPBACK) )
int decisionType = dfa.getNFADecisionStartState().decisionStateType; if ( dfa.isGreedy() && (decisionType==NFAState.OPTIONAL_BLOCK_START || decisionType==NFAState.LOOPBACK) )
int decisionType = dfa.getNFADecisionStartState().decisionStateType; if ( dfa.isGreedy() && (decisionType==NFAState.OPTIONAL_BLOCK_START || decisionType==NFAState.LOOPBACK) )
int decisionType = dfa.getNFADecisionStartState().decisionStateType; if ( dfa.isGreedy() && (decisionType==NFAState.OPTIONAL_BLOCK_START || decisionType==NFAState.LOOPBACK) )
protected int resolveByChoosingFirstAlt(DFAState d, Set<Integer> nondeterministicAlts) { int winningAlt; if ( dfa.isGreedy() ) { winningAlt = resolveByPickingMinAlt(d,nondeterministicAlts); } else { // If nongreedy, the exit alt shout win, but only if it's // involved in the nondeterminism! /* System.out.println("resolving exit alt for decision="+ dfa.decisionNumber+" state="+d); System.out.println("nondet="+nondeterministicAlts); System.out.println("exit alt "+exitAlt); */ int exitAlt = dfa.getNumberOfAlts(); if ( nondeterministicAlts.contains(Utils.integer(exitAlt)) ) { // if nongreedy and exit alt is one of those nondeterministic alts // predicted, resolve in favor of what follows block winningAlt = resolveByPickingExitAlt(d,nondeterministicAlts); } else { winningAlt = resolveByPickingMinAlt(d,nondeterministicAlts); } } return winningAlt; }
protected int resolveByChoosingFirstAlt(DFAState d, Set nondeterministicAlts) { int winningAlt = 0; if ( dfa.isGreedy() ) { winningAlt = resolveByPickingMinAlt(d,nondeterministicAlts); } else { // If nongreedy, the exit alt shout win, but only if it's // involved in the nondeterminism! /* System.out.println("resolving exit alt for decision="+ dfa.decisionNumber+" state="+d); System.out.println("nondet="+nondeterministicAlts); System.out.println("exit alt "+exitAlt); */ int exitAlt = dfa.getNumberOfAlts(); if ( nondeterministicAlts.contains(Utils.integer(exitAlt)) ) { // if nongreedy and exit alt is one of those nondeterministic alts // predicted, resolve in favor of what follows block winningAlt = resolveByPickingExitAlt(d,nondeterministicAlts); } else { winningAlt = resolveByPickingMinAlt(d,nondeterministicAlts); } } return winningAlt; }
protected int resolveByChoosingFirstAlt(DFAState d, Set nondeterministicAlts) { int winningAlt = 0; if ( dfa.isGreedy() ) { winningAlt = resolveByPickingMinAlt(d,nondeterministicAlts); } else { // If nongreedy, the exit alt shout win, but only if it's // involved in the nondeterminism! /* System.out.println("resolving exit alt for decision="+ dfa.decisionNumber+" state="+d); System.out.println("nondet="+nondeterministicAlts); System.out.println("exit alt "+exitAlt); */ int exitAlt = dfa.getNumberOfAlts(); if ( nondeterministicAlts.contains(Utils.integer(exitAlt)) ) { // if nongreedy and exit alt is one of those nondeterministic alts // predicted, resolve in favor of what follows block winningAlt = resolveByPickingExitAlt(d,nondeterministicAlts); } else { winningAlt = resolveByPickingMinAlt(d,nondeterministicAlts); } } return winningAlt; }
protected int resolveByChoosingFirstAlt(DFAState d, Set<Integer> nondeterministicAlts) { int winningAlt; if ( dfa.isGreedy() ) { winningAlt = resolveByPickingMinAlt(d,nondeterministicAlts); } else { // If nongreedy, the exit alt shout win, but only if it's // involved in the nondeterminism! /* System.out.println("resolving exit alt for decision="+ dfa.decisionNumber+" state="+d); System.out.println("nondet="+nondeterministicAlts); System.out.println("exit alt "+exitAlt); */ int exitAlt = dfa.getNumberOfAlts(); if ( nondeterministicAlts.contains(Utils.integer(exitAlt)) ) { // if nongreedy and exit alt is one of those nondeterministic alts // predicted, resolve in favor of what follows block winningAlt = resolveByPickingExitAlt(d,nondeterministicAlts); } else { winningAlt = resolveByPickingMinAlt(d,nondeterministicAlts); } } return winningAlt; }
if ( !dfa.isGreedy() && containsEOT ) { convertToEOTAcceptState(d); return; // no more work to do on this accept state
if ( !dfa.isGreedy() && containsEOT ) { convertToEOTAcceptState(d); return; // no more work to do on this accept state
if ( !dfa.isGreedy() && containsEOT ) { convertToEOTAcceptState(d); return; // no more work to do on this accept state
if ( !dfa.isGreedy() && containsEOT ) { convertToEOTAcceptState(d); return; // no more work to do on this accept state