Module tree_gen

Source
Expand description

Tree Generators

This module contains facilities to help you build an HyperAST.

§Important Note

To make code analysis incremental in the HyperAST, we locally persist locally derived values, we call them metadata. To save memory, we also deduplicate identical nodes using the type, label and children of a subtree. In other word, in the HyperAST, you store Metadata (derived values) along subtrees of the HyperAST, and deduplicate subtree using identifying data. To ensure derived data are unique per subtree, metadata should only be derived from local identifying values.

Re-exports§

pub use zipped::PreResult;
pub use zipped::ZippedTreeGen;

Modules§

metric_definition
parser
utils_ts
utils for generating code with tree-sitter
zipped

Structs§

BasicAccumulator
BasicGlobalData
NoOpMore
Parents
RoleAcc
SpacedGlobalData
StatsGlobalData
SubTreeMetrics
TextedGlobalData

Traits§

AccIndentation
Builder of a node aware of its indentation for the hyperAST
Accumulator
Builder of a node for the hyperAST
GlobalData
More
Prepro
PreproTSG
TotalBytesGlobalData
TreeGen
Primary trait to implement to generate AST.
WithByteRange
WithChildren
WithLabel
WithRole

Functions§

add_cs_no_spaces
add_md_precomp_queries
compute_indentation
get_spacing
has_final_space
hash32
try_compute_indentation
try_get_spacing

Type Aliases§

PrecompQueries
Spaces