Antlr4.Runtime.DefaultErrorStrategy.GetErrorRecoverySet C# (CSharp) Method

GetErrorRecoverySet() private method

private GetErrorRecoverySet ( Parser recognizer ) : IntervalSet
recognizer Parser
return Antlr4.Runtime.Misc.IntervalSet
        protected internal virtual IntervalSet GetErrorRecoverySet(Parser recognizer)
        {
            ATN atn = recognizer.Interpreter.atn;
            RuleContext ctx = recognizer.RuleContext;
            IntervalSet recoverSet = new IntervalSet();
            while (ctx != null && ctx.invokingState >= 0)
            {
                // compute what follows who invoked us
                ATNState invokingState = atn.states[ctx.invokingState];
                RuleTransition rt = (RuleTransition)invokingState.Transition(0);
                IntervalSet follow = atn.NextTokens(rt.followState);
                recoverSet.AddAll(follow);
                ctx = ctx.Parent;
            }
            recoverSet.Remove(TokenConstants.EPSILON);
            //		System.out.println("recover set "+recoverSet.toString(recognizer.getTokenNames()));
            return recoverSet;
        }