public ProgramaContext programa()
    {
        ProgramaContext _localctx = new ProgramaContext(Context, State);

        EnterRule(_localctx, 0, RULE_programa);
        try {
            EnterOuterAlt(_localctx, 1);
            {
                State = 30; Match(T__0);
                State = 31; declare();
                State = 32; blococomando();
                State = 33; Match(T__1);
                State = 34; Match(T_DOT);
            }
        }
        catch (RecognitionException re) {
            _localctx.exception = re;
            ErrorHandler.ReportError(this, re);
            ErrorHandler.Recover(this, re);
        }
        finally {
            ExitRule();
        }
        return(_localctx);
    }
 public void Setup()
 {
     Database.SetInitializer(new DropCreateDatabaseAlways<ProgramaContext>());
     _contextoParaTeste = new ProgramaContext();
     _contextoParaTeste.Programas.Add(ProgramaMother.produzirProgramaValido());
     _contextoParaTeste.SaveChanges();
 }
    public ProgramaContext programa()
    {
        ProgramaContext _localctx = new ProgramaContext(Context, State);

        EnterRule(_localctx, 0, RULE_programa);
        try {
            int _alt;
            EnterOuterAlt(_localctx, 1);
            {
                State = 18; inicio();
                State = 20;
                ErrorHandler.Sync(this);
                _alt = 1;
                do
                {
                    switch (_alt)
                    {
                    case 1:
                    {
                        {
                            State = 19; proposicion();
                        }
                    }
                    break;

                    default:
                        throw new NoViableAltException(this);
                    }
                    State = 22;
                    ErrorHandler.Sync(this);
                    _alt = Interpreter.AdaptivePredict(TokenStream, 0, Context);
                } while (_alt != 2 && _alt != global::Antlr4.Runtime.Atn.ATN.INVALID_ALT_NUMBER);
                State = 24; fin();
            }
        }
        catch (RecognitionException re) {
            _localctx.exception = re;
            ErrorHandler.ReportError(this, re);
            ErrorHandler.Recover(this, re);
        }
        finally {
            ExitRule();
        }
        return(_localctx);
    }
Example #4
0
        public ProgramaContext programa()
        {
            ProgramaContext _localctx = new ProgramaContext(Context, State);

            EnterRule(_localctx, 0, RULE_programa);
            int _la;

            try {
                EnterOuterAlt(_localctx, 1);
                {
                    State = 24; Match(INICIO);
                    State = 25; Match(VARIABLE);
                    State = 26; Match(LLAVE_ABRIR);
                    State = 30;
                    ErrorHandler.Sync(this);
                    _la = TokenStream.LA(1);
                    while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << VAR) | (1L << IMPRIMIR) | (1L << SI) | (1L << VARIABLE) | (1L << NUMERO))) != 0))
                    {
                        {
                            {
                                State = 27; sentencia();
                            }
                        }
                        State = 32;
                        ErrorHandler.Sync(this);
                        _la = TokenStream.LA(1);
                    }
                    State = 33; Match(LLAVE_CERRAR);
                }
            }
            catch (RecognitionException re) {
                _localctx.exception = re;
                ErrorHandler.ReportError(this, re);
                ErrorHandler.Recover(this, re);
            }
            finally {
                ExitRule();
            }
            return(_localctx);
        }
        public ProgramaContext programa()
        {
            ProgramaContext _localctx = new ProgramaContext(_ctx, State);

            EnterRule(_localctx, 0, RULE_programa);
            try {
                EnterOuterAlt(_localctx, 1);
                {
                    State = 10; _localctx._stat = stat();
                    System.Console.WriteLine(_localctx._stat.value);
                }
            }
            catch (RecognitionException re) {
                _localctx.exception = re;
                _errHandler.ReportError(this, re);
                _errHandler.Recover(this, re);
            }
            finally {
                ExitRule();
            }
            return(_localctx);
        }