/// <summary> /// Constructs a new parse tree for a For Each statement. /// </summary> /// <param name="eachLocation">The location of the 'Each'.</param> /// <param name="controlExpression">The control expression.</param> /// <param name="controlVariableDeclarator">The control variable declarator, if any.</param> /// <param name="inLocation">The location of the 'In'.</param> /// <param name="collectionExpression">The collection expression.</param> /// <param name="statements">The statements in the block.</param> /// <param name="nextStatement">The Next statement, if any.</param> /// <param name="span">The location of the parse tree.</param> /// <param name="comments">The comments for the parse tree.</param> public ForEachBlockStatement(Location eachLocation, Expression controlExpression, VariableDeclarator controlVariableDeclarator, Location inLocation, Expression collectionExpression, StatementCollection statements, NextStatement nextStatement, Span span, IList <Comment> comments) : base(TreeType.ForEachBlockStatement, statements, span, comments) { if (controlExpression == null) { throw new ArgumentNullException("controlExpression"); } SetParent(controlExpression); SetParent(controlVariableDeclarator); SetParent(collectionExpression); SetParent(nextStatement); _EachLocation = eachLocation; _ControlExpression = controlExpression; _ControlVariableDeclarator = controlVariableDeclarator; _InLocation = inLocation; _CollectionExpression = collectionExpression; _NextStatement = nextStatement; }
/// <summary> /// Constructs a new parse tree for a For statement. /// </summary> /// <param name="controlExpression">The control expression for the loop.</param> /// <param name="controlVariableDeclarator">The control variable declarator, if any.</param> /// <param name="equalsLocation">The location of the '='.</param> /// <param name="lowerBoundExpression">The lower bound of the loop.</param> /// <param name="toLocation">The location of the 'To'.</param> /// <param name="upperBoundExpression">The upper bound of the loop.</param> /// <param name="stepLocation">The location of the 'Step', if any.</param> /// <param name="stepExpression">The step of the loop, if any.</param> /// <param name="statements">The statements in the For loop.</param> /// <param name="nextStatement">The Next statement, if any.</param> /// <param name="span">The location of the parse tree.</param> /// <param name="comments">The comments for the parse tree.</param> public ForBlockStatement(Expression controlExpression, VariableDeclarator controlVariableDeclarator, Location equalsLocation, Expression lowerBoundExpression, Location toLocation, Expression upperBoundExpression, Location stepLocation, Expression stepExpression, StatementCollection statements, NextStatement nextStatement, Span span, IList <Comment> comments) : base(TreeType.ForBlockStatement, statements, span, comments) { if (controlExpression == null) { throw new ArgumentNullException("controlExpression"); } SetParent(controlExpression); SetParent(controlVariableDeclarator); SetParent(lowerBoundExpression); SetParent(upperBoundExpression); SetParent(stepExpression); SetParent(nextStatement); _ControlExpression = controlExpression; _ControlVariableDeclarator = controlVariableDeclarator; _EqualsLocation = equalsLocation; _LowerBoundExpression = lowerBoundExpression; _ToLocation = toLocation; _UpperBoundExpression = upperBoundExpression; _StepLocation = stepLocation; _StepExpression = stepExpression; _NextStatement = nextStatement; }