2using System.Collections.Generic;
3using System.Threading.Tasks;
87 LinkedList<IElement> Result =
new LinkedList<IElement>();
99 LinkedList<IElement> Result =
new LinkedList<IElement>();
111 if (LeftChildren.Count == RightChildren.Count)
113 LinkedList<IElement> Result =
new LinkedList<IElement>();
114 IEnumerator<IElement> eLeft = LeftChildren.GetEnumerator();
115 IEnumerator<IElement> eRight = RightChildren.GetEnumerator();
119 while (eLeft.MoveNext() && eRight.MoveNext())
132 LinkedList<IElement> LeftResult =
new LinkedList<IElement>();
134 foreach (
IElement LeftChild
in LeftChildren)
136 LinkedList<IElement> RightResult =
new LinkedList<IElement>();
138 foreach (
IElement RightChild
in RightChildren)
141 LeftResult.AddLast(Right.
Encapsulate(RightResult,
this));
180 LinkedList<IElement> Result =
new LinkedList<IElement>();
192 LinkedList<IElement> Result =
new LinkedList<IElement>();
204 if (LeftChildren.Count == RightChildren.Count)
206 LinkedList<IElement> Result =
new LinkedList<IElement>();
207 IEnumerator<IElement> eLeft = LeftChildren.GetEnumerator();
208 IEnumerator<IElement> eRight = RightChildren.GetEnumerator();
212 while (eLeft.MoveNext() && eRight.MoveNext())
225 LinkedList<IElement> LeftResult =
new LinkedList<IElement>();
227 foreach (
IElement LeftChild
in LeftChildren)
229 LinkedList<IElement> RightResult =
new LinkedList<IElement>();
231 foreach (
IElement RightChild
in RightChildren)
234 LeftResult.AddLast(Right.
Encapsulate(RightResult,
this));
Script runtime exception.
Class managing a script expression.
static bool UpgradeField(ref IElement E1, ref ISet Set1, ref IElement E2, ref ISet Set2)
Upgrades elements if necessary, to a common field extension, trying to make them compatible.
Base class for all binary operators.
ScriptNode right
Right operand.
ScriptNode left
Left operand.
bool isAsync
If subtree is asynchroneous.
Base class for binary vector operators.
override IElement Evaluate(Variables Variables)
Evaluates the node, using the variables provided in the Variables collection.
virtual UpgradeBehaviour ScalarUpgradeBehaviour
How scalar operands of different types are to be treated. By default, scalar operands are required to...
virtual Task< IElement > EvaluateVectorAsync(IVector Left, IVector Right, Variables Variables)
Evaluates the operator on vector operands.
override async Task< IElement > EvaluateAsync(Variables Variables)
Evaluates the node, using the variables provided in the Variables collection.
BinaryVectorOperator(ScriptNode Left, ScriptNode Right, int Start, int Length, Expression Expression)
Base class for binary vector operators.
virtual IElement Evaluate(IElement Left, IElement Right, Variables Variables)
Evaluates the operator.
abstract IElement EvaluateVector(IVector Left, IVector Right, Variables Variables)
Evaluates the operator on vector operands.
virtual async Task< IElement > EvaluateAsync(IElement Left, IElement Right, Variables Variables)
Evaluates the operator.
Base class for all nodes in a parsed script tree.
int Length
Length of expression covered by node.
int Start
Start position in script expression.
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.
ICollection< IElement > ChildElements
An enumeration of child elements. If the element is a scalar, this property will return null.
IElement Encapsulate(ICollection< IElement > Elements, ScriptNode Node)
Encapsulates a set of elements into a similar structure as that provided by the current element.
ISet AssociatedSet
Associated Set.
Basic interface for vectors.
Basic interface for all types of sets.
UpgradeBehaviour
How operands are to be handled if not of the same type.