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§
- Basic
Accumulator - Basic
Global Data - NoOp
More - Parents
- RoleAcc
- Spaced
Global Data - Stats
Global Data - SubTree
Metrics - Texted
Global Data
Traits§
- AccIndentation
- Builder of a node aware of its indentation for the hyperAST
- Accumulator
- Builder of a node for the hyperAST
- Global
Data - More
- Prepro
- PreproTSG
- Total
Bytes Global Data - TreeGen
- Primary trait to implement to generate AST.
- With
Byte Range - With
Children - With
Label - With
Role
Functions§
- add_
cs_ no_ spaces - add_
md_ precomp_ queries - compute_
indentation - get_
spacing - has_
final_ space - hash32
- try_
compute_ indentation - try_
get_ spacing