rename var; add missing return

[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9564]
This commit is contained in:
parrt 2011-12-11 14:45:25 -08:00
parent 3fb7466a80
commit b9afdf6e07
1 changed files with 3 additions and 3 deletions

View File

@ -454,6 +454,7 @@ public class ParserATNSimulator<Symbol> extends ATNSimulator {
// this implies that we have a true ambiguity
reportAmbiguity(startIndex, input.index(), ambigAlts, reach);
resolveToProperAlt(decState, ambigAlts, reach);
return ATN.INVALID_ALT_NUMBER;
}
else {
return retryWithContext(input, dfa, startIndex, outerContext,
@ -648,15 +649,14 @@ public class ParserATNSimulator<Symbol> extends ATNSimulator {
{
// ASSUMES PREDICT ONLY
retry_with_context++;
int ctx_alt = predictATNWithDummyDFA(dfa, input, startIndex, reach, outerContext);
int predictedAlt = predictATNWithDummyDFA(dfa, input, startIndex, reach, outerContext);
// it's not context-sensitive; true ambig. fall thru to strip dead alts
// TODO: if ambig, why turn on ctx sensitive?
int predictedAlt = ctx_alt;
if ( buildDFA ) {
DFAState reachTarget = addDFAEdge(dfa, closure, t, reach);
makeAcceptState(reachTarget, ctx_alt);
makeAcceptState(reachTarget, predictedAlt);
reachTarget.isCtxSensitive = true;
if ( reachTarget.ctxToPrediction==null ) {
reachTarget.ctxToPrediction = new LinkedHashMap<RuleContext, Integer>();