473,698 Members | 2,943 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C++/Bison Question

Hi everyone,

I am trying to compile a bison tab.cc file in with a c++ program I am
writing. The program compiles fine without the parser attached but when I
compile with it, it comes up with lots of errors to do with typeinfo and
math.h for some reason. I have included the errors below - any help would
be most appreciated.

Thanks in advance

Tom

******** Top of Bison file **************
#include <string>
#include <list>
#include <map>
#include "objects.h"

using namespace std;
*************** *************** *********

******* Error output *************** *****

In file included from /usr/include/c++/3.2.2/ios:48,
from /usr/include/c++/3.2.2/ostream:45,
from /usr/include/c++/3.2.2/iostream:45,
from clengthspec.h:2 2,
from objects.h:12,
from problem.yy:5:
/usr/include/c++/3.2.2/bits/localefwd.h:239 : declaration does not declare
anything
/usr/include/c++/3.2.2/bits/localefwd.h:239 : parse error before numeric
constant
In file included from /usr/include/c++/3.2.2/cmath:51,
from /usr/include/c++/3.2.2/bits/locale_facets.t cc:41,
from /usr/include/c++/3.2.2/locale:46,
from /usr/include/c++/3.2.2/bits/ostream.tcc:37,
from /usr/include/c++/3.2.2/ostream:275,
from /usr/include/c++/3.2.2/iostream:45,
from clengthspec.h:2 2,
from objects.h:12,
from problem.yy:5:
/usr/include/math.h:281: parse error before numeric constant
In file included from /usr/include/c++/3.2.2/bits/locale_facets.t cc:45,
from /usr/include/c++/3.2.2/locale:46,
from /usr/include/c++/3.2.2/bits/ostream.tcc:37,
from /usr/include/c++/3.2.2/ostream:275,
from /usr/include/c++/3.2.2/iostream:45,
from clengthspec.h:2 2,
from objects.h:12,
from problem.yy:5:
/usr/include/c++/3.2.2/typeinfo:84: parse error before numeric constant
/usr/include/c++/3.2.2/typeinfo:98: semicolon missing after declaration of
`
std::type_info'
/usr/include/c++/3.2.2/typeinfo:99: ISO C++ forbids defining types within
return type
/usr/include/c++/3.2.2/typeinfo:99: `bool' is now a keyword
/usr/include/c++/3.2.2/typeinfo:99: non-member function `std::type_info
std::before(con st std::type_info& )' cannot have `const' method qualifier
/usr/include/c++/3.2.2/typeinfo:99: semicolon missing after declaration of
`
class std::type_info'
/usr/include/c++/3.2.2/typeinfo: In function `int std::before(con st
std::type_info& )':
/usr/include/c++/3.2.2/typeinfo:99: `__name' undeclared (first use this
function)
/usr/include/c++/3.2.2/typeinfo:99: (Each undeclared identifier is
reported
only once for each function it appears in.)
/usr/include/c++/3.2.2/typeinfo:75: `const char*std::type_ info::__name' is
protected
/usr/include/c++/3.2.2/typeinfo:99: within this context
/usr/include/c++/3.2.2/typeinfo: At global scope:
/usr/include/c++/3.2.2/typeinfo:101: non-member function `bool
std::operator== (const std::type_info& )' cannot have `const' method
qualifier
/usr/include/c++/3.2.2/typeinfo:101: `bool std::operator== (const
std::type_info& )' must take exactly two arguments
/usr/include/c++/3.2.2/typeinfo: In function `bool std::operator== (const
std::type_info& )':
/usr/include/c++/3.2.2/typeinfo:75: `const char*std::type_ info::__name' is
protected
/usr/include/c++/3.2.2/typeinfo:101: within this context
/usr/include/c++/3.2.2/typeinfo: At global scope:
/usr/include/c++/3.2.2/typeinfo:104: non-member function `bool
std::operator!= (const std::type_info& )' cannot have `const' method
qualifier
/usr/include/c++/3.2.2/typeinfo:104: `bool std::operator!= (const
std::type_info& )' must take exactly two arguments
/usr/include/c++/3.2.2/typeinfo:107: parse error before `public'
/usr/include/c++/3.2.2/typeinfo:111: virtual outside class declaration
/usr/include/c++/3.2.2/typeinfo:111: non-member function `bool
std::__is_funct ion_p()' cannot have `const' method qualifier
/usr/include/c++/3.2.2/typeinfo:120: virtual outside class declaration
/usr/include/c++/3.2.2/typeinfo:120: non-member function `bool
std::__do_catch (const std::type_info* , void**, unsigned int)' cannot
have `
const' method qualifier
/usr/include/c++/3.2.2/typeinfo:124: virtual outside class declaration
/usr/include/c++/3.2.2/typeinfo:124: non-member function `bool
std::__do_upcas t(const __cxxabiv1::__c lass_type_info* , void**)' cannot
have
`const' method qualifier
/usr/include/c++/3.2.2/typeinfo:149: parse error before `}' token
In file included from objects.h:15,
from problem.yy:5:
--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Jul 22 '05 #1
0 1368

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4711
by: DOKNIK | last post by:
Hi, I am trying to install PHP with the Apache DSO Installation on AIX 5.1. I have successfully configured and installed Apache and can view the Test Apache page successfully The installation guide i am using ( http://hotwired.lycos.com/webmonkey/00/44/index4a.html ) suggest that the installation of packages Bison and Flex have to be installed as part of the pre-requisites
8
16841
by: pavel.orehov | last post by:
Hi, I am using flex and bizon to write HTTP parser. I am passing well flex and bison tools but can't compile their output. ================= Flex file (http_parser.lpp) ============== %{ #include <iostream> #include "http_parser.tab.hpp"
3
6753
by: Santa | last post by:
I am trying to run bison tool, I am getting "/usr/share/bison.simple: No such file or directory" error, I have file bison.simple in cygwin/bin directory, I am trying to copy into /usr/share directory, but /usr/share directory was not exist, how can I solve this problem. Thanks.
4
5391
by: daniele.calisi | last post by:
Hi everyone, after some days spent in long searches with google, I still not have found a solution with this problem: I need to use flex (or flex++) and bison (but not bison++) in order to create a simple expression parser (that reads from a string, but this is another problem) I have problems with the fact that I cannot use bison++, and bison creates a c file... do you have any simple tutorial on how create such
13
4373
by: jc | last post by:
I have written a parser using bison and flex to read ASAP2 file for CAN communications. entire development was done in an unix environment and now the code is ready to be integrated to an existing CAN communication software that i wrote earlier in windows environment(as we get drivers for these CAN cards only for the windows). my problem started when i started to move the code from linux to the visual studio. after many compilation and...
1
1847
by: Adam S | last post by:
I'm using bison to generate a C++ parser targeted for a microcontroller application. The command to generated C++ parser using bison is: bison --skeleton=lalr1.cc <myfile.ypp> and makes heavy use of the STL iostreams. The only use is for C++ iostream is in error reporting in debugging and handling location tracking. Is there anyway to completely remove location tracking and debugging ?
2
5107
by: eng.sharif | last post by:
i want use bison and flex in visual stdio 2005 for make small compiler by use Custom Build Rules in Visual C++ 2005 "FlexBison.rules file " but when i compile "example.y" i get error ------------------------------------------------------------------------------------------ bison.simple: No such file or directory bison: Project : error PRJ0019: A tool returned an error code from bison Project : error PRJ0002 : Error result 1 returned...
1
2266
by: eng.sharif | last post by:
want use bison and flex in visual stdio 2005 for make small compiler by use Custom Build Rules in Visual C++ 2005 "FlexBison.rules file " but when i compile "example.y" i get error ---------------------------------------------------------------------------­--------------- bison.simple: No such file or directory bison: Project : error PRJ0019: A tool returned an error code from bison
3
2794
by: pendell | last post by:
Okay. So I've just installed Fedora core 7 fresh from my machine. It comes with G++, and bison installed directly. So I try to make a program that uses bison. C++ chokes with the error: dimensions_dat.cc:1: error: expected constructor, destructor, or type conversion before '(' token
0
8683
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9170
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8873
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6528
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4372
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4623
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2339
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.