Class ExprTreeWalker


  • public final class ExprTreeWalker
    extends java.lang.Object
    The ExprTreeWalker class provides methods that traverse an expression tree and apply a visitor to its nodes. The protocol used for traversal is explained here.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void visit​(java.lang.Iterable<? extends Node> trees)
      Visits a sequence of expression trees.
      void visit​(Node tree)
      Visits the specified expression node.
      void visitNode​(Node node)
      Visits the specified node.
      • Methods inherited from class java.lang.Object

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

      • ExprTreeWalker

        public ExprTreeWalker​(ExprTreeVisitor visitor)
        Constructs an ExprTreeWalker object.
        Parameters:
        visitor - Visitor to be applied to tree nodes.
        Throws:
        java.lang.IllegalArgumentException - if the visitor parameter is null.
    • Method Detail

      • visit

        public void visit​(java.lang.Iterable<? extends Node> trees)
        Visits a sequence of expression trees. Each node in the sequence is considered a root of an expression tree and the visitor is notified about it by calls to the onRootBegin and onRootEnd methods.
        Parameters:
        trees - A sequence of expression trees to be visited.
        Throws:
        java.lang.IllegalArgumentException - if the parameter equals null; if any of the child nodes of the expression nodes in the sequence has a unknown type.
      • visit

        public void visit​(Node tree)
        Visits the specified expression node. The visited node is considered a root of an expression tree and the visitor is notified about it by calls to the onRootBegin and onRootEnd methods.
        Parameters:
        tree - Expression tree to be visited.
        Throws:
        java.lang.IllegalArgumentException - if the parameter equals null; if any of the expression tree nodes has a unknown type.
      • visitNode

        public void visitNode​(Node node)
        Visits the specified node.
        Parameters:
        node - Node to be visited.
        Throws:
        java.lang.IllegalArgumentException - if the parameter equals null; if the node or any of its child nodes has a unknown type.