Problem with a simple grammar

2005-04-17 Thread Eulogio Serradilla
Hello, I have a simple bison file summarizes as #define YYSTYPE const char* %token NUMBER A TEXT %% stmt: expr /* append a copy of prg to a list */ | stmt expr /* append a copy of prg to a list */ ; expr: NUMBER TEXT A TEXT {

Re: Problem with a simple grammar

2005-04-17 Thread Hans Aberg
I have a simple bison file summarizes as #define YYSTYPE const char* ... When I run the program I got all members of prg having the same semantic value, i.e. all with the last string ($4). This is one of the most frequently asked question on this list: You forget to make copies of the strings in y

Re: Problem with a simple grammar

2005-04-17 Thread Eulogio Serradilla
> >I have a simple bison file summarizes as > > > >#define YYSTYPE const char* > > ... > > >When I run the program I got all members of prg having the same semantic > >value, i.e. all with the last string ($4). > > This is one of the most frequently asked question on this list: You > forget to make

Re: Problem with a simple grammar

2005-04-17 Thread Hans Aberg
At 15:35 +0200 2005/04/17, Eulogio Serradilla wrote: > This is rather old; the latest release is 2.0 Yes, I know, but I prefer to wait for a C++ output for bison, as it says in the FAQ section of the manual. Bison already has some C++ support, though you might not get the file setup you may want.

Re: Problem with a simple grammar

2005-04-17 Thread Eulogio Serradilla
> At 15:35 +0200 2005/04/17, Eulogio Serradilla wrote: > > > This is rather old; the latest release is 2.0 > > > >Yes, I know, but I prefer to wait for a C++ output for bison, as it says > > in the FAQ section of the manual. > > Bison already has some C++ support, though you might not get the file

Re: Problem with a simple grammar

2005-04-17 Thread Hans Aberg
At 19:44 +0200 2005/04/17, Eulogio Serradilla wrote: Actually, I'm using bison++ based on bison 1.19 and it works very well. When there is some documentation in bison about a C++ parser I will change my code. Bison++ is a program different from Bison, supposedly old. Bison has a C++ test, that is

Re: Problem with a simple grammar

2005-04-17 Thread Eulogio Serradilla
> At 19:44 +0200 2005/04/17, Eulogio Serradilla wrote: > >Actually, I'm using bison++ based on bison 1.19 and it works very well. > > When there is some documentation in bison about a C++ parser I will > > change my code. > > Bison++ is a program different from Bison, supposedly old. Bison has > a