protected ExpressionBlockStatement(TreeType type, Expression expression, StatementCollection statements, EndBlockStatement endStatement, Span span, IList <Comment> comments) : base(type, statements, span, comments)
        {
            Debug.Assert(type == TreeType.WithBlockStatement || type == TreeType.SyncLockBlockStatement || type == TreeType.WhileBlockStatement || type == TreeType.UsingBlockStatement);

            SetParent(expression);
            SetParent(endStatement);

            _Expression   = expression;
            _EndStatement = endStatement;
        }
Esempio n. 2
0
        /// <summary>
        /// Constructs a new parse tree for a Try statement.
        /// </summary>
        /// <param name="statements">The statements in the Try block.</param>
        /// <param name="catchBlockStatements">The Catch statements.</param>
        /// <param name="finallyBlockStatement">The Finally statement, if any.</param>
        /// <param name="endStatement">The End Try statement, if any.</param>
        /// <param name="span">The location of the parse tree.</param>
        /// <param name="comments">The comments of the parse tree.</param>
        public TryBlockStatement(StatementCollection statements, StatementCollection catchBlockStatements, FinallyBlockStatement finallyBlockStatement, EndBlockStatement endStatement, Span span, IList <Comment> comments) : base(TreeType.TryBlockStatement, statements, span, comments)
        {
            SetParent(catchBlockStatements);
            SetParent(finallyBlockStatement);
            SetParent(endStatement);

            _CatchBlockStatements  = catchBlockStatements;
            _FinallyBlockStatement = finallyBlockStatement;
            _EndStatement          = endStatement;
        }
Esempio n. 3
0
        /// <summary>
        /// Constructs a new parse tree for a Select statement.
        /// </summary>
        /// <param name="caseLocation">The location of the 'Case', if any.</param>
        /// <param name="expression">The select expression.</param>
        /// <param name="caseBlockStatements">The Case statements.</param>
        /// <param name="caseElseBlockStatement">The Case Else statement, if any.</param>
        /// <param name="endStatement">The End Select 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 SelectBlockStatement(Location caseLocation, Expression expression, StatementCollection statements, StatementCollection caseBlockStatements, CaseElseBlockStatement caseElseBlockStatement, EndBlockStatement endStatement, Span span, IList <Comment> comments) : base(TreeType.SelectBlockStatement, statements, span, comments)
        {
            if (expression == null)
            {
                throw new ArgumentNullException("expression");
            }

            SetParent(expression);
            SetParent(caseBlockStatements);
            SetParent(caseElseBlockStatement);
            SetParent(endStatement);

            _CaseLocation           = caseLocation;
            _Expression             = expression;
            _CaseBlockStatements    = caseBlockStatements;
            _CaseElseBlockStatement = caseElseBlockStatement;
            _EndStatement           = endStatement;
        }
Esempio n. 4
0
        /// <summary>
        /// Constructs a new parse tree for a If statement.
        /// </summary>
        /// <param name="expression">The conditional expression.</param>
        /// <param name="thenLocation">The location of the 'Then', if any.</param>
        /// <param name="statements">The statements in the If block.</param>
        /// <param name="elseIfBlockStatements">The Else If statements.</param>
        /// <param name="elseBlockStatement">The Else statement, if any.</param>
        /// <param name="endStatement">The End If 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 IfBlockStatement(Expression expression, Location thenLocation, StatementCollection statements, StatementCollection elseIfBlockStatements, ElseBlockStatement elseBlockStatement, EndBlockStatement endStatement, Span span, IList <Comment> comments) : base(TreeType.IfBlockStatement, statements, span, comments)
        {
            if (expression == null)
            {
                throw new ArgumentNullException("expression");
            }

            SetParent(expression);
            SetParent(elseIfBlockStatements);
            SetParent(elseBlockStatement);
            SetParent(endStatement);

            _Expression            = expression;
            _ThenLocation          = thenLocation;
            _ElseIfBlockStatements = elseIfBlockStatements;
            _ElseBlockStatement    = elseBlockStatement;
            _EndStatement          = endStatement;
        }
Esempio n. 5
0
 /// <summary>
 /// Constructs a new parse tree for a With statement block.
 /// </summary>
 /// <param name="expression">The expression.</param>
 /// <param name="statements">The statements in the block.</param>
 /// <param name="endStatement">The End statement for the block, if any.</param>
 /// <param name="span">The location of the parse tree.</param>
 /// <param name="comments">The comments for the parse tree.</param>
 public WithBlockStatement(Expression expression, StatementCollection statements, EndBlockStatement endStatement, Span span, IList <Comment> comments) : base(TreeType.WithBlockStatement, expression, statements, endStatement, span, comments)
 {
 }
Esempio n. 6
0
        /// <summary>
        /// Constructs a new parse tree for a Using statement block with variable declarators.
        /// </summary>
        /// <param name="variableDeclarators">The variable declarators.</param>
        /// <param name="statements">The statements in the block.</param>
        /// <param name="endStatement">The End statement for the block, if any.</param>
        /// <param name="span">The location of the parse tree.</param>
        /// <param name="comments">The comments for the parse tree.</param>
        public UsingBlockStatement(VariableDeclaratorCollection variableDeclarators, StatementCollection statements, EndBlockStatement endStatement, Span span, IList <Comment> comments) : base(TreeType.UsingBlockStatement, null, statements, endStatement, span, comments)
        {
            if (variableDeclarators == null)
            {
                throw new ArgumentNullException("variableDeclarators");
            }

            SetParent(variableDeclarators);

            _VariableDeclarators = variableDeclarators;
        }