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); }
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); }
public WhileNode(ExpressionNode condition, BlockNode body) : base(RedILNodeType.While) { Condition = condition; Body = body; }