Files
endorphin-aster-vm/crates/compiler/README.md
T
2026-10-20 01:08:51 +08:00

13 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# compiler
最小 Endor 编译器:frontend AST → 名称/作用域分析 → wordcode 模板 → VM 代码对象。依赖本地 frontend 和 core(Rust 库名 endor_core),不引入第三方依赖,不让 core 反向依赖 parser。运行时基础类和类型注解求值不是编译前提。
| 内容 | 职责 |
| --- | --- |
| [Cargo.toml](Cargo.toml) | compiler 包、本地 frontend/core 依赖与工作区 lint |
| [src](src/README.md) | 分析、字节码生成与显式代码对象装载 |
| [examples](examples/README.md) | 可供 lyra run/eval 的 Endor 源码文件,也是远端集成测试输入 |
| [tests](tests/README.md) | 源码到 VM、错误路径、名称与对象生命周期检查 |
公开入口为 analyze、compile_ast、compile_source、CompileOptions 和 CompiledCode::load。完整规则与所有权见 [编译链路](../../docs/runtime/compiler.md);CLI 使用见 [运行指南](../../docs/operations/README.md)。修改语法仍进入 [frontend](../frontend/README.md),修改指令/验证进入 [objects](../objects/README.md),修改执行进入 [core](../core/README.md)。返回 [工作区](../README.md)。