Class ExpressionTranslator
- java.lang.Object
-
- net.ssehub.easy.dslCore.translation.MessageReceiver
-
- net.ssehub.easy.dslCore.translation.ExpressionTranslator
-
- de.uni_hildesheim.sse.translation.ExpressionTranslator
-
- All Implemented Interfaces:
net.ssehub.easy.dslCore.translation.IMessageReceiver
public class ExpressionTranslator extends net.ssehub.easy.dslCore.translation.ExpressionTranslatorImplements a class which translates a given EMF expression in terms of the IVML grammar into the IVML object model. Please note that errors which occur during translation are not signaled as individual exceptions but collected and accessible throughExpressionTranslator.getMessage(int).- Author:
- Holger Eichelberger
-
-
Field Summary
Fields Modifier and Type Field Description private AssignmentDetectorassignmentDetectorprivate booleanhasTopLevelWarningprivate intlevelprivate RefByCheckVisitorrefByChecker
-
Constructor Summary
Constructors Constructor Description ExpressionTranslator()Creates an expression translator (to be used within this package only).
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static booleanallConstant(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree[] exprs)Returns whether allexprsare constant.private voidcheckForAssigment(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 incstand emits an error or a warning in case that the operation is found.private voidcheckForCompoundElement(net.ssehub.easy.varModel.model.datatypes.Compound comp, java.lang.String name, de.uni_hildesheim.sse.ivml.ActualArgumentList call)Checks for an existing compound elementnameincompand throws an exception if that element does not exist.private voidcheckForSameTypeWarning(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 operationopmay return wrong results if types on both sides are not somehow assignable.private voidcheckOperationOclCompliance(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) voiderror(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) voiderrorAboutTopLevelWarning(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.ConstraintSyntaxTreegetAccessor(de.uni_hildesheim.sse.ivml.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.ConstraintSyntaxTreegetAccessor(de.uni_hildesheim.sse.ivml.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.ConstraintSyntaxTreegetAccessor(de.uni_hildesheim.sse.ivml.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.ConstraintSyntaxTreegetAccessor(de.uni_hildesheim.sse.ivml.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.ConstraintSyntaxTreegetAccessor(de.uni_hildesheim.sse.ivml.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.ConstraintSyntaxTreegetAccessor(de.uni_hildesheim.sse.ivml.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.ConstraintSyntaxTreegetAccessor(de.uni_hildesheim.sse.ivml.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.ConstraintSyntaxTreegetAccessor(de.uni_hildesheim.sse.ivml.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.ConstraintSyntaxTreegetAccessor(de.uni_hildesheim.sse.ivml.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.ConstraintSyntaxTreegetAccessor(de.uni_hildesheim.sse.ivml.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.ConstraintSyntaxTreegetAccessor(de.uni_hildesheim.sse.ivml.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.ConstraintSyntaxTreegetAccessor(de.uni_hildesheim.sse.ivml.Value ex, net.ssehub.easy.varModel.model.DecisionVariableDeclaration decl)Extracts a compound accessor/slot name from the given expression.private net.ssehub.easy.varModel.cst.ConstraintSyntaxTreegetAccessor(java.util.List<de.uni_hildesheim.sse.ivml.ActualArgument> args, net.ssehub.easy.varModel.model.DecisionVariableDeclaration decl)Extracts a compound accessor/slot name from the given arguments.private net.ssehub.easy.varModel.model.datatypes.IDatatypegetSpecificType(net.ssehub.easy.varModel.model.datatypes.IDatatype lhsType, de.uni_hildesheim.sse.ivml.ContainerInitializer initializer, TypeContext context)Returns the specific type of a collection initializer.private net.ssehub.easy.varModel.cst.ConstraintSyntaxTreehandleBasicComment(org.eclipse.emf.ecore.EObject object, net.ssehub.easy.varModel.cst.ConstraintSyntaxTree subtree)Handles the comments assigned to the EMF AST elementobjectand inserts a comment node as top of thesubtreeif required.private booleanhasLiteral(net.ssehub.easy.varModel.model.datatypes.Enum eenum, java.lang.String name)Returns whether the given enumerationeenumdefines a literal calledname.private booleanhasSlot(net.ssehub.easy.varModel.model.datatypes.Compound comp, java.lang.String name)Returns whether the given compoundcompor its refined compounds contains a slot of namename.private net.ssehub.easy.varModel.model.datatypes.IDatatypeinferDatatypeQuietly(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree cst)Infers the datatype ofcst.(package private) voidinitLevel()Initializes the levels.private net.ssehub.easy.varModel.cst.ConstraintSyntaxTreeprocessAccess(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree lhs, de.uni_hildesheim.sse.ivml.ExpressionAccess access, TypeContext context, net.ssehub.easy.varModel.model.IModelElement parent)Process an access expression.private net.ssehub.easy.varModel.cst.ConstraintSyntaxTreeprocessAdditiveExpression(de.uni_hildesheim.sse.ivml.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.ConstraintSyntaxTreeprocessArgument(net.ssehub.easy.varModel.model.datatypes.IDatatype lhsType, de.uni_hildesheim.sse.ivml.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.ConstraintSyntaxTreeprocessAssignmentExpression(de.uni_hildesheim.sse.ivml.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.ConstraintSyntaxTreeprocessBlockExpression(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.ConstraintSyntaxTreeprocessCallsAndAccess(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree lhs, java.util.List<de.uni_hildesheim.sse.ivml.Call> calls, de.uni_hildesheim.sse.ivml.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.ConstraintSyntaxTreeprocessCompoundInitializer(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<de.uni_hildesheim.sse.ivml.ExpressionListEntry> entryList)Processes a compound initializer.private net.ssehub.easy.varModel.cst.ConstraintSyntaxTreeprocessContainerInitializer(net.ssehub.easy.varModel.model.datatypes.IDatatype lhsType, TypeContext context, net.ssehub.easy.varModel.model.IModelElement parent, org.eclipse.emf.common.util.EList<de.uni_hildesheim.sse.ivml.ExpressionListEntry> entryList)Processes a container initializer.private net.ssehub.easy.varModel.cst.ConstraintSyntaxTreeprocessContainerInitializer(net.ssehub.easy.varModel.model.datatypes.IDatatype lhsType, org.eclipse.emf.ecore.EObject expr, de.uni_hildesheim.sse.ivml.ContainerInitializer initializer, TypeContext context, net.ssehub.easy.varModel.model.IModelElement parent)Processes a container initializer.private net.ssehub.easy.varModel.cst.ConstraintSyntaxTreeprocessContainerOp(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree lhs, de.uni_hildesheim.sse.ivml.ContainerOp op, TypeContext context, net.ssehub.easy.varModel.model.IModelElement parent)Processes a container operation.private net.ssehub.easy.varModel.cst.ConstraintSyntaxTreeprocessContainerOp(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree lhs, de.uni_hildesheim.sse.ivml.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 voidprocessDeclaration(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree lhs, de.uni_hildesheim.sse.ivml.ContainerOp op, TypeContext context, net.ssehub.easy.varModel.model.IModelElement parent, de.uni_hildesheim.sse.ivml.Declaration declaration, java.util.List<net.ssehub.easy.varModel.model.DecisionVariableDeclaration> declarators)Processes a valid declaration.private net.ssehub.easy.varModel.cst.ConstraintSyntaxTreeprocessEqualityExpression(de.uni_hildesheim.sse.ivml.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.ConstraintSyntaxTreeprocessExpression(de.uni_hildesheim.sse.ivml.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.ConstraintSyntaxTreeprocessExpression(net.ssehub.easy.varModel.model.datatypes.IDatatype lhsType, de.uni_hildesheim.sse.ivml.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.ConstraintSyntaxTreeprocessExpression(net.ssehub.easy.varModel.model.datatypes.IDatatype lhsType, de.uni_hildesheim.sse.ivml.OptBlockExpression expr, TypeContext context, net.ssehub.easy.varModel.model.IModelElement parent)Processes an (optional block) expression.private net.ssehub.easy.varModel.cst.ConstraintSyntaxTreeprocessFeatureCall(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree lhs, de.uni_hildesheim.sse.ivml.FeatureCall call, TypeContext context, net.ssehub.easy.varModel.model.IModelElement parent)Processes a feature call.private net.ssehub.easy.varModel.cst.ConstraintSyntaxTreeprocessFeatureCallImpl(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree lhs, de.uni_hildesheim.sse.ivml.ActualArgumentList call, TypeContext context, net.ssehub.easy.varModel.model.IModelElement parent, boolean checkOclCompliance)Processes a feature call.private net.ssehub.easy.varModel.cst.ConstraintSyntaxTreeprocessImplicationExpression(de.uni_hildesheim.sse.ivml.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.ConstraintSyntaxTreeprocessLiteralContainer(net.ssehub.easy.varModel.model.datatypes.IDatatype lhsType, de.uni_hildesheim.sse.ivml.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.ConstraintSyntaxTreeprocessLogicalExpression(de.uni_hildesheim.sse.ivml.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.ConstraintSyntaxTreeprocessMultiplicativeExpression(de.uni_hildesheim.sse.ivml.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.ConstraintSyntaxTreeprocessPostfixExpression(de.uni_hildesheim.sse.ivml.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.ConstraintSyntaxTreeprocessPrimaryExpression(de.uni_hildesheim.sse.ivml.PrimaryExpression expr, TypeContext context, net.ssehub.easy.varModel.model.IModelElement parent)Process a primary expression.private net.ssehub.easy.varModel.cst.ConstraintSyntaxTreeprocessRelationalExpression(de.uni_hildesheim.sse.ivml.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.ConstraintSyntaxTreeprocessUnaryExpression(de.uni_hildesheim.sse.ivml.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.IDatatyperefType(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.voidwarnDiscouragedNames(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) voidwarning(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.
-
-
-
Field Detail
-
assignmentDetector
private AssignmentDetector assignmentDetector
-
level
private int level
-
hasTopLevelWarning
private boolean hasTopLevelWarning
-
refByChecker
private RefByCheckVisitor refByChecker
-
-
Method Detail
-
initLevel
void initLevel()
Initializes the levels.
-
errorAboutTopLevelWarning
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.- Parameters:
cause- the causing EObjectcausingFeature- the causing feature
-
error
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.- Parameters:
exception- the exception to usedcause- the cause (as instance of the EMF grammar model)causeFeature- the cause of the feature as an appropriate constant fromIvmlPackage.Literals
-
warning
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.- Parameters:
exception- the exception to usedcause- the cause (as instance of the EMF grammar model)causeFeature- the cause of the feature as an appropriate constant fromIvmlPackage.Literals
-
handleBasicComment
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 elementobjectand inserts a comment node as top of thesubtreeif required.- Parameters:
object- the EMF AST element to analyzesubtree- the constraint subtree to add the comment before- Returns:
- the resulting subtree
-
processExpression
public net.ssehub.easy.varModel.cst.ConstraintSyntaxTree processExpression(de.uni_hildesheim.sse.ivml.Expression expr, TypeContext context, net.ssehub.easy.varModel.model.IModelElement parent) throws net.ssehub.easy.dslCore.translation.TranslatorExceptionProcesses an expression and returns the result as a syntax tree. CallsinitLevel(), i.e., do not call from inside.- Parameters:
expr- the expression to be processedcontext- the type context to be consideredparent- the actual (intended) parent of the constraint to be created- Returns:
- the expression as a parsed syntax tree
- Throws:
net.ssehub.easy.dslCore.translation.TranslatorException- in case that the processing of theexprmust be terminated abnormally
-
processBlockExpression
net.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.TranslatorExceptionProcesses a block expression.- Parameters:
block- the blockcontext- the type contextparent- the parent element- Returns:
- the created constraint syntax tree
- Throws:
net.ssehub.easy.dslCore.translation.TranslatorException- in case that the processing of theblockmust be terminated abnormally
-
processExpression
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree processExpression(net.ssehub.easy.varModel.model.datatypes.IDatatype lhsType, de.uni_hildesheim.sse.ivml.OptBlockExpression expr, TypeContext context, net.ssehub.easy.varModel.model.IModelElement parent) throws net.ssehub.easy.dslCore.translation.TranslatorExceptionProcesses an (optional block) expression.- Parameters:
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 created- Returns:
- the expression as a parsed syntax tree
- Throws:
net.ssehub.easy.dslCore.translation.TranslatorException- in case that the processing of theexprmust be terminated abnormally
-
processExpression
net.ssehub.easy.varModel.cst.ConstraintSyntaxTree processExpression(net.ssehub.easy.varModel.model.datatypes.IDatatype lhsType, de.uni_hildesheim.sse.ivml.Expression expr, TypeContext context, net.ssehub.easy.varModel.model.IModelElement parent) throws net.ssehub.easy.dslCore.translation.TranslatorExceptionProcesses an expression and returns the result as a syntax tree. CallinitLevel()if called from outside.- Parameters:
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 created- Returns:
- the expression as a parsed syntax tree
- Throws:
net.ssehub.easy.dslCore.translation.TranslatorException- in case that the processing of theexprmust be terminated abnormally
-
processAssignmentExpression
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree processAssignmentExpression(de.uni_hildesheim.sse.ivml.AssignmentExpression expr, TypeContext context, net.ssehub.easy.varModel.model.IModelElement parent) throws net.ssehub.easy.dslCore.translation.TranslatorExceptionProcess an assignment expression and turn it into a feature call.- Parameters:
expr- the expression to be processedcontext- the type context to be consideredparent- the actual (intended) parent of the constraint to be created- Returns:
- the expression as a parsed syntax tree
- Throws:
net.ssehub.easy.dslCore.translation.TranslatorException- in case that the processing of theexprmust be terminated abnormally
-
checkForSameTypeWarning
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 operationopmay return wrong results if types on both sides are not somehow assignable.- Parameters:
lhs- the left hand side expressionop- the operatorrhs- the right hand side expressioncause- the causing grammar objectfeature- the causing grammar feature
-
inferDatatypeQuietly
private net.ssehub.easy.varModel.model.datatypes.IDatatype inferDatatypeQuietly(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree cst)
Infers the datatype ofcst.- Parameters:
cst- the constraint syntax tree- Returns:
- the inferred datatype or null in case of failures
-
processImplicationExpression
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree processImplicationExpression(de.uni_hildesheim.sse.ivml.ImplicationExpression expr, TypeContext context, net.ssehub.easy.varModel.model.IModelElement parent) throws net.ssehub.easy.dslCore.translation.TranslatorExceptionProcess an implication expression and turn it into a feature call.- Parameters:
expr- the expression to be processedcontext- the type context to be consideredparent- the actual (intended) parent of the constraint to be created- Returns:
- the expression as a parsed syntax tree
- Throws:
net.ssehub.easy.dslCore.translation.TranslatorException- in case that the processing of theexprmust be terminated abnormally
-
checkForAssigment
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 incstand emits an error or a warning in case that the operation is found.- Parameters:
cst- the constraint syntax tree to be checkederror- emit an error or a warningcause- the causing EObjectcausingFeature- the causing feature incause
-
processLogicalExpression
net.ssehub.easy.varModel.cst.ConstraintSyntaxTree processLogicalExpression(de.uni_hildesheim.sse.ivml.LogicalExpression expr, TypeContext context, net.ssehub.easy.varModel.model.IModelElement parent) throws net.ssehub.easy.dslCore.translation.TranslatorExceptionProcess a logical expression and turn it into a feature call. If called from outside, callinitLevel()before.- Parameters:
expr- the expression to be processedcontext- the type context to be consideredparent- the actual (intended) parent of the constraint to be created- Returns:
- the expression as a parsed syntax tree
- Throws:
net.ssehub.easy.dslCore.translation.TranslatorException- in case that the processing of theexprmust be terminated abnormally
-
processEqualityExpression
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree processEqualityExpression(de.uni_hildesheim.sse.ivml.EqualityExpression expr, TypeContext context, net.ssehub.easy.varModel.model.IModelElement parent) throws net.ssehub.easy.dslCore.translation.TranslatorExceptionProcess a equality expression and turn it into a feature call.- Parameters:
expr- the expression to be processedcontext- the type context to be consideredparent- the actual (intended) parent of the constraint to be created- Returns:
- the expression as a parsed syntax tree
- Throws:
net.ssehub.easy.dslCore.translation.TranslatorException- in case that the processing of theexprmust be terminated abnormally
-
processRelationalExpression
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree processRelationalExpression(de.uni_hildesheim.sse.ivml.RelationalExpression expr, TypeContext context, net.ssehub.easy.varModel.model.IModelElement parent) throws net.ssehub.easy.dslCore.translation.TranslatorExceptionProcess a relational expression and turn it into a feature call.- Parameters:
expr- the expression to be processedcontext- the type context to be consideredparent- the actual (intended) parent of the constraint to be created- Returns:
- the expression as a parsed syntax tree
- Throws:
net.ssehub.easy.dslCore.translation.TranslatorException- in case that the processing of theexprmust be terminated abnormally
-
processAdditiveExpression
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree processAdditiveExpression(de.uni_hildesheim.sse.ivml.AdditiveExpression expr, TypeContext context, net.ssehub.easy.varModel.model.IModelElement parent) throws net.ssehub.easy.dslCore.translation.TranslatorExceptionProcess an additive expression and turn it into a feature call.- Parameters:
expr- the expression to be processedcontext- the type context to be consideredparent- the actual (intended) parent of the constraint to be created- Returns:
- the expression as a parsed syntax tree
- Throws:
net.ssehub.easy.dslCore.translation.TranslatorException- in case that the processing of theexprmust be terminated abnormally
-
processMultiplicativeExpression
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree processMultiplicativeExpression(de.uni_hildesheim.sse.ivml.MultiplicativeExpression expr, TypeContext context, net.ssehub.easy.varModel.model.IModelElement parent) throws net.ssehub.easy.dslCore.translation.TranslatorExceptionProcess a multiplicative expression and turn it into a feature call.- Parameters:
expr- the expression to be processedcontext- the type context to be consideredparent- the actual (intended) parent of the constraint to be created- Returns:
- the expression as a parsed syntax tree
- Throws:
net.ssehub.easy.dslCore.translation.TranslatorException- in case that the processing of theexprmust be terminated abnormally
-
processUnaryExpression
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree processUnaryExpression(de.uni_hildesheim.sse.ivml.UnaryExpression expr, TypeContext context, net.ssehub.easy.varModel.model.IModelElement parent) throws net.ssehub.easy.dslCore.translation.TranslatorExceptionProcess a unary expression and turn it into a feature call.- Parameters:
expr- the expression to be processedcontext- the type context to be consideredparent- the actual (intended) parent of the constraint to be created- Returns:
- the expression as a parsed syntax tree
- Throws:
net.ssehub.easy.dslCore.translation.TranslatorException- in case that the processing of theexprmust be terminated abnormally
-
processFeatureCall
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree processFeatureCall(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree lhs, de.uni_hildesheim.sse.ivml.FeatureCall call, TypeContext context, net.ssehub.easy.varModel.model.IModelElement parent) throws net.ssehub.easy.dslCore.translation.TranslatorExceptionProcesses a feature call. This method allows to work with an emptylhsin case of a "context less method call" such asmax(1, 2)or with a givenlhs, e.g. fors.size();- Parameters:
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 created- Returns:
- the expression as a parsed syntax tree
- Throws:
net.ssehub.easy.dslCore.translation.TranslatorException- in case that the processing of thelhsmust be terminated abnormally
-
processFeatureCallImpl
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree processFeatureCallImpl(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree lhs, de.uni_hildesheim.sse.ivml.ActualArgumentList call, TypeContext context, net.ssehub.easy.varModel.model.IModelElement parent, boolean checkOclCompliance) throws net.ssehub.easy.dslCore.translation.TranslatorExceptionProcesses a feature call. This method allows to work with an emptylhsin case of a "context less method call" such asmax(1, 2)or with a givenlhs, e.g. fors.size();- Parameters:
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 .- Returns:
- the expression as a parsed syntax tree
- Throws:
net.ssehub.easy.dslCore.translation.TranslatorException- in case that the processing of thelhsmust be terminated abnormally
-
processArgument
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree processArgument(net.ssehub.easy.varModel.model.datatypes.IDatatype lhsType, de.uni_hildesheim.sse.ivml.ActualArgument arg, TypeContext context, net.ssehub.easy.varModel.model.IModelElement parent) throws net.ssehub.easy.dslCore.translation.TranslatorExceptionProcess an argument and returns a (named) expression.- Parameters:
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 created- Returns:
- the (named) expression
- Throws:
net.ssehub.easy.dslCore.translation.TranslatorException- in case that the expression cannot be translated for some reason
-
checkForCompoundElement
private void checkForCompoundElement(net.ssehub.easy.varModel.model.datatypes.Compound comp, java.lang.String name, de.uni_hildesheim.sse.ivml.ActualArgumentList call) throws net.ssehub.easy.dslCore.translation.TranslatorExceptionChecks for an existing compound elementnameincompand throws an exception if that element does not exist. This method is used to check whether a compound access overlaps with an operation name.- Parameters:
comp- the compound to checkname- the name of the elementcall- the causing call- Throws:
net.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 name
-
processDeclaration
private void processDeclaration(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree lhs, de.uni_hildesheim.sse.ivml.ContainerOp op, TypeContext context, net.ssehub.easy.varModel.model.IModelElement parent, de.uni_hildesheim.sse.ivml.Declaration declaration, java.util.List<net.ssehub.easy.varModel.model.DecisionVariableDeclaration> declarators) throws net.ssehub.easy.dslCore.translation.TranslatorExceptionProcesses a valid declaration.- Parameters:
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 effect- Throws:
net.ssehub.easy.dslCore.translation.TranslatorException- in case that the processing of thelhsmust be terminated abnormally
-
processContainerOp
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree processContainerOp(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree lhs, de.uni_hildesheim.sse.ivml.ContainerOp op, TypeContext context, net.ssehub.easy.varModel.model.IModelElement parent) throws net.ssehub.easy.dslCore.translation.TranslatorExceptionProcesses a container operation. Fallback resolution to usual operations for non-iterating container operations and fallback to unqualified iterator expressions.- Parameters:
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 created- Returns:
- the expression as a parsed syntax tree
- Throws:
net.ssehub.easy.dslCore.translation.TranslatorException- in case that the processing of thelhsmust be terminated abnormally
-
getAccessor
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree getAccessor(java.util.List<de.uni_hildesheim.sse.ivml.ActualArgument> args, net.ssehub.easy.varModel.model.DecisionVariableDeclaration decl)Extracts a compound accessor/slot name from the given arguments.- Parameters:
args- the argumentsdecl- the binding declarator- Returns:
- the accessor, may be null if there is none
-
getAccessor
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree getAccessor(de.uni_hildesheim.sse.ivml.ImplicationExpression ex, net.ssehub.easy.varModel.model.DecisionVariableDeclaration decl)Extracts a compound accessor/slot name from the given expression.- Parameters:
ex- the expressiondecl- the binding declarator- Returns:
- the accessor, may be null if there is none
-
getAccessor
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree getAccessor(de.uni_hildesheim.sse.ivml.AssignmentExpression ex, net.ssehub.easy.varModel.model.DecisionVariableDeclaration decl)Extracts a compound accessor/slot name from the given expression.- Parameters:
ex- the expressiondecl- the binding declarator- Returns:
- the accessor, may be null if there is none
-
getAccessor
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree getAccessor(de.uni_hildesheim.sse.ivml.LogicalExpression ex, net.ssehub.easy.varModel.model.DecisionVariableDeclaration decl)Extracts a compound accessor/slot name from the given expression.- Parameters:
ex- the expressiondecl- the binding declarator- Returns:
- the accessor, may be null if there is none
-
getAccessor
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree getAccessor(de.uni_hildesheim.sse.ivml.EqualityExpression ex, net.ssehub.easy.varModel.model.DecisionVariableDeclaration decl)Extracts a compound accessor/slot name from the given expression.- Parameters:
ex- the expressiondecl- the binding declarator- Returns:
- the accessor, may be null if there is none
-
getAccessor
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree getAccessor(de.uni_hildesheim.sse.ivml.RelationalExpression ex, net.ssehub.easy.varModel.model.DecisionVariableDeclaration decl)Extracts a compound accessor/slot name from the given expression.- Parameters:
ex- the expressiondecl- the binding declarator- Returns:
- the accessor, may be null if there is none
-
getAccessor
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree getAccessor(de.uni_hildesheim.sse.ivml.AdditiveExpression ex, net.ssehub.easy.varModel.model.DecisionVariableDeclaration decl)Extracts a compound accessor/slot name from the given expression.- Parameters:
ex- the expressiondecl- the binding declarator- Returns:
- the accessor, may be null if there is none
-
getAccessor
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree getAccessor(de.uni_hildesheim.sse.ivml.MultiplicativeExpression ex, net.ssehub.easy.varModel.model.DecisionVariableDeclaration decl)Extracts a compound accessor/slot name from the given expression.- Parameters:
ex- the expressiondecl- the binding declarator- Returns:
- the accessor, may be null if there is none
-
getAccessor
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree getAccessor(de.uni_hildesheim.sse.ivml.UnaryExpression ex, net.ssehub.easy.varModel.model.DecisionVariableDeclaration decl)Extracts a compound accessor/slot name from the given expression.- Parameters:
ex- the expressiondecl- the binding declarator- Returns:
- the accessor, may be null if there is none
-
getAccessor
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree getAccessor(de.uni_hildesheim.sse.ivml.PostfixExpression ex, net.ssehub.easy.varModel.model.DecisionVariableDeclaration decl)Extracts a compound accessor/slot name from the given expression.- Parameters:
ex- the expressiondecl- the binding declarator- Returns:
- the accessor, may be null if there is none
-
getAccessor
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree getAccessor(de.uni_hildesheim.sse.ivml.PrimaryExpression ex, net.ssehub.easy.varModel.model.DecisionVariableDeclaration decl)Extracts a compound accessor/slot name from the given expression.- Parameters:
ex- the expressiondecl- the binding declarator- Returns:
- the accessor, may be null if there is none
-
getAccessor
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree getAccessor(de.uni_hildesheim.sse.ivml.Literal ex, net.ssehub.easy.varModel.model.DecisionVariableDeclaration decl)Extracts a compound accessor/slot name from the given expression.- Parameters:
ex- the expressiondecl- the binding declarator- Returns:
- the accessor, may be null if there is none
-
getAccessor
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree getAccessor(de.uni_hildesheim.sse.ivml.Value ex, net.ssehub.easy.varModel.model.DecisionVariableDeclaration decl)Extracts a compound accessor/slot name from the given expression.- Parameters:
ex- the expressiondecl- the binding declarator- Returns:
- the accessor, may be null if there is none
-
processContainerOp
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree processContainerOp(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree lhs, de.uni_hildesheim.sse.ivml.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.TranslatorExceptionProcesses a container operation.- Parameters:
lhs- the operand expression the container operation runs onop- the container operationdeclarators- explicit declarators overriding the information given inopdeclEx- explicit iterator expression overriding the information given inopcontext- the type context to be consideredparent- the actual (intended) parent of the constraint to be created- Returns:
- the expression as a parsed syntax tree
- Throws:
net.ssehub.easy.dslCore.translation.TranslatorException- in case that the processing of thelhsmust be terminated abnormally
-
checkOperationOclCompliance
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.- Parameters:
op- the operationcause- the causing ECore objectfeature- the causing ECore feature
-
processPostfixExpression
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree processPostfixExpression(de.uni_hildesheim.sse.ivml.PostfixExpression expr, TypeContext context, net.ssehub.easy.varModel.model.IModelElement parent) throws net.ssehub.easy.dslCore.translation.TranslatorExceptionProcess a postfix expression and turn it into a feature call.- Parameters:
expr- the expression to be processedcontext- the type context to be consideredparent- the actual (intended) parent of the constraint to be created- Returns:
- the expression as a parsed syntax tree
- Throws:
net.ssehub.easy.dslCore.translation.TranslatorException- in case that the processing of theexprmust be terminated abnormally
-
refType
private static net.ssehub.easy.varModel.model.datatypes.IDatatype refType(net.ssehub.easy.varModel.model.datatypes.IDatatype varType, TypeContext context)Obtains the reference type.- Parameters:
varType- the variable typecontext- the type context- Returns:
- the reference type
-
processPrimaryExpression
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree processPrimaryExpression(de.uni_hildesheim.sse.ivml.PrimaryExpression expr, TypeContext context, net.ssehub.easy.varModel.model.IModelElement parent) throws net.ssehub.easy.dslCore.translation.TranslatorExceptionProcess a primary expression.- Parameters:
expr- the expression to be processedcontext- the type context to be consideredparent- the actual (intended) parent of the constraint to be created- Returns:
- the expression as a parsed syntax tree
- Throws:
net.ssehub.easy.dslCore.translation.TranslatorException- in case that the processing of theexprmust be terminated abnormally
-
processCallsAndAccess
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree processCallsAndAccess(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree lhs, java.util.List<de.uni_hildesheim.sse.ivml.Call> calls, de.uni_hildesheim.sse.ivml.ExpressionAccess access, TypeContext context, net.ssehub.easy.varModel.model.IModelElement parent) throws net.ssehub.easy.dslCore.translation.TranslatorExceptionProcess a possible empty list of calls and a possible empty access expression.- Parameters:
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 created- Returns:
- the expression as a parsed syntax tree
- Throws:
net.ssehub.easy.dslCore.translation.TranslatorException- in case that the processing of theexprmust be terminated abnormally
-
hasLiteral
private boolean hasLiteral(net.ssehub.easy.varModel.model.datatypes.Enum eenum, java.lang.String name)Returns whether the given enumerationeenumdefines a literal calledname.- Parameters:
eenum- the enumeration to to search forname- the name of the literal- Returns:
trueif there is a literal with the given name,falseelse
-
hasSlot
private boolean hasSlot(net.ssehub.easy.varModel.model.datatypes.Compound comp, java.lang.String name)Returns whether the given compoundcompor its refined compounds contains a slot of namename.- Parameters:
comp- the compound to search forname- the name of the slot- Returns:
trueif there is a slot with the given name,falseelse
-
processAccess
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree processAccess(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree lhs, de.uni_hildesheim.sse.ivml.ExpressionAccess access, TypeContext context, net.ssehub.easy.varModel.model.IModelElement parent) throws net.ssehub.easy.dslCore.translation.TranslatorExceptionProcess an access expression.- Parameters:
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 created- Returns:
- the expression as a parsed syntax tree
- Throws:
net.ssehub.easy.dslCore.translation.TranslatorException- in case that the processing of theexprmust be terminated abnormally
-
processContainerInitializer
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree processContainerInitializer(net.ssehub.easy.varModel.model.datatypes.IDatatype lhsType, org.eclipse.emf.ecore.EObject expr, de.uni_hildesheim.sse.ivml.ContainerInitializer initializer, TypeContext context, net.ssehub.easy.varModel.model.IModelElement parent) throws net.ssehub.easy.dslCore.translation.TranslatorException, net.ssehub.easy.varModel.model.IvmlExceptionProcesses a container initializer.- Parameters:
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 element- Returns:
- an expression representing the literal collection
- Throws:
net.ssehub.easy.dslCore.translation.TranslatorException- in case that the processing of theinitializermust be terminated abnormallynet.ssehub.easy.varModel.model.IvmlException- in case that the processing terminates in IVML type resolution
-
translateToValues
private java.lang.Object[] translateToValues(java.lang.Object[] values) throws net.ssehub.easy.varModel.model.IvmlExceptionTranslates constant expression trees to constant values. This method is required since value objects shall not have constraint syntax tree values but store the values directly.- Parameters:
values- the values to be translated (to be modified as a side effect)- Returns:
- the translated values
- Throws:
net.ssehub.easy.varModel.model.IvmlException- in case that the expressions invaluedo not represent literals
-
getSpecificType
private net.ssehub.easy.varModel.model.datatypes.IDatatype getSpecificType(net.ssehub.easy.varModel.model.datatypes.IDatatype lhsType, de.uni_hildesheim.sse.ivml.ContainerInitializer initializer, TypeContext context) throws net.ssehub.easy.dslCore.translation.TranslatorExceptionReturns the specific type of a collection initializer.- Parameters:
lhsType- the left hand side which defines the type (part)initializer- the initializercontext- the type context for resolving variables etc.- Returns:
- the specific type (may be null if there is none)
- Throws:
net.ssehub.easy.dslCore.translation.TranslatorException- in case that the processing of theinitializermust be terminated abnormally
-
processLiteralContainer
private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree processLiteralContainer(net.ssehub.easy.varModel.model.datatypes.IDatatype lhsType, de.uni_hildesheim.sse.ivml.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.IvmlExceptionProcesses a collection initializer and returns the related constraint syntax tree node.- Parameters:
lhsType- the left hand side which defines the type (part)initializer- the initializercontext- the type context for resolving variables etc.parent- the parent element- Returns:
- the related constraint syntax tree node
- Throws:
net.ssehub.easy.dslCore.translation.TranslatorException- in case that the processing of theinitializermust be terminated abnormallynet.ssehub.easy.varModel.cst.CSTSemanticException- in case that the processing of theinitializermust be terminated abnormallynet.ssehub.easy.varModel.model.IvmlException- in case that the processing of theinitializermust be terminated abnormally
-
processCompoundInitializer
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<de.uni_hildesheim.sse.ivml.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.ValueDoesNotMatchTypeExceptionProcesses a compound initializer.- Parameters:
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 initializer- Returns:
- the model instance representing the container initializer
- Throws:
net.ssehub.easy.dslCore.translation.TranslatorException- in case that the processing of theinitializermust be terminated abnormallynet.ssehub.easy.varModel.cst.CSTSemanticException- in case that the processing of theinitializermust be terminated abnormallynet.ssehub.easy.varModel.model.IvmlException- in case that the processing of theinitializermust be terminated abnormallynet.ssehub.easy.varModel.model.values.ValueDoesNotMatchTypeException- in case that the processing of theinitializermust be terminated abnormally
-
processContainerInitializer
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<de.uni_hildesheim.sse.ivml.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.ValueDoesNotMatchTypeExceptionProcesses a container initializer.- Parameters:
lhsType- the left hand side typecontext- the type context for resolving variables etc.parent- the parent elemententryList- the entries in the initializer- Returns:
- the model instance representing the container initializer
- Throws:
net.ssehub.easy.dslCore.translation.TranslatorException- in case that the processing of theinitializermust be terminated abnormallynet.ssehub.easy.varModel.cst.CSTSemanticException- in case that the processing of theinitializermust be terminated abnormallynet.ssehub.easy.varModel.model.IvmlException- in case that the processing of theinitializermust be terminated abnormallynet.ssehub.easy.varModel.model.values.ValueDoesNotMatchTypeException- in case that the processing of theinitializermust be terminated abnormally
-
allConstant
private static boolean allConstant(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree[] exprs)
Returns whether allexprsare constant.- Parameters:
exprs- the expressions to analyze- Returns:
trueif all expressions are constant,falseelse
-
warnDiscouragedNames
public 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.- Parameters:
name- the name to be checkedcause- the causing language elementcausingFeature- the causing language feature
-
-