38 lines
987 B
C#
38 lines
987 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace AspClassic.Parser;
|
|
|
|
/// <summary>
|
|
/// A parse tree for an aggregate initializer.
|
|
/// </summary>
|
|
public sealed class AggregateInitializer : Initializer
|
|
{
|
|
private readonly InitializerCollection _Elements;
|
|
|
|
/// <summary>
|
|
/// The elements of the aggregate initializer.
|
|
/// </summary>
|
|
public InitializerCollection Elements => _Elements;
|
|
|
|
/// <summary>
|
|
/// Constructs a new aggregate initializer parse tree.
|
|
/// </summary>
|
|
/// <param name="elements">The elements of the aggregate initializer.</param>
|
|
/// <param name="span">The location of the parse tree.</param>
|
|
public AggregateInitializer(InitializerCollection elements, Span span)
|
|
: base(TreeType.AggregateInitializer, span)
|
|
{
|
|
if (elements == null)
|
|
{
|
|
throw new ArgumentNullException("elements");
|
|
}
|
|
SetParent(elements);
|
|
_Elements = elements;
|
|
}
|
|
|
|
protected override void GetChildTrees(IList<Tree> childList)
|
|
{
|
|
Tree.AddChild(childList, Elements);
|
|
}
|
|
}
|