progress
This commit is contained in:
parent
16e76d6b31
commit
484dbfc9d9
529 changed files with 113694 additions and 0 deletions
59
AspClassic.Parser/CallStatement.cs
Normal file
59
AspClassic.Parser/CallStatement.cs
Normal file
|
@ -0,0 +1,59 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace AspClassic.Parser;
|
||||
|
||||
/// <summary>
|
||||
/// A parse tree for a method call statement.
|
||||
/// </summary>
|
||||
public sealed class CallStatement : Statement
|
||||
{
|
||||
private readonly Location _CallLocation;
|
||||
|
||||
private readonly Expression _TargetExpression;
|
||||
|
||||
private readonly ArgumentCollection _Arguments;
|
||||
|
||||
/// <summary>
|
||||
/// The location of the 'Call', if any.
|
||||
/// </summary>
|
||||
public Location CallLocation => _CallLocation;
|
||||
|
||||
/// <summary>
|
||||
/// The target of the call.
|
||||
/// </summary>
|
||||
public Expression TargetExpression => _TargetExpression;
|
||||
|
||||
/// <summary>
|
||||
/// The arguments to the call.
|
||||
/// </summary>
|
||||
public ArgumentCollection Arguments => _Arguments;
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a new parse tree for a method call statement.
|
||||
/// </summary>
|
||||
/// <param name="callLocation">The location of the 'Call', if any.</param>
|
||||
/// <param name="targetExpression">The target of the call.</param>
|
||||
/// <param name="arguments">The arguments to the call.</param>
|
||||
/// <param name="span">The location of the parse tree.</param>
|
||||
/// <param name="comments">The comments of the parse tree.</param>
|
||||
public CallStatement(Location callLocation, Expression targetExpression, ArgumentCollection arguments, Span span, IList<Comment> comments)
|
||||
: base(TreeType.CallStatement, span, comments)
|
||||
{
|
||||
if (targetExpression == null)
|
||||
{
|
||||
throw new ArgumentNullException("targetExpression");
|
||||
}
|
||||
SetParent(targetExpression);
|
||||
SetParent(arguments);
|
||||
_CallLocation = callLocation;
|
||||
_TargetExpression = targetExpression;
|
||||
_Arguments = arguments;
|
||||
}
|
||||
|
||||
protected override void GetChildTrees(IList<Tree> childList)
|
||||
{
|
||||
Tree.AddChild(childList, TargetExpression);
|
||||
Tree.AddChild(childList, Arguments);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue