Package org.eclipse.epsilon.eol
Class EolModule
- java.lang.Object
-
- org.eclipse.epsilon.common.module.AbstractModuleElement
-
- org.eclipse.epsilon.eol.AbstractModule
-
- org.eclipse.epsilon.eol.EolModule
-
- All Implemented Interfaces:
IModule
,ModuleElement
,IEolModule
- Direct Known Subclasses:
EglModule
,EolModuleParallel
,ErlModule
,EUnitModule
,EwlModule
,HutnModule
public class EolModule extends AbstractModule implements IEolModule
-
-
Field Summary
Fields Modifier and Type Field Description protected IEolCompilationContext
compilationContext
protected IEolContext
context
protected java.util.List<ModelDeclaration>
declaredModelDeclarations
protected OperationList
declaredOperations
protected java.util.List<Import>
imports
protected StatementBlock
main
protected java.util.Set<ModelDeclaration>
modelDeclarations
protected OperationList
operations
protected java.util.List<Statement>
postOperationStatements
-
Fields inherited from class org.eclipse.epsilon.eol.AbstractModule
parseProblems, parser, sourceFile, sourceUri
-
-
Constructor Summary
Constructors Constructor Description EolModule()
EolModule(IEolContext 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
checkImports(AST cst)
void
clearCache()
Clear all cached results and type information, and all extended properties.java.util.List<ModuleMarker>
compile()
protected org.antlr.runtime.Lexer
createLexer(org.antlr.runtime.ANTLRInputStream inputStream)
EpsilonParser
createParser(org.antlr.runtime.TokenStream tokenStream)
java.lang.Object
execute()
java.lang.Object
executeImpl()
IEolCompilationContext
getCompilationContext()
IEolContext
getContext()
java.util.List<ModelDeclaration>
getDeclaredModelDeclarations()
OperationList
getDeclaredOperations()
protected java.util.HashMap<java.lang.String,java.lang.Class<?>>
getImportConfiguration()
java.util.List<Import>
getImports()
protected java.util.Collection<Import>
getImportsByExtension(AST cst, java.lang.String extension, java.lang.Class<?> moduleImplClass)
StatementBlock
getMain()
java.lang.String
getMainRule()
java.util.Set<ModelDeclaration>
getModelDelcarations()
OperationList
getOperations()
IEolModule
getParentModule()
java.util.List<Statement>
getPostOperationStatements()
protected void
prepareContext()
void
setContext(IEolContext context)
void
setMain(StatementBlock main)
void
setParentModule(IEolModule parent)
java.lang.String
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
configure, getConfigurationProperties, getParseProblems, parse
-
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, getFile, getModule, getParent, getRegion, getUri, setModule, setParent, setRegion, setUri
-
-
-
-
Field Detail
-
main
protected StatementBlock main
-
context
protected IEolContext context
-
postOperationStatements
protected java.util.List<Statement> postOperationStatements
-
declaredOperations
protected OperationList declaredOperations
-
imports
protected java.util.List<Import> imports
-
operations
protected OperationList operations
-
declaredModelDeclarations
protected java.util.List<ModelDeclaration> declaredModelDeclarations
-
modelDeclarations
protected java.util.Set<ModelDeclaration> modelDeclarations
-
compilationContext
protected IEolCompilationContext compilationContext
-
-
Constructor Detail
-
EolModule
public EolModule()
-
EolModule
public EolModule(IEolContext context)
Instantiates the module with the specified execution context.- Parameters:
context
- The execution context- Since:
- 1.6
-
-
Method Detail
-
build
public void build(AST cst, IModule module)
- Specified by:
build
in interfaceModuleElement
- Overrides:
build
in classAbstractModuleElement
-
adapt
public ModuleElement adapt(AST cst, ModuleElement parentAst)
- Specified by:
adapt
in classAbstractModule
-
createLexer
protected org.antlr.runtime.Lexer createLexer(org.antlr.runtime.ANTLRInputStream inputStream)
- Specified by:
createLexer
in classAbstractModule
-
createParser
public EpsilonParser createParser(org.antlr.runtime.TokenStream tokenStream)
- Specified by:
createParser
in classAbstractModule
-
getMainRule
public java.lang.String getMainRule()
- Specified by:
getMainRule
in classAbstractModule
-
getDeclaredOperations
public OperationList getDeclaredOperations()
- Specified by:
getDeclaredOperations
in interfaceIEolModule
-
getImportConfiguration
protected java.util.HashMap<java.lang.String,java.lang.Class<?>> getImportConfiguration()
-
getCompilationContext
public IEolCompilationContext getCompilationContext()
- Specified by:
getCompilationContext
in interfaceIEolModule
-
prepareContext
protected void prepareContext() throws EolRuntimeException
- Throws:
EolRuntimeException
-
getImports
public java.util.List<Import> getImports()
- Specified by:
getImports
in interfaceIEolModule
-
toString
public java.lang.String toString()
- Overrides:
toString
in classAbstractModuleElement
-
getModelDelcarations
public java.util.Set<ModelDeclaration> getModelDelcarations()
- Specified by:
getModelDelcarations
in interfaceIEolModule
-
getOperations
public OperationList getOperations()
- Specified by:
getOperations
in interfaceIEolModule
-
getImportsByExtension
protected java.util.Collection<Import> getImportsByExtension(AST cst, java.lang.String extension, java.lang.Class<?> moduleImplClass)
-
checkImports
protected void checkImports(AST cst)
-
getDeclaredModelDeclarations
public java.util.List<ModelDeclaration> getDeclaredModelDeclarations()
- Specified by:
getDeclaredModelDeclarations
in interfaceIEolModule
-
getParentModule
public IEolModule getParentModule()
- Specified by:
getParentModule
in interfaceIEolModule
-
setParentModule
public void setParentModule(IEolModule parent)
- Specified by:
setParentModule
in interfaceIEolModule
-
execute
public java.lang.Object execute() throws EolRuntimeException
- Specified by:
execute
in interfaceIEolModule
- Throws:
EolRuntimeException
-
executeImpl
public java.lang.Object executeImpl() throws EolRuntimeException
- Throws:
EolRuntimeException
-
compile
public java.util.List<ModuleMarker> compile()
-
getPostOperationStatements
public java.util.List<Statement> getPostOperationStatements()
- Specified by:
getPostOperationStatements
in interfaceIEolModule
-
getMain
public StatementBlock getMain()
- Specified by:
getMain
in interfaceIEolModule
-
setMain
public void setMain(StatementBlock main)
-
getContext
public IEolContext getContext()
- Specified by:
getContext
in interfaceIEolModule
-
setContext
public void setContext(IEolContext context)
- Specified by:
setContext
in interfaceIEolModule
-
clearCache
public void clearCache()
Clear all cached results and type information, and all extended properties. Useful for rerunning the same EolModule with different sets of models, without having to parse it again.
-
-