Function traverse

    • A function to traverse an AST. It traverses it depth first.

      Parameters

      • node: RootResult

        the node to start traversing at.

      • OptionalonEnter: NodeVisitor

        node visitor function that will be called on entering the node. This corresponds to preorder traversing.

      • OptionalonLeave: NodeVisitor

        node visitor function that will be called on leaving the node. This corresponds to postorder traversing.

      Returns void