76 string s = Left.DefaultVariableName;
79 else if (s == Right.DefaultVariableName)
114 bool RecalcIsAsync =
false;
117 if (!(this.left is
null))
119 b = !Callback(this.left, out NewNode, State);
120 if (!(NewNode is
null))
125 RecalcIsAsync =
true;
128 if (b || (Order ==
SearchMethod.TreeOrder && !
this.left.ForAllChildNodes(Callback, State, Order)))
137 if (!(this.right is
null))
139 b = !Callback(this.right, out NewNode, State);
140 if (!(NewNode is
null))
142 this.right = NewNode;
145 RecalcIsAsync =
true;
148 if (b || (Order ==
SearchMethod.TreeOrder && !
this.right.ForAllChildNodes(Callback, State, Order)))
184 int Result = base.GetHashCode();
210 null, Arguments,
null).Result;
212 if (!(Result is
null))
217 null, Arguments,
null).Result;
Class managing a script expression.
Base class for all binary operators.
ScriptNode RightOperand
Right operand.
virtual void CalcIsAsync()
Recalculates if operator is asynchronous or not.
ScriptNode LeftOperand
Left operand.
override bool IsAsynchronous
If the node (or its decendants) include asynchronous evaluation. Asynchronous nodes should be evaluat...
ScriptNode right
Right operand.
ScriptNode left
Left operand.
override bool ForAllChildNodes(ScriptNodeEventHandler Callback, object State, SearchMethod Order)
Calls the callback method for all child nodes.
override int GetHashCode()
override bool Equals(object obj)
static IElement EvaluateNamedOperator(string Name, IElement Left, IElement Right, ScriptNode Node)
Evaluates a named operator available in code-behind.
BinaryOperator(ScriptNode Left, ScriptNode Right, int Start, int Length, Expression Expression)
Base class for all binary operators.
bool isAsync
If subtree is asynchroneous.
virtual string DefaultVariableName
Default variable name, if any, null otherwise.
Base class for all nodes in a parsed script tree.
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.
Named method call operator.
override async Task< IElement > EvaluateAsync(IElement Operand, Variables Variables)
Evaluates the node, using the variables provided in the Variables collection.
Basic interface for all types of elements.
object AssociatedObjectValue
Associated object value.
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