From: <so...@us...> - 2004-03-12 16:22:47
|
Update of /cvsroot/agd/server/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18671/src Modified Files: lang.y compile.c compile.h Log Message: Renamed id_t to def_id_t Index: lang.y =================================================================== RCS file: /cvsroot/agd/server/src/lang.y,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** lang.y 12 Mar 2004 08:44:53 -0000 1.1 --- lang.y 12 Mar 2004 16:03:10 -0000 1.2 *************** *** 11,16 **** extern int scope_level; ! void add_function(id_t *idp, int lineno, array_t *code); ! void redeclaration_error(id_t *id, int new_type); int compare_args(array_t *arg1, array_t *arg2); --- 11,16 ---- extern int scope_level; ! void add_function(def_id_t *idp, int lineno, array_t *code); ! void redeclaration_error(def_id_t *id, int new_type); int compare_args(array_t *arg1, array_t *arg2); *************** *** 29,33 **** array_t arr; expr_t expr; ! id_t *id; } --- 29,33 ---- array_t arr; expr_t expr; ! def_id_t *id; } *************** *** 96,100 **** type L_IDENTIFIER { ! id_t *idp; idp = find_id($2); if(idp && idp->type != ID_FUN_PROT) { --- 96,100 ---- type L_IDENTIFIER { ! def_id_t *idp; idp = find_id($2); if(idp && idp->type != ID_FUN_PROT) { *************** *** 107,111 **** '(' arguments ')' { ! id_t *idp; int i; idp = $<id>3; --- 107,111 ---- '(' arguments ')' { ! def_id_t *idp; int i; idp = $<id>3; *************** *** 115,119 **** for(i=0;i<$5.length;i++) { variable_t *v; ! id_t *id; v = $5.data[i]; id = find_id(v->name); --- 115,119 ---- for(i=0;i<$5.length;i++) { variable_t *v; ! def_id_t *id; v = $5.data[i]; id = find_id(v->name); *************** *** 130,134 **** { if($8.length) { ! id_t *idp = $<id>3; if(idp->lpc_type != $1 || compare_args(idp->args, &$5)) { char buf[256]; --- 130,134 ---- { if($8.length) { ! def_id_t *idp = $<id>3; if(idp->lpc_type != $1 || compare_args(idp->args, &$5)) { char buf[256]; *************** *** 380,384 **** L_IDENTIFIER { ! id_t *id; id = find_id($1); if(id) { --- 380,384 ---- L_IDENTIFIER { ! def_id_t *id; id = find_id($1); if(id) { *************** *** 397,401 **** | L_IDENTIFIER L_ASSIGN expr { ! id_t *id; variable_t *lval; --- 397,401 ---- | L_IDENTIFIER L_ASSIGN expr { ! def_id_t *id; variable_t *lval; Index: compile.c =================================================================== RCS file: /cvsroot/agd/server/src/compile.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** compile.c 12 Mar 2004 13:50:23 -0000 1.10 --- compile.c 12 Mar 2004 16:03:10 -0000 1.11 *************** *** 29,35 **** void define_id(char *name, int type, int lpc_type, array_t *args) { ! id_t *idp; ! idp = type_xmalloc(id_t); ! memset(idp, 0, sizeof(id_t)); idp->name = name; idp->type = type; --- 29,35 ---- void define_id(char *name, int type, int lpc_type, array_t *args) { ! def_id_t *idp; ! idp = type_xmalloc(def_id_t); ! memset(idp, 0, sizeof(def_id_t)); idp->name = name; idp->type = type; *************** *** 69,76 **** /* Binary search! */ ! id_t *find_id(char *name) { int i; ! id_t *idp; /* First search in local_ids. */ --- 69,76 ---- /* Binary search! */ ! def_id_t *find_id(char *name) { int i; ! def_id_t *idp; /* First search in local_ids. */ *************** *** 93,97 **** void free_id(void *p) { ! id_t *id = p; xfree(id->name); if(id->args) --- 93,97 ---- void free_id(void *p) { ! def_id_t *id = p; xfree(id->name); if(id->args) *************** *** 104,108 **** scope_level--; for(i=0;i<local_ids.length;i++) { ! id_t *id = local_ids.data[i]; if((id->type == ID_LVAR || id->type == ID_ARG) && id->base_scope > scope_level) { #ifdef DEBUG --- 104,108 ---- scope_level--; for(i=0;i<local_ids.length;i++) { ! def_id_t *id = local_ids.data[i]; if((id->type == ID_LVAR || id->type == ID_ARG) && id->base_scope > scope_level) { #ifdef DEBUG *************** *** 262,266 **** init_array(&curr_f->code); } ! void add_function(id_t *idp, int lineno, array_t *code) { if(idp->index < cob->prog->functions.length) { --- 262,266 ---- init_array(&curr_f->code); } ! void add_function(def_id_t *idp, int lineno, array_t *code) { if(idp->index < cob->prog->functions.length) { *************** *** 364,368 **** /* Only for locals right now. But watch out! */ if(assign) { ! id_t *id; /* Could use numlocals, since we just defined it. */ id = find_id(var->name); --- 364,368 ---- /* Only for locals right now. But watch out! */ if(assign) { ! def_id_t *id; /* Could use numlocals, since we just defined it. */ id = find_id(var->name); *************** *** 443,447 **** } ! void redeclaration_error(id_t *id, int new_type) { char buf[256]; --- 443,447 ---- } ! void redeclaration_error(def_id_t *id, int new_type) { char buf[256]; *************** *** 526,530 **** int i; for(i=0;i<local_ids.length;i++) { ! id_t *id = local_ids.data[i]; if(id->type == ID_FUN_PROT && id->has_been_called) { char buf[256]; --- 526,530 ---- int i; for(i=0;i<local_ids.length;i++) { ! def_id_t *id = local_ids.data[i]; if(id->type == ID_FUN_PROT && id->has_been_called) { char buf[256]; Index: compile.h =================================================================== RCS file: /cvsroot/agd/server/src/compile.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** compile.h 12 Mar 2004 08:40:10 -0000 1.8 --- compile.h 12 Mar 2004 16:03:10 -0000 1.9 *************** *** 18,25 **** int has_been_called; array_t *args; /* For ID_FUN_PROT and ID_FUN */ ! } id_t; void define_id(char *name, int type, int lpc_type, array_t *args); ! id_t *find_id(char *name); /* lang.y stuff */ --- 18,25 ---- int has_been_called; array_t *args; /* For ID_FUN_PROT and ID_FUN */ ! } def_id_t; void define_id(char *name, int type, int lpc_type, array_t *args); ! def_id_t *find_id(char *name); /* lang.y stuff */ |