Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
StringLeftAddition.cs
6
8{
13 {
18 {
19 }
20
27 {
28 if (Operation.Name != "op_Addition")
29 return Grade.NotAtAll;
30
31 object Left = Operation.Left.AssociatedObjectValue;
32 object Right = Operation.Right.AssociatedObjectValue;
33
34 if (Left is string && !(Right is string))
35 return Grade.Barely;
36 else
37 return Grade.NotAtAll;
38 }
39
47 {
48 string Left = ScriptNode.ToString(Operation.Left) ?? string.Empty;
49 string Right = ScriptNode.ToString(Operation.Right) ?? string.Empty;
50
51 return new StringValue(Left + Right);
52 }
53 }
54}
Base class for all nodes in a parsed script tree.
Definition: ScriptNode.cs:69
override string ToString()
Definition: ScriptNode.cs:359
Grade Supports(IBinaryOperation Operation)
How well the operator supports the given types of operands.
IElement Evaluate(IBinaryOperation Operation, ScriptNode Node)
Evaluates the custom binary operator.
Basic interface for all types of elements.
Definition: IElement.cs:21
object AssociatedObjectValue
Associated object value.
Definition: IElement.cs:34
Grade
Grade enumeration
Definition: Grade.cs:7