public PrintStmtContext printStmt() { PrintStmtContext _localctx = new PrintStmtContext(Context, State); EnterRule(_localctx, 136, RULE_printStmt); int _la; try { EnterOuterAlt(_localctx, 1); { State = 1409; Match(PRINT); State = 1410; Match(WS); State = 1411; fileNumber(); State = 1413; _la = TokenStream.La(1); if (_la==WS) { { State = 1412; Match(WS); } } State = 1415; Match(T__0); State = 1420; switch ( Interpreter.AdaptivePredict(TokenStream,193,Context) ) { case 1: { State = 1417; switch ( Interpreter.AdaptivePredict(TokenStream,192,Context) ) { case 1: { State = 1416; Match(WS); } break; } State = 1419; outputList(); } break; } } } catch (RecognitionException re) { _localctx.exception = re; ErrorHandler.ReportError(this, re); ErrorHandler.Recover(this, re); } finally { ExitRule(); } return _localctx; }
public StmtContext stmt() { StmtContext _localctx = new StmtContext(Context, State); EnterRule(_localctx, 2, RULE_stmt); try { State = 71; ErrorHandler.Sync(this); switch (TokenStream.LA(1)) { case NOP: _localctx = new NopStmtContext(_localctx); EnterOuterAlt(_localctx, 1); { State = 11; Match(NOP); State = 12; Match(NEWLINE); } break; case IADD: _localctx = new IaddStmtContext(_localctx); EnterOuterAlt(_localctx, 2); { State = 13; Match(IADD); State = 14; Match(NEWLINE); } break; case ISUB: _localctx = new IsubStmtContext(_localctx); EnterOuterAlt(_localctx, 3); { State = 15; Match(ISUB); State = 16; Match(NEWLINE); } break; case IMUL: _localctx = new ImulStmtContext(_localctx); EnterOuterAlt(_localctx, 4); { State = 17; Match(IMUL); State = 18; Match(NEWLINE); } break; case ILT: _localctx = new IltStmtContext(_localctx); EnterOuterAlt(_localctx, 5); { State = 19; Match(ILT); State = 20; Match(NEWLINE); } break; case IEQ: _localctx = new IeqStmtContext(_localctx); EnterOuterAlt(_localctx, 6); { State = 21; Match(IEQ); State = 22; Match(NEWLINE); } break; case BR: _localctx = new BrStmtContext(_localctx); EnterOuterAlt(_localctx, 7); { State = 23; Match(BR); State = 24; expr(); State = 25; Match(NEWLINE); } break; case BRT: _localctx = new BrtStmtContext(_localctx); EnterOuterAlt(_localctx, 8); { State = 27; Match(BRT); State = 28; expr(); State = 29; Match(NEWLINE); } break; case BRF: _localctx = new BrfStmtContext(_localctx); EnterOuterAlt(_localctx, 9); { State = 31; Match(BRF); State = 32; expr(); State = 33; Match(NEWLINE); } break; case ICONST: _localctx = new IconstStmtContext(_localctx); EnterOuterAlt(_localctx, 10); { State = 35; Match(ICONST); State = 36; expr(); State = 37; Match(NEWLINE); } break; case LOAD: _localctx = new LoadStmtContext(_localctx); EnterOuterAlt(_localctx, 11); { State = 39; Match(LOAD); State = 40; expr(); State = 41; Match(NEWLINE); } break; case GLOAD: _localctx = new GloadStmtContext(_localctx); EnterOuterAlt(_localctx, 12); { State = 43; Match(GLOAD); State = 44; expr(); State = 45; Match(NEWLINE); } break; case STORE: _localctx = new StoreStmtContext(_localctx); EnterOuterAlt(_localctx, 13); { State = 47; Match(STORE); State = 48; expr(); State = 49; Match(NEWLINE); } break; case GSTORE: _localctx = new GstoreStmtContext(_localctx); EnterOuterAlt(_localctx, 14); { State = 51; Match(GSTORE); State = 52; expr(); State = 53; Match(NEWLINE); } break; case PRINT: _localctx = new PrintStmtContext(_localctx); EnterOuterAlt(_localctx, 15); { State = 55; Match(PRINT); State = 56; Match(NEWLINE); } break; case POP: _localctx = new PopStmtContext(_localctx); EnterOuterAlt(_localctx, 16); { State = 57; Match(POP); State = 58; Match(NEWLINE); } break; case CALL: _localctx = new CallStmtContext(_localctx); EnterOuterAlt(_localctx, 17); { State = 59; Match(CALL); State = 60; expr(); State = 61; expr(); State = 62; Match(NEWLINE); } break; case RET: _localctx = new RetStmtContext(_localctx); EnterOuterAlt(_localctx, 18); { State = 64; Match(RET); State = 65; Match(NEWLINE); } break; case HALT: _localctx = new HaltStmtContext(_localctx); EnterOuterAlt(_localctx, 19); { State = 66; Match(HALT); State = 67; Match(NEWLINE); } break; case LABEL: _localctx = new LabelStmtContext(_localctx); EnterOuterAlt(_localctx, 20); { State = 68; Match(LABEL); State = 69; Match(NEWLINE); } break; case NEWLINE: _localctx = new BlankStmtContext(_localctx); EnterOuterAlt(_localctx, 21); { State = 70; Match(NEWLINE); } break; default: throw new NoViableAltException(this); } } catch (RecognitionException re) { _localctx.exception = re; ErrorHandler.ReportError(this, re); ErrorHandler.Recover(this, re); } finally { ExitRule(); } return(_localctx); }