progress
This commit is contained in:
parent
16e76d6b31
commit
484dbfc9d9
529 changed files with 113694 additions and 0 deletions
62
AspClassic.Parser/AliasImport.cs
Normal file
62
AspClassic.Parser/AliasImport.cs
Normal file
|
@ -0,0 +1,62 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace AspClassic.Parser;
|
||||
|
||||
/// <summary>
|
||||
/// A parse tree for an Imports statement that aliases a type or namespace.
|
||||
/// </summary>
|
||||
public sealed class AliasImport : Import
|
||||
{
|
||||
private readonly SimpleName _Name;
|
||||
|
||||
private readonly Location _EqualsLocation;
|
||||
|
||||
private readonly TypeName _AliasedTypeName;
|
||||
|
||||
/// <summary>
|
||||
/// The alias name.
|
||||
/// </summary>
|
||||
public SimpleName Name => _Name;
|
||||
|
||||
/// <summary>
|
||||
/// The location of the '='.
|
||||
/// </summary>
|
||||
public Location EqualsLocation => _EqualsLocation;
|
||||
|
||||
/// <summary>
|
||||
/// The name being aliased.
|
||||
/// </summary>
|
||||
public TypeName AliasedTypeName => _AliasedTypeName;
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a new aliased import parse tree.
|
||||
/// </summary>
|
||||
/// <param name="name">The name of the alias.</param>
|
||||
/// <param name="equalsLocation">The location of the '='.</param>
|
||||
/// <param name="aliasedTypeName">The name being aliased.</param>
|
||||
/// <param name="span">The location of the parse tree.</param>
|
||||
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<Tree> childList)
|
||||
{
|
||||
base.GetChildTrees(childList);
|
||||
Tree.AddChild(childList, AliasedTypeName);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue