1using System.Threading.Tasks;
15 private readonly
int nrArguments;
32 this.nrArguments = this.arguments.Length;
37 private void CalcIsAsync()
41 for (
int i = 0; i < this.nrArguments; i++)
70 object Obj =
Operand.AssociatedObjectValue;
77 if (this.nrArguments != Lambda.NrArguments)
84 for (i = 0; i < this.nrArguments; i++)
86 Node = this.arguments[i];
104 object Obj =
Operand.AssociatedObjectValue;
111 if (this.nrArguments != Lambda.NrArguments)
118 for (i = 0; i < this.nrArguments; i++)
120 Node = this.arguments[i];
127 return await Lambda.EvaluateAsync(Arg,
Variables);
143 if (!this.arguments.ForAllChildNodes(Callback, State, Order))
148 bool RecalcIsAsync =
false;
150 for (i = 0; i < this.nrArguments; i++)
152 Node = this.arguments[i];
155 bool b = !Callback(Node, out
ScriptNode NewNode, State);
156 if (!(NewNode is
null))
158 this.arguments[i] = Node = NewNode;
161 RecalcIsAsync =
true;
179 if (!this.arguments.ForAllChildNodes(Callback, State, Order))
190 AreEqual(this.arguments, O.arguments) &&
197 int Result = base.GetHashCode();
198 Result ^= Result << 5 ^
GetHashCode(this.arguments);
Script runtime exception.
Class managing a script expression.
Base class for all funcions.
Base class for all unary scalar operators performing operand null checks.
readonly bool nullCheck
If null should be returned if operand is null.
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.
virtual bool IsAsynchronous
If the node (or its decendants) include asynchronous evaluation. Asynchronous nodes should be evaluat...
void SetParent(ScriptNode Parent)
Sets the parent node. Can only be used when expression is being parsed.
abstract IElement Evaluate(Variables Variables)
Evaluates the node, using the variables provided in the Variables collection. This method should be ...
virtual Task< IElement > EvaluateAsync(Variables Variables)
Evaluates the node, using the variables provided in the Variables collection. This method should be ...
ScriptNode Operand
Operand.
static readonly ObjectValue Null
Null value.
Dynamic function call operator
ScriptNode[] Arguments
Arguments
override IElement EvaluateScalar(IElement Operand, Variables Variables)
Evaluates the operator on scalar operands.
override bool IsAsynchronous
If the node (or its decendants) include asynchronous evaluation. Asynchronous nodes should be evaluat...
override bool ForAllChildNodes(ScriptNodeEventHandler Callback, object State, SearchMethod Order)
Calls the callback method for all child nodes.
DynamicFunctionCall(ScriptNode Function, ScriptNode[] Arguments, bool NullCheck, int Start, int Length, Expression Expression)
Dynamic function call operator
override async Task< IElement > EvaluateScalarAsync(IElement Operand, Variables Variables)
Evaluates the operator on scalar operands.
override bool Equals(object obj)
override int GetHashCode()
Basic interface for all types of elements.
Base interface for lambda expressions.
delegate bool ScriptNodeEventHandler(ScriptNode Node, out ScriptNode NewNode, object State)
Delegate for ScriptNode callback methods.
SearchMethod
Method to traverse the expression structure