feat(pproc): 实现C语言预处理器功能并重构项目依赖

- 新增预处理器库(pproc),替代原有的pprocessor模块
- 实现完整的宏定义解析功能,支持对象宏和函数宏
- 添加条件编译指令处理(#if、#ifdef、#ifndef、#else、#elif、#endif)
- 实现宏展开机制,包括嵌套宏和递归宏处理
- 添加宏定义测试用例,覆盖基本功能和复杂场景
- 在cbuild.toml中更新依赖配置,移除parser、ast、ast2ir、ir等未完成模块
- 新增lexer工具函数用于token流处理
- 添加宏定义表管理功能,支持宏的创建、查找、删除操作
- 实现宏参数解析和替换列表处理
This commit is contained in:
zzy
2026-02-17 22:47:25 +08:00
parent 681a15cb44
commit 2de5ae59f5
13 changed files with 1083 additions and 84 deletions

View File

@@ -4,10 +4,10 @@ version = "0.1.0"
dependencies = [
{ name = "argparse", path = "./libs/argparse" },
{ name = "pprocessor", path = "./libs/pprocessor" },
{ name = "lexer", path = "./libs/lexer" },
{ name = "parser", path = "./libs/parser" },
{ name = "ast", path = "./libs/ast" },
{ name = "ast2ir", path = "./libs/ast2ir" },
{ name = "ir", path = "./libs/ir" },
{ name = "pproc", path = "./libs/pproc" },
# { name = "parser", path = "./libs/parser" },
# { name = "ast", path = "./libs/ast" },
# { name = "ast2ir", path = "./libs/ast2ir" },
# { name = "ir", path = "./libs/ir" },
]