Any idea how to fix this? I have a grammar which compiled without problems on bison 2.4.1/gcc 4.4.7 (RHEL 6.5), but which won't now compile on bison 3.0.2/gcc 4.8.2 (Ubuntu 14.04).

The bison.tab.cc output from 2.4.1 included a definition of yylval as:

semantic_type yylval;

The 3.0.2 output has no definition, and the compiler complains when it reaches the first reference to yylval in the new bison.tab.cc, saying that "'yylval' was not declared in this scope." This corresponds to my first use of 'yylval' in my .y file.

I'm using the C++ skeleton (lalr1.cc), and not explicitly declaring a pure-parser.

http://stackoverflow.com/questions/23685843/problems-with-yylval-and-yylloc-after-switching-to-bison-3-0 is the same question on stackoverflow, from May 15th, with a suggestion to use yyla.value instead.

Thanks.


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

Reply via email to