public class ExpressionTranslator
extends net.ssehub.easy.dslCore.translation.ExpressionTranslator
ExpressionTranslator.getMessage(int).| Modifier and Type | Field and Description |
|---|---|
private AssignmentDetector |
assignmentDetector |
private boolean |
hasTopLevelWarning |
private int |
level |
private RefByCheckVisitor |
refByChecker |
| Constructor and Description |
|---|
ExpressionTranslator()
Creates an expression translator (to be used within this package only).
|
| Modifier and Type | Method and Description |
|---|---|
private static boolean |
allConstant(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree[] exprs)
Returns whether all
exprs are constant. |
private void |
checkForAssigment(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree cst,
boolean error,
org.eclipse.emf.ecore.EObject cause,
org.eclipse.emf.ecore.EStructuralFeature causingFeature)
Checks for an assignment operation directly in
cst and emits an error
or a warning in case that the operation is found. |
private void |
checkForCompoundElement(net.ssehub.easy.varModel.model.datatypes.Compound comp,
java.lang.String name,
ActualArgumentList call)
Checks for an existing compound element
name in comp and throws an
exception if that element does not exist. |
private void |
checkForSameTypeWarning(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree lhs,
java.lang.String op,
net.ssehub.easy.varModel.cst.ConstraintSyntaxTree rhs,
org.eclipse.emf.ecore.EObject cause,
org.eclipse.emf.ecore.EStructuralFeature feature)
Checks whether the operation
op may return wrong results if types on both sides are not somehow
assignable. |
private void |
checkOperationOclCompliance(net.ssehub.easy.varModel.model.datatypes.Operation op,
org.eclipse.emf.ecore.EObject cause,
org.eclipse.emf.ecore.EStructuralFeature feature)
Checks for OCL operation compliance and issues a warning if violated and compliance mode is enabled.
|
(package private) void |
error(net.ssehub.easy.basics.messages.IIdentifiable exception,
org.eclipse.emf.ecore.EObject cause,
org.eclipse.emf.ecore.EStructuralFeature causeFeature)
Turns an IVML exception into a xText error.
|
(package private) void |
errorAboutTopLevelWarning(org.eclipse.emf.ecore.EObject cause,
org.eclipse.emf.ecore.EStructuralFeature causingFeature)
Checks for illegal top-level warnings and emits an error if required.
|
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree |
getAccessor(AdditiveExpression ex,
net.ssehub.easy.varModel.model.DecisionVariableDeclaration decl)
Extracts a compound accessor/slot name from the given expression.
|
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree |
getAccessor(AssignmentExpression ex,
net.ssehub.easy.varModel.model.DecisionVariableDeclaration decl)
Extracts a compound accessor/slot name from the given expression.
|
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree |
getAccessor(EqualityExpression ex,
net.ssehub.easy.varModel.model.DecisionVariableDeclaration decl)
Extracts a compound accessor/slot name from the given expression.
|
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree |
getAccessor(ImplicationExpression ex,
net.ssehub.easy.varModel.model.DecisionVariableDeclaration decl)
Extracts a compound accessor/slot name from the given expression.
|
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree |
getAccessor(java.util.List<ActualArgument> args,
net.ssehub.easy.varModel.model.DecisionVariableDeclaration decl)
Extracts a compound accessor/slot name from the given arguments.
|
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree |
getAccessor(Literal ex,
net.ssehub.easy.varModel.model.DecisionVariableDeclaration decl)
Extracts a compound accessor/slot name from the given expression.
|
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree |
getAccessor(LogicalExpression ex,
net.ssehub.easy.varModel.model.DecisionVariableDeclaration decl)
Extracts a compound accessor/slot name from the given expression.
|
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree |
getAccessor(MultiplicativeExpression ex,
net.ssehub.easy.varModel.model.DecisionVariableDeclaration decl)
Extracts a compound accessor/slot name from the given expression.
|
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree |
getAccessor(PostfixExpression ex,
net.ssehub.easy.varModel.model.DecisionVariableDeclaration decl)
Extracts a compound accessor/slot name from the given expression.
|
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree |
getAccessor(PrimaryExpression ex,
net.ssehub.easy.varModel.model.DecisionVariableDeclaration decl)
Extracts a compound accessor/slot name from the given expression.
|
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree |
getAccessor(RelationalExpression ex,
net.ssehub.easy.varModel.model.DecisionVariableDeclaration decl)
Extracts a compound accessor/slot name from the given expression.
|
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree |
getAccessor(UnaryExpression ex,
net.ssehub.easy.varModel.model.DecisionVariableDeclaration decl)
Extracts a compound accessor/slot name from the given expression.
|
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree |
getAccessor(Value ex,
net.ssehub.easy.varModel.model.DecisionVariableDeclaration decl)
Extracts a compound accessor/slot name from the given expression.
|
private net.ssehub.easy.varModel.model.datatypes.IDatatype |
getSpecificType(net.ssehub.easy.varModel.model.datatypes.IDatatype lhsType,
ContainerInitializer initializer,
TypeContext context)
Returns the specific type of a collection initializer.
|
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree |
handleBasicComment(org.eclipse.emf.ecore.EObject object,
net.ssehub.easy.varModel.cst.ConstraintSyntaxTree subtree)
Handles the comments assigned to the EMF AST element
object
and inserts a comment node as top of the subtree if required. |
private boolean |
hasLiteral(net.ssehub.easy.varModel.model.datatypes.Enum eenum,
java.lang.String name)
Returns whether the given enumeration
eenum defines a literal
called name. |
private boolean |
hasSlot(net.ssehub.easy.varModel.model.datatypes.Compound comp,
java.lang.String name)
Returns whether the given compound
comp or its refined compounds
contains a slot of name name. |
private net.ssehub.easy.varModel.model.datatypes.IDatatype |
inferDatatypeQuietly(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree cst)
Infers the datatype of
cst. |
(package private) void |
initLevel()
Initializes the levels.
|
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree |
processAccess(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree lhs,
ExpressionAccess access,
TypeContext context,
net.ssehub.easy.varModel.model.IModelElement parent)
Process an access expression.
|
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree |
processAdditiveExpression(AdditiveExpression expr,
TypeContext context,
net.ssehub.easy.varModel.model.IModelElement parent)
Process an additive expression and turn it into a feature call.
|
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree |
processArgument(net.ssehub.easy.varModel.model.datatypes.IDatatype lhsType,
ActualArgument arg,
TypeContext context,
net.ssehub.easy.varModel.model.IModelElement parent)
Process an argument and returns a (named) expression.
|
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree |
processAssignmentExpression(AssignmentExpression expr,
TypeContext context,
net.ssehub.easy.varModel.model.IModelElement parent)
Process an assignment expression and turn it into a feature call.
|
(package private) net.ssehub.easy.varModel.cst.ConstraintSyntaxTree |
processBlockExpression(de.uni_hildesheim.sse.ivml.BlockExpression block,
TypeContext context,
net.ssehub.easy.varModel.model.IModelElement parent)
Processes a block expression.
|
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree |
processCallsAndAccess(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree lhs,
java.util.List<Call> calls,
ExpressionAccess access,
TypeContext context,
net.ssehub.easy.varModel.model.IModelElement parent)
Process a possible empty list of calls and a possible empty access
expression.
|
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree |
processCompoundInitializer(net.ssehub.easy.varModel.model.datatypes.IDatatype lhsType,
TypeContext context,
net.ssehub.easy.varModel.model.IModelElement parent,
net.ssehub.easy.varModel.model.datatypes.IDatatype specificType,
org.eclipse.emf.common.util.EList<ExpressionListEntry> entryList)
Processes a compound initializer.
|
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree |
processContainerInitializer(net.ssehub.easy.varModel.model.datatypes.IDatatype lhsType,
org.eclipse.emf.ecore.EObject expr,
ContainerInitializer initializer,
TypeContext context,
net.ssehub.easy.varModel.model.IModelElement parent)
Processes a container initializer.
|
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree |
processContainerInitializer(net.ssehub.easy.varModel.model.datatypes.IDatatype lhsType,
TypeContext context,
net.ssehub.easy.varModel.model.IModelElement parent,
org.eclipse.emf.common.util.EList<ExpressionListEntry> entryList)
Processes a container initializer.
|
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree |
processContainerOp(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree lhs,
ContainerOp op,
java.util.List<net.ssehub.easy.varModel.model.DecisionVariableDeclaration> declarators,
net.ssehub.easy.varModel.cst.ConstraintSyntaxTree declEx,
TypeContext context,
net.ssehub.easy.varModel.model.IModelElement parent)
Processes a container operation.
|
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree |
processContainerOp(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree lhs,
ContainerOp op,
TypeContext context,
net.ssehub.easy.varModel.model.IModelElement parent)
Processes a container operation.
|
private void |
processDeclaration(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree lhs,
ContainerOp op,
TypeContext context,
net.ssehub.easy.varModel.model.IModelElement parent,
Declaration declaration,
java.util.List<net.ssehub.easy.varModel.model.DecisionVariableDeclaration> declarators)
Processes a valid declaration.
|
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree |
processEqualityExpression(EqualityExpression expr,
TypeContext context,
net.ssehub.easy.varModel.model.IModelElement parent)
Process a equality expression and turn it into a feature call.
|
net.ssehub.easy.varModel.cst.ConstraintSyntaxTree |
processExpression(Expression expr,
TypeContext context,
net.ssehub.easy.varModel.model.IModelElement parent)
Processes an expression and returns the result as a syntax tree.
|
(package private) net.ssehub.easy.varModel.cst.ConstraintSyntaxTree |
processExpression(net.ssehub.easy.varModel.model.datatypes.IDatatype lhsType,
Expression expr,
TypeContext context,
net.ssehub.easy.varModel.model.IModelElement parent)
Processes an expression and returns the result as a syntax tree.
|
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree |
processExpression(net.ssehub.easy.varModel.model.datatypes.IDatatype lhsType,
OptBlockExpression expr,
TypeContext context,
net.ssehub.easy.varModel.model.IModelElement parent)
Processes an (optional block) expression.
|
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree |
processFeatureCall(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree lhs,
FeatureCall call,
TypeContext context,
net.ssehub.easy.varModel.model.IModelElement parent)
Processes a feature call.
|
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree |
processFeatureCallImpl(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree lhs,
ActualArgumentList call,
TypeContext context,
net.ssehub.easy.varModel.model.IModelElement parent,
boolean checkOclCompliance)
Processes a feature call.
|
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree |
processImplicationExpression(ImplicationExpression expr,
TypeContext context,
net.ssehub.easy.varModel.model.IModelElement parent)
Process an implication expression and turn it into a feature call.
|
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree |
processLiteralContainer(net.ssehub.easy.varModel.model.datatypes.IDatatype lhsType,
ContainerInitializer initializer,
TypeContext context,
net.ssehub.easy.varModel.model.IModelElement parent)
Processes a collection initializer and returns the related constraint syntax tree node.
|
(package private) net.ssehub.easy.varModel.cst.ConstraintSyntaxTree |
processLogicalExpression(LogicalExpression expr,
TypeContext context,
net.ssehub.easy.varModel.model.IModelElement parent)
Process a logical expression and turn it into a feature call.
|
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree |
processMultiplicativeExpression(MultiplicativeExpression expr,
TypeContext context,
net.ssehub.easy.varModel.model.IModelElement parent)
Process a multiplicative expression and turn it into a feature call.
|
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree |
processPostfixExpression(PostfixExpression expr,
TypeContext context,
net.ssehub.easy.varModel.model.IModelElement parent)
Process a postfix expression and turn it into a feature call.
|
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree |
processPrimaryExpression(PrimaryExpression expr,
TypeContext context,
net.ssehub.easy.varModel.model.IModelElement parent)
Process a primary expression.
|
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree |
processRelationalExpression(RelationalExpression expr,
TypeContext context,
net.ssehub.easy.varModel.model.IModelElement parent)
Process a relational expression and turn it into a feature call.
|
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree |
processUnaryExpression(UnaryExpression expr,
TypeContext context,
net.ssehub.easy.varModel.model.IModelElement parent)
Process a unary expression and turn it into a feature call.
|
private static net.ssehub.easy.varModel.model.datatypes.IDatatype |
refType(net.ssehub.easy.varModel.model.datatypes.IDatatype varType,
TypeContext context)
Obtains the reference type.
|
private java.lang.Object[] |
translateToValues(java.lang.Object[] values)
Translates constant expression trees to constant values.
|
void |
warnDiscouragedNames(java.lang.String name,
org.eclipse.emf.ecore.EObject cause,
org.eclipse.emf.ecore.EStructuralFeature causingFeature)
Checks for and warns about discouraged names.
|
(package private) void |
warning(net.ssehub.easy.varModel.model.IvmlException exception,
org.eclipse.emf.ecore.EObject cause,
org.eclipse.emf.ecore.EStructuralFeature causeFeature)
Turns an IVML exception into a xText warning.
|
private AssignmentDetector assignmentDetector
private int level
private boolean hasTopLevelWarning
private RefByCheckVisitor refByChecker
public ExpressionTranslator()
void initLevel()
void errorAboutTopLevelWarning(org.eclipse.emf.ecore.EObject cause,
org.eclipse.emf.ecore.EStructuralFeature causingFeature)
cause - the causing EObjectcausingFeature - the causing featurevoid error(net.ssehub.easy.basics.messages.IIdentifiable exception,
org.eclipse.emf.ecore.EObject cause,
org.eclipse.emf.ecore.EStructuralFeature causeFeature)
exception - the exception to usedcause - the cause (as instance of the EMF grammar model)causeFeature - the cause of the feature as an appropriate constant from
de.uni_hildesheim.sse.ivml.IvmlPackage.Literalsvoid warning(net.ssehub.easy.varModel.model.IvmlException exception,
org.eclipse.emf.ecore.EObject cause,
org.eclipse.emf.ecore.EStructuralFeature causeFeature)
exception - the exception to usedcause - the cause (as instance of the EMF grammar model)causeFeature - the cause of the feature as an appropriate constant from
de.uni_hildesheim.sse.ivml.IvmlPackage.Literalsprivate net.ssehub.easy.varModel.cst.ConstraintSyntaxTree handleBasicComment(org.eclipse.emf.ecore.EObject object,
net.ssehub.easy.varModel.cst.ConstraintSyntaxTree subtree)
object
and inserts a comment node as top of the subtree if required.object - the EMF AST element to analyzesubtree - the constraint subtree to add the comment beforepublic net.ssehub.easy.varModel.cst.ConstraintSyntaxTree processExpression(Expression expr,
TypeContext context,
net.ssehub.easy.varModel.model.IModelElement parent)
throws net.ssehub.easy.dslCore.translation.TranslatorException
initLevel(),
i.e., do not call from inside.expr - the expression to be processedcontext - the type context to be consideredparent - the actual (intended) parent of the constraint to be creatednet.ssehub.easy.dslCore.translation.TranslatorException - in case that the processing of the expr must be
terminated abnormallynet.ssehub.easy.varModel.cst.ConstraintSyntaxTree processBlockExpression(de.uni_hildesheim.sse.ivml.BlockExpression block,
TypeContext context,
net.ssehub.easy.varModel.model.IModelElement parent)
throws net.ssehub.easy.dslCore.translation.TranslatorException
block - the blockcontext - the type contextparent - the parent elementnet.ssehub.easy.dslCore.translation.TranslatorException - in case that the processing of the block must be
terminated abnormallyprivate net.ssehub.easy.varModel.cst.ConstraintSyntaxTree processExpression(net.ssehub.easy.varModel.model.datatypes.IDatatype lhsType,
OptBlockExpression expr,
TypeContext context,
net.ssehub.easy.varModel.model.IModelElement parent)
throws net.ssehub.easy.dslCore.translation.TranslatorException
lhsType - the data type on the left hand side of the expressionexpr - the expression to be processedcontext - the type context to be consideredparent - the actual (intended) parent of the constraint to be creatednet.ssehub.easy.dslCore.translation.TranslatorException - in case that the processing of the expr must be
terminated abnormallynet.ssehub.easy.varModel.cst.ConstraintSyntaxTree processExpression(net.ssehub.easy.varModel.model.datatypes.IDatatype lhsType,
Expression expr,
TypeContext context,
net.ssehub.easy.varModel.model.IModelElement parent)
throws net.ssehub.easy.dslCore.translation.TranslatorException
initLevel()
if called from outside.lhsType - the data type on the left hand side of the expressionexpr - the expression to be processedcontext - the type context to be consideredparent - the actual (intended) parent of the constraint to be creatednet.ssehub.easy.dslCore.translation.TranslatorException - in case that the processing of the expr must be
terminated abnormallyprivate net.ssehub.easy.varModel.cst.ConstraintSyntaxTree processAssignmentExpression(AssignmentExpression expr,
TypeContext context,
net.ssehub.easy.varModel.model.IModelElement parent)
throws net.ssehub.easy.dslCore.translation.TranslatorException
expr - the expression to be processedcontext - the type context to be consideredparent - the actual (intended) parent of the constraint to be creatednet.ssehub.easy.dslCore.translation.TranslatorException - in case that the processing of the expr must be
terminated abnormallyprivate void checkForSameTypeWarning(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree lhs,
java.lang.String op,
net.ssehub.easy.varModel.cst.ConstraintSyntaxTree rhs,
org.eclipse.emf.ecore.EObject cause,
org.eclipse.emf.ecore.EStructuralFeature feature)
op may return wrong results if types on both sides are not somehow
assignable.lhs - the left hand side expressionop - the operatorrhs - the right hand side expressioncause - the causing grammar objectfeature - the causing grammar featureprivate net.ssehub.easy.varModel.model.datatypes.IDatatype inferDatatypeQuietly(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree cst)
cst.cst - the constraint syntax treeprivate net.ssehub.easy.varModel.cst.ConstraintSyntaxTree processImplicationExpression(ImplicationExpression expr,
TypeContext context,
net.ssehub.easy.varModel.model.IModelElement parent)
throws net.ssehub.easy.dslCore.translation.TranslatorException
expr - the expression to be processedcontext - the type context to be consideredparent - the actual (intended) parent of the constraint to be creatednet.ssehub.easy.dslCore.translation.TranslatorException - in case that the processing of the expr must be
terminated abnormallyprivate void checkForAssigment(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree cst,
boolean error,
org.eclipse.emf.ecore.EObject cause,
org.eclipse.emf.ecore.EStructuralFeature causingFeature)
cst and emits an error
or a warning in case that the operation is found.cst - the constraint syntax tree to be checkederror - emit an error or a warningcause - the causing EObjectcausingFeature - the causing feature in causenet.ssehub.easy.varModel.cst.ConstraintSyntaxTree processLogicalExpression(LogicalExpression expr,
TypeContext context,
net.ssehub.easy.varModel.model.IModelElement parent)
throws net.ssehub.easy.dslCore.translation.TranslatorException
initLevel() before.expr - the expression to be processedcontext - the type context to be consideredparent - the actual (intended) parent of the constraint to be creatednet.ssehub.easy.dslCore.translation.TranslatorException - in case that the processing of the expr must be
terminated abnormallyprivate net.ssehub.easy.varModel.cst.ConstraintSyntaxTree processEqualityExpression(EqualityExpression expr,
TypeContext context,
net.ssehub.easy.varModel.model.IModelElement parent)
throws net.ssehub.easy.dslCore.translation.TranslatorException
expr - the expression to be processedcontext - the type context to be consideredparent - the actual (intended) parent of the constraint to be creatednet.ssehub.easy.dslCore.translation.TranslatorException - in case that the processing of the expr must be
terminated abnormallyprivate net.ssehub.easy.varModel.cst.ConstraintSyntaxTree processRelationalExpression(RelationalExpression expr,
TypeContext context,
net.ssehub.easy.varModel.model.IModelElement parent)
throws net.ssehub.easy.dslCore.translation.TranslatorException
expr - the expression to be processedcontext - the type context to be consideredparent - the actual (intended) parent of the constraint to be creatednet.ssehub.easy.dslCore.translation.TranslatorException - in case that the processing of the expr must be
terminated abnormallyprivate net.ssehub.easy.varModel.cst.ConstraintSyntaxTree processAdditiveExpression(AdditiveExpression expr,
TypeContext context,
net.ssehub.easy.varModel.model.IModelElement parent)
throws net.ssehub.easy.dslCore.translation.TranslatorException
expr - the expression to be processedcontext - the type context to be consideredparent - the actual (intended) parent of the constraint to be creatednet.ssehub.easy.dslCore.translation.TranslatorException - in case that the processing of the expr must be
terminated abnormallyprivate net.ssehub.easy.varModel.cst.ConstraintSyntaxTree processMultiplicativeExpression(MultiplicativeExpression expr,
TypeContext context,
net.ssehub.easy.varModel.model.IModelElement parent)
throws net.ssehub.easy.dslCore.translation.TranslatorException
expr - the expression to be processedcontext - the type context to be consideredparent - the actual (intended) parent of the constraint to be creatednet.ssehub.easy.dslCore.translation.TranslatorException - in case that the processing of the expr must be
terminated abnormallyprivate net.ssehub.easy.varModel.cst.ConstraintSyntaxTree processUnaryExpression(UnaryExpression expr,
TypeContext context,
net.ssehub.easy.varModel.model.IModelElement parent)
throws net.ssehub.easy.dslCore.translation.TranslatorException
expr - the expression to be processedcontext - the type context to be consideredparent - the actual (intended) parent of the constraint to be creatednet.ssehub.easy.dslCore.translation.TranslatorException - in case that the processing of the expr must be
terminated abnormallyprivate net.ssehub.easy.varModel.cst.ConstraintSyntaxTree processFeatureCall(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree lhs,
FeatureCall call,
TypeContext context,
net.ssehub.easy.varModel.model.IModelElement parent)
throws net.ssehub.easy.dslCore.translation.TranslatorException
lhs in case of a "context less method call" such as
max(1, 2) or with a given lhs, e.g. for
s.size();lhs - the operand expression (may be null as described above)call - the call to be processedcontext - the type context to be consideredparent - the actual (intended) parent of the constraint to be creatednet.ssehub.easy.dslCore.translation.TranslatorException - in case that the processing of the lhs must be
terminated abnormallyprivate net.ssehub.easy.varModel.cst.ConstraintSyntaxTree processFeatureCallImpl(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree lhs,
ActualArgumentList call,
TypeContext context,
net.ssehub.easy.varModel.model.IModelElement parent,
boolean checkOclCompliance)
throws net.ssehub.easy.dslCore.translation.TranslatorException
lhs in case of a "context less method call" such as
max(1, 2) or with a given lhs, e.g. for
s.size();lhs - the operand expression (may be null as described above)call - the call to be processedcontext - the type context to be consideredparent - the actual (intended) parent of the constraint to be createdcheckOclCompliance - check for OCL compliance of this call, i.e., -> vs .net.ssehub.easy.dslCore.translation.TranslatorException - in case that the processing of the lhs must be
terminated abnormallyprivate net.ssehub.easy.varModel.cst.ConstraintSyntaxTree processArgument(net.ssehub.easy.varModel.model.datatypes.IDatatype lhsType,
ActualArgument arg,
TypeContext context,
net.ssehub.easy.varModel.model.IModelElement parent)
throws net.ssehub.easy.dslCore.translation.TranslatorException
lhsType - the left hand side type (optional, may be null)arg - the argument expressioncontext - the type context to be consideredparent - the actual (intended) parent of the constraint to be creatednet.ssehub.easy.dslCore.translation.TranslatorException - in case that the expression cannot be translated for some reasonprivate void checkForCompoundElement(net.ssehub.easy.varModel.model.datatypes.Compound comp,
java.lang.String name,
ActualArgumentList call)
throws net.ssehub.easy.dslCore.translation.TranslatorException
name in comp and throws an
exception if that element does not exist. This method is used to check whether a compound access
overlaps with an operation name.comp - the compound to checkname - the name of the elementcall - the causing callnet.ssehub.easy.dslCore.translation.TranslatorException - an exception in case that the element does not exist (and in this
specific case clashes with an operation call of the same nameprivate void processDeclaration(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree lhs,
ContainerOp op,
TypeContext context,
net.ssehub.easy.varModel.model.IModelElement parent,
Declaration declaration,
java.util.List<net.ssehub.easy.varModel.model.DecisionVariableDeclaration> declarators)
throws net.ssehub.easy.dslCore.translation.TranslatorException
lhs - the operand expression the container operation runs onop - the container operationcontext - the type context to be consideredparent - the actual (intended) parent of the constraint to be createddeclaration - the declaration to be processeddeclarators - the declarators to be modified as a side effectnet.ssehub.easy.dslCore.translation.TranslatorException - in case that the processing of the lhs must be terminated abnormallyprivate net.ssehub.easy.varModel.cst.ConstraintSyntaxTree processContainerOp(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree lhs,
ContainerOp op,
TypeContext context,
net.ssehub.easy.varModel.model.IModelElement parent)
throws net.ssehub.easy.dslCore.translation.TranslatorException
lhs - the operand expression the container operation runs onop - the container operationcontext - the type context to be consideredparent - the actual (intended) parent of the constraint to be creatednet.ssehub.easy.dslCore.translation.TranslatorException - in case that the processing of the lhs must be
terminated abnormallyprivate net.ssehub.easy.varModel.cst.ConstraintSyntaxTree getAccessor(java.util.List<ActualArgument> args,
net.ssehub.easy.varModel.model.DecisionVariableDeclaration decl)
args - the argumentsdecl - the binding declaratorprivate net.ssehub.easy.varModel.cst.ConstraintSyntaxTree getAccessor(ImplicationExpression ex,
net.ssehub.easy.varModel.model.DecisionVariableDeclaration decl)
ex - the expressiondecl - the binding declaratorprivate net.ssehub.easy.varModel.cst.ConstraintSyntaxTree getAccessor(AssignmentExpression ex,
net.ssehub.easy.varModel.model.DecisionVariableDeclaration decl)
ex - the expressiondecl - the binding declaratorprivate net.ssehub.easy.varModel.cst.ConstraintSyntaxTree getAccessor(LogicalExpression ex,
net.ssehub.easy.varModel.model.DecisionVariableDeclaration decl)
ex - the expressiondecl - the binding declaratorprivate net.ssehub.easy.varModel.cst.ConstraintSyntaxTree getAccessor(EqualityExpression ex,
net.ssehub.easy.varModel.model.DecisionVariableDeclaration decl)
ex - the expressiondecl - the binding declaratorprivate net.ssehub.easy.varModel.cst.ConstraintSyntaxTree getAccessor(RelationalExpression ex,
net.ssehub.easy.varModel.model.DecisionVariableDeclaration decl)
ex - the expressiondecl - the binding declaratorprivate net.ssehub.easy.varModel.cst.ConstraintSyntaxTree getAccessor(AdditiveExpression ex,
net.ssehub.easy.varModel.model.DecisionVariableDeclaration decl)
ex - the expressiondecl - the binding declaratorprivate net.ssehub.easy.varModel.cst.ConstraintSyntaxTree getAccessor(MultiplicativeExpression ex,
net.ssehub.easy.varModel.model.DecisionVariableDeclaration decl)
ex - the expressiondecl - the binding declaratorprivate net.ssehub.easy.varModel.cst.ConstraintSyntaxTree getAccessor(UnaryExpression ex,
net.ssehub.easy.varModel.model.DecisionVariableDeclaration decl)
ex - the expressiondecl - the binding declaratorprivate net.ssehub.easy.varModel.cst.ConstraintSyntaxTree getAccessor(PostfixExpression ex,
net.ssehub.easy.varModel.model.DecisionVariableDeclaration decl)
ex - the expressiondecl - the binding declaratorprivate net.ssehub.easy.varModel.cst.ConstraintSyntaxTree getAccessor(PrimaryExpression ex,
net.ssehub.easy.varModel.model.DecisionVariableDeclaration decl)
ex - the expressiondecl - the binding declaratorprivate net.ssehub.easy.varModel.cst.ConstraintSyntaxTree getAccessor(Literal ex,
net.ssehub.easy.varModel.model.DecisionVariableDeclaration decl)
ex - the expressiondecl - the binding declaratorprivate net.ssehub.easy.varModel.cst.ConstraintSyntaxTree getAccessor(Value ex,
net.ssehub.easy.varModel.model.DecisionVariableDeclaration decl)
ex - the expressiondecl - the binding declaratorprivate net.ssehub.easy.varModel.cst.ConstraintSyntaxTree processContainerOp(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree lhs,
ContainerOp op,
java.util.List<net.ssehub.easy.varModel.model.DecisionVariableDeclaration> declarators,
net.ssehub.easy.varModel.cst.ConstraintSyntaxTree declEx,
TypeContext context,
net.ssehub.easy.varModel.model.IModelElement parent)
throws net.ssehub.easy.dslCore.translation.TranslatorException
lhs - the operand expression the container operation runs onop - the container operationdeclarators - explicit declarators overriding the information given in opdeclEx - explicit iterator expression overriding the information given in opcontext - the type context to be consideredparent - the actual (intended) parent of the constraint to be creatednet.ssehub.easy.dslCore.translation.TranslatorException - in case that the processing of the lhs must be
terminated abnormallyprivate void checkOperationOclCompliance(net.ssehub.easy.varModel.model.datatypes.Operation op,
org.eclipse.emf.ecore.EObject cause,
org.eclipse.emf.ecore.EStructuralFeature feature)
op - the operationcause - the causing ECore objectfeature - the causing ECore featureprivate net.ssehub.easy.varModel.cst.ConstraintSyntaxTree processPostfixExpression(PostfixExpression expr,
TypeContext context,
net.ssehub.easy.varModel.model.IModelElement parent)
throws net.ssehub.easy.dslCore.translation.TranslatorException
expr - the expression to be processedcontext - the type context to be consideredparent - the actual (intended) parent of the constraint to be creatednet.ssehub.easy.dslCore.translation.TranslatorException - in case that the processing of the expr must be
terminated abnormallyprivate static net.ssehub.easy.varModel.model.datatypes.IDatatype refType(net.ssehub.easy.varModel.model.datatypes.IDatatype varType,
TypeContext context)
varType - the variable typecontext - the type contextprivate net.ssehub.easy.varModel.cst.ConstraintSyntaxTree processPrimaryExpression(PrimaryExpression expr,
TypeContext context,
net.ssehub.easy.varModel.model.IModelElement parent)
throws net.ssehub.easy.dslCore.translation.TranslatorException
expr - the expression to be processedcontext - the type context to be consideredparent - the actual (intended) parent of the constraint to be creatednet.ssehub.easy.dslCore.translation.TranslatorException - in case that the processing of the expr must be
terminated abnormallyprivate net.ssehub.easy.varModel.cst.ConstraintSyntaxTree processCallsAndAccess(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree lhs,
java.util.List<Call> calls,
ExpressionAccess access,
TypeContext context,
net.ssehub.easy.varModel.model.IModelElement parent)
throws net.ssehub.easy.dslCore.translation.TranslatorException
lhs - the expression on the left hand side (processed so far)calls - a list of calls (may be null or empty)access - an optional access expression (may be null)context - the type context to be consideredparent - the actual (intended) parent of the constraint to be creatednet.ssehub.easy.dslCore.translation.TranslatorException - in case that the processing of the expr must be
terminated abnormallyprivate boolean hasLiteral(net.ssehub.easy.varModel.model.datatypes.Enum eenum,
java.lang.String name)
eenum defines a literal
called name.eenum - the enumeration to to search forname - the name of the literaltrue if there is a literal with the given name, false elseprivate boolean hasSlot(net.ssehub.easy.varModel.model.datatypes.Compound comp,
java.lang.String name)
comp or its refined compounds
contains a slot of name name.comp - the compound to search forname - the name of the slottrue if there is a slot with the given name, false elseprivate net.ssehub.easy.varModel.cst.ConstraintSyntaxTree processAccess(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree lhs,
ExpressionAccess access,
TypeContext context,
net.ssehub.easy.varModel.model.IModelElement parent)
throws net.ssehub.easy.dslCore.translation.TranslatorException
lhs - the expression on the left hand side (processed so far)access - an access expressioncontext - the type context to be consideredparent - the actual (intended) parent of the constraint to be creatednet.ssehub.easy.dslCore.translation.TranslatorException - in case that the processing of the expr must be
terminated abnormallyprivate net.ssehub.easy.varModel.cst.ConstraintSyntaxTree processContainerInitializer(net.ssehub.easy.varModel.model.datatypes.IDatatype lhsType,
org.eclipse.emf.ecore.EObject expr,
ContainerInitializer initializer,
TypeContext context,
net.ssehub.easy.varModel.model.IModelElement parent)
throws net.ssehub.easy.dslCore.translation.TranslatorException,
net.ssehub.easy.varModel.model.IvmlException
lhsType - the left hand side which defines the type (part)expr - the containing primary expressioninitializer - the initializercontext - the type context for resolving variables etc.parent - the parent elementnet.ssehub.easy.dslCore.translation.TranslatorException - in case that the processing of the initializer must
be terminated abnormallynet.ssehub.easy.varModel.model.IvmlException - in case that the processing terminates in IVML type resolutionprivate java.lang.Object[] translateToValues(java.lang.Object[] values)
throws net.ssehub.easy.varModel.model.IvmlException
values - the values to be translated (to be modified as a side effect)net.ssehub.easy.varModel.model.IvmlException - in case that the expressions in value do not
represent literalsprivate net.ssehub.easy.varModel.model.datatypes.IDatatype getSpecificType(net.ssehub.easy.varModel.model.datatypes.IDatatype lhsType,
ContainerInitializer initializer,
TypeContext context)
throws net.ssehub.easy.dslCore.translation.TranslatorException
lhsType - the left hand side which defines the type (part)initializer - the initializercontext - the type context for resolving variables etc.net.ssehub.easy.dslCore.translation.TranslatorException - in case that the processing of the initializer
must be terminated abnormallyprivate net.ssehub.easy.varModel.cst.ConstraintSyntaxTree processLiteralContainer(net.ssehub.easy.varModel.model.datatypes.IDatatype lhsType,
ContainerInitializer initializer,
TypeContext context,
net.ssehub.easy.varModel.model.IModelElement parent)
throws net.ssehub.easy.dslCore.translation.TranslatorException,
net.ssehub.easy.varModel.cst.CSTSemanticException,
net.ssehub.easy.varModel.model.IvmlException
lhsType - the left hand side which defines the type (part)initializer - the initializercontext - the type context for resolving variables etc.parent - the parent elementnet.ssehub.easy.dslCore.translation.TranslatorException - in case that the processing of the initializer
must be terminated abnormallynet.ssehub.easy.varModel.cst.CSTSemanticException - in case that the processing of the initializer
must be terminated abnormallynet.ssehub.easy.varModel.model.IvmlException - in case that the processing of the initializer
must be terminated abnormallyprivate net.ssehub.easy.varModel.cst.ConstraintSyntaxTree processCompoundInitializer(net.ssehub.easy.varModel.model.datatypes.IDatatype lhsType,
TypeContext context,
net.ssehub.easy.varModel.model.IModelElement parent,
net.ssehub.easy.varModel.model.datatypes.IDatatype specificType,
org.eclipse.emf.common.util.EList<ExpressionListEntry> entryList)
throws net.ssehub.easy.dslCore.translation.TranslatorException,
net.ssehub.easy.varModel.cst.CSTSemanticException,
net.ssehub.easy.varModel.model.IvmlException,
net.ssehub.easy.varModel.model.values.ValueDoesNotMatchTypeException
lhsType - the left hand side typecontext - the type context for resolving variables etc.parent - the parent elementspecificType - the specific type of the containerentryList - the entries of the initializernet.ssehub.easy.dslCore.translation.TranslatorException - in case that the processing of the initializer
must be terminated abnormallynet.ssehub.easy.varModel.cst.CSTSemanticException - in case that the processing of the initializer
must be terminated abnormallynet.ssehub.easy.varModel.model.IvmlException - in case that the processing of the initializer
must be terminated abnormallynet.ssehub.easy.varModel.model.values.ValueDoesNotMatchTypeException - in case that the processing of the initializer
must be terminated abnormallyprivate net.ssehub.easy.varModel.cst.ConstraintSyntaxTree processContainerInitializer(net.ssehub.easy.varModel.model.datatypes.IDatatype lhsType,
TypeContext context,
net.ssehub.easy.varModel.model.IModelElement parent,
org.eclipse.emf.common.util.EList<ExpressionListEntry> entryList)
throws net.ssehub.easy.dslCore.translation.TranslatorException,
net.ssehub.easy.varModel.cst.CSTSemanticException,
net.ssehub.easy.varModel.model.IvmlException,
net.ssehub.easy.varModel.model.values.ValueDoesNotMatchTypeException
lhsType - the left hand side typecontext - the type context for resolving variables etc.parent - the parent elemententryList - the entries in the initializernet.ssehub.easy.dslCore.translation.TranslatorException - in case that the processing of the initializer
must be terminated abnormallynet.ssehub.easy.varModel.cst.CSTSemanticException - in case that the processing of the initializer
must be terminated abnormallynet.ssehub.easy.varModel.model.IvmlException - in case that the processing of the initializer
must be terminated abnormallynet.ssehub.easy.varModel.model.values.ValueDoesNotMatchTypeException - in case that the processing of the initializer
must be terminated abnormallyprivate static boolean allConstant(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree[] exprs)
exprs are constant.exprs - the expressions to analyzetrue if all expressions are constant, false elsepublic void warnDiscouragedNames(java.lang.String name,
org.eclipse.emf.ecore.EObject cause,
org.eclipse.emf.ecore.EStructuralFeature causingFeature)
name - the name to be checkedcause - the causing language elementcausingFeature - the causing language featureCopyright © 2009 - 2018 SSE. All Rights Reserved.