|
From: | David Fang |
Subject: | Re: Bison C++ parsers and ylwrap |
Date: | Sun, 2 Mar 2008 17:37:01 -0500 (EST) |
It probably is a bug. I for one use bison/yacc very sparingly only and lack the experience how to deal with it portably. Which is why it would be better if someone else worked on fixing it.For whatever it's worth, I have always found bison's C++ support to be sub-par. It's always been easier to create C source from bison, put some 'extern "C"' decls in the %{ %} header of the .y file, and output to a .cc file. So while I have no resolution for the bug, I would encourage you to just use bison conventionally as a workaround.
Another data point, I use the normal C-skeleton style parsers from bison/yacc but compile them in C++ (myparser.yy -> myparser.cc), and have no problems with using C++ in the semantic actions. (I also don't need any extern "C" declarations/references as long as everything is compiled consistently as C++. I've been doing this since yacc (skeleton 1.14?) and bison 1.35.
Fang David Fang Computer Systems Laboratory Electrical & Computer Engineering Cornell University http://www.csl.cornell.edu/~fang/ -- (2400 baud? Netscape 3.0?? lynx??? No problem!)
[Prev in Thread] | Current Thread | [Next in Thread] |