예제 #1
0
 public final ProgContext prog() throws RecognitionException {
   ProgContext _localctx = new ProgContext(_ctx, getState());
   enterRule(_localctx, 0, RULE_prog);
   int _la;
   try {
     enterOuterAlt(_localctx, 1);
     {
       setState(7);
       _errHandler.sync(this);
       _la = _input.LA(1);
       do {
         {
           {
             setState(6);
             stat();
           }
         }
         setState(9);
         _errHandler.sync(this);
         _la = _input.LA(1);
       } while ((((_la) & ~0x3f) == 0
           && ((1L << _la) & ((1L << 5) | (1L << ID) | (1L << INT) | (1L << NEWLINE))) != 0));
     }
   } catch (RecognitionException re) {
     _localctx.exception = re;
     _errHandler.reportError(this, re);
     _errHandler.recover(this, re);
   } finally {
     exitRule();
   }
   return _localctx;
 }
 @Override
 public void exitProg(ProgContext ctx) {
   for (InstContext i : ctx.inst()) {
     saida += getValue(i) + "\n";
   }
   // saida += "\n";
   setValue(ctx, saida);
 }