stage1 完成sema词法
This commit is contained in:
@@ -85,7 +85,7 @@ typedef struct {
|
||||
} spl_ir_node_t;
|
||||
typedef VEC(spl_ir_node_t) spl_ir_node_vec_t;
|
||||
|
||||
typedef usize spl_ir_node_ref_t;
|
||||
typedef usize spl_ir_node_ref_t; /* 0 is error */
|
||||
typedef VEC(spl_ir_node_ref_t) spl_ir_node_ref_vec_t;
|
||||
|
||||
typedef struct {
|
||||
@@ -106,8 +106,9 @@ typedef struct {
|
||||
spl_ir_node_vec_t nodes;
|
||||
spl_ir_node_ref_vec_t labels;
|
||||
} spl_ir_func_t;
|
||||
|
||||
typedef usize spl_ir_func_ref_t; /* 0 is error */
|
||||
typedef VEC(spl_ir_func_t) spl_ir_func_vec_t;
|
||||
|
||||
typedef struct {
|
||||
spl_ir_func_vec_t funcs;
|
||||
} spl_ir_t;
|
||||
@@ -115,6 +116,12 @@ typedef struct {
|
||||
void spl_ir_init(spl_ir_t *ir);
|
||||
void spl_ir_drop(spl_ir_t *ir);
|
||||
|
||||
spl_ir_node_ref_t spl_ir_alloc_node(spl_ir_t *ir, spl_ir_func_ref_t fn_id);
|
||||
spl_ir_func_ref_t spl_ir_alloc_fn(spl_ir_t *ir);
|
||||
|
||||
spl_ir_node_t *spl_ir_node(spl_ir_t *ir, spl_ir_func_ref_t fn_id, spl_ir_node_ref_t node_id);
|
||||
spl_ir_func_t *spl_ir_func(spl_ir_t *ir, spl_ir_func_ref_t fn_id);
|
||||
|
||||
void spl_ir_dump(spl_ir_t *ir);
|
||||
|
||||
#endif /* __SPL_IR_H__ */
|
||||
|
||||
Reference in New Issue
Block a user