public StatContext stat()
        {
            StatContext _localctx = new StatContext(_ctx, State);

            EnterRule(_localctx, 2, RULE_stat);
            try {
                State = 20;
                switch (Interpreter.AdaptivePredict(_input, 1, _ctx))
                {
                case 1:
                    _localctx = new PrintExprContext(_localctx);
                    EnterOuterAlt(_localctx, 1);
                    {
                        State = 11; expr(0);
                        State = 12; Match(NEWLINE);
                    }
                    break;

                case 2:
                    _localctx = new AssignContext(_localctx);
                    EnterOuterAlt(_localctx, 2);
                    {
                        State = 14; Match(ID);
                        State = 15; Match(3);
                        State = 16; expr(0);
                        State = 17; Match(NEWLINE);
                    }
                    break;

                case 3:
                    _localctx = new BlankContext(_localctx);
                    EnterOuterAlt(_localctx, 3);
                    {
                        State = 19; Match(NEWLINE);
                    }
                    break;
                }
            }
            catch (RecognitionException re) {
                _localctx.exception = re;
                _errHandler.ReportError(this, re);
                _errHandler.Recover(this, re);
            }
            finally {
                ExitRule();
            }
            return(_localctx);
        }
Ejemplo n.º 2
0
    public Stat1Context stat1()
    {
        Stat1Context _localctx = new Stat1Context(Context, State);

        EnterRule(_localctx, 4, RULE_stat1);
        try {
            _localctx = new PrintExprContext(_localctx);
            EnterOuterAlt(_localctx, 1);
            {
                State = 32; expr(0);
            }
        }
        catch (RecognitionException re) {
            _localctx.exception = re;
            ErrorHandler.ReportError(this, re);
            ErrorHandler.Recover(this, re);
        }
        finally {
            ExitRule();
        }
        return(_localctx);
    }