From 9911f9a73c7dc46069199e52f2bc54082d10366c Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Wed, 3 Jan 2018 23:10:59 +0100 Subject: Initial --- symbol.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 symbol.h (limited to 'symbol.h') 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); -- cgit v1.2.3-54-g00ecf