walkDescendants

fun Node.walkDescendants(walker: (Node) -> Sequence<Node> = Node::walk): Sequence<Node>

Return

walks the whole AST starting from the childnodes of this node.

Parameters

walker

a function that generates a sequence of nodes. By default this is the depth-first "walk" method. For post-order traversal, take "walkLeavesFirst"


fun <N : Any> Node.walkDescendants(type: KClass<N>, walker: (Node) -> Sequence<Node> = Node::walk): Sequence<N>