1using System.Collections.Generic;
35 return this.ConvertToVector(
Operand);
56 return ToVector2.ToVector();
69 if (!(CheckAgainst is
IVector Vector))
71 Vector = this.ConvertToVector(CheckAgainst) as
IVector;
79 Dictionary<string, PatternRec> VariableNames =
null;
87 if (VariableNames is
null)
88 VariableNames =
new Dictionary<string, PatternRec>();
90 if (!VariableNames.ContainsKey(Ref2.VariableName))
92 if (AlreadyFound.TryGetValue(Ref2.VariableName, out IElement E))
94 VariableNames[Ref2.VariableName] = new PatternRec()
102 VariableNames[Ref2.VariableName] = new PatternRec()
104 New = new List<IElement>(),
116 switch (this.op.PatternMatch(
Element, AlreadyFound))
119 if (!(VariableNames is
null))
121 foreach (KeyValuePair<string, PatternRec> P
in VariableNames)
123 if (!(P.Value.New is
null))
125 if (AlreadyFound.TryGetValue(P.Key, out
IElement E))
128 AlreadyFound.Remove(P.Key);
146 if (!(VariableNames is
null))
148 foreach (KeyValuePair<string, PatternRec> P
in VariableNames)
150 if (!(P.Value.New is
null))
151 AlreadyFound[P.Key] = VectorDefinition.Encapsulate(P.Value.New,
false,
this);
158 private class PatternRec
160 public List<IElement> New;
Base class for all types of elements.
Class managing a script expression.
Base class for all unary operators performing operand null checks.
bool NullCheck
If null check is to be used.
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.
virtual PatternMatchResult PatternMatch(IElement CheckAgainst, Dictionary< string, IElement > AlreadyFound)
Performs a pattern match operation.
int Start
Start position in script expression.
ScriptNode Operand
Operand.
override bool ForAllChildNodes(ScriptNodeEventHandler Callback, object State, SearchMethod Order)
Calls the callback method for all child nodes.
Represents a variable reference.
static readonly ObjectValue Null
Null value.
override IElement Evaluate(IElement Operand, Variables Variables)
Evaluates the node, using the variables provided in the Variables collection.
override PatternMatchResult PatternMatch(IElement CheckAgainst, Dictionary< string, IElement > AlreadyFound)
Performs a pattern match operation.
ToVector(ScriptNode Operand, bool NullCheck, int Start, int Length, Expression Expression)
To-Vector operator.
static IElement Encapsulate(Array Elements, bool CanEncapsulateAsMatrix, ScriptNode Node)
Encapsulates the elements of a vector.
Basic interface for all types of elements.
object AssociatedObjectValue
Associated object value.
Basic interface for vectors.
Basic interface for all types of module elements.
Basic interface for all types of sets.
Interface for objects that can be converted into matrices.
PatternMatchResult
Status result of a pattern matching operation.
SearchMethod
Method to traverse the expression structure