Class ExpressionTranslator

  • All Implemented Interfaces:
    net.ssehub.easy.dslCore.translation.IMessageReceiver

    public class ExpressionTranslator
    extends net.ssehub.easy.dslCore.translation.ExpressionTranslator
    Implements 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 through ExpressionTranslator.getMessage(int).
    Author:
    Holger Eichelberger
    • 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 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, 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​(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​(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.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.
      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.
      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.
      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.
      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.
      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.
      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.
      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.
      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.
      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.
      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.
      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.
      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)
      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, 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.ConstraintSyntaxTree processAdditiveExpression​(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.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)
      Process an argument and returns a (named) expression.
      private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree processAssignmentExpression​(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.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<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.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)
      Processes a compound 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<de.uni_hildesheim.sse.ivml.ExpressionListEntry> entryList)
      Processes a container initializer.
      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)
      Processes a container initializer.
      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)
      Processes a container operation.
      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)
      Processes a container operation.
      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)
      Processes a valid declaration.
      private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree processEqualityExpression​(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.ConstraintSyntaxTree processExpression​(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.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)
      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, 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.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)
      Processes a feature call.
      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)
      Processes a feature call.
      private net.ssehub.easy.varModel.cst.ConstraintSyntaxTree processImplicationExpression​(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.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)
      Processes a collection initializer and returns the related constraint syntax tree node.
      (package private) net.ssehub.easy.varModel.cst.ConstraintSyntaxTree processLogicalExpression​(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.ConstraintSyntaxTree processMultiplicativeExpression​(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.ConstraintSyntaxTree processPostfixExpression​(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.ConstraintSyntaxTree processPrimaryExpression​(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.ConstraintSyntaxTree processRelationalExpression​(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.ConstraintSyntaxTree processUnaryExpression​(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.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.
      • Methods inherited from class net.ssehub.easy.dslCore.translation.ExpressionTranslator

        clearMessages, clearMessages, collect, error, error, getErrorCount, getMessage, getMessageCount, warning
      • Methods inherited from class net.ssehub.easy.dslCore.translation.MessageReceiver

        error
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • level

        private int level
      • hasTopLevelWarning

        private boolean hasTopLevelWarning
    • Constructor Detail

      • ExpressionTranslator

        public ExpressionTranslator()
        Creates an expression translator (to be used within this package only).
    • 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 EObject
        causingFeature - 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 used
        cause - the cause (as instance of the EMF grammar model)
        causeFeature - the cause of the feature as an appropriate constant from IvmlPackage.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 used
        cause - the cause (as instance of the EMF grammar model)
        causeFeature - the cause of the feature as an appropriate constant from IvmlPackage.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 element object and inserts a comment node as top of the subtree if required.
        Parameters:
        object - the EMF AST element to analyze
        subtree - 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.TranslatorException
        Processes an expression and returns the result as a syntax tree. Calls initLevel(), i.e., do not call from inside.
        Parameters:
        expr - the expression to be processed
        context - the type context to be considered
        parent - 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 the expr must 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.TranslatorException
        Processes a block expression.
        Parameters:
        block - the block
        context - the type context
        parent - the parent element
        Returns:
        the created constraint syntax tree
        Throws:
        net.ssehub.easy.dslCore.translation.TranslatorException - in case that the processing of the block must 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.TranslatorException
        Processes an (optional block) expression.
        Parameters:
        lhsType - the data type on the left hand side of the expression
        expr - the expression to be processed
        context - the type context to be considered
        parent - 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 the expr must 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.TranslatorException
        Processes an expression and returns the result as a syntax tree. Call initLevel() if called from outside.
        Parameters:
        lhsType - the data type on the left hand side of the expression
        expr - the expression to be processed
        context - the type context to be considered
        parent - 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 the expr must 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.TranslatorException
        Process an assignment expression and turn it into a feature call.
        Parameters:
        expr - the expression to be processed
        context - the type context to be considered
        parent - 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 the expr must 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 operation op may return wrong results if types on both sides are not somehow assignable.
        Parameters:
        lhs - the left hand side expression
        op - the operator
        rhs - the right hand side expression
        cause - the causing grammar object
        feature - the causing grammar feature
      • inferDatatypeQuietly

        private net.ssehub.easy.varModel.model.datatypes.IDatatype inferDatatypeQuietly​(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree cst)
        Infers the datatype of cst.
        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.TranslatorException
        Process an implication expression and turn it into a feature call.
        Parameters:
        expr - the expression to be processed
        context - the type context to be considered
        parent - 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 the expr must 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 in cst and emits an error or a warning in case that the operation is found.
        Parameters:
        cst - the constraint syntax tree to be checked
        error - emit an error or a warning
        cause - the causing EObject
        causingFeature - the causing feature in cause
      • 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.TranslatorException
        Process a logical expression and turn it into a feature call. If called from outside, call initLevel() before.
        Parameters:
        expr - the expression to be processed
        context - the type context to be considered
        parent - 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 the expr must 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.TranslatorException
        Process a equality expression and turn it into a feature call.
        Parameters:
        expr - the expression to be processed
        context - the type context to be considered
        parent - 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 the expr must 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.TranslatorException
        Process a relational expression and turn it into a feature call.
        Parameters:
        expr - the expression to be processed
        context - the type context to be considered
        parent - 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 the expr must 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.TranslatorException
        Process an additive expression and turn it into a feature call.
        Parameters:
        expr - the expression to be processed
        context - the type context to be considered
        parent - 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 the expr must 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.TranslatorException
        Process a multiplicative expression and turn it into a feature call.
        Parameters:
        expr - the expression to be processed
        context - the type context to be considered
        parent - 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 the expr must 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.TranslatorException
        Process a unary expression and turn it into a feature call.
        Parameters:
        expr - the expression to be processed
        context - the type context to be considered
        parent - 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 the expr must 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.TranslatorException
        Processes a feature call. This method allows to work with an empty lhs in case of a "context less method call" such as max(1, 2) or with a given lhs, e.g. for s.size();
        Parameters:
        lhs - the operand expression (may be null as described above)
        call - the call to be processed
        context - the type context to be considered
        parent - 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 the lhs must 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.TranslatorException
        Processes a feature call. This method allows to work with an empty lhs in case of a "context less method call" such as max(1, 2) or with a given lhs, e.g. for s.size();
        Parameters:
        lhs - the operand expression (may be null as described above)
        call - the call to be processed
        context - the type context to be considered
        parent - the actual (intended) parent of the constraint to be created
        checkOclCompliance - 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 the lhs must 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.TranslatorException
        Process an argument and returns a (named) expression.
        Parameters:
        lhsType - the left hand side type (optional, may be null)
        arg - the argument expression
        context - the type context to be considered
        parent - 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.TranslatorException
        Checks for an existing compound element 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.
        Parameters:
        comp - the compound to check
        name - the name of the element
        call - 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.TranslatorException
        Processes a valid declaration.
        Parameters:
        lhs - the operand expression the container operation runs on
        op - the container operation
        context - the type context to be considered
        parent - the actual (intended) parent of the constraint to be created
        declaration - the declaration to be processed
        declarators - the declarators to be modified as a side effect
        Throws:
        net.ssehub.easy.dslCore.translation.TranslatorException - in case that the processing of the lhs must 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.TranslatorException
        Processes 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 on
        op - the container operation
        context - the type context to be considered
        parent - 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 the lhs must 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 arguments
        decl - 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 expression
        decl - 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 expression
        decl - 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 expression
        decl - 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 expression
        decl - 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 expression
        decl - 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 expression
        decl - 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 expression
        decl - 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 expression
        decl - 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 expression
        decl - 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 expression
        decl - 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 expression
        decl - 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 expression
        decl - 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.TranslatorException
        Processes a container operation.
        Parameters:
        lhs - the operand expression the container operation runs on
        op - the container operation
        declarators - explicit declarators overriding the information given in op
        declEx - explicit iterator expression overriding the information given in op
        context - the type context to be considered
        parent - 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 the lhs must 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 operation
        cause - the causing ECore object
        feature - 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.TranslatorException
        Process a postfix expression and turn it into a feature call.
        Parameters:
        expr - the expression to be processed
        context - the type context to be considered
        parent - 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 the expr must 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 type
        context - 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.TranslatorException
        Process a primary expression.
        Parameters:
        expr - the expression to be processed
        context - the type context to be considered
        parent - 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 the expr must 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.TranslatorException
        Process 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 considered
        parent - 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 the expr must be terminated abnormally
      • hasLiteral

        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.
        Parameters:
        eenum - the enumeration to to search for
        name - the name of the literal
        Returns:
        true if there is a literal with the given name, false else
      • hasSlot

        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.
        Parameters:
        comp - the compound to search for
        name - the name of the slot
        Returns:
        true if there is a slot with the given name, false else
      • 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.TranslatorException
        Process an access expression.
        Parameters:
        lhs - the expression on the left hand side (processed so far)
        access - an access expression
        context - the type context to be considered
        parent - 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 the expr must 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.IvmlException
        Processes a container initializer.
        Parameters:
        lhsType - the left hand side which defines the type (part)
        expr - the containing primary expression
        initializer - the initializer
        context - 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 the initializer must be terminated abnormally
        net.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.IvmlException
        Translates 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 in value do 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.TranslatorException
        Returns the specific type of a collection initializer.
        Parameters:
        lhsType - the left hand side which defines the type (part)
        initializer - the initializer
        context - 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 the initializer must 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.IvmlException
        Processes a collection initializer and returns the related constraint syntax tree node.
        Parameters:
        lhsType - the left hand side which defines the type (part)
        initializer - the initializer
        context - 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 the initializer must be terminated abnormally
        net.ssehub.easy.varModel.cst.CSTSemanticException - in case that the processing of the initializer must be terminated abnormally
        net.ssehub.easy.varModel.model.IvmlException - in case that the processing of the initializer must 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.ValueDoesNotMatchTypeException
        Processes a compound initializer.
        Parameters:
        lhsType - the left hand side type
        context - the type context for resolving variables etc.
        parent - the parent element
        specificType - the specific type of the container
        entryList - 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 the initializer must be terminated abnormally
        net.ssehub.easy.varModel.cst.CSTSemanticException - in case that the processing of the initializer must be terminated abnormally
        net.ssehub.easy.varModel.model.IvmlException - in case that the processing of the initializer must be terminated abnormally
        net.ssehub.easy.varModel.model.values.ValueDoesNotMatchTypeException - in case that the processing of the initializer must 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.ValueDoesNotMatchTypeException
        Processes a container initializer.
        Parameters:
        lhsType - the left hand side type
        context - the type context for resolving variables etc.
        parent - the parent element
        entryList - 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 the initializer must be terminated abnormally
        net.ssehub.easy.varModel.cst.CSTSemanticException - in case that the processing of the initializer must be terminated abnormally
        net.ssehub.easy.varModel.model.IvmlException - in case that the processing of the initializer must be terminated abnormally
        net.ssehub.easy.varModel.model.values.ValueDoesNotMatchTypeException - in case that the processing of the initializer must be terminated abnormally
      • allConstant

        private static boolean allConstant​(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree[] exprs)
        Returns whether all exprs are constant.
        Parameters:
        exprs - the expressions to analyze
        Returns:
        true if all expressions are constant, false else
      • 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 checked
        cause - the causing language element
        causingFeature - the causing language feature