help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

'yylval was not declared' on switch from Bison 2.4.1 to 3.0.2


From: Evan Lavelle
Subject: 'yylval was not declared' on switch from Bison 2.4.1 to 3.0.2
Date: Sat, 08 Nov 2014 14:31:50 +0000
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20130801 Thunderbird/17.0.8

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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]