#include #include "symbol.h" struct symbol* symbol_make_var(char *name, struct type *rtype) { struct symbol *sym = malloc(sizeof(struct symbol)); sym->name = name; sym->stype = ST_VAR; sym->rtype = rtype; sym->numparams = 0; sym->params = NULL; return sym; } struct symbol* symbol_make_func(char *name, struct type *rtype, int numparams) { struct symbol *sym = malloc(sizeof(struct symbol)); sym->name = name; sym->stype = ST_FUNC; sym->rtype = rtype; sym->numparams = numparams; sym->params = malloc(numparams * sizeof(struct pair_tn)); return sym; }