hi there, i´m using last version of bison on windows xp., bison 1.875 i have come up with a problem which is just dirving my crazy, see the code here: function_designator : identifier { dir=BuscarSimb(TablaActual,$1,&veces); $$=malloc(sizeof(struct RecordGCI)); $$->tipo=dir->tipo; $$->texto=malloc(strlen($1)+1); $$->texto=strcpy($$->texto,$1); $$->tiporet=dir->tipo_retorno; $$->numparam=dir->n_param; strcpy(nomfungu,$1); nodolistaauxiliar.paramlleva=numparamllevo; nodolistaauxiliar.parammax=numparamreal; nodolistaauxiliar.sigparam=puntiparam; nodolistaauxiliar.ptrbu=$$; strcpy(nodolistaauxiliar.nomfun,nomfungu); Insert1(nodolistaauxiliar,listaauxiliar); numparamllevo=0; CuantosNormal++; FunDesigIden(); } params { FunDesigParams($$); };
ok, so the big problem is that after params , when calling FunDesigParams($$), the pointer has changed its value but i can assure you that i do not touch that $$ any other place but here, and still do not change it at that Macro(fundesigparams) i know it has changed cause i have aprintf which i did not copy here, a printf just after the malloc and another one just before FunDesig. the union is this: %union { int numero; /*Valor numerico */ char * texto; /*Valor del lexema o la cadena de texto*/ char t; /*Tipo de expresion E.tipo*/ char op; /*Que operador (Si procede)*/ int tipo; /*Si es identificador, enterlo literal, true o false.*/ int v_ent; /*Valores de los enteros*/ int v_bool; /*Valores de los booleanos*/ char* v_cad; struct TNodoSim* p_id; struct RecordGCI* semix; }; and the type for func desig is: %type <semix> function_designator can anyone plz help me? i m just gettin crazy! -- Javier Ignacio Asenjo Quinteiro _______________________________________________ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison