init basic
This commit is contained in:
18
ccompiler/frontend/parser/symtab/symtab.h
Normal file
18
ccompiler/frontend/parser/symtab/symtab.h
Normal 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
|
||||
Reference in New Issue
Block a user