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 your lexer. Thus you only get a pointer into a buffer, as you work with pointers.


PS. I have to use bison 1.24 so you may not be able to help me.

This is rather old; the latest release is 2.0 -- Hans Aberg


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

Reply via email to