Class WriterVisitor<V extends VariableDeclaration>

    • Field Detail

      • printExpressionStatementIndentation

        private boolean printExpressionStatementIndentation
      • printExpressionStatementNewLine

        private boolean printExpressionStatementNewLine
    • Constructor Detail

      • WriterVisitor

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

      • isPrintExpressionStatementIndentation

        protected boolean isPrintExpressionStatementIndentation()
        Returns whether indentations at expression statements shall be printed.
        Returns:
        whether indentations at expression statements shall be printed
      • setPrintExpressionStatementIndentation

        protected void setPrintExpressionStatementIndentation​(boolean printExpressionStatementIndentation)
        Changes whether indentations at expression statements shall be printed.
        Parameters:
        printExpressionStatementIndentation - if indentations shall be printed or not
      • isPrintExpressionStatementNewLine

        protected boolean isPrintExpressionStatementNewLine()
        Returns whether a new line after expression statements shall be printed if endsWithSemicolon(ExpressionStatement) is true.
        Returns:
        whether a new line after expression statements shall be printed
      • setPrintExpressionStatementNewLine

        protected void setPrintExpressionStatementNewLine​(boolean printExpressionStatementNewLine)
        Changes whether a new line after an expression statement shall be printed if endsWithSemicolon(ExpressionStatement) is true.
        Parameters:
        printExpressionStatementNewLine - if a new line shall be printed or not
      • printModifiers

        protected void printModifiers​(IModifierHolder holder)
        Prints the modifiers of the given modifier holder.
        Parameters:
        holder - the modifier holder
      • visitVariableDeclaration

        public java.lang.Object visitVariableDeclaration​(VariableDeclaration var)
                                                  throws VilException
        Description copied from interface: IVisitor
        Visits a variable declaration.
        Specified by:
        visitVariableDeclaration in interface IVisitor
        Parameters:
        var - the variable declaration
        Returns:
        the result of visiting the given statement (may be null)
        Throws:
        VilException - in case that visiting fails (e.g., execution)
      • visitAdvice

        public java.lang.Object visitAdvice​(Advice advice)
                                     throws VilException
        Description copied from interface: IVisitor
        Visits an advice.
        Specified by:
        visitAdvice in interface IVisitor
        Parameters:
        advice - the advice to be visited
        Returns:
        the result of visiting the given statement (may be null)
        Throws:
        VilException - in case that visiting fails (e.g., execution)
      • printVersionRestrictions

        protected void printVersionRestrictions​(IVersionRestriction restriction,
                                                boolean capitalize)
        Prints the version restriction.
        Parameters:
        restriction - the version restriction (may be null)
        capitalize - whether the "with" shall be stated in capital letters
      • printParameterList

        protected void printParameterList​(IParameterizable<V> parameterizable)
                                   throws VilException
        Prints the parameter list of parameterizable.
        Parameters:
        parameterizable - the element to print the parameter list
        Throws:
        VilException - in case that visiting fails
      • visitExpressionStatement

        public java.lang.Object visitExpressionStatement​(ExpressionStatement statement)
                                                  throws VilException
        Description copied from interface: IVisitor
        Visits a statement.
        Specified by:
        visitExpressionStatement in interface IVisitor
        Parameters:
        statement - the statement
        Returns:
        the result of visiting the given statement (may be null)
        Throws:
        VilException - in case that visiting fails (e.g., execution)
      • endsWithSemicolon

        protected boolean endsWithSemicolon​(ExpressionStatement statement)
        Returns whether the given statement ends with a semicolon.
        Parameters:
        statement - the statement to check
        Returns:
        true if it ends with a semicolon, false else
      • printVersion

        protected void printVersion​(Version ver)
        Prints the version.
        Parameters:
        ver - the version to be printed
      • printImportLeadin

        protected void printImportLeadin​(ModelImport<?> imp)
        Prints the import keyword(s) and the name.
        Parameters:
        imp - the import to be printed
      • o2i

        protected static final int o2i​(java.lang.Object object)
        Returns 0 of object is null else 1.
        Parameters:
        object - the object to be tested
        Returns:
        0 of object is null else 1
      • visitTypedef

        public java.lang.Object visitTypedef​(Typedef typedef)
                                      throws VilException
        Description copied from interface: IVisitor
        Visits a typedef.
        Specified by:
        visitTypedef in interface IVisitor
        Parameters:
        typedef - the typedef
        Returns:
        the result of visiting (may be null)
        Throws:
        VilException - in case that visiting fails (e.g., execution)
      • visitCompound

        public java.lang.Object visitCompound​(Compound compound)
                                       throws VilException
        Description copied from interface: IVisitor
        Visits a compound.
        Specified by:
        visitCompound in interface IVisitor
        Parameters:
        compound - the compound
        Returns:
        the result of visiting (may be null)
        Throws:
        VilException - in case that visiting fails (e.g., execution)