forked from jasder/antlr
Add computed state to DFA before moving to full context simulation
This commit is contained in:
parent
2393cfd40e
commit
64354e5740
|
@ -663,18 +663,16 @@ public class ParserATNSimulator extends ATNSimulator {
|
||||||
computeStartState(dfa.atnStartState,
|
computeStartState(dfa.atnStartState,
|
||||||
outerContext,
|
outerContext,
|
||||||
true);
|
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
|
// not accept state: isCtxSensitive
|
||||||
D.requiresFullContext = true; // always force DFA to ATN simulate
|
D.requiresFullContext = true; // always force DFA to ATN simulate
|
||||||
D.prediction = ATN.INVALID_ALT_NUMBER;
|
D.prediction = ATN.INVALID_ALT_NUMBER;
|
||||||
addDFAEdge(dfa, previousD, t, D);
|
D = addDFAEdge(dfa, previousD, t, D);
|
||||||
return predictedAlt; // all done with preds, etc...
|
|
||||||
|
return execATNWithFullContext(dfa, D, s0_closure,
|
||||||
|
input, startIndex,
|
||||||
|
outerContext,
|
||||||
|
D.configs.conflictingAlts.nextSetBit(0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue