Antlr4.Runtime.Atn.ParserATNSimulator.GetEpsilonTarget C# (CSharp) Method

GetEpsilonTarget() protected method

protected GetEpsilonTarget ( ATNConfig config, Transition t, bool collectPredicates, bool inContext, bool fullCtx, bool treatEofAsEpsilon ) : ATNConfig
config ATNConfig
t Transition
collectPredicates bool
inContext bool
fullCtx bool
treatEofAsEpsilon bool
return ATNConfig
        protected ATNConfig GetEpsilonTarget(ATNConfig config,
										  Transition t,
										  bool collectPredicates,
										  bool inContext,
										  bool fullCtx,
										  bool treatEofAsEpsilon)
        {
            switch (t.TransitionType)
            {
                case TransitionType.RULE:
                    return RuleTransition(config, (RuleTransition)t);

                case TransitionType.PRECEDENCE:
                    return PrecedenceTransition(config, (PrecedencePredicateTransition)t, collectPredicates, inContext, fullCtx);

                case TransitionType.PREDICATE:
                    return PredTransition(config, (PredicateTransition)t,
                                          collectPredicates,
                                          inContext,
                                          fullCtx);

                case TransitionType.ACTION:
                    return ActionTransition(config, (ActionTransition)t);

                case TransitionType.EPSILON:
                    return new ATNConfig(config, t.target);

                case TransitionType.ATOM:
                case TransitionType.RANGE:
                case TransitionType.SET:
                    // EOF transitions act like epsilon transitions after the first EOF
                    // transition is traversed
                    if (treatEofAsEpsilon)
                    {
                        if (t.Matches(TokenConstants.EOF, 0, 1))
                        {
                            return new ATNConfig(config, t.target);
                        }
                    }

                    return null;

                default:
                    return null;
            }
        }