Package org.kigalisim.lang.operation
Class DefineVariableOperation
java.lang.Object
org.kigalisim.lang.operation.DefineVariableOperation
- All Implemented Interfaces:
Operation
Operation that defines a variable and sets its value in the engine.
This operation defines a variable with the specified name and sets its value in the engine.
-
Constructor Summary
ConstructorsConstructorDescriptionDefineVariableOperation(String variableName, Operation valueOperation) Create a new DefineVariableOperation. -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute(PushDownMachine machine) Executes the variable definition operation.
-
Constructor Details
-
DefineVariableOperation
Create a new DefineVariableOperation.- Parameters:
variableName- The name of the variable to define.valueOperation- The operation that calculates the value to set.
-
-
Method Details
-
execute
Executes the variable definition operation.This method executes the value operation to obtain the value, defines the variable if it doesn't exist, and then sets the variable value in the engine.
-