Пример #1
0
            public RedILNode VisitBlockStatement(BlockStatement blockStatement, State data)
            {
                var block = new BlockNode();

                foreach (var child in blockStatement.Children)
                {
                    var visited = child.AcceptVisitor(this, data.NewState(blockStatement, block));
                    if (visited.Type != RedILNodeType.Empty)
                    {
                        block.Children.Add(visited);
                    }
                }

                return(block);
            }
Пример #2
0
            public RedILNode VisitVariableDeclarationStatement(VariableDeclarationStatement variableDeclarationStatement, State data)
            {
                var block = new BlockNode()
                {
                    Explicit = false
                };

                foreach (var variable in variableDeclarationStatement.Variables)
                {
                    var decl = CastUtilities.CastRedILNode <VariableDeclareNode>(
                        variable.AcceptVisitor(this, data.NewState(variableDeclarationStatement, block)));
                    block.Children.Add(decl);
                }

                return(block);
            }
Пример #3
0
 public WhileNode(ExpressionNode condition, BlockNode body)
     : base(RedILNodeType.While)
 {
     Condition = condition;
     Body      = body;
 }