Antlr4.Runtime.Atn.ParserATNSimulator.EvalSemanticContext C# (CSharp) Метод

EvalSemanticContext() защищенный Метод

protected EvalSemanticContext ( PredPrediction predPredictions, ParserRuleContext outerContext, bool complete ) : BitSet
predPredictions PredPrediction
outerContext ParserRuleContext
complete bool
Результат Antlr4.Runtime.Sharpen.BitSet
        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;
        }

Same methods

ParserATNSimulator::EvalSemanticContext ( SemanticContext pred, ParserRuleContext parserCallStack, int alt, bool fullCtx ) : bool