using System;
using System.Collections.Generic;
namespace AspClassic.Parser;
///
/// A parse tree for an Else If statement.
///
public sealed class ElseIfStatement : Statement
{
private readonly Expression _Expression;
private readonly Location _ThenLocation;
///
/// The conditional expression.
///
public Expression Expression => _Expression;
///
/// The location of the 'Then', if any.
///
public Location ThenLocation => _ThenLocation;
///
/// Constructs a new parse tree for an Else If statement.
///
/// The conditional expression.
/// The location of the 'Then', if any.
/// The location of the parse tree.
/// The comments for the parse tree.
public ElseIfStatement(Expression expression, Location thenLocation, Span span, IList comments)
: base(TreeType.ElseIfStatement, span, comments)
{
if (expression == null)
{
throw new ArgumentNullException("expression");
}
SetParent(expression);
_Expression = expression;
_ThenLocation = thenLocation;
}
protected override void GetChildTrees(IList childList)
{
Tree.AddChild(childList, Expression);
}
}