Package org.eclipse.epsilon.evl
Class EvlModule
- java.lang.Object
-
- 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 java.util.Set<java.lang.String>
CONFIG_PROPERTIES
protected java.util.List<ConstraintContext>
constraintContexts
protected java.util.ArrayList<Constraint>
constraints
protected java.util.ArrayList<ConstraintContext>
declaredConstraintContexts
protected IEvlFixer
fixer
static java.lang.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
compilationContext, 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(java.util.Map<java.lang.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)
java.util.Set<UnsatisfiedConstraint>
execute()
java.util.Set<java.lang.String>
getConfigurationProperties()
Get the set of property names that should be retrieved from the ILaunchConfiguration in order to configure this module.java.util.List<ConstraintContext>
getConstraintContexts()
java.util.List<Constraint>
getConstraints()
IEvlContext
getContext()
java.util.List<ConstraintContext>
getDeclaredConstraintContexts()
java.util.HashMap<java.lang.String,java.lang.Class<?>>
getImportConfiguration()
java.lang.String
getMainRule()
protected java.util.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 java.util.Collection<Constraint>
preProcessConstraintContext(ConstraintContext constraintContext)
protected java.util.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, compile, getCompilationContext, getDeclaredModelDeclarations, getDeclaredOperations, getImports, getImportsByExtension, getMain, getModelDelcarations, 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, 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
getCompilationContext, getDeclaredModelDeclarations, getDeclaredOperations, getImports, getMain, getModelDelcarations, 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
compile, createAst, getSourceUri, parse, parse, parse, parse, parse
-
Methods inherited from interface org.eclipse.epsilon.common.module.ModuleElement
getChildren, getComments, getFile, getModule, getParent, getRegion, getUri, setModule, setParent, setRegion, setUri
-
-
-
-
Field Detail
-
fixer
protected IEvlFixer fixer
-
constraintContexts
protected java.util.List<ConstraintContext> constraintContexts
-
declaredConstraintContexts
protected final java.util.ArrayList<ConstraintContext> declaredConstraintContexts
-
constraints
protected final java.util.ArrayList<Constraint> constraints
-
OPTIMIZE_CONSTRAINTS
public static final java.lang.String OPTIMIZE_CONSTRAINTS
- See Also:
- Constant Field Values
-
CONFIG_PROPERTIES
protected static final java.util.Set<java.lang.String> CONFIG_PROPERTIES
-
-
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 java.lang.String getMainRule()
- Overrides:
getMainRule
in classErlModule
-
adapt
public ModuleElement adapt(AST cst, ModuleElement parentAst)
-
getImportConfiguration
public java.util.HashMap<java.lang.String,java.lang.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 java.util.List<ConstraintContext> getDeclaredConstraintContexts()
- Specified by:
getDeclaredConstraintContexts
in interfaceIEvlModule
-
getConstraintContexts
public java.util.List<ConstraintContext> getConstraintContexts()
- Specified by:
getConstraintContexts
in interfaceIEvlModule
-
getOptimisedConstraintsFor
protected java.util.Collection<Constraint> getOptimisedConstraintsFor(ConstraintContext constraintContext) throws EolRuntimeException
- Parameters:
constraintContext
-- Returns:
- Throws:
EolRuntimeException
- Since:
- 1.6
-
preProcessConstraintContext
protected java.util.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 java.util.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 java.util.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 java.util.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(java.util.Map<java.lang.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 java.util.Set<java.lang.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
-
-