computeIds

fun Node.computeIds(walker: (Node) -> Sequence<Node> = Node::walk, idProvider: IdProvider = SequentialIdProvider()): IdentityHashMap<Node, String>

Return

walks the whole AST starting from the given node and associates each visited node with a generated id

Parameters

walker

a function that generates a sequence of nodes. By default this is the depth-first "walk" method.

idProvider

a provider that takes a node and returns a String identifier representing it For post-order traversal, take "walkLeavesFirst".