Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
PostIncrement.cs
1
using
System;
2
using
Waher.Script.Abstraction.Elements
;
3
using
Waher.Script.Exceptions
;
4
using
Waher.Script.Model
;
5
using
Waher.Script.Objects
;
6
7
namespace
Waher.Script.Operators.Assignments.Post
8
{
12
public
class
PostIncrement
:
ScriptLeafNodeVariableReference
13
{
21
public
PostIncrement
(
string
VariableName
,
int
Start
,
int
Length
,
Expression
Expression
)
22
: base(
VariableName
,
Start
,
Length
,
Expression
)
23
{
24
}
25
31
public
override
IElement
Evaluate
(
Variables
Variables
)
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
}
Waher.Script.Exceptions.ScriptRuntimeException
Script runtime exception.
Definition:
ScriptRuntimeException.cs:10
Waher.Script.Expression
Class managing a script expression.
Definition:
Expression.cs:39
Waher.Script.Model.ScriptLeafNodeVariableReference
Represents a variable reference.
Definition:
ScriptLeafNodeVariableReference.cs:9
Waher.Script.Model.ScriptLeafNodeVariableReference.variableName
readonly string variableName
Name of variable being referenced by the node.
Definition:
ScriptLeafNodeVariableReference.cs:13
Waher.Script.Model.ScriptLeafNodeVariableReference.VariableName
string VariableName
Variable Name.
Definition:
ScriptLeafNodeVariableReference.cs:31
Waher.Script.Model.ScriptNode.Length
int Length
Length of expression covered by node.
Definition:
ScriptNode.cs:101
Waher.Script.Model.ScriptNode.Start
int Start
Start position in script expression.
Definition:
ScriptNode.cs:92
Waher.Script.Objects.DoubleNumber
Double-valued number.
Definition:
DoubleNumber.cs:12
Waher.Script.Operators.Assignments.Post.PostIncrement
Post-Increment operator.
Definition:
PostIncrement.cs:13
Waher.Script.Operators.Assignments.Post.PostIncrement.PostIncrement
PostIncrement(string VariableName, int Start, int Length, Expression Expression)
Post-Increment operator.
Definition:
PostIncrement.cs:21
Waher.Script.Operators.Assignments.Post.PostIncrement.Evaluate
override IElement Evaluate(Variables Variables)
Evaluates the node, using the variables provided in the Variables collection.
Definition:
PostIncrement.cs:31
Waher.Script.Variable
Contains information about a variable.
Definition:
Variable.cs:10
Waher.Script.Variables
Collection of variables.
Definition:
Variables.cs:25
Waher.Script.Variables.TryGetVariable
virtual bool TryGetVariable(string Name, out Variable Variable)
Tries to get a variable object, given its name.
Definition:
Variables.cs:52
Waher.Script.Abstraction.Elements.IElement
Basic interface for all types of elements.
Definition:
IElement.cs:20
Waher.Script.Abstraction.Elements.IElement.AssociatedObjectValue
object AssociatedObjectValue
Associated object value.
Definition:
IElement.cs:33
Waher.Script.Abstraction.Elements
Definition:
AbelianGroupElement.cs:5
Waher.Script.Exceptions
Definition:
ScriptAbortedException.cs:4
Waher.Script.Model
Definition:
BinaryBooleanOperator.cs:8
Waher.Script.Objects
Definition:
BooleanValue.cs:7
Waher.Script.Operators.Assignments.Post
Definition:
PostDecrement.cs:8
IoTGateway
Script
Waher.Script
Operators
Assignments
Post
PostIncrement.cs
Generated by
1.9.5