Re: classical error but unresolved "syntax error at end of input"

2005-08-10 Thread Hans Aberg


On 9 Aug 2005, at 17:23, soledady wrote:


the result of the grammar file (*.y) compilation give me this error:
"syntax error at end of input"


You do not give much information, such as which Bison version you  
use. You could try adding ";" after each grammar rule. Perhaps you  
should make a bug report to Bug-Bison.


  Hans Aberg




___
Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison


Re: classical error but unresolved "syntax error at end of input"

2005-08-10 Thread soledady
I found the solution, the problem come from a function in the file
SuiteTest.c i correct this and now it works but without the function.

hope its clear

thanks you for your help and your quick answer.

bye
soledady


Le mercredi 10 août 2005 à 11:34 +0200, Hans Aberg a écrit :
> On 9 Aug 2005, at 17:23, soledady wrote:
> 
> > the result of the grammar file (*.y) compilation give me this error:
> > "syntax error at end of input"
> 
> You do not give much information, such as which Bison version you  
> use. You could try adding ";" after each grammar rule. Perhaps you  
> should make a bug report to Bug-Bison.
> 
>Hans Aberg
> 
> 
> 



___
Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison


Re: redundant merges for GLR

2005-08-10 Thread Joel E. Denny
On Fri, 29 Jul 2005, Joel E. Denny wrote:

> On Tue, 19 Jul 2005, Joel E. Denny wrote:
>
> > I am attempting to use bison's %glr-parser and %merge to construct parse
> > forests.  I'm getting duplicate representations of some trees within the
> > forest.  Both bison 1.875 and 2.0 give the same results.

I haven't seen any response to my posts last month on problems I'm having
with bison GLR:

  http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html
  http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html
  http://lists.gnu.org/archive/html/help-bison/2005-07/msg00017.html

Were my explanations unclear?  Am I correct that this is unintended
behavior?  Should I post these to bug-bison instead?

I need these problems resolved for my work, so I may start exploring
bison's source myself.  However, I don't want to waste my time moving in
that direction if (1) these are not legitimate bison bugs and I'm just
misunderstanding what bison GLR is intended to do or (2) someone else is
already working on these problems.

In any case, I would very much appreciate any hints you can give me.

Thanks.

Joel



___
Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison


problem with $$, maybe bug??

2005-08-10 Thread Roberto Mandall

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  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


Re: problem with $$, maybe bug??

2005-08-10 Thread Hans Aberg


On 10 Aug 2005, at 21:18, Roberto Mandall wrote:


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)


In the $$ value of the first action is named $2 in the last action.  
Is that your problem?


  Hans Aberg




___
Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison


problem with $$, maybe bug??

2005-08-10 Thread Javier Ignacio Asenjo Quinteiro
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  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