init basic

This commit is contained in:
ZZY
2025-03-05 15:45:19 +08:00
commit 09299e339c
42 changed files with 5752 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
// symtab.h
#ifndef __SYMTAB_H__
#define __SYMTAB_H__
struct SymbolTable {
struct Scope* cur_scope;
struct Scope* global_scope;
};
void init_symtab(struct SymbolTable* symtab);
void del_symtab(struct SymbolTable* symtab);
void symtab_enter_scope(struct SymbolTable* symtab);
void symtab_leave_scope(struct SymbolTable* symtab);
void symtab_add_symbol(struct SymbolTable* symtab, const char* name, void* ast_node);
void* symtab_lookup_symbol(struct SymbolTable* symtab, const char* name);
#endif