79 lines
2.4 KiB
C#
79 lines
2.4 KiB
C#
using System.Collections.Generic;
|
|
|
|
namespace AspClassic.Parser;
|
|
|
|
/// <summary>
|
|
/// A parse tree for a Declare statement.
|
|
/// </summary>
|
|
public abstract class ExternalDeclaration : SignatureDeclaration
|
|
{
|
|
private readonly Location _CharsetLocation;
|
|
|
|
private readonly Charset _Charset;
|
|
|
|
private readonly Location _SubOrFunctionLocation;
|
|
|
|
private readonly Location _LibLocation;
|
|
|
|
private readonly StringLiteralExpression _LibLiteral;
|
|
|
|
private readonly Location _AliasLocation;
|
|
|
|
private readonly StringLiteralExpression _AliasLiteral;
|
|
|
|
/// <summary>
|
|
/// The location of 'Auto', 'Ansi' or 'Unicode', if any.
|
|
/// </summary>
|
|
public Location CharsetLocation => _CharsetLocation;
|
|
|
|
/// <summary>
|
|
/// The charset.
|
|
/// </summary>
|
|
public Charset Charset => _Charset;
|
|
|
|
/// <summary>
|
|
/// The location of 'Sub' or 'Function'.
|
|
/// </summary>
|
|
public Location SubOrFunctionLocation => _SubOrFunctionLocation;
|
|
|
|
/// <summary>
|
|
/// The location of 'Lib', if any.
|
|
/// </summary>
|
|
public Location LibLocation => _LibLocation;
|
|
|
|
/// <summary>
|
|
/// The library, if any.
|
|
/// </summary>
|
|
public StringLiteralExpression LibLiteral => _LibLiteral;
|
|
|
|
/// <summary>
|
|
/// The location of 'Alias', if any.
|
|
/// </summary>
|
|
public Location AliasLocation => _AliasLocation;
|
|
|
|
/// <summary>
|
|
/// The alias, if any.
|
|
/// </summary>
|
|
public StringLiteralExpression AliasLiteral => _AliasLiteral;
|
|
|
|
protected ExternalDeclaration(TreeType type, AttributeBlockCollection attributes, ModifierCollection modifiers, Location keywordLocation, Location charsetLocation, Charset charset, Location subOrFunctionLocation, SimpleName name, Location libLocation, StringLiteralExpression libLiteral, Location aliasLocation, StringLiteralExpression aliasLiteral, ParameterCollection parameters, Location asLocation, AttributeBlockCollection resultTypeAttributes, TypeName resultType, Span span, IList<Comment> comments)
|
|
: base(type, attributes, modifiers, keywordLocation, name, null, parameters, asLocation, resultTypeAttributes, resultType, span, comments)
|
|
{
|
|
SetParent(libLiteral);
|
|
SetParent(aliasLiteral);
|
|
_CharsetLocation = charsetLocation;
|
|
_Charset = charset;
|
|
_SubOrFunctionLocation = subOrFunctionLocation;
|
|
_LibLocation = libLocation;
|
|
_LibLiteral = libLiteral;
|
|
_AliasLocation = aliasLocation;
|
|
_AliasLiteral = aliasLiteral;
|
|
}
|
|
|
|
protected override void GetChildTrees(IList<Tree> childList)
|
|
{
|
|
base.GetChildTrees(childList);
|
|
Tree.AddChild(childList, LibLiteral);
|
|
Tree.AddChild(childList, AliasLiteral);
|
|
}
|
|
}
|