D - the Ecore language declaration typeR - the model rule typeprotected abstract class AbstractModelTranslator.AbstractRuleTranslator<D extends org.eclipse.emf.ecore.EObject,R extends Rule>
extends java.lang.Object
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractRuleTranslator(java.lang.Class<D> cls)
Creates a rule translator.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
addRule(M script,
R rule)
Adds the given rule to the
|
protected abstract R |
createRule(D ruleDecl,
TypeDescriptor<?> returnType,
VariableDeclaration[] params,
M parent)
Creates a specific rule from the given declaration, parameters and parent.
|
protected abstract de.uni_hildesheim.sse.vilBuildLanguage.RuleElementBlock |
getBlock(D ruleDecl)
Returns the actual rule block.
|
protected abstract java.lang.String |
getDisplayName()
Returns the display name of the language concept being processed.
|
protected abstract org.eclipse.emf.ecore.EStructuralFeature |
getNameLiteral()
Returns the name literal.
|
protected abstract de.uni_hildesheim.sse.vil.expressions.expressionDsl.ParameterList |
getParameterList(D ruleDecl)
Returns the actual parameter list.
|
protected org.eclipse.emf.ecore.EStructuralFeature |
getPostconditionLiteral()
Returns the postcondition literal.
|
protected org.eclipse.emf.ecore.EStructuralFeature |
getPreconditionLiteral()
Returns the precondition literal.
|
protected abstract TypeDescriptor<?> |
getReturnType(D ruleDecl,
Resolver resolver)
Returns the result type of the given
ruleDecl. |
protected abstract de.uni_hildesheim.sse.vilBuildLanguage.RuleConditions |
getRuleConditions(D ruleDecl)
Returns the actual rule conditions.
|
protected void |
processAdditionalRuleBodyElements(D ruleDecl,
R rule,
M parent,
Resolver resolver)
Is called to process additional rule body elements.
|
protected RuleInfo<D,R> |
processRule(D ruleDecl,
M parent)
Processes a rule declaration.
|
private void |
processRuleBody(RuleInfo<D,R> info,
M parent)
Processes a rule body.
|
private void |
processRuleConditions(RuleDescriptor descriptor,
de.uni_hildesheim.sse.vilBuildLanguage.RuleConditions cond)
Processes optional rule pre/postconditions.
|
void |
processRules(L unit,
java.util.List<org.eclipse.emf.ecore.EObject> elements,
M script)
Processes all rules considering dependencies and terminates with
an error if not all can be resolved.
|
private java.lang.Class<D extends org.eclipse.emf.ecore.EObject> cls
protected AbstractRuleTranslator(java.lang.Class<D> cls)
cls - the language declaration classpublic void processRules(L unit, java.util.List<org.eclipse.emf.ecore.EObject> elements, M script) throws TranslatorException
unit - the language unit to processelements - the language elements to be processedscript - the resulting instance being createdTranslatorExceptionprotected RuleInfo<D,R> processRule(D ruleDecl, M parent) throws TranslatorException
ruleDecl - the ECore rule objectparent - the parent scriptTranslatorException - in case that the translation fails due to semantic reasons#processRuleBody(RuleInfo)private void processRuleBody(RuleInfo<D,R> info, M parent) throws TranslatorException
info - the rule information object containing the link between the ECore and the model instanceTranslatorException - in case that the translation fails due to semantic reasonsprivate void processRuleConditions(RuleDescriptor descriptor, de.uni_hildesheim.sse.vilBuildLanguage.RuleConditions cond) throws TranslatorException
ruleDecl - the ECore rule objectparent - the parent scriptTranslatorException - in case that the translation fails due to semantic reasons#processRuleBody(RuleInfo)protected abstract java.lang.String getDisplayName()
protected abstract org.eclipse.emf.ecore.EStructuralFeature getNameLiteral()
protected org.eclipse.emf.ecore.EStructuralFeature getPreconditionLiteral()
protected org.eclipse.emf.ecore.EStructuralFeature getPostconditionLiteral()
protected abstract R createRule(D ruleDecl, TypeDescriptor<?> returnType, VariableDeclaration[] params, M parent)
ruleDecl - the rule declarationreturnType - the desired return typeparams - the resolved parametersparent - the parentprotected abstract TypeDescriptor<?> getReturnType(D ruleDecl, Resolver resolver) throws TranslatorException
ruleDecl.ruleDecl - the rule declarationresolver - the actual resolver instanceTranslatorException - in case that resolving the type failsprotected abstract de.uni_hildesheim.sse.vil.expressions.expressionDsl.ParameterList getParameterList(D ruleDecl)
ruleDecl - the rule declarationprotected abstract de.uni_hildesheim.sse.vilBuildLanguage.RuleConditions getRuleConditions(D ruleDecl)
ruleDecl - the rule declarationprotected void processAdditionalRuleBodyElements(D ruleDecl, R rule, M parent, Resolver resolver) throws TranslatorException
ruleDecl - the rule declarationrule - the actual rule (to be modified as a side effect)resolver - the variable resolverTranslatorException - in case of translation problemsprotected abstract de.uni_hildesheim.sse.vilBuildLanguage.RuleElementBlock getBlock(D ruleDecl)
ruleDecl - the rule declarationCopyright © 2009 - 2018 SSE. All Rights Reserved.