Expand description
Tree Generators
This module contains facilities to help you build an HyperAST.
- TreeGen::makeis where a subtree is pushed in the HyperAST- You should also use crate::store::nodes::legion::NodeStore::prepare_insertionto insert subtrees in the HyperAST while deduplicating identical ones
 
- You should also use 
- To visit parsers with a zipper/cursor interface you should implement ZippedTreeGen- [crate::parser::TreeCursor] should be implemented to wrap you parser’s interface
 
- [
§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 
- BasicGlobal Data 
- NoOpMore 
- Parents
- RoleAcc
- SpacedGlobal Data 
- StatsGlobal Data 
- SubTreeMetrics 
- TextedGlobal Data 
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
- TotalBytes Global Data 
- TreeGen
- Primary trait to implement to generate AST.
- WithByte Range 
- 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