Class AbstractModelTranslator.RuleTranslator
java.lang.Object
AbstractModelTranslator<M,L>.de.uni_hildesheim.sse.buildLanguageTranslation.AbstractModelTranslator.AbstractRuleTranslator<RuleDeclaration,net.ssehub.easy.instantiation.core.model.buildlangModel.Rule>
de.uni_hildesheim.sse.buildLanguageTranslation.AbstractModelTranslator.RuleTranslator
- Enclosing class:
AbstractModelTranslator<M extends net.ssehub.easy.instantiation.core.model.buildlangModel.Script,L extends LanguageUnit>
protected class AbstractModelTranslator.RuleTranslator
extends AbstractModelTranslator<M,L>.AbstractRuleTranslator<RuleDeclaration,net.ssehub.easy.instantiation.core.model.buildlangModel.Rule>
Implements a translator for VIL rules.
- Author:
- Holger Eichelberger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidAdds the given rule to theprotected net.ssehub.easy.instantiation.core.model.buildlangModel.RulecreateRule(RuleDeclaration ruleDecl, net.ssehub.easy.instantiation.core.model.vilTypes.TypeDescriptor<?> returnType, net.ssehub.easy.instantiation.core.model.buildlangModel.VariableDeclaration[] params, M parent) Creates a specific rule from the given declaration, parameters and parent.protected RuleElementBlockgetBlock(RuleDeclaration ruleDecl) Returns the actual rule block.protected StringReturns the display name of the language concept being processed.protected org.eclipse.emf.ecore.EStructuralFeatureReturns the name literal.protected de.uni_hildesheim.sse.vil.expressions.expressionDsl.ParameterListgetParameterList(RuleDeclaration ruleDecl) Returns the actual parameter list.protected net.ssehub.easy.instantiation.core.model.vilTypes.TypeDescriptor<?> getReturnType(RuleDeclaration ruleDecl, net.ssehub.easy.instantiation.core.model.buildlangModel.Resolver resolver) Returns the result type of the givenruleDecl.protected RuleConditionsgetRuleConditions(RuleDeclaration ruleDecl) Returns the actual rule conditions.Methods inherited from class de.uni_hildesheim.sse.buildLanguageTranslation.AbstractModelTranslator.AbstractRuleTranslator
getPostconditionLiteral, getPreconditionLiteral, processAdditionalRuleBodyElements, processRule, processRules
-
Constructor Details
-
RuleTranslator
protected RuleTranslator()Creates the translator.
-
-
Method Details
-
addRule
Description copied from class:AbstractModelTranslator.AbstractRuleTranslatorAdds the given rule to the- Specified by:
addRulein classAbstractModelTranslator<M extends net.ssehub.easy.instantiation.core.model.buildlangModel.Script,L extends LanguageUnit>.AbstractRuleTranslator<RuleDeclaration, net.ssehub.easy.instantiation.core.model.buildlangModel.Rule>
-
createRule
protected net.ssehub.easy.instantiation.core.model.buildlangModel.Rule createRule(RuleDeclaration ruleDecl, net.ssehub.easy.instantiation.core.model.vilTypes.TypeDescriptor<?> returnType, net.ssehub.easy.instantiation.core.model.buildlangModel.VariableDeclaration[] params, M parent) Description copied from class:AbstractModelTranslator.AbstractRuleTranslatorCreates a specific rule from the given declaration, parameters and parent.- Specified by:
createRulein classAbstractModelTranslator<M extends net.ssehub.easy.instantiation.core.model.buildlangModel.Script,L extends LanguageUnit>.AbstractRuleTranslator<RuleDeclaration, net.ssehub.easy.instantiation.core.model.buildlangModel.Rule> - Parameters:
ruleDecl- the rule declarationreturnType- the desired return typeparams- the resolved parametersparent- the parent- Returns:
- the specific rule, tactic or strategy (rt-VIL)
-
getReturnType
protected net.ssehub.easy.instantiation.core.model.vilTypes.TypeDescriptor<?> getReturnType(RuleDeclaration ruleDecl, net.ssehub.easy.instantiation.core.model.buildlangModel.Resolver resolver) throws net.ssehub.easy.dslCore.translation.TranslatorException Description copied from class:AbstractModelTranslator.AbstractRuleTranslatorReturns the result type of the givenruleDecl.- Specified by:
getReturnTypein classAbstractModelTranslator<M extends net.ssehub.easy.instantiation.core.model.buildlangModel.Script,L extends LanguageUnit>.AbstractRuleTranslator<RuleDeclaration, net.ssehub.easy.instantiation.core.model.buildlangModel.Rule> - Parameters:
ruleDecl- the rule declarationresolver- the actual resolver instance- Returns:
- the result type
- Throws:
net.ssehub.easy.dslCore.translation.TranslatorException- in case that resolving the type fails
-
getParameterList
protected de.uni_hildesheim.sse.vil.expressions.expressionDsl.ParameterList getParameterList(RuleDeclaration ruleDecl) Description copied from class:AbstractModelTranslator.AbstractRuleTranslatorReturns the actual parameter list.- Specified by:
getParameterListin classAbstractModelTranslator<M extends net.ssehub.easy.instantiation.core.model.buildlangModel.Script,L extends LanguageUnit>.AbstractRuleTranslator<RuleDeclaration, net.ssehub.easy.instantiation.core.model.buildlangModel.Rule> - Parameters:
ruleDecl- the rule declaration- Returns:
- the parameter list of the rule declaration
-
getRuleConditions
Description copied from class:AbstractModelTranslator.AbstractRuleTranslatorReturns the actual rule conditions.- Specified by:
getRuleConditionsin classAbstractModelTranslator<M extends net.ssehub.easy.instantiation.core.model.buildlangModel.Script,L extends LanguageUnit>.AbstractRuleTranslator<RuleDeclaration, net.ssehub.easy.instantiation.core.model.buildlangModel.Rule> - Parameters:
ruleDecl- the rule declaration- Returns:
- the rule conditions of the rule declaration
-
getBlock
Description copied from class:AbstractModelTranslator.AbstractRuleTranslatorReturns the actual rule block.- Specified by:
getBlockin classAbstractModelTranslator<M extends net.ssehub.easy.instantiation.core.model.buildlangModel.Script,L extends LanguageUnit>.AbstractRuleTranslator<RuleDeclaration, net.ssehub.easy.instantiation.core.model.buildlangModel.Rule> - Parameters:
ruleDecl- the rule declaration- Returns:
- the rule block of the rule declaration (may be null)
-
getNameLiteral
protected org.eclipse.emf.ecore.EStructuralFeature getNameLiteral()Description copied from class:AbstractModelTranslator.AbstractRuleTranslatorReturns the name literal.- Specified by:
getNameLiteralin classAbstractModelTranslator<M extends net.ssehub.easy.instantiation.core.model.buildlangModel.Script,L extends LanguageUnit>.AbstractRuleTranslator<RuleDeclaration, net.ssehub.easy.instantiation.core.model.buildlangModel.Rule> - Returns:
- the name literal
-
getDisplayName
Description copied from class:AbstractModelTranslator.AbstractRuleTranslatorReturns the display name of the language concept being processed.- Specified by:
getDisplayNamein classAbstractModelTranslator<M extends net.ssehub.easy.instantiation.core.model.buildlangModel.Script,L extends LanguageUnit>.AbstractRuleTranslator<RuleDeclaration, net.ssehub.easy.instantiation.core.model.buildlangModel.Rule> - Returns:
- the display name
-