using System; using System.Collections.Generic; namespace AspClassic.Parser; /// /// A parse tree for an Imports statement that aliases a type or namespace. /// public sealed class AliasImport : Import { private readonly SimpleName _Name; private readonly Location _EqualsLocation; private readonly TypeName _AliasedTypeName; /// /// The alias name. /// public SimpleName Name => _Name; /// /// The location of the '='. /// public Location EqualsLocation => _EqualsLocation; /// /// The name being aliased. /// public TypeName AliasedTypeName => _AliasedTypeName; /// /// Constructs a new aliased import parse tree. /// /// The name of the alias. /// The location of the '='. /// The name being aliased. /// The location of the parse tree. public AliasImport(SimpleName name, Location equalsLocation, TypeName aliasedTypeName, Span span) : base(TreeType.AliasImport, span) { if (aliasedTypeName == null) { throw new ArgumentNullException("aliasedTypeName"); } if (name == null) { throw new ArgumentNullException("name"); } SetParent(name); SetParent(aliasedTypeName); _Name = name; _EqualsLocation = equalsLocation; _AliasedTypeName = aliasedTypeName; } protected override void GetChildTrees(IList childList) { base.GetChildTrees(childList); Tree.AddChild(childList, AliasedTypeName); } }