Class AbstractModelTranslator.RuleTranslator
- java.lang.Object
-
- de.uni_hildesheim.sse.buildLanguageTranslation.AbstractModelTranslator.AbstractRuleTranslator<de.uni_hildesheim.sse.vilBuildLanguage.RuleDeclaration,Rule>
-
- de.uni_hildesheim.sse.buildLanguageTranslation.AbstractModelTranslator.RuleTranslator
-
- Enclosing class:
- AbstractModelTranslator<M extends Script,L extends de.uni_hildesheim.sse.vilBuildLanguage.LanguageUnit>
protected class AbstractModelTranslator.RuleTranslator extends AbstractModelTranslator.AbstractRuleTranslator<de.uni_hildesheim.sse.vilBuildLanguage.RuleDeclaration,Rule>
Implements a translator for VIL rules.- Author:
- Holger Eichelberger
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedRuleTranslator()Creates the translator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddRule(M script, Rule rule)Adds the given rule to theprotected RulecreateRule(de.uni_hildesheim.sse.vilBuildLanguage.RuleDeclaration ruleDecl, TypeDescriptor<?> returnType, VariableDeclaration[] params, M parent)Creates a specific rule from the given declaration, parameters and parent.protected de.uni_hildesheim.sse.vilBuildLanguage.RuleElementBlockgetBlock(de.uni_hildesheim.sse.vilBuildLanguage.RuleDeclaration ruleDecl)Returns the actual rule block.protected java.lang.StringgetDisplayName()Returns the display name of the language concept being processed.protected org.eclipse.emf.ecore.EStructuralFeaturegetNameLiteral()Returns the name literal.protected de.uni_hildesheim.sse.vil.expressions.expressionDsl.ParameterListgetParameterList(de.uni_hildesheim.sse.vilBuildLanguage.RuleDeclaration ruleDecl)Returns the actual parameter list.protected TypeDescriptor<?>getReturnType(de.uni_hildesheim.sse.vilBuildLanguage.RuleDeclaration ruleDecl, Resolver resolver)Returns the result type of the givenruleDecl.protected de.uni_hildesheim.sse.vilBuildLanguage.RuleConditionsgetRuleConditions(de.uni_hildesheim.sse.vilBuildLanguage.RuleDeclaration ruleDecl)Returns the actual rule conditions.-
Methods inherited from class de.uni_hildesheim.sse.buildLanguageTranslation.AbstractModelTranslator.AbstractRuleTranslator
getPostconditionLiteral, getPreconditionLiteral, processAdditionalRuleBodyElements, processRule, processRules
-
-
-
-
Method Detail
-
addRule
protected void addRule(M script, Rule rule)
Description copied from class:AbstractModelTranslator.AbstractRuleTranslatorAdds the given rule to the- Specified by:
addRulein classAbstractModelTranslator.AbstractRuleTranslator<de.uni_hildesheim.sse.vilBuildLanguage.RuleDeclaration,Rule>
-
createRule
protected Rule createRule(de.uni_hildesheim.sse.vilBuildLanguage.RuleDeclaration ruleDecl, TypeDescriptor<?> returnType, VariableDeclaration[] params, M parent)
Description copied from class:AbstractModelTranslator.AbstractRuleTranslatorCreates a specific rule from the given declaration, parameters and parent.- Specified by:
createRulein classAbstractModelTranslator.AbstractRuleTranslator<de.uni_hildesheim.sse.vilBuildLanguage.RuleDeclaration,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 TypeDescriptor<?> getReturnType(de.uni_hildesheim.sse.vilBuildLanguage.RuleDeclaration ruleDecl, Resolver resolver) throws TranslatorException
Description copied from class:AbstractModelTranslator.AbstractRuleTranslatorReturns the result type of the givenruleDecl.- Specified by:
getReturnTypein classAbstractModelTranslator.AbstractRuleTranslator<de.uni_hildesheim.sse.vilBuildLanguage.RuleDeclaration,Rule>- Parameters:
ruleDecl- the rule declarationresolver- the actual resolver instance- Returns:
- the result type
- Throws:
TranslatorException- in case that resolving the type fails
-
getParameterList
protected de.uni_hildesheim.sse.vil.expressions.expressionDsl.ParameterList getParameterList(de.uni_hildesheim.sse.vilBuildLanguage.RuleDeclaration ruleDecl)
Description copied from class:AbstractModelTranslator.AbstractRuleTranslatorReturns the actual parameter list.- Specified by:
getParameterListin classAbstractModelTranslator.AbstractRuleTranslator<de.uni_hildesheim.sse.vilBuildLanguage.RuleDeclaration,Rule>- Parameters:
ruleDecl- the rule declaration- Returns:
- the parameter list of the rule declaration
-
getRuleConditions
protected de.uni_hildesheim.sse.vilBuildLanguage.RuleConditions getRuleConditions(de.uni_hildesheim.sse.vilBuildLanguage.RuleDeclaration ruleDecl)
Description copied from class:AbstractModelTranslator.AbstractRuleTranslatorReturns the actual rule conditions.- Specified by:
getRuleConditionsin classAbstractModelTranslator.AbstractRuleTranslator<de.uni_hildesheim.sse.vilBuildLanguage.RuleDeclaration,Rule>- Parameters:
ruleDecl- the rule declaration- Returns:
- the rule conditions of the rule declaration
-
getBlock
protected de.uni_hildesheim.sse.vilBuildLanguage.RuleElementBlock getBlock(de.uni_hildesheim.sse.vilBuildLanguage.RuleDeclaration ruleDecl)
Description copied from class:AbstractModelTranslator.AbstractRuleTranslatorReturns the actual rule block.- Specified by:
getBlockin classAbstractModelTranslator.AbstractRuleTranslator<de.uni_hildesheim.sse.vilBuildLanguage.RuleDeclaration,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.AbstractRuleTranslator<de.uni_hildesheim.sse.vilBuildLanguage.RuleDeclaration,Rule>- Returns:
- the name literal
-
getDisplayName
protected java.lang.String getDisplayName()
Description copied from class:AbstractModelTranslator.AbstractRuleTranslatorReturns the display name of the language concept being processed.- Specified by:
getDisplayNamein classAbstractModelTranslator.AbstractRuleTranslator<de.uni_hildesheim.sse.vilBuildLanguage.RuleDeclaration,Rule>- Returns:
- the display name
-
-