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 /symbol.h |
Initial
Diffstat (limited to 'symbol.h')
-rw-r--r-- | symbol.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/symbol.h b/symbol.h new file mode 100644 index 0000000..454e8bc --- /dev/null +++ b/symbol.h @@ -0,0 +1,29 @@ +#pragma once + +#include "ir.h" +#include "type.h" + + +enum symbol_type { + ST_VAR, + ST_FUNC +}; + +struct pair_tn { + struct type *type; + char *name; +}; + +struct symbol { + char *name; + enum symbol_type stype; + struct type *rtype; + struct ref ref; + + int numparams; + struct pair_tn *params; +}; + + +struct symbol* symbol_make_var(char *name, struct type *rtype); +struct symbol* symbol_make_func(char *name, struct type *rtype, int numparams); |