using System;
using System.Collections.Generic;
namespace AspClassic.Parser;
///
/// A parse tree for an expression initializer.
///
public sealed class ExpressionInitializer : Initializer
{
private readonly Expression _Expression;
///
/// The expression.
///
public Expression Expression => _Expression;
///
/// Constructs a new expression initializer parse tree.
///
/// The expression.
/// The location of the parse tree.
public ExpressionInitializer(Expression expression, Span span)
: base(TreeType.ExpressionInitializer, span)
{
if (expression == null)
{
throw new ArgumentNullException("expression");
}
SetParent(expression);
_Expression = expression;
}
protected override void GetChildTrees(IList childList)
{
Tree.AddChild(childList, Expression);
}
}