Package org.eclipse.epsilon.hutn
Class HutnModule
java.lang.Object
org.eclipse.epsilon.common.module.AbstractModuleElement
org.eclipse.epsilon.eol.AbstractModule
org.eclipse.epsilon.eol.EolModule
org.eclipse.epsilon.hutn.HutnModule
- All Implemented Interfaces:
IModule,ModuleElement,IEolModule,IHutnModule
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Fileprotected HutnDocumentprotected booleanprotected booleanprotected SpecFields inherited from class org.eclipse.epsilon.eol.EolModule
context, declaredModelDeclarations, declaredOperations, imports, main, modelDeclarations, operations, postOperationStatementsFields inherited from class org.eclipse.epsilon.eol.AbstractModule
parseProblems, parser, sourceFile, sourceUri -
Constructor Summary
ConstructorsConstructorDescriptionHutnModule(IHutnContext context) Instantiates the module with the specified execution context. -
Method Summary
Modifier and TypeMethodDescriptionadapt(AST cst, ModuleElement parentAst) voidprotected org.antlr.runtime.LexercreateLexer(org.antlr.runtime.ANTLRInputStream inputStream) createParser(org.antlr.runtime.TokenStream tokenStream) booleanReturns false only if the HUTN source passed to parse is not valid HUTN.booleanprotected booleaninvokeMainRule(List<org.antlr.runtime.CommonToken> comments) protected booleanvoidsetConfigFileDirectory(File configFileDirectory) storeEmfModel(File baseDirectory, String defaultModelPath, String inferredMetamodelPath) Generates an EMF model for the HUTN source passed to parse.voidstoreIntermediateModel(File destination) voidstoreIntermediateModelTransformation(File destination) voidprotected voidtranslateAst(AST ast) Methods inherited from class org.eclipse.epsilon.eol.EolModule
clearCache, createDebugger, execute, executeImpl, getDeclaredModelDeclarations, getDeclaredOperations, getImportConfiguration, getImportManager, getImports, getMain, getModelDeclarations, getOperations, getParentModule, getPostOperationStatements, loadImports, prepareContext, setContext, setImportManager, setMain, setParentModule, toStringMethods inherited from class org.eclipse.epsilon.eol.AbstractModule
assignAnnotations, assignComment, assignComments, createAst, extractComments, getParseProblems, getSourceFile, getSourceUri, parse, parseMethods inherited from class org.eclipse.epsilon.common.module.AbstractModuleElement
equals, getChildren, getComments, getData, getDebugInfo, getFile, getModule, getParent, getRegion, getUri, hashCode, setModule, setParent, setRegion, setUriMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.epsilon.eol.IEolModule
configure, getConfigurationProperties, getParseProblems, parseMethods inherited from interface org.eclipse.epsilon.common.module.IModule
createAst, getSourceUri, parse, parse, parse, parse, parseMethods inherited from interface org.eclipse.epsilon.common.module.ModuleElement
getChildren, getComments, getData, getFile, getModule, getParent, getRegion, getUri, setModule, setParent, setRegion, setUri
-
Field Details
-
document
-
spec
-
metaModelIsValid
protected boolean metaModelIsValid -
configFileDirectory
-
hutnIsValid
protected boolean hutnIsValid
-
-
Constructor Details
-
HutnModule
public HutnModule() -
HutnModule
Instantiates the module with the specified execution context.- Parameters:
context- The execution context- Since:
- 1.6
-
-
Method Details
-
createLexer
protected org.antlr.runtime.Lexer createLexer(org.antlr.runtime.ANTLRInputStream inputStream) - Overrides:
createLexerin classEolModule
-
createParser
- Overrides:
createParserin classEolModule
-
adapt
-
getMainRule
- Overrides:
getMainRulein classEolModule
-
getContext
- Specified by:
getContextin interfaceIEolModule- Overrides:
getContextin classEolModule
-
invokeMainRule
- Overrides:
invokeMainRulein classAbstractModule- Throws:
Exception
-
parsingWasSuccessful
protected boolean parsingWasSuccessful() -
build
- Specified by:
buildin interfaceModuleElement- Overrides:
buildin classEolModule
-
translateAst
- Throws:
HutnException
-
hasValidHutn
public boolean hasValidHutn()Description copied from interface:IHutnModuleReturns false only if the HUTN source passed to parse is not valid HUTN. True is returned when the HUTN is valid, regardless of whether it conforms to the metamodel specified in the preamble.- Specified by:
hasValidHutnin interfaceIHutnModule
-
setConfigFileDirectory
- Specified by:
setConfigFileDirectoryin interfaceIHutnModule
-
hasValidMetaModel
public boolean hasValidMetaModel()- Specified by:
hasValidMetaModelin interfaceIHutnModule
-
getNsUris
- Specified by:
getNsUrisin interfaceIHutnModule
-
getModelFile
- Specified by:
getModelFilein interfaceIHutnModule
-
generateEmfModel
- Specified by:
generateEmfModelin interfaceIHutnModule- Returns:
- an in-memory EMF model for the HUTN source passed to parse.
- Throws:
HutnGenerationException
-
storeEmfModel
public List<File> storeEmfModel(File baseDirectory, String defaultModelPath, String inferredMetamodelPath) throws HutnGenerationException Description copied from interface:IHutnModuleGenerates an EMF model for the HUTN source passed to parse.
The model is stored in the given baseDirectory, with filename defaultModelPath. The HUTN source may contain a modelFile attribute (in a model package, in the Spec preamble). When a modelFile attribute is specified in the HUTN source, that value takes precedence over defaultModelPath.
When a metamodel is inferred (because no metamodel is specfied in the Spec preamble), it is generated in the given baseDirectory, with filename inferredMetamodelPath.
- Specified by:
storeEmfModelin interfaceIHutnModule- Returns:
- the list of Files generated by this method invocation.
- Throws:
HutnGenerationException
-
getIntermediateModel
- Specified by:
getIntermediateModelin interfaceIHutnModule
-
storeIntermediateModel
- Specified by:
storeIntermediateModelin interfaceIHutnModule
-
storeIntermediateModelTransformation
- Specified by:
storeIntermediateModelTransformationin interfaceIHutnModule- Throws:
HutnGenerationException
-
storeIntermediateModelTransformationForAllInputModels
public void storeIntermediateModelTransformationForAllInputModels(File destination) throws HutnGenerationException - Specified by:
storeIntermediateModelTransformationForAllInputModelsin interfaceIHutnModule- Throws:
HutnGenerationException
-