473,503 Members | 1,735 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using flex++ and bison (not ++) with c++

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
a thing?

Dec 21 '05 #1
4 5374

<da************@gmail.com> schrieb im Newsbeitrag
news:11********************@o13g2000cwo.googlegrou ps.com...
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
a thing?


Why not using boost::spirit?

www.boost.org
Dec 21 '05 #2
da************@gmail.com wrote:
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
a thing?


Recent versions of bison can be used with C++. You can see a sample in my
open source z80 assembler:

http://www.arrakis.es/~ninsesabe/pasmo/

The last version, still under development, has a bison parser that compiles
in C++, inside a namespace and using a class as lexer.

Take care, bison manual warns that c++ related features can be changed in
next releases.

--
Salu2
Dec 21 '05 #3

Gernot Frisch wrote:
Why not using boost::spirit?


Man, that thing is incredible. I wrote an incredibly validator for a
file format we made up in less than 2 hours, with the learning and
everything.

Where can I get more info? I want to look into the possibilty of
feeding parse() a stream instead of character sequence. Flipping
through the docs has been helpful up to this point but I need more;
maybe it's in there but I can't find it...where is a good full coverage
tutorial on spirit (not just regurgitating the calculator example in
the docs for instance)?

Dec 22 '05 #4

ro**********@gmail.com wrote:
Gernot Frisch wrote:
Why not using boost::spirit?


Man, that thing is incredible. I wrote an incredibly validator for a
file format we made up in less than 2 hours, with the learning and
everything.

Where can I get more info? I want to look into the possibilty of
feeding parse() a stream instead of character sequence. Flipping
through the docs has been helpful up to this point but I need more;
maybe it's in there but I can't find it...where is a good full coverage
tutorial on spirit (not just regurgitating the calculator example in
the docs for instance)?


Nevermind...perfectly obvious if you just keep reading a bit.

Dec 22 '05 #5

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

Similar topics

4
10902
by: Uwe Ziegenhagen | last post by:
Hello, my fellows and me implement a c++ tool that is able to divide blank/tab separated files into <number>, <text>, <c-singlelinecomment> and <multilinecomment>. So far it's not working bad,...
0
2563
by: Tom Heathcote | last post by:
Apologies for posting a flex++ question rather than a C++ question, but there does not appear to be a flex++ newsgroup... I am trying to rebuild some old lexical scanner / analyzer code, which I...
2
6564
by: olig9 | last post by:
Hello, is there a way to feed an ifstream to a parser generated with flex and bison? I could see that flex wants a FILE* for reading, but I only have an ifstream (actually and ifstream*) for...
8
16821
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) ============== %{...
3
11751
by: John Sasso | last post by:
In my Yacc .y file I defined: %union { int value; struct Symbol Sym; } The Symbol struct I defined in a header file I #included in the Prologue section of the .y file as:
6
15457
by: Volker Hetzer | last post by:
Hi! We are finding ourselves in a situation where we have to parse several more or less free format text files. In the past, on linux, we had flex and bison for generating very fast parsers for...
2
2509
by: James Calivar | last post by:
Hi, I'm trying to compile PHP v5.1.6 under Windows XP using cygwin. I get the following error when I run ./configure. Can anyone help please? $ ./configure loading cache ./config.cache...
2
5088
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...
1
2241
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...
0
7199
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,...
0
7076
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
6984
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7453
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...
0
5576
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4670
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...
0
3151
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
732
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
377
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.