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

D

daniele.calisi

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?
 
G

Gernot Frisch

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
 
?

=?ISO-8859-15?Q?Juli=E1n?= Albo

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.
 
R

roberts.noah

Gernot said:
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)?
 
R

roberts.noah

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,981
Messages
2,570,188
Members
46,731
Latest member
MarcyGipso

Latest Threads

Top