stage1 完成sema词法
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
typedef usize spl_scope_id_t; /* 0 is error */
|
||||
typedef struct {
|
||||
spl_scope_id_t parent;
|
||||
MAP(const char *, spl_type_id_t) symbols;
|
||||
MAP(const char *, spl_def_id_t) symbols;
|
||||
} spl_scope_node_t;
|
||||
typedef VEC(spl_scope_node_t) spl_scope_node_vec_t;
|
||||
|
||||
@@ -17,17 +17,19 @@ typedef struct {
|
||||
spl_scope_node_vec_t scopes;
|
||||
spl_scope_id_t root_scope;
|
||||
spl_scope_id_t current_scope;
|
||||
spl_def_id_t root_def;
|
||||
int error_count;
|
||||
} spl_sema_t;
|
||||
|
||||
void spl_sema_init(spl_sema_t *sema);
|
||||
void spl_sema_drop(spl_sema_t *sema);
|
||||
void spl_sema_run(spl_sema_t *sema);
|
||||
void spl_sema_check(spl_sema_t *sema);
|
||||
|
||||
spl_scope_id_t spl_sema_scope_alloc(spl_sema_t *sema);
|
||||
bool spl_sema_scope_insert(spl_sema_t *sema, spl_scope_id_t id, const char *symbol_name,
|
||||
spl_type_id_t symbol_val);
|
||||
spl_def_id_t symbol_val);
|
||||
typedef VEC(const char *) spl_symbol_path_t;
|
||||
spl_type_id_t spl_sema_scope_find(spl_sema_t *sema, spl_symbol_path_t path);
|
||||
spl_def_id_t spl_sema_scope_find(spl_sema_t *sema, spl_symbol_path_t path);
|
||||
|
||||
#endif /* __SPL_SEMA_H__ */
|
||||
|
||||
Reference in New Issue
Block a user