19 lines
479 B
C
19 lines
479 B
C
// symtab.h
|
|
#ifndef __SYMTAB_H__
|
|
#define __SYMTAB_H__
|
|
|
|
typedef struct symtab {
|
|
struct Scope* cur_scope;
|
|
struct Scope* global_scope;
|
|
} symtab_t;
|
|
|
|
void init_symtab(symtab_t* symtab);
|
|
void del_symtab(symtab_t* symtab);
|
|
|
|
void symtab_enter_scope(symtab_t* symtab);
|
|
void symtab_leave_scope(symtab_t* symtab);
|
|
void* symtab_add_symbol(symtab_t* symtab, const char* name, void* ast_node, int can_duplicate);
|
|
void* symtab_lookup_symbol(symtab_t* symtab, const char* name);
|
|
|
|
#endif
|