diff options
author | Tom Smeding <tom.smeding@gmail.com> | 2018-01-03 23:10:59 +0100 |
---|---|---|
committer | Tom Smeding <tom.smeding@gmail.com> | 2018-01-03 23:10:59 +0100 |
commit | 9911f9a73c7dc46069199e52f2bc54082d10366c (patch) | |
tree | 914cd4fc2367207271c1c53c7f11a96ed9bbc9b7 /symtab.h |
Initial
Diffstat (limited to 'symtab.h')
-rw-r--r-- | symtab.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/symtab.h b/symtab.h new file mode 100644 index 0000000..18dd8e0 --- /dev/null +++ b/symtab.h @@ -0,0 +1,23 @@ +#pragma once + +#include "symbol.h" +#include "type.h" + + +struct symtab { + struct symtab *parent; + int cap,len; + struct symbol **syms; +}; + + +struct symtab* symtab_make(); +void symtab_delete_recursive(struct symtab *symtab); + +struct symbol* symtab_find(const struct symtab *symtab, const char *name); +struct symbol* symtab_find_local(const struct symtab *symtab, const char *name); +void symtab_insert(struct symtab *symtab, struct symbol *sym); + +struct symtab* symtab_root(struct symtab *symtab); +struct symtab* symtab_sub(struct symtab *symtab); +struct symtab* symtab_delete_get_parent(struct symtab *symtab); |