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