feat(ast2ir): 添加浮点类型支持和复合初始化功能
- 在ABI类型计算中添加FLOAT和DOUBLE类型的映射 - 修复AST操作符注释中的歧义描述 - 为ast2ir上下文添加类型缓存以解决递归结构体定义问题 - 实现复合初始化表达式的支持,包括数组和结构体初始化 - 添加前置和后置自增/自减操作符的IR转换 - 实现三元条件表达式的IR生成 - 添加类型转换(cast)和sizeof操作符的支持 - 重构数组长度推断逻辑并添加类型大小计算函数 - 实现结构体和联合体的递归类型解析 - 添加函数指针调用相关的IR节点类型定义 fix(ast): 修正间接操作符的注释说明 refactor(ast2ir): 优化代码结构并添加必要的断言验证
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#define __SCC_SEMA_H__
|
||||
|
||||
#include <scc_ast.h>
|
||||
#include <scc_utils.h>
|
||||
|
||||
typedef struct scc_sema_ctx scc_sema_ctx_t;
|
||||
/**
|
||||
@@ -13,6 +14,12 @@ typedef void (*scc_sema_callback_t)(scc_sema_ctx_t *context,
|
||||
typedef scc_ast_qual_type_t *(*scc_sema_got_type_t)(scc_sema_ctx_t *context,
|
||||
const char *name);
|
||||
|
||||
typedef struct scc_label_scope {
|
||||
int function_scope_depth;
|
||||
scc_hashtable_t labels; // 标签名 -> scc_ast_stmt_t* (LABEL节点)
|
||||
scc_ast_stmt_vec_t pending_gotos; // 尚未找到目标的goto语句
|
||||
} scc_sema_label_scope_t;
|
||||
|
||||
/**
|
||||
* @brief 语义分析回调集合
|
||||
*/
|
||||
@@ -26,6 +33,7 @@ struct scc_sema_ctx {
|
||||
|
||||
scc_ast_stmt_vec_t break_stack;
|
||||
scc_ast_stmt_vec_t continue_stack;
|
||||
scc_sema_label_scope_t label_scope;
|
||||
void *context;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user