progress
This commit is contained in:
parent
16e76d6b31
commit
484dbfc9d9
529 changed files with 113694 additions and 0 deletions
62
AspClassic.Parser/QualifiedName.cs
Normal file
62
AspClassic.Parser/QualifiedName.cs
Normal file
|
@ -0,0 +1,62 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace AspClassic.Parser;
|
||||
|
||||
/// <summary>
|
||||
/// A parse tree for a qualified name (e.g. 'foo.bar').
|
||||
/// </summary>
|
||||
public sealed class QualifiedName : Name
|
||||
{
|
||||
private readonly Name _Qualifier;
|
||||
|
||||
private readonly Location _DotLocation;
|
||||
|
||||
private readonly SimpleName _Name;
|
||||
|
||||
/// <summary>
|
||||
/// The qualifier on the left-hand side of the dot.
|
||||
/// </summary>
|
||||
public Name Qualifier => _Qualifier;
|
||||
|
||||
/// <summary>
|
||||
/// The location of the dot.
|
||||
/// </summary>
|
||||
public Location DotLocation => _DotLocation;
|
||||
|
||||
/// <summary>
|
||||
/// The name on the right-hand side of the dot.
|
||||
/// </summary>
|
||||
public SimpleName Name => _Name;
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a new parse tree for a qualified name.
|
||||
/// </summary>
|
||||
/// <param name="qualifier">The qualifier on the left-hand side of the dot.</param>
|
||||
/// <param name="dotLocation">The location of the dot.</param>
|
||||
/// <param name="name">The name on the right-hand side of the dot.</param>
|
||||
/// <param name="span">The location of the parse tree.</param>
|
||||
public QualifiedName(Name qualifier, Location dotLocation, SimpleName name, Span span)
|
||||
: base(TreeType.QualifiedName, span)
|
||||
{
|
||||
if (qualifier == null)
|
||||
{
|
||||
throw new ArgumentNullException("qualifier");
|
||||
}
|
||||
if (name == null)
|
||||
{
|
||||
throw new ArgumentNullException("name");
|
||||
}
|
||||
SetParent(qualifier);
|
||||
SetParent(name);
|
||||
_Qualifier = qualifier;
|
||||
_DotLocation = dotLocation;
|
||||
_Name = name;
|
||||
}
|
||||
|
||||
protected override void GetChildTrees(IList<Tree> childList)
|
||||
{
|
||||
Tree.AddChild(childList, Qualifier);
|
||||
Tree.AddChild(childList, Name);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue