progress
This commit is contained in:
parent
16e76d6b31
commit
484dbfc9d9
529 changed files with 113694 additions and 0 deletions
49
AspClassic.Parser/NewExpression.cs
Normal file
49
AspClassic.Parser/NewExpression.cs
Normal file
|
@ -0,0 +1,49 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace AspClassic.Parser;
|
||||
|
||||
/// <summary>
|
||||
/// A parse tree for a New expression.
|
||||
/// </summary>
|
||||
public sealed class NewExpression : Expression
|
||||
{
|
||||
private readonly TypeName _Target;
|
||||
|
||||
private readonly ArgumentCollection _Arguments;
|
||||
|
||||
/// <summary>
|
||||
/// The target type to create.
|
||||
/// </summary>
|
||||
public TypeName Target => _Target;
|
||||
|
||||
/// <summary>
|
||||
/// The arguments to the constructor.
|
||||
/// </summary>
|
||||
public ArgumentCollection Arguments => _Arguments;
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a new parse tree for a New expression.
|
||||
/// </summary>
|
||||
/// <param name="target">The target type to create.</param>
|
||||
/// <param name="arguments">The arguments to the constructor.</param>
|
||||
/// <param name="span">The location of the parse tree.</param>
|
||||
public NewExpression(TypeName target, ArgumentCollection arguments, Span span)
|
||||
: base(TreeType.NewExpression, span)
|
||||
{
|
||||
if (target == null)
|
||||
{
|
||||
throw new ArgumentNullException("target");
|
||||
}
|
||||
SetParent(target);
|
||||
SetParent(arguments);
|
||||
_Target = target;
|
||||
_Arguments = arguments;
|
||||
}
|
||||
|
||||
protected override void GetChildTrees(IList<Tree> childList)
|
||||
{
|
||||
Tree.AddChild(childList, Target);
|
||||
Tree.AddChild(childList, Arguments);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue