Package org.openl.rules.tbasic.runtime
Class TBasicVM
- java.lang.Object
-
- org.openl.rules.tbasic.runtime.TBasicVM
-
public class TBasicVM extends Object
TheTBasicVMclass executes Algorithm logic. Besides execution of operations list, the class provides logic to support GOTO to main method and errors processing.
-
-
Constructor Summary
Constructors Constructor Description TBasicVM(IOpenClass tbasicType, List<RuntimeOperation> operations, Map<String,RuntimeOperation> labels)Create an instance ofTBasicVMinitialized with main Algorithm method operations and labels register.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectrun(List<RuntimeOperation> methodSteps, Map<String,RuntimeOperation> methodLabels, TBasicContextHolderEnv environment)Run sub-method of Algorithm.Objectrun(TBasicContextHolderEnv environment)Run the method of Algorithm.
-
-
-
Constructor Detail
-
TBasicVM
public TBasicVM(IOpenClass tbasicType, List<RuntimeOperation> operations, Map<String,RuntimeOperation> labels)
Create an instance ofTBasicVMinitialized with main Algorithm method operations and labels register.- Parameters:
operations-labels-
-
-
Method Detail
-
run
public Object run(List<RuntimeOperation> methodSteps, Map<String,RuntimeOperation> methodLabels, TBasicContextHolderEnv environment)
Run sub-method of Algorithm.TBasicVMinstance will execute the provided operations list.
The sub-method can be called only within of execution of main Algorithm method. However, the implementation does not put any restrictions.- Parameters:
methodSteps- The list of operations to run.methodLabels- The labels register for sub-method.environment- The environment for execution.- Returns:
- The result of the method execution.
-
run
public Object run(TBasicContextHolderEnv environment)
Run the method of Algorithm.TBasicVMinstance will run operations which are considered in current context.
Method also implements logic to handle all errors by user defined handling method.
Method should be called only for main Algorithm method, all sub methods should be run usingrun(List, Map, TBasicContextHolderEnv).- Parameters:
environment- The environment for execution.- Returns:
- The result of the method execution.
-
-