feat(ast): 重构AST转储功能并创建AST到IR转换器
- 重构ast_dump.c中的宏定义,简化PRINT_VALUE、PRINT_NODE、 PRINT_QUOTED_VALUE等宏的实现 - 移除冗余的PRINT_COLORED宏定义 - 统一使用SCC_TREE_DUMP_PRINT_PURE和SCC_TREE_DUMP_PRINT_AROUND 宏进行转储输出 - 在dump_stmt_impl函数中优化节点转储逻辑,统一使用end_node_dump 替代手动换行 - 添加对未知节点类型的警告日志输出 - 创建新的ast2ir模块,包含AST到IR的基本转换功能 - 实现ast_type_to_ir_type、ast_expr_to_ir、ast_stmt_to_ir、 ast_decl_to_ir等核心转换函数 - 更新IR库依赖配置,添加scc_utils和tree_dump依赖 - 新增IR基础接口定义文件ir_base.h和IR构建器接口ir_builder.h
This commit is contained in:
10
libs/ast2ir/include/scc_ast2ir.h
Normal file
10
libs/ast2ir/include/scc_ast2ir.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#ifndef __SCC_AST2IR_H__
|
||||
#define __SCC_AST2IR_H__
|
||||
|
||||
#include <lexer_token.h>
|
||||
#include <scc_ast.h>
|
||||
#include <scc_ir.h>
|
||||
|
||||
void scc_ast2ir(scc_ast_translation_unit_t *tu, scc_ir_builder_t *builder);
|
||||
|
||||
#endif /* __SCC_AST2IR_H__ */
|
||||
Reference in New Issue
Block a user