2using System.Collections.Generic;
3using System.Threading.Tasks;
75 Result = LE.AddRight(Temp);
76 if (!(Result is
null))
80 if (!(Result is
null))
92 if (!LeftSet.Equals(RightSet))
98 if (!(LE is
null) && !(RE is
null))
103 Result = LE.AddRight(Temp);
104 if (!(Result is
null))
108 if (!(Result is
null))
116 if (!(Result is
null))
123 LinkedList<IElement> Elements =
new LinkedList<IElement>();
135 LinkedList<IElement> Elements =
new LinkedList<IElement>();
147 if (LeftChildren.Count == RightChildren.Count)
149 LinkedList<IElement> Elements =
new LinkedList<IElement>();
150 IEnumerator<IElement> eLeft = LeftChildren.GetEnumerator();
151 IEnumerator<IElement> eRight = RightChildren.GetEnumerator();
155 while (eLeft.MoveNext() && eRight.MoveNext())
168 LinkedList<IElement> LeftResult =
new LinkedList<IElement>();
170 foreach (
IElement LeftChild
in LeftChildren)
172 LinkedList<IElement> RightResult =
new LinkedList<IElement>();
174 foreach (
IElement RightChild
in RightChildren)
177 LeftResult.AddLast(Right.
Encapsulate(RightResult, Node));
198 Left.Differentiate(VariableName,
Variables),
199 Right.Differentiate(VariableName,
Variables),
200 this.Start,
this.Length,
this.Expression);
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.
static IElement EvaluateNamedOperator(string Name, IElement Left, IElement Right, ScriptNode Node)
Evaluates a named operator available in code-behind.
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 ...
Subtract(ScriptNode Left, ScriptNode Right, int Start, int Length, Expression Expression)
Subtraction operator.
static IElement EvaluateSubtraction(IElement Left, IElement Right, ScriptNode Node)
Subtracts the right operand from the left one.
override IElement Evaluate(Variables Variables)
Evaluates the node, using the variables provided in the Variables collection.
ScriptNode Differentiate(string VariableName, Variables Variables)
Differentiates a script node, if possible.
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.
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.
bool IsScalar
If the element represents a scalar value.
Basic interface for all types of group elements.
IGroupElement Negate()
Negates the element.
ISemiGroupElement AddLeft(ISemiGroupElement Element)
Tries to add an element to the current element, from the left.
Basic interface for all types of sets.
Base interface for lambda expressions.