using System;
using System.Collections.Generic;
namespace AspClassic.Parser;
///
/// A parse tree for variable declarations.
///
public sealed class VariableListDeclaration : ModifiedDeclaration
{
private readonly VariableDeclaratorCollection _VariableDeclarators;
///
/// The variables being declared.
///
public VariableDeclaratorCollection VariableDeclarators => _VariableDeclarators;
///
/// Constructs a parse tree for variable declarations.
///
/// The attributes on the declaration.
/// The modifiers on the declaration.
/// The variables being declared.
/// The location of the parse tree.
/// The comments for the parse tree.
public VariableListDeclaration(AttributeBlockCollection attributes, ModifierCollection modifiers, VariableDeclaratorCollection variableDeclarators, Span span, IList comments)
: base(TreeType.VariableListDeclaration, attributes, modifiers, span, comments)
{
if (variableDeclarators == null)
{
throw new ArgumentNullException("variableDeclarators");
}
SetParent(variableDeclarators);
_VariableDeclarators = variableDeclarators;
}
protected override void GetChildTrees(IList childList)
{
base.GetChildTrees(childList);
Tree.AddChild(childList, VariableDeclarators);
}
}