예제 #1
0
        /// <summary>
        /// Constructs a new parse tree for a line If statement.
        /// </summary>
        /// <param name="expression">The conditional expression.</param>
        /// <param name="thenLocation">The location of the 'Then'.</param>
        /// <param name="ifStatements">The If statements.</param>
        /// <param name="elseLocation">The location of the 'Else', if any.</param>
        /// <param name="elseStatements">The Else statements.</param>
        /// <param name="span">The location of the parse tree.</param>
        /// <param name="comments">The comments for the parse tree.</param>
        public LineIfStatement(Expression expression, Location thenLocation, StatementCollection ifStatements, Location elseLocation, StatementCollection elseStatements, Span span, IList <Comment> comments) : base(TreeType.LineIfBlockStatement, span, comments)
        {
            if (expression == null)
            {
                throw new ArgumentNullException("expression");
            }

            SetParent(expression);
            SetParent(ifStatements);
            SetParent(elseStatements);

            _Expression     = expression;
            _ThenLocation   = thenLocation;
            _IfStatements   = ifStatements;
            _ElseLocation   = elseLocation;
            _ElseStatements = elseStatements;
        }
예제 #2
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;
        }
예제 #3
0
        /// <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;
        }
예제 #4
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)
 {
 }
예제 #5
0
        /// <summary>
        /// Constructs a new parse tree for a Do statement.
        /// </summary>
        /// <param name="expression">The While or Until expression, if any.</param>
        /// <param name="isWhile">Whether the Do is followed by a While or Until, if any.</param>
        /// <param name="whileOrUntilLocation">The location of the While or Until, if any.</param>
        /// <param name="statements">The statements in the block.</param>
        /// <param name="endStatement">The ending Loop statement.</param>
        /// <param name="span">The location of the parse tree.</param>
        /// <param name="comments">The comments on the parse tree.</param>
        public DoBlockStatement(Expression expression, bool isWhile, Location whileOrUntilLocation, StatementCollection statements, LoopStatement endStatement, Span span, IList <Comment> comments) : base(TreeType.DoBlockStatement, statements, span, comments)
        {
            SetParent(expression);
            SetParent(endStatement);

            _Expression           = expression;
            _IsWhile              = isWhile;
            _WhileOrUntilLocation = whileOrUntilLocation;
            _EndStatement         = endStatement;
        }
예제 #6
0
 protected BlockStatement(TreeType type, StatementCollection statements, Span span, IList <Comment> comments) : base(type, span, comments)
 {
     _Statements = statements;
     SetParent(statements);
 }
예제 #7
0
        /// <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;
        }
예제 #8
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;
        }