2using System.Threading.Tasks;
14 private bool? bothBool =
null;
37 bool ScalarDirectly =
false;
43 catch (Exception exLeft)
46 ScalarDirectly =
true;
54 if (this.bothBool.HasValue &&
this.bothBool.Value && !(BL is
null))
56 bool LValue = BL.
Value;
58 if (!(Result is
null))
65 catch (Exception exRight)
68 ScalarDirectly =
true;
76 this.bothBool =
false;
84 catch (Exception exRight)
87 ScalarDirectly =
true;
92 if (!(BL is
null) && !(BR is
null))
94 if (!this.bothBool.HasValue)
101 this.bothBool =
false;
132 catch (Exception exLeft)
142 if (this.bothBool.HasValue &&
this.bothBool.Value && !(BL is
null))
144 bool LValue = BL.
Value;
146 if (!(Result is
null))
153 catch (Exception exRight)
163 this.bothBool =
false;
171 catch (Exception exRight)
178 if (!(BL is
null) && !(BR is
null))
180 if (!this.bothBool.HasValue)
181 this.bothBool =
true;
187 this.bothBool =
false;
207 return this.
Evaluate(exLeft, exRight);
358 return Task.FromResult(this.
Evaluate(Left, Right));
369 return Task.FromResult(this.
Evaluate(Left, Right));
380 return Task.FromResult(this.
Evaluate(Left, Right));
389 public virtual Task<IElement>
EvaluateAsync(Exception Left, Exception Right)
391 return Task.FromResult(this.
Evaluate(Left, Right));
Script runtime exception.
Class managing a script expression.
static bool TryConvert(object Value, Type DesiredType, out object Result)
Tries to convert an object Value to an object of type DesiredType .
Base class for binary boolean operators.
virtual Task< IElement > EvaluateAsync(Exception Left, bool Right)
Evaluates the boolean operator.
abstract IElement Evaluate(bool Left, Exception Right)
Evaluates the boolean operator.
virtual Task< IElement > EvaluateOptimizedResultAsync(bool Left)
Gives the operator a chance to optimize its execution if it knows the value of the left operand....
abstract IElement Evaluate(bool Left, bool Right)
Evaluates the boolean operator.
BinaryBooleanOperator(ScriptNode Left, ScriptNode Right, int Start, int Length, Expression Expression)
Base class for binary boolean operators.
override IElement EvaluateScalar(IElement Left, IElement Right, Variables Variables)
Evaluates the operator on scalar operands.
abstract IElement EvaluateOptimizedResult(bool Left)
Gives the operator a chance to optimize its execution if it knows the value of the left operand....
virtual Task< IElement > EvaluateAsync(bool Left, bool Right)
Evaluates the boolean operator.
virtual Task< IElement > EvaluateAsync(bool Left, Exception Right)
Evaluates the boolean operator.
override IElement Evaluate(Variables Variables)
Evaluates the node, using the variables provided in the Variables collection.
virtual Task< IElement > EvaluateAsync(Exception Left, Exception Right)
Evaluates the boolean operator.
override async Task< IElement > EvaluateAsync(Variables Variables)
Evaluates the node, using the variables provided in the Variables collection.
abstract IElement Evaluate(Exception Left, bool Right)
Evaluates the boolean operator.
abstract IElement Evaluate(Exception Left, Exception Right)
Evaluates the boolean operator.
override async Task< IElement > EvaluateScalarAsync(IElement Left, IElement Right, Variables Variables)
Evaluates the operator on scalar operands.
ScriptNode right
Right operand.
ScriptNode left
Left operand.
bool isAsync
If subtree is asynchroneous.
Base class for binary scalar operators.
Base class for all nodes in a parsed script tree.
int Length
Length of expression covered by node.
int Start
Start position in script expression.
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 ...
Basic interface for all types of elements.
object AssociatedObjectValue
Associated object value.