Expand description
A lossless syntax tree stored flat: nodes in preorder, each covering a range of lexer tokens. Trivia between significant tokens belongs to the innermost node covering both neighbours, and the root covers every token, so the source is recovered from the tokens alone.
Structsยง
- Children
- Iterator over the direct children of a node.
- Node
- One node: its kind, the tokens it covers (
first..end, both significant at the edges unless empty), its parent, and the index just past its last descendant. - NodeId
- Index of a node in
SyntaxTree::nodes; the root isNodeId(0). - Syntax
Tree - The tree of one source text.