Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
Implication.cs
1using System;
2using System.Runtime.ExceptionServices;
6
8{
13 {
23 : base(Left, Right, Start, Length, Expression)
24 {
25 }
26
33 public override IElement EvaluateOptimizedResult(bool Left)
34 {
35 if (!Left)
36 return BooleanValue.True;
37 else
38 return null;
39 }
40
47 public override IElement Evaluate(bool Left, bool Right)
48 {
49 if (!Left || Right)
50 return BooleanValue.True;
51 else
52 return BooleanValue.False;
53 }
54
61 public override IElement Evaluate(Exception Left, bool Right)
62 {
63 ExceptionDispatchInfo.Capture(Left).Throw();
64 return ObjectValue.Null;
65 }
66
73 public override IElement Evaluate(bool Left, Exception Right)
74 {
75 ExceptionDispatchInfo.Capture(Right).Throw();
76 return ObjectValue.Null;
77 }
78
85 public override IElement Evaluate(Exception Left, Exception Right)
86 {
87 ExceptionDispatchInfo.Capture(Left).Throw();
88 return ObjectValue.Null;
89 }
90
91 }
92}
Class managing a script expression.
Definition: Expression.cs:39
Base class for binary boolean operators.
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
Boolean-valued number.
Definition: BooleanValue.cs:12
static readonly BooleanValue False
Constant false value.
static readonly BooleanValue True
Constant true value.
static readonly ObjectValue Null
Null value.
Definition: ObjectValue.cs:86
override IElement Evaluate(bool Left, Exception Right)
Evaluates the boolean operator.
Definition: Implication.cs:73
override IElement EvaluateOptimizedResult(bool Left)
Gives the operator a chance to optimize its execution if it knows the value of the left operand....
Definition: Implication.cs:33
override IElement Evaluate(Exception Left, Exception Right)
Evaluates the boolean operator.
Definition: Implication.cs:85
Implication(ScriptNode Left, ScriptNode Right, int Start, int Length, Expression Expression)
Implication.
Definition: Implication.cs:22
override IElement Evaluate(bool Left, bool Right)
Evaluates the boolean operator.
Definition: Implication.cs:47
override IElement Evaluate(Exception Left, bool Right)
Evaluates the boolean operator.
Definition: Implication.cs:61
Basic interface for all types of elements.
Definition: IElement.cs:20