2using System.Collections.Generic;
3using System.Threading.Tasks;
89 LinkedList<IElement> Elements =
new LinkedList<IElement>();
92 Elements.AddLast(
EvaluateIndex(E, IndexX, IndexY, NullCheck, Node));
111 if (x < 0 || x >
int.MaxValue || x != Math.Truncate(x) || y < 0 || y >
int.MaxValue || y != Math.Truncate(y))
123 LinkedList<IElement> Elements =
new LinkedList<IElement>();
135 LinkedList<IElement> Elements =
new LinkedList<IElement>();
147 if (IndexXChildren.Count == IndexYChildren.Count)
149 LinkedList<IElement> Elements =
new LinkedList<IElement>();
150 IEnumerator<IElement> eX = IndexXChildren.GetEnumerator();
151 IEnumerator<IElement> eY = IndexYChildren.GetEnumerator();
155 while (eX.MoveNext() && eY.MoveNext())
156 Elements.AddLast(
EvaluateIndex(Matrix, eX.Current, eY.Current, Node));
168 LinkedList<IElement> XResult =
new LinkedList<IElement>();
170 foreach (
IElement XChild
in IndexXChildren)
172 LinkedList<IElement> YResult =
new LinkedList<IElement>();
174 foreach (
IElement YChild
in IndexYChildren)
175 YResult.AddLast(
EvaluateIndex(Matrix, XChild, YChild, Node));
177 XResult.AddLast(IndexY.
Encapsulate(YResult, Node));
Script runtime exception.
Class managing a script expression.
ScriptNode right
Right operand.
ScriptNode left
Left operand.
bool isAsync
If subtree is asynchroneous.
Base class for all unary 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.
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 ...
ScriptNode middle
Middle operand.
static IElement EvaluateIndex(IMatrix Matrix, IElement IndexX, IElement IndexY, ScriptNode Node)
Evaluates the vector index operator.
static IElement EvaluateIndex(IElement Matrix, IElement IndexX, IElement IndexY, bool NullCheck, ScriptNode Node)
Evaluates the matrix index operator.
override IElement Evaluate(Variables Variables)
Evaluates the node, using the variables provided in the Variables collection.
MatrixIndex(ScriptNode Left, ScriptNode X, ScriptNode Y, bool NullCheck, int Start, int Length, Expression Expression)
Matrix Index operator.
override async Task< IElement > EvaluateAsync(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.
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 matrices.
IElement GetElement(int Column, int Row)
Gets an element of the matrix.