using System; using System.Collections.Generic; namespace AspClassic.Parser; /// /// A parse tree for an Else block statement. /// public sealed class ElseBlockStatement : BlockStatement { private readonly ElseStatement _ElseStatement; /// /// The Else or Else If statement. /// public ElseStatement ElseStatement => _ElseStatement; /// /// Constructs a new parse tree for an Else block statement. /// /// The Else statement. /// The statements in the block. /// The location of the parse tree. /// The comments for the parse tree. public ElseBlockStatement(ElseStatement elseStatement, StatementCollection statements, Span span, IList comments) : base(TreeType.ElseBlockStatement, statements, span, comments) { if (elseStatement == null) { throw new ArgumentNullException("elseStatement"); } SetParent(elseStatement); _ElseStatement = elseStatement; } protected override void GetChildTrees(IList childList) { Tree.AddChild(childList, ElseStatement); base.GetChildTrees(childList); } }