cpehle / gpuocelot

Automatically exported from code.google.com/p/gpuocelot
0 stars 0 forks source link

Build fix for the newer bison environment #98

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
With the older bison, yyparse prototype is not contained in the generated 
header file[1].

However, the newer bison (I'm using 3.0.2 on Ubuntu 14.04) generates the header 
file with the yyparse prototype.
The yyparse prototype is declared with the parameter types. Since 
parser::PTXParser::State is nested class, we cannot add forward declaration 
into the generated header. And since PTXParser.h and yyparse prototype have a 
circular reference, we cannot include PTXParser.h in the generated 
ptxgrammar.hpp.

To solve it, I've created the patch for PTXLexer.h. In this patch, we provides 
yyparse macro definition to avoid generating yyparse prototype. I think it is 
relatively stable solution for the generated header by bison.

Could you review this patch?

[1]: https://lists.gnu.org/archive/html/bug-bison/2012-06/msg00013.html

Original issue reported on code.google.com by yusuke.suzuki@sslab.ics.keio.ac.jp on 1 Oct 2014 at 2:24

Attachments: