Crate parse_tree[][src]

parse_tree is a library to represent so-called parse tree. A parse tree is a non-abstract AST: it's a generic syntax tree which remembers all whitespace, comments and other trivia.

Modules

algo

Structs

BottomUpBuilder

A builder for creating parse trees by a bottom-up walk over the tree nodes.

ParseTree

The parse tree for a single source file.

PtNode
PtNodeId
Symbol

A type of a syntactic construct, including both leaf tokens and composite nodes, like "a comma" or "a function".

TextRange

A range in the text, represented as a pair of TextUnits.

TextUnit

An offset into text. Offset is represented as u32 storing number of utf8-bytes, but most of the clients should treat it like opaque measure.

Token

A token of source code.

TopDownBuilder

A builder for creating parse trees by a top-down walk over the tree nodes. Each start_internal call must be paired with a finish_internal call. Nodes created within a pair of start_internal / finish_internal calls become children of the internal node.