Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
Wildcard.cs
1using System.Threading.Tasks;
5
7{
12 {
20 : base(Start, Length, Expression)
21 {
22 }
23
30 {
31 if (Variables is ObjectProperties Properties)
32 return Expression.Encapsulate(Properties.Object);
33 else
34 return ObjectValue.Null;
35 }
36
42 public override Task<IElement> EvaluateAsync(Variables Variables)
43 {
44 return Task.FromResult(this.Evaluate(Variables));
45 }
46
48 public override bool Equals(object obj)
49 {
50 return obj is Wildcard;
51 }
52
54 public override int GetHashCode()
55 {
56 return "*".GetHashCode();
57 }
58
59 #region IIterativeEvaluation
60
64 public bool CanEvaluateIteratively => true;
65
71 {
72 return new WildcardEvaluator(this);
73 }
74
75 #endregion
76 }
77}
Class managing a script expression.
Definition: Expression.cs:41
static IElement Encapsulate(object Value)
Encapsulates an object.
Definition: Expression.cs:5241
Base class for leaf nodes in a parsed script tree.
int Length
Length of expression covered by node.
Definition: ScriptNode.cs:101
int Start
Start position in script expression.
Definition: ScriptNode.cs:92
static readonly ObjectValue Null
Null value.
Definition: ObjectValue.cs:88
Represents the Wildcard symbol *
Definition: Wildcard.cs:12
bool CanEvaluateIteratively
If the node can be evaluated iteratively.
Definition: Wildcard.cs:64
override bool Equals(object obj)
Definition: Wildcard.cs:48
Wildcard(int Start, int Length, Expression Expression)
Represents the Wildcard symbol *
Definition: Wildcard.cs:19
IIterativeEvaluator CreateEvaluator()
Creates an iterative evaluator for the node.
Definition: Wildcard.cs:70
override Task< IElement > EvaluateAsync(Variables Variables)
Evaluates the node, using the variables provided in the Variables collection.
Definition: Wildcard.cs:42
override IElement Evaluate(Variables Variables)
Evaluates the node, using the variables provided in the Variables collection.
Definition: Wildcard.cs:29
Collection of variables.
Definition: Variables.cs:25
Basic interface for all types of elements.
Definition: IElement.cs:21
A function that can be iteratively evaluated, meaning it can be iteratively computed one element at a...
An interative evaluator of a function supporting the IIterativeEvaluation interface.