From 7a0e78225a62ce613672b05c9ce1e42ac6419b2c Mon Sep 17 00:00:00 2001 From: Teddy Date: Sun, 27 Apr 2014 17:53:08 +0800 Subject: ... --- semantics.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'semantics.h') diff --git a/semantics.h b/semantics.h index d0b681a..0a555df 100644 --- a/semantics.h +++ b/semantics.h @@ -14,14 +14,14 @@ typedef struct CDef CDef; typedef CDef *CDef_t; struct CVar { - const char *name; + char *name; CVar_t next; /* next in the linked list */ CType_t type; int start; CNode *ast; }; -CVar_t cvar_create(const char *name, CType_t type, CNode *ast); +CVar_t cvar_create(char *name, CType_t type, CNode *ast); void cvar_print(CVar_t cv); struct CType { @@ -35,7 +35,7 @@ struct CType { CPTR, CFUNC } type; - const char *name; + char *name; union { struct { CTable_t fields; /* for a struct or union */ @@ -57,7 +57,7 @@ struct CType { CNode *ast; }; -CType_t ctype_create(const char *name, int type, CNode *ast); +CType_t ctype_create(char *name, int type, CNode *ast); void ctype_debug_print(CType_t ct); typedef unsigned int (*Hashfunc_t) (const char *); @@ -157,10 +157,11 @@ enum DefState{ }; int is_identifier(const char *name); -void push(const char *name); +void push(char *name); void cibic_init(void); void block_enter(void); void block_exit(void); void def_enter(enum DefState kind); void def_exit(void); +int calc_size(CType_t type); #endif -- cgit v1.2.3-70-g09d2