Exemplo n.º 1
0
        public FuncLit(BlockStmt body, FuncType ft)
        {
            TypeInfo = ft;
            Body     = body;

            BuildRelation();
        }
Exemplo n.º 2
0
        public FileNode(BlockStmt block, List <ImportStmt> imports)
        {
            Block   = block;
            Imports = imports;

            BuildRelation();
        }
Exemplo n.º 3
0
        public WhileStmt(Expr con, TokenPos defpos, Scope s, BlockStmt body)
        {
            Condition = con;
            Pos       = defpos;
            ScopeInfo = s;
            Body      = body;

            BuildRelation();
        }
Exemplo n.º 4
0
        public IfStmt(Expr con, BlockStmt body, BlockStmt elsebody, TokenPos ifpos)
        {
            Condition = con;
            Body      = body;
            ElseBody  = elsebody;
            IfPos     = ifpos;

            BuildRelation();
        }
Exemplo n.º 5
0
        public ForStmt(Stmt init, Expr con, Stmt post, TokenPos defpos, Scope s, BlockStmt body)
        {
            Condition = con;
            Init      = init;
            Post      = post;
            Pos       = defpos;
            ScopeInfo = s;
            Body      = body;

            BuildRelation();
        }
Exemplo n.º 6
0
        public ForRangeStmt(Ident key, Ident value, Expr x, TokenPos inpos, TokenPos defpos, Scope s, BlockStmt body)
        {
            Key       = key;
            Value     = value;
            X         = x;
            InPos     = inpos;
            Pos       = defpos;
            ScopeInfo = s;
            Body      = body;

            BuildRelation();
        }
Exemplo n.º 7
0
        IfStmt ParseIfStmt()
        {
            var defpos = CurrTokenPos;

            Expect(TokenType.If);

            var condition = ParseRHS();

            var body = ParseBlockStmt();

            BlockStmt elseBody;

            if (CurrTokenType == TokenType.Else)
            {
                Next();
                elseBody = ParseBlockStmt();
            }
            else
            {
                elseBody = new BlockStmt(CurrTokenPos, CurrTokenPos);
            }

            return(new IfStmt(condition, body, elseBody, defpos));
        }