Package org.intocps.maestro.plugin
Class BasicMaestroExpansionPlugin
- java.lang.Object
-
- org.intocps.maestro.plugin.BasicMaestroExpansionPlugin
-
- All Implemented Interfaces:
IMaestroExpansionPlugin,IMaestroPlugin
public abstract class BasicMaestroExpansionPlugin extends java.lang.Object implements IMaestroExpansionPlugin
Abstract base maestro expansion plugin implementation. All plugins should extend this class to reduce the impact on future changes of the @{linkIMaestroExpansionPlugininterface
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classBasicMaestroExpansionPlugin.FunctionDeclarationBuilder-
Nested classes/interfaces inherited from interface org.intocps.maestro.plugin.IMaestroExpansionPlugin
IMaestroExpansionPlugin.ConfigOption, IMaestroExpansionPlugin.EmptyRuntimeConfig<R>, IMaestroExpansionPlugin.RuntimeConfigAddition<T>
-
-
Field Summary
-
Fields inherited from interface org.intocps.maestro.plugin.IMaestroPlugin
FMI_STATUS_VARIABLE_NAME, GLOBAL_EXECUTION_CONTINUE
-
-
Constructor Summary
Constructors Constructor Description BasicMaestroExpansionPlugin()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<org.intocps.maestro.ast.node.PStm>expand(org.intocps.maestro.ast.AFunctionDeclaration declaredFunction, java.util.List<org.intocps.maestro.ast.node.PExp> formalArguments, IPluginConfiguration config, org.intocps.maestro.framework.core.ISimulationEnvironment env, org.intocps.maestro.core.messages.IErrorReporter errorReporter)Fallback function for raw expansion<R> java.util.Map.Entry<java.util.List<org.intocps.maestro.ast.node.PStm>,IMaestroExpansionPlugin.RuntimeConfigAddition<R>>expandWithRuntimeAddition(org.intocps.maestro.ast.AFunctionDeclaration declaredFunction, java.util.List<org.intocps.maestro.ast.node.PExp> formalArguments, IPluginConfiguration config, org.intocps.maestro.framework.core.ISimulationEnvironment env, org.intocps.maestro.core.messages.IErrorReporter errorReporter)Function to use for building using the raw interface This is search order 2<R> IMaestroExpansionPlugin.RuntimeConfigAddition<R>expandWithRuntimeAddition(org.intocps.maestro.ast.AFunctionDeclaration declaredFunction, org.intocps.maestro.framework.fmi2.api.Fmi2Builder<org.intocps.maestro.ast.node.PStm,org.intocps.maestro.ast.node.ASimulationSpecificationCompilationUnit,org.intocps.maestro.ast.node.PExp,?> builder, java.util.List<org.intocps.maestro.framework.fmi2.api.Fmi2Builder.Variable<org.intocps.maestro.ast.node.PStm,?>> formalArguments, IPluginConfiguration config, org.intocps.maestro.framework.core.ISimulationEnvironment env, org.intocps.maestro.core.messages.IErrorReporter errorReporter)Function to use for building using the builder interface.IMaestroExpansionPlugin.ConfigOptiongetConfigRequirement()Get the configuration requirement for this expansion pluginprotected BasicMaestroExpansionPlugin.FunctionDeclarationBuildergetFunctionDeclarationBuilder(java.lang.String name)protected BasicMaestroExpansionPlugin.FunctionDeclarationBuildergetFunctionDeclarationBuilder(java.lang.String name, org.intocps.maestro.ast.node.PType returnType)IPluginConfigurationparseConfig(java.io.InputStream is)booleanrequireConfig()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.intocps.maestro.plugin.IMaestroExpansionPlugin
getDeclaredImportUnit
-
Methods inherited from interface org.intocps.maestro.plugin.IMaestroPlugin
getName, getVersion
-
-
-
-
Method Detail
-
getFunctionDeclarationBuilder
protected BasicMaestroExpansionPlugin.FunctionDeclarationBuilder getFunctionDeclarationBuilder(java.lang.String name, org.intocps.maestro.ast.node.PType returnType)
-
getFunctionDeclarationBuilder
protected BasicMaestroExpansionPlugin.FunctionDeclarationBuilder getFunctionDeclarationBuilder(java.lang.String name)
-
getConfigRequirement
public IMaestroExpansionPlugin.ConfigOption getConfigRequirement()
Description copied from interface:IMaestroExpansionPluginGet the configuration requirement for this expansion plugin- Specified by:
getConfigRequirementin interfaceIMaestroExpansionPlugin- Returns:
- the requirement
-
requireConfig
public boolean requireConfig()
- Specified by:
requireConfigin interfaceIMaestroExpansionPlugin
-
parseConfig
public IPluginConfiguration parseConfig(java.io.InputStream is) throws java.io.IOException
- Specified by:
parseConfigin interfaceIMaestroExpansionPlugin- Throws:
java.io.IOException
-
expandWithRuntimeAddition
public <R> java.util.Map.Entry<java.util.List<org.intocps.maestro.ast.node.PStm>,IMaestroExpansionPlugin.RuntimeConfigAddition<R>> expandWithRuntimeAddition(org.intocps.maestro.ast.AFunctionDeclaration declaredFunction, java.util.List<org.intocps.maestro.ast.node.PExp> formalArguments, IPluginConfiguration config, org.intocps.maestro.framework.core.ISimulationEnvironment env, org.intocps.maestro.core.messages.IErrorReporter errorReporter) throws ExpandException
Function to use for building using the raw interface This is search order 2- Specified by:
expandWithRuntimeAdditionin interfaceIMaestroExpansionPlugin- Type Parameters:
R- the runtime type- Parameters:
declaredFunction- the function within the plugin that is selected to be expandedformalArguments- the formal arguments given to the expansion. these will match the function signatures formalsconfig- the configuration of null is not requiredenv- the runtime environmenterrorReporter- the error reported that must be used for reporting any errors or warnings- Returns:
- a map entry containing the list of raw entries and a runtime contribution or
IMaestroExpansionPlugin.EmptyRuntimeConfig - Throws:
ExpandException- if expansion fails
-
expand
public java.util.List<org.intocps.maestro.ast.node.PStm> expand(org.intocps.maestro.ast.AFunctionDeclaration declaredFunction, java.util.List<org.intocps.maestro.ast.node.PExp> formalArguments, IPluginConfiguration config, org.intocps.maestro.framework.core.ISimulationEnvironment env, org.intocps.maestro.core.messages.IErrorReporter errorReporter) throws ExpandExceptionFallback function for raw expansion- Specified by:
expandin interfaceIMaestroExpansionPlugin- Parameters:
declaredFunction- the function within the plugin that is selected to be expandedformalArguments- the formal arguments given to the expansion. these will match the function signatures formalsconfig- the configuration of null is not requiredenv- the runtime environmenterrorReporter- the error reported that must be used for reporting any errors or warnings- Returns:
- a list of raw statements
- Throws:
ExpandException- if expansion fails
-
expandWithRuntimeAddition
public <R> IMaestroExpansionPlugin.RuntimeConfigAddition<R> expandWithRuntimeAddition(org.intocps.maestro.ast.AFunctionDeclaration declaredFunction, org.intocps.maestro.framework.fmi2.api.Fmi2Builder<org.intocps.maestro.ast.node.PStm,org.intocps.maestro.ast.node.ASimulationSpecificationCompilationUnit,org.intocps.maestro.ast.node.PExp,?> builder, java.util.List<org.intocps.maestro.framework.fmi2.api.Fmi2Builder.Variable<org.intocps.maestro.ast.node.PStm,?>> formalArguments, IPluginConfiguration config, org.intocps.maestro.framework.core.ISimulationEnvironment env, org.intocps.maestro.core.messages.IErrorReporter errorReporter) throws ExpandException
Function to use for building using the builder interface.
This is search order 1- Specified by:
expandWithRuntimeAdditionin interfaceIMaestroExpansionPlugin- Type Parameters:
R- the runtime type- Parameters:
declaredFunction- the function within the plugin that is selected to be expandedbuilder- the builder object to use for building the outputformalArguments- the formal arguments given to the expansion. these will match the function signatures formalsconfig- the configuration of null is not requiredenv- the runtime environmenterrorReporter- the error reported that must be used for reporting any errors or warnings- Returns:
- either a runtime contribution or
IMaestroExpansionPlugin.EmptyRuntimeConfig - Throws:
ExpandException- if expansion fails
-
-