diff options
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); |