TreeVisitor

abstract class TreeVisitor(source)

Iterate over all the nodes in (a part of) the AST. In contrast to the visit methods in Node, these methods are implemented in a simple recursive way which should be more efficient. A disadvantage is that they cannot be quit in the middle of their traversal.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
abstract fun process(node: Node)
Process the given node.
Link copied to clipboard
open fun visitBreadthFirst(node: Node)
https://en.wikipedia.
Link copied to clipboard
open fun visitDirectChildren(node: Node)
Performs a simple traversal over all nodes that have the passed node as their parent.
Link copied to clipboard
open fun visitLeavesFirst(node: Node)
Link copied to clipboard
open fun visitPostOrder(node: Node)
Performs a post-order node traversal starting with a given node.
Link copied to clipboard
open fun visitPreOrder(node: Node)
Performs a pre-order node traversal starting with a given node.