After reading hans post it just clicked ... Function_designator: identifier { embedded action assigning to $$ } Params { func on $$ }
If I am not mistaken shouldn't the $$ assignment in the 1st embedded action be accessed as $2 in the action for this production? Regards Ramaswamy -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Roberto Mandall Sent: Thursday, August 11, 2005 12:48 AM To: help-bison@gnu.org Subject: problem with $$, maybe bug?? 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! ______________________________________________ Renovamos el Correo Yahoo! Nuevos servicios, más seguridad http://correo.yahoo.es _______________________________________________ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison DISCLAIMER This message and any attachment(s) contained here are information that is confidential, proprietary to HCL Technologies and its customers. Contents may be privileged or otherwise protected by law. The information is solely intended for the individual or the entity it is addressed to. If you are not the intended recipient of this message, you are not authorized to read, forward, print, retain, copy or disseminate this message or any part of it. If you have received this e-mail in error, please notify the sender immediately by return e-mail and delete it from your computer _______________________________________________ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison