sipha-tree
CST and AST construction for sipha - arena allocation, node types, and lowering.
Overview
sipha-tree provides the core data structures for representing Concrete Syntax Trees (CSTs) and utilities for lowering them into Abstract Syntax Trees (ASTs).
Features
- NodeArena: Efficient arena-based allocation for CST nodes
- CstNode: Fundamental building block of the CST
- CstKind: Enum representing different node types (Token, Rule, Trivia, Error)
- NodeChildren: Compact representation for node children
- LowerCtx: Context for AST lowering operations
- AstNode: Trait for AST nodes to be lowered from CST
Quick Start
Add sipha-tree to your Cargo.toml:
[]
= "0.1.1"
Example
use ;
use ;
use Span;
let mut arena = new;
let num_node = arena.alloc;
let expr_node = arena.alloc;
assert!;
License
This project is licensed under the MIT License - see the LICENSE file for details.