2using System.Collections.Generic;
3using System.Threading.Tasks;
68 else if (Right is
IVector Vector)
76 LinkedList<IElement> Elements =
new LinkedList<IElement>();
79 Elements.AddLast(this.
Evaluate(Left, E));
88 if (LeftChildren.Count == RightChildren.Count)
90 LinkedList<IElement> Elements =
new LinkedList<IElement>();
91 IEnumerator<IElement> eLeft = LeftChildren.GetEnumerator();
92 IEnumerator<IElement> eRight = RightChildren.GetEnumerator();
96 while (eLeft.MoveNext() && eRight.MoveNext())
97 Elements.AddLast(this.
Evaluate(eLeft.Current, eRight.Current));
109 LinkedList<IElement> LeftResult =
new LinkedList<IElement>();
111 foreach (
IElement LeftChild
in LeftChildren)
113 LinkedList<IElement> RightResult =
new LinkedList<IElement>();
115 foreach (
IElement RightChild
in RightChildren)
116 RightResult.AddLast(this.
Evaluate(LeftChild, RightChild));
118 LeftResult.AddLast(Right.
Encapsulate(RightResult,
this));
Base class for all types of elements.
virtual ICollection< IElement > ChildElements
An enumeration of child elements. If the element is a scalar, this property will return null.
Base class for all types of sets.
Script runtime exception.
Class managing a script expression.
Base class for all binary operators.
ScriptNode right
Right operand.
ScriptNode left
Left operand.
bool isAsync
If subtree is asynchroneous.
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 ...
static readonly BooleanValue False
Constant false value.
static readonly BooleanValue True
Constant true value.
override IElement Evaluate(Variables Variables)
Evaluates the node, using the variables provided in the Variables collection.
In(ScriptNode Left, ScriptNode Right, int Start, int Length, Expression Expression)
In operator
virtual IElement Evaluate(IElement Left, IElement Right)
Evaluates the operator.
override async Task< IElement > EvaluateAsync(Variables Variables)
Evaluates the node, using the variables provided in the Variables collection.
virtual IElement Evaluate(IElement Left, IVector Right)
Evaluates the operator.
virtual IElement Evaluate(IElement Left, ISet Right)
Evaluates the operator.
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.
bool IsScalar
If the element represents a scalar value.
Basic interface for vectors.
Basic interface for all types of sets.
bool Contains(IElement Element)
Checks if the set contains an element.