Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
PostIncrement.cs
1using System;
6
8{
13 {
23 {
24 }
25
32 {
33 if (!Variables.TryGetVariable(this.variableName, out Variable v))
34 throw new ScriptRuntimeException("Variable not found: " + this.variableName, this);
35
36 IElement Value = v.ValueElement;
37 IElement Value2;
38
39 if (Value.AssociatedObjectValue is double d)
40 Value2 = new DoubleNumber(d + 1);
41 else
42 Value2 = Pre.PreIncrement.Increment(Value, this);
43
44 Variables[this.variableName] = Value2;
45
46 return Value;
47 }
48
49 }
50}
Class managing a script expression.
Definition: Expression.cs:39
readonly string variableName
Name of variable being referenced by the node.
int Length
Length of expression covered by node.
Definition: ScriptNode.cs:101
int Start
Start position in script expression.
Definition: ScriptNode.cs:92
Post-Increment operator.
PostIncrement(string VariableName, int Start, int Length, Expression Expression)
Post-Increment operator.
override IElement Evaluate(Variables Variables)
Evaluates the node, using the variables provided in the Variables collection.
Contains information about a variable.
Definition: Variable.cs:10
Collection of variables.
Definition: Variables.cs:25
virtual bool TryGetVariable(string Name, out Variable Variable)
Tries to get a variable object, given its name.
Definition: Variables.cs:52
Basic interface for all types of elements.
Definition: IElement.cs:20
object AssociatedObjectValue
Associated object value.
Definition: IElement.cs:33
Definition: PostDecrement.cs:8