Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
TryFinally.cs
1using System;
2using System.Threading.Tasks;
5
7{
12 {
21 public TryFinally(ScriptNode Statement, ScriptNode FinallyStatement, int Start, int Length, Expression Expression)
22 : base(Statement, FinallyStatement, Start, Length, Expression)
23 {
24 }
25
32 {
33 try
34 {
35 return this.left.Evaluate(Variables);
36 }
37 finally
38 {
39 this.right.Evaluate(Variables);
40 }
41 }
42
48 public override async Task<IElement> EvaluateAsync(Variables Variables)
49 {
50 if (!this.isAsync)
51 return this.Evaluate(Variables);
52
53 try
54 {
55 return await this.left.EvaluateAsync(Variables);
56 }
57 finally
58 {
59 await this.right.EvaluateAsync(Variables);
60 }
61 }
62 }
63}
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
override IElement Evaluate(Variables Variables)
Evaluates the node, using the variables provided in the Variables collection.
Definition: TryFinally.cs:31
TryFinally(ScriptNode Statement, ScriptNode FinallyStatement, int Start, int Length, Expression Expression)
Try-Finally operator.
Definition: TryFinally.cs:21
override async Task< IElement > EvaluateAsync(Variables Variables)
Evaluates the node, using the variables provided in the Variables collection.
Definition: TryFinally.cs:48
Collection of variables.
Definition: Variables.cs:25
Basic interface for all types of elements.
Definition: IElement.cs:20