public class ExpressionTranslator extends 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(ConstraintSyntaxTree[] exprs)
Returns whether all
exprs are constant. |
private void |
checkForAssigment(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(Compound comp,
java.lang.String name,
de.uni_hildesheim.sse.ivml.ActualArgumentList call)
Checks for an existing compound element
name in comp and throws an
exception if that element does not exist. |
private void |
checkForSameTypeWarning(ConstraintSyntaxTree lhs,
java.lang.String op,
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(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(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 ConstraintSyntaxTree |
getAccessor(de.uni_hildesheim.sse.ivml.AdditiveExpression ex,
DecisionVariableDeclaration decl)
Extracts a compound accessor/slot name from the given expression.
|
private ConstraintSyntaxTree |
getAccessor(de.uni_hildesheim.sse.ivml.AssignmentExpression ex,
DecisionVariableDeclaration decl)
Extracts a compound accessor/slot name from the given expression.
|
private ConstraintSyntaxTree |
getAccessor(de.uni_hildesheim.sse.ivml.EqualityExpression ex,
DecisionVariableDeclaration decl)
Extracts a compound accessor/slot name from the given expression.
|
private ConstraintSyntaxTree |
getAccessor(de.uni_hildesheim.sse.ivml.ImplicationExpression ex,
DecisionVariableDeclaration decl)
Extracts a compound accessor/slot name from the given expression.
|
private ConstraintSyntaxTree |
getAccessor(java.util.List<de.uni_hildesheim.sse.ivml.ActualArgument> args,
DecisionVariableDeclaration decl)
Extracts a compound accessor/slot name from the given arguments.
|
private ConstraintSyntaxTree |
getAccessor(de.uni_hildesheim.sse.ivml.Literal ex,
DecisionVariableDeclaration decl)
Extracts a compound accessor/slot name from the given expression.
|
private ConstraintSyntaxTree |
getAccessor(de.uni_hildesheim.sse.ivml.LogicalExpression ex,
DecisionVariableDeclaration decl)
Extracts a compound accessor/slot name from the given expression.
|
private ConstraintSyntaxTree |
getAccessor(de.uni_hildesheim.sse.ivml.MultiplicativeExpression ex,
DecisionVariableDeclaration decl)
Extracts a compound accessor/slot name from the given expression.
|
private ConstraintSyntaxTree |
getAccessor(de.uni_hildesheim.sse.ivml.PostfixExpression ex,
DecisionVariableDeclaration decl)
Extracts a compound accessor/slot name from the given expression.
|
private ConstraintSyntaxTree |
getAccessor(de.uni_hildesheim.sse.ivml.PrimaryExpression ex,
DecisionVariableDeclaration decl)
Extracts a compound accessor/slot name from the given expression.
|
private ConstraintSyntaxTree |
getAccessor(de.uni_hildesheim.sse.ivml.RelationalExpression ex,
DecisionVariableDeclaration decl)
Extracts a compound accessor/slot name from the given expression.
|
private ConstraintSyntaxTree |
getAccessor(de.uni_hildesheim.sse.ivml.UnaryExpression ex,
DecisionVariableDeclaration decl)
Extracts a compound accessor/slot name from the given expression.
|
private ConstraintSyntaxTree |
getAccessor(de.uni_hildesheim.sse.ivml.Value ex,
DecisionVariableDeclaration decl)
Extracts a compound accessor/slot name from the given expression.
|
private IDatatype |
getSpecificType(IDatatype lhsType,
de.uni_hildesheim.sse.ivml.ContainerInitializer initializer,
TypeContext context)
Returns the specific type of a collection initializer.
|
private ConstraintSyntaxTree |
handleBasicComment(org.eclipse.emf.ecore.EObject object,
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(Enum eenum,
java.lang.String name)
Returns whether the given enumeration
eenum defines a literal
called name. |
private boolean |
hasSlot(Compound comp,
java.lang.String name)
Returns whether the given compound
comp or its refined compounds
contains a slot of name name. |
private IDatatype |
inferDatatypeQuietly(ConstraintSyntaxTree cst)
Infers the datatype of
cst. |
(package private) void |
initLevel()
Initializes the levels.
|
private ConstraintSyntaxTree |
processAccess(ConstraintSyntaxTree lhs,
de.uni_hildesheim.sse.ivml.ExpressionAccess access,
TypeContext context,
IModelElement parent)
Process an access expression.
|
private ConstraintSyntaxTree |
processAdditiveExpression(de.uni_hildesheim.sse.ivml.AdditiveExpression expr,
TypeContext context,
IModelElement parent)
Process an additive expression and turn it into a feature call.
|
private ConstraintSyntaxTree |
processArgument(IDatatype lhsType,
de.uni_hildesheim.sse.ivml.ActualArgument arg,
TypeContext context,
IModelElement parent)
Process an argument and returns a (named) expression.
|
private ConstraintSyntaxTree |
processAssignmentExpression(de.uni_hildesheim.sse.ivml.AssignmentExpression expr,
TypeContext context,
IModelElement parent)
Process an assignment expression and turn it into a feature call.
|
(package private) ConstraintSyntaxTree |
processBlockExpression(de.uni_hildesheim.sse.ivml.BlockExpression block,
TypeContext context,
IModelElement parent)
Processes a block expression.
|
private ConstraintSyntaxTree |
processCallsAndAccess(ConstraintSyntaxTree lhs,
java.util.List<de.uni_hildesheim.sse.ivml.Call> calls,
de.uni_hildesheim.sse.ivml.ExpressionAccess access,
TypeContext context,
IModelElement parent)
Process a possible empty list of calls and a possible empty access
expression.
|
private ConstraintSyntaxTree |
processCompoundInitializer(IDatatype lhsType,
TypeContext context,
IModelElement parent,
IDatatype specificType,
org.eclipse.emf.common.util.EList<de.uni_hildesheim.sse.ivml.ExpressionListEntry> entryList)
Processes a compound initializer.
|
private ConstraintSyntaxTree |
processContainerInitializer(IDatatype lhsType,
org.eclipse.emf.ecore.EObject expr,
de.uni_hildesheim.sse.ivml.ContainerInitializer initializer,
TypeContext context,
IModelElement parent)
Processes a container initializer.
|
private ConstraintSyntaxTree |
processContainerInitializer(IDatatype lhsType,
TypeContext context,
IModelElement parent,
org.eclipse.emf.common.util.EList<de.uni_hildesheim.sse.ivml.ExpressionListEntry> entryList)
Processes a container initializer.
|
private ConstraintSyntaxTree |
processContainerOp(ConstraintSyntaxTree lhs,
de.uni_hildesheim.sse.ivml.ContainerOp op,
java.util.List<DecisionVariableDeclaration> declarators,
ConstraintSyntaxTree declEx,
TypeContext context,
IModelElement parent)
Processes a container operation.
|
private ConstraintSyntaxTree |
processContainerOp(ConstraintSyntaxTree lhs,
de.uni_hildesheim.sse.ivml.ContainerOp op,
TypeContext context,
IModelElement parent)
Processes a container operation.
|
private void |
processDeclaration(ConstraintSyntaxTree lhs,
de.uni_hildesheim.sse.ivml.ContainerOp op,
TypeContext context,
IModelElement parent,
de.uni_hildesheim.sse.ivml.Declaration declaration,
java.util.List<DecisionVariableDeclaration> declarators)
Processes a valid declaration.
|
private ConstraintSyntaxTree |
processEqualityExpression(de.uni_hildesheim.sse.ivml.EqualityExpression expr,
TypeContext context,
IModelElement parent)
Process a equality expression and turn it into a feature call.
|
ConstraintSyntaxTree |
processExpression(de.uni_hildesheim.sse.ivml.Expression expr,
TypeContext context,
IModelElement parent)
Processes an expression and returns the result as a syntax tree.
|
(package private) ConstraintSyntaxTree |
processExpression(IDatatype lhsType,
de.uni_hildesheim.sse.ivml.Expression expr,
TypeContext context,
IModelElement parent)
Processes an expression and returns the result as a syntax tree.
|
private ConstraintSyntaxTree |
processExpression(IDatatype lhsType,
de.uni_hildesheim.sse.ivml.OptBlockExpression expr,
TypeContext context,
IModelElement parent)
Processes an (optional block) expression.
|
private ConstraintSyntaxTree |
processFeatureCall(ConstraintSyntaxTree lhs,
de.uni_hildesheim.sse.ivml.FeatureCall call,
TypeContext context,
IModelElement parent)
Processes a feature call.
|
private ConstraintSyntaxTree |
processFeatureCallImpl(ConstraintSyntaxTree lhs,
de.uni_hildesheim.sse.ivml.ActualArgumentList call,
TypeContext context,
IModelElement parent,
boolean checkOclCompliance)
Processes a feature call.
|
private ConstraintSyntaxTree |
processImplicationExpression(de.uni_hildesheim.sse.ivml.ImplicationExpression expr,
TypeContext context,
IModelElement parent)
Process an implication expression and turn it into a feature call.
|
private ConstraintSyntaxTree |
processLiteralContainer(IDatatype lhsType,
de.uni_hildesheim.sse.ivml.ContainerInitializer initializer,
TypeContext context,
IModelElement parent)
Processes a collection initializer and returns the related constraint syntax tree node.
|
(package private) ConstraintSyntaxTree |
processLogicalExpression(de.uni_hildesheim.sse.ivml.LogicalExpression expr,
TypeContext context,
IModelElement parent)
Process a logical expression and turn it into a feature call.
|
private ConstraintSyntaxTree |
processMultiplicativeExpression(de.uni_hildesheim.sse.ivml.MultiplicativeExpression expr,
TypeContext context,
IModelElement parent)
Process a multiplicative expression and turn it into a feature call.
|
private ConstraintSyntaxTree |
processPostfixExpression(de.uni_hildesheim.sse.ivml.PostfixExpression expr,
TypeContext context,
IModelElement parent)
Process a postfix expression and turn it into a feature call.
|
private ConstraintSyntaxTree |
processPrimaryExpression(de.uni_hildesheim.sse.ivml.PrimaryExpression expr,
TypeContext context,
IModelElement parent)
Process a primary expression.
|
private ConstraintSyntaxTree |
processRelationalExpression(de.uni_hildesheim.sse.ivml.RelationalExpression expr,
TypeContext context,
IModelElement parent)
Process a relational expression and turn it into a feature call.
|
private ConstraintSyntaxTree |
processUnaryExpression(de.uni_hildesheim.sse.ivml.UnaryExpression expr,
TypeContext context,
IModelElement parent)
Process a unary expression and turn it into a feature call.
|
private static IDatatype |
refType(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(IvmlException exception,
org.eclipse.emf.ecore.EObject cause,
org.eclipse.emf.ecore.EStructuralFeature causeFeature)
Turns an IVML exception into a xText warning.
|
clearMessages, clearMessages, collect, error, error, getErrorCount, getMessage, getMessageCount, warningerrorprivate 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(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
IvmlPackage.Literalsvoid warning(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
IvmlPackage.Literalsprivate ConstraintSyntaxTree handleBasicComment(org.eclipse.emf.ecore.EObject object, 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 ConstraintSyntaxTree processExpression(de.uni_hildesheim.sse.ivml.Expression expr, TypeContext context, IModelElement parent) throws 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 createdTranslatorException - in case that the processing of the expr must be
terminated abnormallyConstraintSyntaxTree processBlockExpression(de.uni_hildesheim.sse.ivml.BlockExpression block, TypeContext context, IModelElement parent) throws TranslatorException
block - the blockcontext - the type contextparent - the parent elementTranslatorException - in case that the processing of the block must be
terminated abnormallyprivate ConstraintSyntaxTree processExpression(IDatatype lhsType, de.uni_hildesheim.sse.ivml.OptBlockExpression expr, TypeContext context, IModelElement parent) throws 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 createdTranslatorException - in case that the processing of the expr must be
terminated abnormallyConstraintSyntaxTree processExpression(IDatatype lhsType, de.uni_hildesheim.sse.ivml.Expression expr, TypeContext context, IModelElement parent) throws 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 createdTranslatorException - in case that the processing of the expr must be
terminated abnormallyprivate ConstraintSyntaxTree processAssignmentExpression(de.uni_hildesheim.sse.ivml.AssignmentExpression expr, TypeContext context, IModelElement parent) throws TranslatorException
expr - the expression to be processedcontext - the type context to be consideredparent - the actual (intended) parent of the constraint to be createdTranslatorException - in case that the processing of the expr must be
terminated abnormallyprivate void checkForSameTypeWarning(ConstraintSyntaxTree lhs, java.lang.String op, 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 IDatatype inferDatatypeQuietly(ConstraintSyntaxTree cst)
cst.cst - the constraint syntax treeprivate ConstraintSyntaxTree processImplicationExpression(de.uni_hildesheim.sse.ivml.ImplicationExpression expr, TypeContext context, IModelElement parent) throws TranslatorException
expr - the expression to be processedcontext - the type context to be consideredparent - the actual (intended) parent of the constraint to be createdTranslatorException - in case that the processing of the expr must be
terminated abnormallyprivate void checkForAssigment(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 causeConstraintSyntaxTree processLogicalExpression(de.uni_hildesheim.sse.ivml.LogicalExpression expr, TypeContext context, IModelElement parent) throws TranslatorException
initLevel() before.expr - the expression to be processedcontext - the type context to be consideredparent - the actual (intended) parent of the constraint to be createdTranslatorException - in case that the processing of the expr must be
terminated abnormallyprivate ConstraintSyntaxTree processEqualityExpression(de.uni_hildesheim.sse.ivml.EqualityExpression expr, TypeContext context, IModelElement parent) throws TranslatorException
expr - the expression to be processedcontext - the type context to be consideredparent - the actual (intended) parent of the constraint to be createdTranslatorException - in case that the processing of the expr must be
terminated abnormallyprivate ConstraintSyntaxTree processRelationalExpression(de.uni_hildesheim.sse.ivml.RelationalExpression expr, TypeContext context, IModelElement parent) throws TranslatorException
expr - the expression to be processedcontext - the type context to be consideredparent - the actual (intended) parent of the constraint to be createdTranslatorException - in case that the processing of the expr must be
terminated abnormallyprivate ConstraintSyntaxTree processAdditiveExpression(de.uni_hildesheim.sse.ivml.AdditiveExpression expr, TypeContext context, IModelElement parent) throws TranslatorException
expr - the expression to be processedcontext - the type context to be consideredparent - the actual (intended) parent of the constraint to be createdTranslatorException - in case that the processing of the expr must be
terminated abnormallyprivate ConstraintSyntaxTree processMultiplicativeExpression(de.uni_hildesheim.sse.ivml.MultiplicativeExpression expr, TypeContext context, IModelElement parent) throws TranslatorException
expr - the expression to be processedcontext - the type context to be consideredparent - the actual (intended) parent of the constraint to be createdTranslatorException - in case that the processing of the expr must be
terminated abnormallyprivate ConstraintSyntaxTree processUnaryExpression(de.uni_hildesheim.sse.ivml.UnaryExpression expr, TypeContext context, IModelElement parent) throws TranslatorException
expr - the expression to be processedcontext - the type context to be consideredparent - the actual (intended) parent of the constraint to be createdTranslatorException - in case that the processing of the expr must be
terminated abnormallyprivate ConstraintSyntaxTree processFeatureCall(ConstraintSyntaxTree lhs, de.uni_hildesheim.sse.ivml.FeatureCall call, TypeContext context, IModelElement parent) throws 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 createdTranslatorException - in case that the processing of the lhs must be
terminated abnormallyprivate ConstraintSyntaxTree processFeatureCallImpl(ConstraintSyntaxTree lhs, de.uni_hildesheim.sse.ivml.ActualArgumentList call, TypeContext context, IModelElement parent, boolean checkOclCompliance) throws 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 .TranslatorException - in case that the processing of the lhs must be
terminated abnormallyprivate ConstraintSyntaxTree processArgument(IDatatype lhsType, de.uni_hildesheim.sse.ivml.ActualArgument arg, TypeContext context, IModelElement parent) throws 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 createdTranslatorException - in case that the expression cannot be translated for some reasonprivate void checkForCompoundElement(Compound comp, java.lang.String name, de.uni_hildesheim.sse.ivml.ActualArgumentList call) throws 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 callTranslatorException - 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(ConstraintSyntaxTree lhs, de.uni_hildesheim.sse.ivml.ContainerOp op, TypeContext context, IModelElement parent, de.uni_hildesheim.sse.ivml.Declaration declaration, java.util.List<DecisionVariableDeclaration> declarators) throws 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 effectTranslatorException - in case that the processing of the lhs must be terminated abnormallyprivate ConstraintSyntaxTree processContainerOp(ConstraintSyntaxTree lhs, de.uni_hildesheim.sse.ivml.ContainerOp op, TypeContext context, IModelElement parent) throws 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 createdTranslatorException - in case that the processing of the lhs must be
terminated abnormallyprivate ConstraintSyntaxTree getAccessor(java.util.List<de.uni_hildesheim.sse.ivml.ActualArgument> args, DecisionVariableDeclaration decl)
args - the argumentsdecl - the binding declaratorprivate ConstraintSyntaxTree getAccessor(de.uni_hildesheim.sse.ivml.ImplicationExpression ex, DecisionVariableDeclaration decl)
ex - the expressiondecl - the binding declaratorprivate ConstraintSyntaxTree getAccessor(de.uni_hildesheim.sse.ivml.AssignmentExpression ex, DecisionVariableDeclaration decl)
ex - the expressiondecl - the binding declaratorprivate ConstraintSyntaxTree getAccessor(de.uni_hildesheim.sse.ivml.LogicalExpression ex, DecisionVariableDeclaration decl)
ex - the expressiondecl - the binding declaratorprivate ConstraintSyntaxTree getAccessor(de.uni_hildesheim.sse.ivml.EqualityExpression ex, DecisionVariableDeclaration decl)
ex - the expressiondecl - the binding declaratorprivate ConstraintSyntaxTree getAccessor(de.uni_hildesheim.sse.ivml.RelationalExpression ex, DecisionVariableDeclaration decl)
ex - the expressiondecl - the binding declaratorprivate ConstraintSyntaxTree getAccessor(de.uni_hildesheim.sse.ivml.AdditiveExpression ex, DecisionVariableDeclaration decl)
ex - the expressiondecl - the binding declaratorprivate ConstraintSyntaxTree getAccessor(de.uni_hildesheim.sse.ivml.MultiplicativeExpression ex, DecisionVariableDeclaration decl)
ex - the expressiondecl - the binding declaratorprivate ConstraintSyntaxTree getAccessor(de.uni_hildesheim.sse.ivml.UnaryExpression ex, DecisionVariableDeclaration decl)
ex - the expressiondecl - the binding declaratorprivate ConstraintSyntaxTree getAccessor(de.uni_hildesheim.sse.ivml.PostfixExpression ex, DecisionVariableDeclaration decl)
ex - the expressiondecl - the binding declaratorprivate ConstraintSyntaxTree getAccessor(de.uni_hildesheim.sse.ivml.PrimaryExpression ex, DecisionVariableDeclaration decl)
ex - the expressiondecl - the binding declaratorprivate ConstraintSyntaxTree getAccessor(de.uni_hildesheim.sse.ivml.Literal ex, DecisionVariableDeclaration decl)
ex - the expressiondecl - the binding declaratorprivate ConstraintSyntaxTree getAccessor(de.uni_hildesheim.sse.ivml.Value ex, DecisionVariableDeclaration decl)
ex - the expressiondecl - the binding declaratorprivate ConstraintSyntaxTree processContainerOp(ConstraintSyntaxTree lhs, de.uni_hildesheim.sse.ivml.ContainerOp op, java.util.List<DecisionVariableDeclaration> declarators, ConstraintSyntaxTree declEx, TypeContext context, IModelElement parent) throws 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 createdTranslatorException - in case that the processing of the lhs must be
terminated abnormallyprivate void checkOperationOclCompliance(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 ConstraintSyntaxTree processPostfixExpression(de.uni_hildesheim.sse.ivml.PostfixExpression expr, TypeContext context, IModelElement parent) throws TranslatorException
expr - the expression to be processedcontext - the type context to be consideredparent - the actual (intended) parent of the constraint to be createdTranslatorException - in case that the processing of the expr must be
terminated abnormallyprivate static IDatatype refType(IDatatype varType, TypeContext context)
varType - the variable typecontext - the type contextprivate ConstraintSyntaxTree processPrimaryExpression(de.uni_hildesheim.sse.ivml.PrimaryExpression expr, TypeContext context, IModelElement parent) throws TranslatorException
expr - the expression to be processedcontext - the type context to be consideredparent - the actual (intended) parent of the constraint to be createdTranslatorException - in case that the processing of the expr must be
terminated abnormallyprivate ConstraintSyntaxTree processCallsAndAccess(ConstraintSyntaxTree lhs, java.util.List<de.uni_hildesheim.sse.ivml.Call> calls, de.uni_hildesheim.sse.ivml.ExpressionAccess access, TypeContext context, IModelElement parent) throws 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 createdTranslatorException - in case that the processing of the expr must be
terminated abnormallyprivate boolean hasLiteral(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(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 ConstraintSyntaxTree processAccess(ConstraintSyntaxTree lhs, de.uni_hildesheim.sse.ivml.ExpressionAccess access, TypeContext context, IModelElement parent) throws 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 createdTranslatorException - in case that the processing of the expr must be
terminated abnormallyprivate ConstraintSyntaxTree processContainerInitializer(IDatatype lhsType, org.eclipse.emf.ecore.EObject expr, de.uni_hildesheim.sse.ivml.ContainerInitializer initializer, TypeContext context, IModelElement parent) throws TranslatorException, 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 elementTranslatorException - in case that the processing of the initializer must
be terminated abnormallyIvmlException - in case that the processing terminates in IVML type resolutionprivate java.lang.Object[] translateToValues(java.lang.Object[] values)
throws IvmlException
values - the values to be translated (to be modified as a side effect)IvmlException - in case that the expressions in value do not
represent literalsprivate IDatatype getSpecificType(IDatatype lhsType, de.uni_hildesheim.sse.ivml.ContainerInitializer initializer, TypeContext context) throws TranslatorException
lhsType - the left hand side which defines the type (part)initializer - the initializercontext - the type context for resolving variables etc.TranslatorException - in case that the processing of the initializer
must be terminated abnormallyprivate ConstraintSyntaxTree processLiteralContainer(IDatatype lhsType, de.uni_hildesheim.sse.ivml.ContainerInitializer initializer, TypeContext context, IModelElement parent) throws TranslatorException, CSTSemanticException, IvmlException
lhsType - the left hand side which defines the type (part)initializer - the initializercontext - the type context for resolving variables etc.parent - the parent elementTranslatorException - in case that the processing of the initializer
must be terminated abnormallyCSTSemanticException - in case that the processing of the initializer
must be terminated abnormallyIvmlException - in case that the processing of the initializer
must be terminated abnormallyprivate ConstraintSyntaxTree processCompoundInitializer(IDatatype lhsType, TypeContext context, IModelElement parent, IDatatype specificType, org.eclipse.emf.common.util.EList<de.uni_hildesheim.sse.ivml.ExpressionListEntry> entryList) throws TranslatorException, CSTSemanticException, IvmlException, 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 initializerTranslatorException - in case that the processing of the initializer
must be terminated abnormallyCSTSemanticException - in case that the processing of the initializer
must be terminated abnormallyIvmlException - in case that the processing of the initializer
must be terminated abnormallyValueDoesNotMatchTypeException - in case that the processing of the initializer
must be terminated abnormallyprivate ConstraintSyntaxTree processContainerInitializer(IDatatype lhsType, TypeContext context, IModelElement parent, org.eclipse.emf.common.util.EList<de.uni_hildesheim.sse.ivml.ExpressionListEntry> entryList) throws TranslatorException, CSTSemanticException, IvmlException, ValueDoesNotMatchTypeException
lhsType - the left hand side typecontext - the type context for resolving variables etc.parent - the parent elemententryList - the entries in the initializerTranslatorException - in case that the processing of the initializer
must be terminated abnormallyCSTSemanticException - in case that the processing of the initializer
must be terminated abnormallyIvmlException - in case that the processing of the initializer
must be terminated abnormallyValueDoesNotMatchTypeException - in case that the processing of the initializer
must be terminated abnormallyprivate static boolean allConstant(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.