|Using bison and C++ together --- compile with gcc or g++?? How?? email@example.com (Timothy Lofft) (2001-01-26)|
|Re: Using bison and C++ together --- compile with gcc or g++?? How?? firstname.lastname@example.org (2001-01-28)|
|From:||Timothy Lofft <email@example.com>|
|Date:||26 Jan 2001 16:57:18 -0500|
|Organization:||Golden Triangle On Line Inc.|
|Posted-Date:||26 Jan 2001 16:57:17 EST|
Using bison for the first time (as part of a compilers class), so I'm
hoping there's a simple solution to our problems.
We are trying to compile a bison file with g++, but it gives all sorts
of errors about implicit function declarations. We also want to be
able to use our own C++ class inside bison to store various symbols.
If we include the header for the class definition, it gets worse. I
can eliminate some of the errors by adding "extern" declarations of
the function headers in the *.y file but this seems to be a silly
solution, as I'm creating declarations for such functions as free,
malloc and strcat.... there must be a better way.
Is there some standard way to use bison generated code with C++
classes? Or do we need to create a C-interface to the C++ classes and
compile the generate bison file using gcc?
I've done a fairly complete search of the Internet with seemingly no
success but if anyone has any pointers, they too would be appreciated.
[See the compilers archives for info on C++-ized versions of bison. -John]
Return to the
Search the comp.compilers archives again.