1个不稳定版本
| 0.8.0 | 2024年7月27日 | 
|---|
#259 在 编程语言 中
每月下载量:159
用于  2 crate
96KB
 2K  SLoC
bulloak-syntax
概述
bulloak-syntax 是一个Rust库,提供了一种将字符串形式的树状结构转换为抽象语法树(AST)的语法解析器。它还包括语义分析器,用于对解析结构进行进一步处理。
功能
- 将包含树状结构的字符串解析为AST
- 对输入字符串进行分词
- 对解析的AST执行语义分析
- 支持解析单个和多个树
- 使用自定义 FrontendError类型进行错误处理
使用方法
要在项目中使用bulloak-syntax,请将其添加到您的 Cargo.toml
[dependencies]
bulloak-syntax = "0.1.0"  # Replace with the actual version
然后解析输入
use bulloak_syntax::parse;
fn main() -> anyhow::Result<()> {
    let input = "your tree-like structure here";
    let asts = parse(input)?;
    // Process the ASTs as needed
    for ast in asts {
        // ...
    }
    Ok(())
}
许可证
本项目的许可证为以下之一
- Apache许可证2.0版 (LICENSE-APACHE 或 https://apache.ac.cn/licenses/LICENSE-2.0)。
- MIT许可证 (LICENSE-MIT 或 https://open-source.org.cn/licenses/MIT)。
依赖项
~0.5–1MB
~22K SLoC