using System;
using System.Collections.Generic;
namespace AspClassic.Parser;
///
/// A parse tree for a Using block statement.
///
public sealed class UsingBlockStatement : ExpressionBlockStatement
{
private readonly VariableDeclaratorCollection _VariableDeclarators;
///
/// The variable declarators, if no expression.
///
public VariableDeclaratorCollection VariableDeclarators => _VariableDeclarators;
///
/// Constructs a new parse tree for a Using statement block with an expression.
///
/// The expression.
/// The statements in the block.
/// The End statement for the block, if any.
/// The location of the parse tree.
/// The comments for the parse tree.
public UsingBlockStatement(Expression expression, StatementCollection statements, EndBlockStatement endStatement, Span span, IList comments)
: base(TreeType.UsingBlockStatement, expression, statements, endStatement, span, comments)
{
}
///
/// Constructs a new parse tree for a Using statement block with variable declarators.
///
/// The variable declarators.
/// The statements in the block.
/// The End statement for the block, if any.
/// The location of the parse tree.
/// The comments for the parse tree.
public UsingBlockStatement(VariableDeclaratorCollection variableDeclarators, StatementCollection statements, EndBlockStatement endStatement, Span span, IList comments)
: base(TreeType.UsingBlockStatement, null, statements, endStatement, span, comments)
{
if (variableDeclarators == null)
{
throw new ArgumentNullException("variableDeclarators");
}
SetParent(variableDeclarators);
_VariableDeclarators = variableDeclarators;
}
protected override void GetChildTrees(IList childList)
{
Tree.AddChild(childList, VariableDeclarators);
base.GetChildTrees(childList);
}
}