Expand description
A tree builder for the construction of syntax trees.
Please refer to the documentation on GreenNodeBuilder
itself and the “getting started”
section from the top-level documentation for an introduction to how to build a
syntax tree.
Structs
- A checkpoint for maybe wrapping a node. See
GreenNodeBuilder::checkpoint
for details. - A builder for green trees. Construct with
new
,with_cache
, orfrom_cache
. To add tree nodes, start them withstart_node
, addtoken
s and thenfinish_node
. When the whole tree is constructed, callfinish
to obtain the root. - A
NodeCache
deduplicates identical tokens and small nodes during tree construction. You can re-use the same cache for multiple similar trees withGreenNodeBuilder::with_cache
.