コード例 #1
0
        public SwitchStatement(Location location,
                               Expr value,
                               ArrayList <Expr[]> caseList,
                               ArrayList <BlockStatement> blockList,
                               Statement defaultBlock,
                               string label)
        {
            super(location);

            _value = value;

            _cases = new Expr[caseList.size()][];
            caseList.toArray(_cases);

            _blocks = new BlockStatement[blockList.size()];
            blockList.toArray(_blocks);

            _defaultBlock = defaultBlock;

            for (int i = 0; i < _blocks.length; i++)
            {
                _blocks[i].setParent(this);
            }

            if (_defaultBlock != null)
            {
                _defaultBlock.setParent(this);
            }

            _label = label;
        }
コード例 #2
0
        public TryStatement(Location location, Statement block)
        {
            super(location);

            _block = block;

            block.setParent(this);
        }
コード例 #3
0
        public WhileStatement(Location location,
                              Expr test,
                              Statement block,
                              string label)
        {
            super(location);

            _test  = test;
            _block = block;
            _label = label;

            block.setParent(this);
        }
コード例 #4
0
        public ForStatement(Location location, Expr init, Expr test, Expr incr,
                            Statement block, string label)
        {
            super(location);

            _init = init;
            _test = test;
            _incr = incr;

            _block = block;
            _label = label;

            block.setParent(this);
        }
コード例 #5
0
        public ForeachStatement(Location location,
                                Expr objExpr,
                                AbstractVarExpr key,
                                AbstractVarExpr value,
                                bool isRef,
                                Statement block,
                                string label)
        {
            super(location);

            _objExpr = objExpr;

            _key   = key;
            _value = value;
            _isRef = isRef;

            _block = block;
            _label = label;

            block.setParent(this);
        }
コード例 #6
0
        public IfStatement(Location location,
                           Expr test,
                           Statement trueBlock,
                           Statement falseBlock)
        {
            super(location);

            _test       = test;
            _trueBlock  = trueBlock;
            _falseBlock = falseBlock;

            if (_trueBlock != null)
            {
                _trueBlock.setParent(this);
            }

            if (_falseBlock != null)
            {
                _falseBlock.setParent(this);
            }
        }
コード例 #7
0
        public void addCatch(StringValue id, AbstractVarExpr lhs, Statement block)
        {
            _catchList.add(new Catch(id, lhs, block));

            block.setParent(this);
        }