Collects all node ids within a tree given by a respective root node
The root id nodes to start collecting from
Collects all node ids within a tree given by a respective root node, but stops collecting at nodes where the given stop function returns true.
This can be used to exclude certain subtrees from the collection, for example to exclude function bodies when collecting ids on the root level.
The root id nodes to start collecting from
A function that determines whether to stop collecting at a given node, does not stop by default
In contrast to the nesting stored in the RNode structure, this function calculates the depth of a node by counting the number of parents until the root node is reached.
Returns the direct parent of a node. Usually, only root nodes do not have a parent, and you can assume that there is a linear chain of parents leading to the root node.
iterateParents - to get all parents of a node
A helper function to retrieve the id of a given node, if available.
A helper function to retrieve the location of a given node, if available.
Returns an iterable of all parents of a node, starting with the direct parent and ending with the root node.
A helper function to retrieve the lexeme of a given node, if available.
If the fullLexeme is available, it will be returned, otherwise the lexeme will be returned.
Readonlyname: "RNode"Visits all node ids within a tree given by a respective root node using a depth-first search with prefix order.
The root id nodes to start collecting from
OptionalonVisit: OnEnter<OtherInfo>Called before visiting the subtree of each node. Can be used to stop visiting the subtree starting with this node (return true stop)
OptionalonExit: OnExit<OtherInfo>Called after the subtree of a node has been visited, called for leafs too (even though their subtree is empty)
Helper object to provide helper functions for RNodes.