Package de.uni_hildesheim.sse
Class BuildLangModelUtility
java.lang.Object
net.ssehub.easy.dslCore.ModelUtility<ImplementationUnit,net.ssehub.easy.instantiation.core.model.buildlangModel.Script>
de.uni_hildesheim.sse.BuildLangModelUtility
- All Implemented Interfaces:
net.ssehub.easy.basics.modelManagement.IModelLoader<net.ssehub.easy.instantiation.core.model.buildlangModel.Script>
public class BuildLangModelUtility
extends net.ssehub.easy.dslCore.ModelUtility<ImplementationUnit,net.ssehub.easy.instantiation.core.model.buildlangModel.Script>
implements net.ssehub.easy.basics.modelManagement.IModelLoader<net.ssehub.easy.instantiation.core.model.buildlangModel.Script>
Provides language-wide functionality.
- Author:
- Holger Eichelberger
-
Nested Class Summary
Nested classes/interfaces inherited from class net.ssehub.easy.dslCore.ModelUtility
net.ssehub.easy.dslCore.ModelUtility.RuleNested classes/interfaces inherited from interface net.ssehub.easy.basics.modelManagement.IModelLoader
net.ssehub.easy.basics.modelManagement.IModelLoader.IModelInfoHolder<M extends net.ssehub.easy.basics.modelManagement.IModel>, net.ssehub.easy.basics.modelManagement.IModelLoader.LoadResult<M extends net.ssehub.easy.basics.modelManagement.IModel> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BuildLangModelUtilityprivate static final net.ssehub.easy.dslCore.ModelUtility.Rule[]Fields inherited from class net.ssehub.easy.dslCore.ModelUtility
RULE_CONFLICT, RULE_IMPORT, RULE_VERSION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnet.ssehub.easy.dslCore.TranslationResult<net.ssehub.easy.instantiation.core.model.buildlangModel.Script> createBuildModel(ImplementationUnit root, URI uri, boolean registerSuccessful) Create the build language model from an EMF implementation unit.net.ssehub.easy.instantiation.core.model.expressions.ExpressioncreateExpression(String text, net.ssehub.easy.instantiation.core.model.buildlangModel.Resolver resolver, StringBuilder warnings) Parsestextinto an expression.net.ssehub.easy.instantiation.core.model.expressions.ExpressioncreateExpression(String text, net.ssehub.easy.instantiation.core.model.expressions.IRuntimeEnvironment environment) net.ssehub.easy.basics.modelManagement.ModelInfo<net.ssehub.easy.instantiation.core.model.buildlangModel.Script> protected ClassLoaderprotected Stringprotected voidInitializes instances which depend onModelUtility.resourceInitializer.List<net.ssehub.easy.basics.modelManagement.ModelInfo<net.ssehub.easy.instantiation.core.model.buildlangModel.Script>> obtainInfo(org.eclipse.emf.common.util.URI uri) Obtains model information.net.ssehub.easy.dslCore.TranslationResult<net.ssehub.easy.instantiation.core.model.buildlangModel.Script> parse(org.eclipse.emf.common.util.URI uri, net.ssehub.easy.basics.modelManagement.ImportResolver<net.ssehub.easy.instantiation.core.model.buildlangModel.Script> resolver) parseImplementationUnit(org.eclipse.emf.common.util.URI uri, net.ssehub.easy.dslCore.translation.MessageReceiver receiver, net.ssehub.easy.dslCore.ModelUtility.Rule... rules) Parses anurito obtain a.invalid reference
VariabilityUnitvoidprint(net.ssehub.easy.dslCore.TranslationResult<net.ssehub.easy.instantiation.core.model.buildlangModel.Script> result, Writer out, boolean emitComments, boolean emitImports) Prints the model stored in the result to the console output stream (for debugging / testing).Methods inherited from class net.ssehub.easy.dslCore.ModelUtility
append, appendWithNewLine, createInputStream, cutLeadin, cutLeadin, forceUnloadOnParse, getGrammar, getInfo, getInjector, getResourceInitializer, getResourceSet, handles, instances, load, main, obtainInfo, parse, parse, parse, parse, parseFragment, parseFragment, scan, setInjector, setResourceInitializer, toNetUri, validateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.ssehub.easy.basics.modelManagement.IModelLoader
load, scan
-
Field Details
-
INSTANCE
-
LEADIN_RULES
private static final net.ssehub.easy.dslCore.ModelUtility.Rule[] LEADIN_RULES
-
-
Constructor Details
-
BuildLangModelUtility
private BuildLangModelUtility()Prevents external creation.
-
-
Method Details
-
createBuildModel
public net.ssehub.easy.dslCore.TranslationResult<net.ssehub.easy.instantiation.core.model.buildlangModel.Script> createBuildModel(ImplementationUnit root, URI uri, boolean registerSuccessful) Create the build language model from an EMF implementation unit.- Parameters:
root- the root-level build unituri- the URI of the project to resolve (in order to find the closest project, may be null)registerSuccessful- successfully created models shall be registered- Returns:
- the created variability model including messages
-
initializeAfterResourceInitializer
protected void initializeAfterResourceInitializer()Initializes instances which depend onModelUtility.resourceInitializer.- Specified by:
initializeAfterResourceInitializerin classnet.ssehub.easy.dslCore.ModelUtility<ImplementationUnit,net.ssehub.easy.instantiation.core.model.buildlangModel.Script>
-
parse
public net.ssehub.easy.dslCore.TranslationResult<net.ssehub.easy.instantiation.core.model.buildlangModel.Script> parse(org.eclipse.emf.common.util.URI uri, net.ssehub.easy.basics.modelManagement.ImportResolver<net.ssehub.easy.instantiation.core.model.buildlangModel.Script> resolver) throws IOException - Specified by:
parsein classnet.ssehub.easy.dslCore.ModelUtility<ImplementationUnit,net.ssehub.easy.instantiation.core.model.buildlangModel.Script> - Throws:
IOException
-
print
public void print(net.ssehub.easy.dslCore.TranslationResult<net.ssehub.easy.instantiation.core.model.buildlangModel.Script> result, Writer out, boolean emitComments, boolean emitImports) Prints the model stored in the result to the console output stream (for debugging / testing).- Parameters:
result- the result instanceout- the output writeremitComments- whether comments shall be emittedemitImports- whether imports shall be emitted
-
getLanguageName
- Specified by:
getLanguageNamein classnet.ssehub.easy.dslCore.ModelUtility<ImplementationUnit,net.ssehub.easy.instantiation.core.model.buildlangModel.Script>
-
getLanguageClassLoader
- Specified by:
getLanguageClassLoaderin classnet.ssehub.easy.dslCore.ModelUtility<ImplementationUnit,net.ssehub.easy.instantiation.core.model.buildlangModel.Script>
-
createExpression
public net.ssehub.easy.instantiation.core.model.expressions.Expression createExpression(String text, net.ssehub.easy.instantiation.core.model.buildlangModel.Resolver resolver, StringBuilder warnings) throws net.ssehub.easy.instantiation.core.model.common.VilException Parsestextinto an expression.- Parameters:
text- the text to be parsedenvironment- the runtime environment for resolving variablesan- optional buffer to collect warnings- Returns:
- the resulting expression
- Throws:
net.ssehub.easy.instantiation.core.model.common.VilException- in case that parsing fails
-
createExpression
public net.ssehub.easy.instantiation.core.model.expressions.Expression createExpression(String text, net.ssehub.easy.instantiation.core.model.expressions.IRuntimeEnvironment environment) throws net.ssehub.easy.instantiation.core.model.common.VilException - Throws:
net.ssehub.easy.instantiation.core.model.common.VilException
-
getExtension
- Specified by:
getExtensionin classnet.ssehub.easy.dslCore.ModelUtility<ImplementationUnit,net.ssehub.easy.instantiation.core.model.buildlangModel.Script>
-
parseImplementationUnit
public ImplementationUnit parseImplementationUnit(org.eclipse.emf.common.util.URI uri, net.ssehub.easy.dslCore.translation.MessageReceiver receiver, net.ssehub.easy.dslCore.ModelUtility.Rule... rules) throws IOException Parses anurito obtain a. Cuts the firstinvalid reference
VariabilityUnitrulesif given, else parses the entire text.- Parameters:
uri- the URI to readreceiver- the message receiver used for storing messages (may be null)rules- optional rules for cutting the header of the contents, removing the remainder for performance- Returns:
- the variability unit (or null if not found)
- Throws:
IOException- in case of any I/O and parsing problems- See Also:
-
obtainInfo
public List<net.ssehub.easy.basics.modelManagement.ModelInfo<net.ssehub.easy.instantiation.core.model.buildlangModel.Script>> obtainInfo(org.eclipse.emf.common.util.URI uri) throws IOException Obtains model information.- Specified by:
obtainInfoin classnet.ssehub.easy.dslCore.ModelUtility<ImplementationUnit,net.ssehub.easy.instantiation.core.model.buildlangModel.Script> - Parameters:
uri- the URI to read the info from- Returns:
- the project info instances related to
uri - Throws:
IOException- in case that an I/O error happens during parsing
-
getInfo
public net.ssehub.easy.basics.modelManagement.ModelInfo<net.ssehub.easy.instantiation.core.model.buildlangModel.Script> getInfo(URI uri) - Specified by:
getInfoin classnet.ssehub.easy.dslCore.ModelUtility<ImplementationUnit,net.ssehub.easy.instantiation.core.model.buildlangModel.Script>
-