private bool levelThree_sempred(LevelThreeContext _localctx, int predIndex)
        {
            switch (predIndex)
            {
            case 0: return(Precpred(_ctx, 2));

            case 1: return(Precpred(_ctx, 1));
            }
            return(true);
        }
        private LevelThreeContext levelThree(int _p)
        {
            ParserRuleContext _parentctx = _ctx;
            int _parentState             = State;
            LevelThreeContext _localctx  = new LevelThreeContext(_ctx, _parentState);
            LevelThreeContext _prevctx   = _localctx;
            int _startState = 2;

            EnterRecursionRule(_localctx, 2, RULE_levelThree, _p);
            int _la;

            try {
                int _alt;
                EnterOuterAlt(_localctx, 1);
                {
                    State = 14;
                    switch (_input.La(1))
                    {
                    case ENTRY:
                    case LPAREN:
                    {
                        _localctx = new LevelTwoOuterContext(_localctx);
                        _ctx      = _localctx;
                        _prevctx  = _localctx;

                        State = 12; levelTwo(0);
                    }
                    break;

                    case REFERENCE:
                    {
                        _localctx = new ReferenceContext(_localctx);
                        _ctx      = _localctx;
                        _prevctx  = _localctx;
                        State     = 13; Match(REFERENCE);
                    }
                    break;

                    default:
                        throw new NoViableAltException(this);
                    }
                    _ctx.stop = _input.Lt(-1);
                    State     = 24;
                    _errHandler.Sync(this);
                    _alt = Interpreter.AdaptivePredict(_input, 2, _ctx);
                    while (_alt != 2 && _alt != global::Antlr4.Runtime.Atn.ATN.InvalidAltNumber)
                    {
                        if (_alt == 1)
                        {
                            if (_parseListeners != null)
                            {
                                TriggerExitRuleEvent();
                            }
                            _prevctx = _localctx;
                            {
                                State = 22;
                                switch (Interpreter.AdaptivePredict(_input, 1, _ctx))
                                {
                                case 1:
                                {
                                    _localctx = new StarOperator3Context(new LevelThreeContext(_parentctx, _parentState));
                                    ((StarOperator3Context)_localctx).left = _prevctx;
                                    PushNewRecursionContext(_localctx, _startState, RULE_levelThree);
                                    State = 16;
                                    if (!(Precpred(_ctx, 2)))
                                    {
                                        throw new FailedPredicateException(this, "Precpred(_ctx, 2)");
                                    }
                                    State = 17;
                                    ((StarOperator3Context)_localctx).op = _input.Lt(1);
                                    _la = _input.La(1);
                                    if (!(_la == STAR || _la == HAT))
                                    {
                                        ((StarOperator3Context)_localctx).op = _errHandler.RecoverInline(this);
                                    }
                                    Consume();
                                    State = 18; ((StarOperator3Context)_localctx).right = levelThree(3);
                                }
                                break;

                                case 2:
                                {
                                    _localctx = new PlusOperator3Context(new LevelThreeContext(_parentctx, _parentState));
                                    ((PlusOperator3Context)_localctx).left = _prevctx;
                                    PushNewRecursionContext(_localctx, _startState, RULE_levelThree);
                                    State = 19;
                                    if (!(Precpred(_ctx, 1)))
                                    {
                                        throw new FailedPredicateException(this, "Precpred(_ctx, 1)");
                                    }
                                    State = 20; Match(PLUS);
                                    State = 21; ((PlusOperator3Context)_localctx).right = levelThree(2);
                                }
                                break;
                                }
                            }
                        }
                        State = 26;
                        _errHandler.Sync(this);
                        _alt = Interpreter.AdaptivePredict(_input, 2, _ctx);
                    }
                }
            }
            catch (RecognitionException re) {
                _localctx.exception = re;
                _errHandler.ReportError(this, re);
                _errHandler.Recover(this, re);
            }
            finally {
                UnrollRecursionContexts(_parentctx);
            }
            return(_localctx);
        }
 public ReferenceContext(LevelThreeContext context)
 {
     CopyFrom(context);
 }
 public LevelTwoOuterContext(LevelThreeContext context)
 {
     CopyFrom(context);
 }
 public PlusOperator3Context(LevelThreeContext context)
 {
     CopyFrom(context);
 }
 public virtual void CopyFrom(LevelThreeContext context)
 {
     base.CopyFrom(context);
 }