Class ExpressionCopyVisitor

    • Constructor Detail

      • ExpressionCopyVisitor

        public ExpressionCopyVisitor​(java.util.Map<VariableDeclaration,​VariableDeclaration> mapping,
                                     boolean reuse)
        Creates a new copy visitor.
        Parameters:
        mapping - the variable mapping to be considered while copying (may be null for no mapping)
        reuse - whether leaves shall be reused rather than created again
      • ExpressionCopyVisitor

        public ExpressionCopyVisitor​(java.util.Map<VariableDeclaration,​VariableDeclaration> mapping,
                                     boolean reuse,
                                     IVersionRestriction.IVariableMapper mapper)
        Creates a new copy visitor.
        Parameters:
        mapping - the variable mapping to be considered while copying (may be null for no mapping)
        reuse - whether leaves shall be reused rather than created again
        mapper - an optional variable mapper (may be null if absent)
    • Method Detail

      • 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)
      • 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)
      • 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)
      • 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)
      • visitScript

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

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

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

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

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

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

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

        public java.lang.Object visitMapExpression​(MapExpression map)
                                            throws VilException
        Description copied from interface: IVisitor
        Visits a map expression.
        Specified by:
        visitMapExpression in interface IVisitor
        Parameters:
        map - the expression to be visited
        Returns:
        the result of visiting the given expression (may be null)
        Throws:
        VilException - in case that visiting fails (e.g., execution)
      • visitInstantiateExpression

        public java.lang.Object visitInstantiateExpression​(InstantiateExpression inst)
                                                    throws VilException
        Description copied from interface: IVisitor
        Visits an instantiate expression.
        Specified by:
        visitInstantiateExpression in interface IVisitor
        Parameters:
        inst - the instantiation expression
        Returns:
        the result of visiting the given expression (may be null)
        Throws:
        VilException - in case that visiting fails (e.g., execution)
      • 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)
      • visitWhileStatement

        public java.lang.Object visitWhileStatement​(WhileStatement stmt)
                                             throws VilException
        Description copied from interface: IVisitor
        Visits a while statement.
        Specified by:
        visitWhileStatement in interface IVisitor
        Parameters:
        stmt - the statement to be visited
        Returns:
        the result of visiting the given expression (may be null)
        Throws:
        VilException - in case that visiting fails (e.g., execution)
      • visitForStatement

        public java.lang.Object visitForStatement​(ForStatement stmt)
                                           throws VilException
        Description copied from interface: IVisitor
        Visits a for statement.
        Specified by:
        visitForStatement in interface IVisitor
        Parameters:
        stmt - the statement to be visited
        Returns:
        the result of visiting the given expression (may be null)
        Throws:
        VilException - in case that visiting fails (e.g., execution)