traverse

fun traverse(rootNode: Node, callback: (path: NodePath<*>) -> Unit)

Traverses the given AST node and its descendants depth-first order and calls the given callback function for each node.

Parameters

rootNode

root AST node to traverse.

callback

function to be called for each node.