protected virtual BitSet EvalSemanticContext(PredPrediction[] predPredictions,
ParserRuleContext outerContext,
bool complete)
{
BitSet predictions = new BitSet();
foreach (PredPrediction pair in predPredictions)
{
if (pair.pred == SemanticContext.NONE)
{
predictions[pair.alt] = true;
if (!complete)
{
break;
}
continue;
}
bool fullCtx = false; // in dfa
bool predicateEvaluationResult = EvalSemanticContext(pair.pred, outerContext, pair.alt, fullCtx);
if (debug || dfa_debug)
{
Console.WriteLine("eval pred " + pair + "=" + predicateEvaluationResult);
}
if (predicateEvaluationResult)
{
if (debug || dfa_debug) Console.WriteLine("PREDICT " + pair.alt);
predictions[pair.alt] = true;
if (!complete)
{
break;
}
}
}
return predictions;
}