58 lines
1.4 KiB
C#
58 lines
1.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace AspClassic.Parser;
|
|
|
|
/// <summary>
|
|
/// A parse tree for a qualified name expression.
|
|
/// </summary>
|
|
public sealed class QualifiedExpression : Expression
|
|
{
|
|
private readonly Expression _Qualifier;
|
|
|
|
private readonly Location _DotLocation;
|
|
|
|
private readonly SimpleName _Name;
|
|
|
|
/// <summary>
|
|
/// The expression qualifying the name.
|
|
/// </summary>
|
|
public Expression Qualifier => _Qualifier;
|
|
|
|
/// <summary>
|
|
/// The location of the '.'.
|
|
/// </summary>
|
|
public Location DotLocation => _DotLocation;
|
|
|
|
/// <summary>
|
|
/// The qualified name.
|
|
/// </summary>
|
|
public SimpleName Name => _Name;
|
|
|
|
/// <summary>
|
|
/// Constructs a new parse tree for a qualified name expression.
|
|
/// </summary>
|
|
/// <param name="qualifier">The expression qualifying the name.</param>
|
|
/// <param name="dotLocation">The location of the '.'.</param>
|
|
/// <param name="name">The qualified name.</param>
|
|
/// <param name="span">The location of the parse tree.</param>
|
|
public QualifiedExpression(Expression qualifier, Location dotLocation, SimpleName name, Span span)
|
|
: base(TreeType.QualifiedExpression, span)
|
|
{
|
|
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);
|
|
}
|
|
}
|