2using System.Threading.Tasks;
36 private void CalcIsAsync()
84 if (!this.IsAsynchronous)
133 bool RecalcIsAsync =
false;
136 if (!(this.argument1 is
null))
138 b = !Callback(this.argument1, out NewNode, State);
139 if (!(NewNode is
null))
141 this.argument1 = NewNode;
144 RecalcIsAsync =
true;
147 if (b || (Order ==
SearchMethod.TreeOrder && !
this.argument1.ForAllChildNodes(Callback, State, Order)))
156 if (!(this.argument2 is
null))
158 b = !Callback(this.argument2, out NewNode, State);
159 if (!(NewNode is
null))
161 this.argument2 = NewNode;
164 RecalcIsAsync =
true;
167 if (b || (Order ==
SearchMethod.TreeOrder && !
this.argument2.ForAllChildNodes(Callback, State, Order)))
195 this.argument1.
Equals(O.argument1) &&
196 this.argument2.
Equals(O.argument2) &&
203 int Result = base.GetHashCode();
204 Result ^= Result << 5 ^ this.argument1.
GetHashCode();
205 Result ^= Result << 5 ^ this.argument2.
GetHashCode();
Class managing a script expression.
Base class for all funcions.
Base class for funcions of one variable.
override async Task< IElement > EvaluateAsync(Variables Variables)
Evaluates the node, using the variables provided in the Variables collection.
FunctionTwoVariables(ScriptNode Argument1, ScriptNode Argument2, int Start, int Length, Expression Expression)
Base class for funcions of one variable.
override int GetHashCode()
override string[] DefaultArgumentNames
Default Argument names
override bool ForAllChildNodes(ScriptNodeEventHandler Callback, object State, SearchMethod Order)
Calls the callback method for all child nodes.
override bool IsAsynchronous
If the node (or its decendants) include asynchronous evaluation. Asynchronous nodes should be evaluat...
override IElement Evaluate(Variables Variables)
Evaluates the node, using the variables provided in the Variables collection.
ScriptNode Argument2
Function argument 2.
abstract IElement Evaluate(IElement Argument1, IElement Argument2, Variables Variables)
Evaluates the function.
ScriptNode Argument1
Function argument 1.
override bool Equals(object obj)
virtual Task< IElement > EvaluateAsync(IElement Argument1, IElement Argument2, Variables Variables)
Evaluates the function.
Base class for all nodes in a parsed script tree.
int Length
Length of expression covered by node.
override bool Equals(object obj)
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.
override int GetHashCode()
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 ...
Basic interface for all types of elements.
delegate bool ScriptNodeEventHandler(ScriptNode Node, out ScriptNode NewNode, object State)
Delegate for ScriptNode callback methods.
SearchMethod
Method to traverse the expression structure