Class ExpressionWriter

    • Field Detail

      • oclCompliance

        private static boolean oclCompliance
        Detect, warn, report about and write to avoid OCL compliance problems.
      • compositeExpressions

        private transient java.util.Stack<CompositeExpression> compositeExpressions
      • isInContent

        private transient boolean isInContent
      • isInExpression

        private transient boolean isInExpression
    • Constructor Detail

      • ExpressionWriter

        public ExpressionWriter​(java.io.Writer out)
        Creates a build language writer.
        Parameters:
        out - the writer to write the elements to
    • Method Detail

      • setOclCompliance

        public static void setOclCompliance​(boolean compliance)
        Changes the OCL compliance setting. Similar to IVML, but we separate this in case that the UI shall do different settings for IVML and VIL.
        Parameters:
        compliance - operate with OCL compliance (true), allow both IVML + OCL (false
      • considerOclCompliance

        public static boolean considerOclCompliance()
        Returns whether OCL compliance shall be considered. Similar to IVML, but we separate this in case that the UI shall do different settings for IVML and VIL.
        Returns:
        true for OCL compliance, false else
      • printName

        private void printName​(CallExpression call)
        Prints the name of a call expression.
        Parameters:
        call - the call to print the name for
      • printType

        protected void printType​(TypeDescriptor<?> type)
        Prints the given type.
        Parameters:
        type - the type to be printed
      • printIteratorDeclarators

        private void printIteratorDeclarators​(CallExpression call)
                                       throws VilException
        Prints the iterator declarators if appropriate.
        Parameters:
        call - the call expression to print the declarators for
        Throws:
        VilException - if visiting fails
      • printCallAccess

        private void printCallAccess​(CallExpression call)
                              throws VilException
        Prints the call access operator.
        Parameters:
        call - the call to print
        Throws:
        VilException - in case of type resolution problems
      • printArgumentList

        protected void printArgumentList​(IArgumentProvider provider,
                                         int start)
                                  throws VilException
        Prints an argument list.
        Parameters:
        provider - the argument provider
        start - the start argument index (usually 0)
        Throws:
        VilException - in case that visiting fails
      • visitExpression

        public java.lang.Object visitExpression​(Expression ex)
                                         throws VilException
        Description copied from interface: IExpressionVisitor
        Visits an unspecified expression (in case of specialized nodes).
        Specified by:
        visitExpression in interface IExpressionVisitor
        Parameters:
        ex - the node
        Returns:
        the result of visiting this expression (may be null)
        Throws:
        VilException - in case that visiting fails (e.g., execution)
      • printContentExpressions

        protected void printContentExpressions​(IExpressionIterator iter)
                                        throws VilException
        Prints a content expressions given by an expression iterator.
        Parameters:
        iter - the expression iterator
        Throws:
        VilException - if printing fails for some reason
      • quoteExpression

        protected boolean quoteExpression​(Expression expression)
        Returns if visiting expression in printContentExpressions(IExpressionIterator) shall lead to quote constant expressions or unquoted constant expressionsisInExpression.
        Parameters:
        expression - the expression to visit
        Returns:
        true for quoting, false else
      • isInComposite

        protected boolean isInComposite()
        Check if Expression is in CompositeExpression.
        Returns:
        boolean
      • isInContent

        protected boolean isInContent()
        Check if Expression is in content.
        Returns:
        boolean
      • setInContent

        protected void setInContent​(boolean isInContent)
        Set that expression is in content.
        Parameters:
        isInContent - boolean