-
Notifications
You must be signed in to change notification settings - Fork 0
Usage
#Using the executors
The minimum required elements for execution are a:
- Epsilon Executor
- Language Executor
- Script
The Epsilon Executor is responsible for correctly configuring the context by add models, parameters and native delegates, and for the actual execution: parsing the script, execution and retrieving the result. An Epsilon Executor requires the specific Language Executor for the language of the script.
A Language Executor is provided for each Epsilon language (EOL, EVL, ETL, EPL, etc.). Each Language Executor provides additional methods/constructors to provide additional information for the specific language.
The Script is the file or string that contains the code we want to execute.
The Epsilon Executor provides different constructors to create executors with different level of details. The full-fledged constructor is presented next:
public EpsilonExecutor(
EpsilonLanguageExecutor<?> languageExecutor,
Path scriptPath,
String code,
Collection<org.eclipse.epsilon.eol.models.IModel> models,
Map<String,Object> parameters,
Collection<org.eclipse.epsilon.eol.types.IToolNativeTypeDelegate> nativeDelegates,
boolean disposeModels,
boolean profileExecution)
The parameters are:
- languageExecutor: the specific language executor
- scriptPath: the path to the script we want to execute
- code: the code to execute. If both the script and code are given, only the script is used.
- models: the collection of models used in the script
- parameters: external parameters, provided as name:value map
- nativeDelegates: the native delegates required for execution
- disposeModels: flag to indicate if models are disposed after execution
- profileExecution: flag to indicate if the execution should be profiled
Models need to be created before hand using the API of the respective model type, e.g. EMF, CSV, Simulink, etc.
The EOL executor