Package org.eclipse.epsilon.evl
Class EvlModule
-
- All Implemented Interfaces:
IModule
,ModuleElement
,IEolModule
,IErlModule
,IEvlModule
- Direct Known Subclasses:
EvlModuleParallel
public class EvlModule extends ErlModule implements IEvlModule
-
-
Field Summary
Fields Modifier and Type Field Description protected static Set<String>
CONFIG_PROPERTIES
protected List<ConstraintContext>
constraintContexts
protected ArrayList<Constraint>
constraints
protected ArrayList<ConstraintContext>
declaredConstraintContexts
protected IEvlFixer
fixer
static String
OPTIMIZE_CONSTRAINTS
-
Fields inherited from class org.eclipse.epsilon.erl.ErlModule
declaredPost, declaredPre, post, pre
-
Fields inherited from class org.eclipse.epsilon.eol.EolModule
context, declaredModelDeclarations, declaredOperations, imports, main, modelDeclarations, operations, postOperationStatements
-
Fields inherited from class org.eclipse.epsilon.eol.AbstractModule
parseProblems, parser, sourceFile, sourceUri
-
-
Constructor Summary
Constructors Constructor Description EvlModule()
EvlModule(IEvlContext context)
Instantiates the module with the specified execution context.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ModuleElement
adapt(AST cst, ModuleElement parentAst)
void
build(AST cst, IModule module)
protected void
checkConstraints()
Invokes the execute() method on all Constraints in all ConstraintContexts.void
configure(Map<String,?> properties)
Configure the IEolModule with the given propertiesprotected org.antlr.runtime.Lexer
createLexer(org.antlr.runtime.ANTLRInputStream inputStream)
EpsilonParser
createParser(org.antlr.runtime.TokenStream tokenStream)
Set<UnsatisfiedConstraint>
execute()
Set<String>
getConfigurationProperties()
Get the set of property names that should be retrieved from the ILaunchConfiguration in order to configure this module.List<ConstraintContext>
getConstraintContexts()
List<Constraint>
getConstraints()
IEvlContext
getContext()
List<ConstraintContext>
getDeclaredConstraintContexts()
HashMap<String,Class<?>>
getImportConfiguration()
String
getMainRule()
protected Collection<Constraint>
getOptimisedConstraintsFor(ConstraintContext constraintContext)
IEvlFixer
getUnsatisfiedConstraintFixer()
boolean
isOptimizeConstraints()
Checks if is optimize constraints.void
postExecution()
Clean up, execute fixes and post block.protected void
prepareContext()
protected Collection<Constraint>
preProcessConstraintContext(ConstraintContext constraintContext)
protected Set<UnsatisfiedConstraint>
processRules()
Main rule processing logic.void
setOptimizeConstraints(boolean optimizeConstraints)
Sets the optimize constraints.void
setUnsatisfiedConstraintFixer(IEvlFixer fixer)
-
Methods inherited from class org.eclipse.epsilon.erl.ErlModule
calculateSuperRules, execute, execute, executeImpl, getDeclaredPost, getDeclaredPre, getPost, getPre, prepareExecution
-
Methods inherited from class org.eclipse.epsilon.eol.EolModule
checkImports, clearCache, getDeclaredModelDeclarations, getDeclaredOperations, getImports, getImportsByExtension, getMain, getModelDeclarations, getOperations, getParentModule, getPostOperationStatements, setContext, setMain, setParentModule, toString
-
Methods inherited from class org.eclipse.epsilon.eol.AbstractModule
assignAnnotations, assignComment, assignComments, createAst, extractComments, getParseProblems, getSourceFile, getSourceUri, invokeMainRule, parse, parse
-
Methods inherited from class org.eclipse.epsilon.common.module.AbstractModuleElement
equals, getChildren, getComments, getData, getDebugInfo, getFile, getModule, getParent, getRegion, getUri, hashCode, setModule, setParent, setRegion, setUri
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.epsilon.eol.IEolModule
getDeclaredModelDeclarations, getDeclaredOperations, getImports, getMain, getModelDeclarations, getOperations, getParentModule, getParseProblems, getPostOperationStatements, parse, setContext, setParentModule
-
Methods inherited from interface org.eclipse.epsilon.erl.IErlModule
getDeclaredPost, getDeclaredPre, getPost, getPre
-
Methods inherited from interface org.eclipse.epsilon.evl.IEvlModule
getConstraint, getConstraintContext
-
Methods inherited from interface org.eclipse.epsilon.common.module.IModule
createAst, getSourceUri, parse, parse, parse, parse, parse
-
Methods inherited from interface org.eclipse.epsilon.common.module.ModuleElement
getChildren, getComments, getData, getFile, getModule, getParent, getRegion, getUri, setModule, setParent, setRegion, setUri
-
-
-
-
Field Detail
-
fixer
protected IEvlFixer fixer
-
constraintContexts
protected List<ConstraintContext> constraintContexts
-
declaredConstraintContexts
protected final ArrayList<ConstraintContext> declaredConstraintContexts
-
constraints
protected final ArrayList<Constraint> constraints
-
OPTIMIZE_CONSTRAINTS
public static final String OPTIMIZE_CONSTRAINTS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
EvlModule
public EvlModule()
-
EvlModule
public EvlModule(IEvlContext context)
Instantiates the module with the specified execution context.- Parameters:
context
- The execution context- Since:
- 1.6
-
-
Method Detail
-
createLexer
protected org.antlr.runtime.Lexer createLexer(org.antlr.runtime.ANTLRInputStream inputStream)
- Overrides:
createLexer
in classErlModule
-
createParser
public EpsilonParser createParser(org.antlr.runtime.TokenStream tokenStream)
- Overrides:
createParser
in classErlModule
-
getMainRule
public String getMainRule()
- Overrides:
getMainRule
in classErlModule
-
adapt
public ModuleElement adapt(AST cst, ModuleElement parentAst)
-
getImportConfiguration
public HashMap<String,Class<?>> getImportConfiguration()
- Overrides:
getImportConfiguration
in classErlModule
-
build
public void build(AST cst, IModule module)
- Specified by:
build
in interfaceModuleElement
- Overrides:
build
in classErlModule
-
getDeclaredConstraintContexts
public List<ConstraintContext> getDeclaredConstraintContexts()
- Specified by:
getDeclaredConstraintContexts
in interfaceIEvlModule
-
getConstraintContexts
public List<ConstraintContext> getConstraintContexts()
- Specified by:
getConstraintContexts
in interfaceIEvlModule
-
getOptimisedConstraintsFor
protected Collection<Constraint> getOptimisedConstraintsFor(ConstraintContext constraintContext) throws EolRuntimeException
- Parameters:
constraintContext
-- Returns:
- Throws:
EolRuntimeException
- Since:
- 1.6
-
preProcessConstraintContext
protected Collection<Constraint> preProcessConstraintContext(ConstraintContext constraintContext) throws EolRuntimeException
- Parameters:
constraintContext
-- Returns:
- Throws:
EolRuntimeException
- Since:
- 1.6
-
prepareContext
protected void prepareContext() throws EolRuntimeException
- Overrides:
prepareContext
in classEolModule
- Throws:
EolRuntimeException
-
processRules
protected Set<UnsatisfiedConstraint> processRules() throws EolRuntimeException
Description copied from class:ErlModule
Main rule processing logic. Non-abstract for compatibility.- Overrides:
processRules
in classErlModule
- Returns:
- The result of executing this module.
- Throws:
EolRuntimeException
-
checkConstraints
protected void checkConstraints() throws EolRuntimeException
Invokes the execute() method on all Constraints in all ConstraintContexts. If optimizeConstraints, the constraints to be checked are filtered.- Throws:
EolRuntimeException
- Since:
- 1.6
-
postExecution
public void postExecution() throws EolRuntimeException
Clean up, execute fixes and post block.- Overrides:
postExecution
in classErlModule
- Throws:
EolRuntimeException
- Since:
- 1.6
-
execute
public Set<UnsatisfiedConstraint> execute() throws EolRuntimeException
- Specified by:
execute
in interfaceIEolModule
- Specified by:
execute
in interfaceIEvlModule
- Overrides:
execute
in classEolModule
- Throws:
EolRuntimeException
- Since:
- 1.6
-
getContext
public IEvlContext getContext()
- Specified by:
getContext
in interfaceIEolModule
- Specified by:
getContext
in interfaceIErlModule
- Specified by:
getContext
in interfaceIEvlModule
- Overrides:
getContext
in classErlModule
-
getConstraints
public List<Constraint> getConstraints()
- Specified by:
getConstraints
in interfaceIEvlModule
-
setUnsatisfiedConstraintFixer
public void setUnsatisfiedConstraintFixer(IEvlFixer fixer)
- Specified by:
setUnsatisfiedConstraintFixer
in interfaceIEvlModule
-
getUnsatisfiedConstraintFixer
public IEvlFixer getUnsatisfiedConstraintFixer()
- Specified by:
getUnsatisfiedConstraintFixer
in interfaceIEvlModule
-
isOptimizeConstraints
public boolean isOptimizeConstraints()
Checks if is optimize constraints.- Returns:
- true, if is optimize constraints
-
setOptimizeConstraints
public void setOptimizeConstraints(boolean optimizeConstraints)
Sets the optimize constraints.- Parameters:
optimizeConstraints
- the new optimize constraints
-
configure
public void configure(Map<String,?> properties)
Description copied from interface:IEolModule
Configure the IEolModule with the given properties- Specified by:
configure
in interfaceIEolModule
- Parameters:
properties
- a map of property:value- Since:
- 1.6
-
getConfigurationProperties
public Set<String> getConfigurationProperties()
Description copied from interface:IEolModule
Get the set of property names that should be retrieved from the ILaunchConfiguration in order to configure this module.- Specified by:
getConfigurationProperties
in interfaceIEolModule
- Returns:
- Since:
- 1.6
-
-