Ejemplo n.º 1
0
    public StmtContext stmt()
    {
        StmtContext _localctx = new StmtContext(Context, State);

        EnterRule(_localctx, 2, RULE_stmt);
        try {
            State = 42;
            ErrorHandler.Sync(this);
            switch (Interpreter.AdaptivePredict(TokenStream, 1, Context))
            {
            case 1:
                EnterOuterAlt(_localctx, 1);
                {
                    State = 40; def_stmt();
                }
                break;

            case 2:
                EnterOuterAlt(_localctx, 2);
                {
                    State = 41; link_stmt();
                }
                break;
            }
        }
        catch (RecognitionException re) {
            _localctx.exception = re;
            ErrorHandler.ReportError(this, re);
            ErrorHandler.Recover(this, re);
        }
        finally {
            ExitRule();
        }
        return(_localctx);
    }
Ejemplo n.º 2
0
    public StmtContext stmt()
    {
        StmtContext _localctx = new StmtContext(Context, State);

        EnterRule(_localctx, 4, RULE_stmt);
        try {
            State = 56;
            ErrorHandler.Sync(this);
            switch (Interpreter.AdaptivePredict(TokenStream, 4, Context))
            {
            case 1:
                EnterOuterAlt(_localctx, 1);
                {
                    State = 48; node_stmt();
                }
                break;

            case 2:
                EnterOuterAlt(_localctx, 2);
                {
                    State = 49; edge_stmt();
                }
                break;

            case 3:
                EnterOuterAlt(_localctx, 3);
                {
                    State = 50; attr_stmt();
                }
                break;

            case 4:
                EnterOuterAlt(_localctx, 4);
                {
                    State = 51; id();
                    State = 52; Match(T__3);
                    State = 53; id();
                }
                break;

            case 5:
                EnterOuterAlt(_localctx, 5);
                {
                    State = 55; subgraph();
                }
                break;
            }
        }
        catch (RecognitionException re) {
            _localctx.exception = re;
            ErrorHandler.ReportError(this, re);
            ErrorHandler.Recover(this, re);
        }
        finally {
            ExitRule();
        }
        return(_localctx);
    }
Ejemplo n.º 3
0
    public StmtContext stmt()
    {
        StmtContext _localctx = new StmtContext(Context, State);

        EnterRule(_localctx, 8, RULE_stmt);
        try {
            State = 40;
            ErrorHandler.Sync(this);
            switch (TokenStream.LA(1))
            {
            case IF:
                EnterOuterAlt(_localctx, 1);
                {
                    State = 35;
                    cond();
                }
                break;

            case WHILE:
                EnterOuterAlt(_localctx, 2);
                {
                    State = 36;
                    loop();
                }
                break;

            case RETURN:
                EnterOuterAlt(_localctx, 3);
                {
                    State = 37;
                    returnStmt();
                    State = 38;
                    Match(SEMI);
                }
                break;

            default:
                throw new NoViableAltException(this);
            }
        }
        catch (RecognitionException re) {
            _localctx.exception = re;
            ErrorHandler.ReportError(this, re);
            ErrorHandler.Recover(this, re);
        }
        finally {
            ExitRule();
        }
        return(_localctx);
    }
Ejemplo n.º 4
0
    public StmtContext stmt()
    {
        StmtContext _localctx = new StmtContext(_ctx, State);

        EnterRule(_localctx, 2, RULE_stmt);
        try {
            State = 27;
            switch (_input.La(1))
            {
            case T__3:
                EnterOuterAlt(_localctx, 1);
                {
                    State = 21; valueToBot();
                    State = 22; Match(NEWLINE);
                }
                break;

            case T__4:
                EnterOuterAlt(_localctx, 2);
                {
                    State = 24; botToDest();
                    State = 25; Match(NEWLINE);
                }
                break;

            default:
                throw new NoViableAltException(this);
            }
        }
        catch (RecognitionException re) {
            _localctx.exception = re;
            _errHandler.ReportError(this, re);
            _errHandler.Recover(this, re);
        }
        finally {
            ExitRule();
        }
        return(_localctx);
    }
Ejemplo n.º 5
0
 public BlankStmtContext(StmtContext context)
 {
     CopyFrom(context);
 }
Ejemplo n.º 6
0
 public PrintStmtContext(StmtContext context)
 {
     CopyFrom(context);
 }
Ejemplo n.º 7
0
 public StoreStmtContext(StmtContext context)
 {
     CopyFrom(context);
 }
Ejemplo n.º 8
0
 public IconstStmtContext(StmtContext context)
 {
     CopyFrom(context);
 }
Ejemplo n.º 9
0
 public NopStmtContext(StmtContext context)
 {
     CopyFrom(context);
 }
Ejemplo n.º 10
0
 public IeqStmtContext(StmtContext context)
 {
     CopyFrom(context);
 }
Ejemplo n.º 11
0
 public ImulStmtContext(StmtContext context)
 {
     CopyFrom(context);
 }
Ejemplo n.º 12
0
 public virtual void CopyFrom(StmtContext context)
 {
     base.CopyFrom(context);
 }
Ejemplo n.º 13
0
    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);
    }
Ejemplo n.º 14
0
	public StmtContext stmt() {
		StmtContext _localctx = new StmtContext(Context, State);
		EnterRule(_localctx, 24, RULE_stmt);
		try {
			State = 373;
			switch (TokenStream.La(1)) {
			case RETURN:
			case RAISE:
			case FROM:
			case IMPORT:
			case GLOBAL:
			case NONLOCAL:
			case ASSERT:
			case LAMBDA:
			case NOT:
			case NONE:
			case TRUE:
			case FALSE:
			case YIELD:
			case DEL:
			case PASS:
			case CONTINUE:
			case BREAK:
			case NAME:
			case STRING_LITERAL:
			case BYTES_LITERAL:
			case DECIMAL_INTEGER:
			case OCT_INTEGER:
			case HEX_INTEGER:
			case BIN_INTEGER:
			case FLOAT_NUMBER:
			case IMAG_NUMBER:
			case ELLIPSIS:
			case STAR:
			case OPEN_PAREN:
			case OPEN_BRACK:
			case ADD:
			case MINUS:
			case NOT_OP:
			case OPEN_BRACE:
				EnterOuterAlt(_localctx, 1);
				{
				State = 371; simple_stmt();
				}
				break;
			case DEF:
			case IF:
			case WHILE:
			case FOR:
			case TRY:
			case WITH:
			case CLASS:
			case AT:
				EnterOuterAlt(_localctx, 2);
				{
				State = 372; compound_stmt();
				}
				break;
			default:
				throw new NoViableAltException(this);
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			ErrorHandler.ReportError(this, re);
			ErrorHandler.Recover(this, re);
		}
		finally {
			ExitRule();
		}
		return _localctx;
	}
Ejemplo n.º 15
0
 public CallStmtContext(StmtContext context)
 {
     CopyFrom(context);
 }
Ejemplo n.º 16
0
 public BrtStmtContext(StmtContext context)
 {
     CopyFrom(context);
 }
Ejemplo n.º 17
0
 public IsubStmtContext(StmtContext context)
 {
     CopyFrom(context);
 }
Ejemplo n.º 18
0
 public LabelStmtContext(StmtContext context)
 {
     CopyFrom(context);
 }
Ejemplo n.º 19
0
 public IaddStmtContext(StmtContext context)
 {
     CopyFrom(context);
 }
Ejemplo n.º 20
0
 public GloadStmtContext(StmtContext context)
 {
     CopyFrom(context);
 }
Ejemplo n.º 21
0
 public HaltStmtContext(StmtContext context)
 {
     CopyFrom(context);
 }