Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
IdenticalTo.cs
1using System.Threading.Tasks;
5
7{
12 {
22 : base(Left, Right, Start, Length, Expression)
23 {
24 }
25
32 {
33 IElement Left = this.left.Evaluate(Variables);
34 IElement Right = this.right.Evaluate(Variables);
35
36 if (Left.GetType() != Right.GetType())
37 return BooleanValue.False;
38 else if (Left.Equals(Right))
39 return BooleanValue.True;
40 else
41 return BooleanValue.False;
42 }
43
49 public override async Task<IElement> EvaluateAsync(Variables Variables)
50 {
51 if (!this.isAsync)
52 return this.Evaluate(Variables);
53
54 IElement Left = await this.left.EvaluateAsync(Variables);
55 IElement Right = await this.right.EvaluateAsync(Variables);
56
57 if (Left.GetType() != Right.GetType())
58 return BooleanValue.False;
59 else if (Left.Equals(Right))
60 return BooleanValue.True;
61 else
62 return BooleanValue.False;
63 }
64 }
65}
Class managing a script expression.
Definition: Expression.cs:39
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.
Definition: ScriptNode.cs:69
int Length
Length of expression covered by node.
Definition: ScriptNode.cs:101
int Start
Start position in script expression.
Definition: ScriptNode.cs:92
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 ...
Definition: ScriptNode.cs:158
Boolean-valued number.
Definition: BooleanValue.cs:12
static readonly BooleanValue False
Constant false value.
static readonly BooleanValue True
Constant true value.
IdenticalTo(ScriptNode Left, ScriptNode Right, int Start, int Length, Expression Expression)
Identical To.
Definition: IdenticalTo.cs:21
override IElement Evaluate(Variables Variables)
Evaluates the node, using the variables provided in the Variables collection.
Definition: IdenticalTo.cs:31
override async Task< IElement > EvaluateAsync(Variables Variables)
Evaluates the node, using the variables provided in the Variables collection.
Definition: IdenticalTo.cs:49
Collection of variables.
Definition: Variables.cs:25
Basic interface for all types of elements.
Definition: IElement.cs:20