progress
This commit is contained in:
parent
16e76d6b31
commit
484dbfc9d9
529 changed files with 113694 additions and 0 deletions
61
AspClassic.Parser/EnumValueDeclaration.cs
Normal file
61
AspClassic.Parser/EnumValueDeclaration.cs
Normal file
|
@ -0,0 +1,61 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace AspClassic.Parser;
|
||||
|
||||
/// <summary>
|
||||
/// A parse tree for an enumerated value declaration.
|
||||
/// </summary>
|
||||
public sealed class EnumValueDeclaration : ModifiedDeclaration
|
||||
{
|
||||
private readonly Name _Name;
|
||||
|
||||
private readonly Location _EqualsLocation;
|
||||
|
||||
private readonly Expression _Expression;
|
||||
|
||||
/// <summary>
|
||||
/// The name of the enumerated value.
|
||||
/// </summary>
|
||||
public Name Name => _Name;
|
||||
|
||||
/// <summary>
|
||||
/// The location of the '=', if any.
|
||||
/// </summary>
|
||||
public Location EqualsLocation => _EqualsLocation;
|
||||
|
||||
/// <summary>
|
||||
/// The enumerated value, if any.
|
||||
/// </summary>
|
||||
public Expression Expression => _Expression;
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a new parse tree for an enumerated value.
|
||||
/// </summary>
|
||||
/// <param name="attributes">The attributes on the declaration.</param>
|
||||
/// <param name="name">The name of the declaration.</param>
|
||||
/// <param name="equalsLocation">The location of the '=', if any.</param>
|
||||
/// <param name="expression">The enumerated value, if any.</param>
|
||||
/// <param name="span">The location of the parse tree.</param>
|
||||
/// <param name="comments">The comments for the parse tree.</param>
|
||||
public EnumValueDeclaration(AttributeBlockCollection attributes, Name name, Location equalsLocation, Expression expression, Span span, IList<Comment> comments)
|
||||
: base(TreeType.EnumValueDeclaration, attributes, null, span, comments)
|
||||
{
|
||||
if (name == null)
|
||||
{
|
||||
throw new ArgumentNullException("name");
|
||||
}
|
||||
SetParent(name);
|
||||
SetParent(expression);
|
||||
_Name = name;
|
||||
_EqualsLocation = equalsLocation;
|
||||
_Expression = expression;
|
||||
}
|
||||
|
||||
protected override void GetChildTrees(IList<Tree> childList)
|
||||
{
|
||||
base.GetChildTrees(childList);
|
||||
Tree.AddChild(childList, Name);
|
||||
Tree.AddChild(childList, Expression);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue