Class DelegatingHierarchyVisitor

  • All Implemented Interfaces:
    LanguageObjectVisitor

    public class DelegatingHierarchyVisitor
    extends HierarchyVisitor
    Delegates pre- and post-processing for each node in the hierarchy to delegate visitors.
    • Method Detail

      • visitNode

        public void visitNode​(LanguageObject obj)
        Description copied from class: AbstractLanguageVisitor
        Visit the LanguageObject instance to perform the Visitor's operation on that instance. This method can also be used by the subclass to visit any LanguageObject instances that the given instance may contain.
        Overrides:
        visitNode in class AbstractLanguageVisitor
        Parameters:
        obj - an LanguageObject instance
        See Also:
        HierarchyVisitor
      • preOrderVisit

        public static void preOrderVisit​(LanguageObjectVisitor behaviorVisitor,
                                         LanguageObject object)
        This utility method can be used to execute the behaviorVisitor in a pre-order walk of the language objects. "Pre-order" in this case means that the visit method of the behaviorVisitor will be called before the visit method of it's children. It is expected that the behavior visit does NOT perform iteration, as that function will be performed by the HierarchyVisitor.
        Parameters:
        behaviorVisitor - The visitor specifying what behavior is performed at each node type
        object - The root of the object tree to perform visitation on
      • postOrderVisit

        public static void postOrderVisit​(LanguageObjectVisitor behaviorVisitor,
                                          LanguageObject object)
        This utility method can be used to execute the behaviorVisitor in a post-order walk of the language objects. "Post-order" in this case means that the visit method of the behaviorVisitor will be called after the visit method of it's children. It is expected that the behavior visit does NOT perform iteration, as that function will be performed by the HierarchyVisitor.
        Parameters:
        behaviorVisitor - The visitor specifying what behavior is performed at each node type
        object - The root of the object tree to perform visitation on