Add computed state to DFA before moving to full context simulation

This commit is contained in:
Sam Harwell 2013-04-18 13:00:06 -05:00
parent 2393cfd40e
commit 64354e5740
1 changed files with 6 additions and 8 deletions

View File

@ -663,18 +663,16 @@ public class ParserATNSimulator extends ATNSimulator {
computeStartState(dfa.atnStartState,
outerContext,
true);
predictedAlt = execATNWithFullContext(dfa, D, s0_closure,
input, startIndex,
outerContext,
D.configs.conflictingAlts.nextSetBit(0));
// TODO: if true conflict found and same answer as we got with SLL,
// then make it non ctx sensitive DFA state
// not accept state: isCtxSensitive
D.requiresFullContext = true; // always force DFA to ATN simulate
D.prediction = ATN.INVALID_ALT_NUMBER;
addDFAEdge(dfa, previousD, t, D);
return predictedAlt; // all done with preds, etc...
D = addDFAEdge(dfa, previousD, t, D);
return execATNWithFullContext(dfa, D, s0_closure,
input, startIndex,
outerContext,
D.configs.conflictingAlts.nextSetBit(0));
}
}