1using System.Threading.Tasks;
14 private readonly
string functionName;
16 private readonly
int nrArguments;
17 private readonly
bool nullCheck;
36 this.nullCheck = NullCheck;
37 this.nrArguments = this.arguments.Length;
73 string s = this.nrArguments.ToString();
83 v.ValueObject is
Variables GlobalVariables &&
84 (GlobalVariables.TryGetVariable(
this.functionName +
" " + s, out v) ||
85 GlobalVariables.TryGetVariable(
this.functionName, out v)) &&
94 if (this.nrArguments == 1)
95 throw new ScriptRuntimeException(
"No function defined having 1 argument named '" + this.functionName +
"' found.",
this);
97 throw new ScriptRuntimeException(
"No function defined having " + s +
" arguments named '" + this.functionName +
"' found.",
this);
106 for (i = 0; i < this.nrArguments; i++)
108 Node = this.arguments[i];
134 if (!this.arguments.ForAllChildNodes(Callback, State, Order))
140 for (i = 0; i < this.nrArguments; i++)
142 Node = this.arguments[i];
145 bool b = !Callback(Node, out
ScriptNode NewNode, State);
146 if (!(NewNode is
null))
148 this.arguments[i] = Node = NewNode;
159 if (!this.arguments.ForAllChildNodes(Callback, State, Order))
170 this.functionName.
Equals(O.functionName) &&
171 this.nullCheck.Equals(O.nullCheck) &&
172 AreEqual(this.arguments, O.arguments) &&
179 int Result = base.GetHashCode();
180 Result ^= Result << 5 ^ this.functionName.GetHashCode();
181 Result ^= Result << 5 ^ this.nullCheck.GetHashCode();
182 Result ^= Result << 5 ^
GetHashCode(this.arguments);
Script runtime exception.
Class managing a script expression.
Base class for all nodes in a parsed script tree.
bool ForAllChildNodes(ScriptNodeEventHandler Callback, object State, bool DepthFirst)
Calls the callback method for all child nodes.
int Length
Length of expression covered by node.
static bool AreEqual(ScriptNode S1, ScriptNode S2)
Compares if two script nodes are equal.
int Start
Start position in script expression.
void SetParent(ScriptNode Parent)
Sets the parent node. Can only be used when expression is being parsed.
virtual Task< IElement > EvaluateAsync(Variables Variables)
Evaluates the node, using the variables provided in the Variables collection. This method should be ...
static readonly ObjectValue Null
Null value.
Named function call operator
override Task< IElement > EvaluateAsync(Variables Variables)
Evaluates the node, using the variables provided in the Variables collection.
override int GetHashCode()
override bool IsAsynchronous
If the node (or its decendants) include asynchronous evaluation. Asynchronous nodes should be evaluat...
ScriptNode[] Arguments
Arguments
override bool ForAllChildNodes(ScriptNodeEventHandler Callback, object State, SearchMethod Order)
Calls the callback method for all child nodes.
override IElement Evaluate(Variables Variables)
Evaluates the node, using the variables provided in the Variables collection.
string FunctionName
Function name.
override bool Equals(object obj)
NamedFunctionCall(string FunctionName, ScriptNode[] Arguments, bool NullCheck, int Start, int Length, Expression Expression)
Named function call operator
Contains information about a variable.
virtual bool TryGetVariable(string Name, out Variable Variable)
Tries to get a variable object, given its name.
Basic interface for all types of elements.
Base interface for lambda expressions.
bool IsAsynchronous
If the node (or its decendants) include asynchronous evaluation. Asynchronous nodes should be evaluat...
Task< IElement > EvaluateAsync(IElement[] Arguments, Variables Variables)
Evaluates the lambda expression.
IElement Evaluate(IElement[] Arguments, Variables Variables)
Evaluates the lambda expression.
delegate bool ScriptNodeEventHandler(ScriptNode Node, out ScriptNode NewNode, object State)
Delegate for ScriptNode callback methods.
SearchMethod
Method to traverse the expression structure