Antlr4.Runtime.Atn.ProfilingATNSimulator.ReportAmbiguity C# (CSharp) Method

ReportAmbiguity() protected method

protected ReportAmbiguity ( DFA dfa, DFAState D, int startIndex, int stopIndex, bool exact, BitSet ambigAlts, ATNConfigSet configSet ) : void
dfa Antlr4.Runtime.Dfa.DFA
D Antlr4.Runtime.Dfa.DFAState
startIndex int
stopIndex int
exact bool
ambigAlts Antlr4.Runtime.Sharpen.BitSet
configSet ATNConfigSet
return void
        protected override void ReportAmbiguity(DFA dfa, DFAState D, int startIndex, int stopIndex, bool exact,
		                                    BitSet ambigAlts, ATNConfigSet configSet)
        {
            int prediction;
            if (ambigAlts != null)
            {
            prediction = ambigAlts.NextSetBit(0);
            }
            else {
                prediction = configSet.GetAlts().NextSetBit(0);
            }
            if (configSet.fullCtx && prediction != conflictingAltResolvedBySLL)
            {
            // Even though this is an ambiguity we are reporting, we can
            // still detect some context sensitivities.  Both SLL and LL
            // are showing a conflict, hence an ambiguity, but if they resolve
            // to different minimum alternatives we have also identified a
            // context sensitivity.
            decisions[currentDecision].contextSensitivities.Add( new ContextSensitivityInfo(currentDecision, null /*configs*/, input, startIndex, stopIndex) );
            }
            decisions[currentDecision].ambiguities.Add(
            new AmbiguityInfo(currentDecision, null /*configs, ambigAlts*/,
                              input, startIndex, stopIndex/*, configs.IsFullContext*/)
            );
            base.ReportAmbiguity(dfa, D, startIndex, stopIndex, exact, ambigAlts, configSet);
        }