From ca9650190643302b8af46b106230fda877407f07 Mon Sep 17 00:00:00 2001 From: Teddy Date: Fri, 4 Apr 2014 20:34:44 +0800 Subject: working on type checking --- semantics.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'semantics.h') diff --git a/semantics.h b/semantics.h index 46f9a41..dfbf7b7 100644 --- a/semantics.h +++ b/semantics.h @@ -12,10 +12,11 @@ typedef struct CVar{ struct CVar *next; /* next in the linked list */ struct CType *type; int offset; + CNode *ast; } CVar; typedef CVar *CVar_t; -CVar_t cvar_create(const char *name, struct CType *type); +CVar_t cvar_create(const char *name, struct CType *type, CNode *ast); void cvar_print(CVar_t cv); typedef struct CType { @@ -45,10 +46,11 @@ typedef struct CType { } func; /* for a function */ } rec; int size; /* memory footprint */ + CNode *ast; } CType; typedef CType *CType_t; -CType_t ctype_create(const char *name, int type); +CType_t ctype_create(const char *name, int type, CNode *ast); void ctype_debug_print(CType_t ct); typedef unsigned int (*Hashfunc_t) (const char *); -- cgit v1.2.3