using System;
using System.Collections.Generic;
namespace AspClassic.Parser;
///
/// A parse tree for a qualified name expression.
///
public sealed class QualifiedExpression : Expression
{
private readonly Expression _Qualifier;
private readonly Location _DotLocation;
private readonly SimpleName _Name;
///
/// The expression qualifying the name.
///
public Expression Qualifier => _Qualifier;
///
/// The location of the '.'.
///
public Location DotLocation => _DotLocation;
///
/// The qualified name.
///
public SimpleName Name => _Name;
///
/// Constructs a new parse tree for a qualified name expression.
///
/// The expression qualifying the name.
/// The location of the '.'.
/// The qualified name.
/// The location of the parse tree.
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 childList)
{
Tree.AddChild(childList, Qualifier);
Tree.AddChild(childList, Name);
}
}