Boost logo

Boost Users :

Subject: Re: [Boost-users] converting bison to boost::spirit
From: Michael Caisse (boost_at_[hidden])
Date: 2011-04-27 13:56:06

On 04/27/2011 09:37 AM, Littlefield, Tyler wrote:
> Hello all:
> I have a server I am trying to rewrite, but it uses bison to generate
> the parser. I know near to nothing about either of these, and the
> examples kind of confuse me. Is there a way that I can somehow convert
> the bison to boost::spirit for parsing?
> Also: I'm kind of curious how one would go about making a parser with
> boost::spirit. So I define my tokens, (lets say I want to make a
> calculator as it's pretty simple). Then I would need to generate a
> tree, correct? My first thought was to just use the [] operator to
> pass in a function to receive the tokens, then push it to a vector,
> but that seems like it would be really slow when it comes to parsing
> the tokens. I also know of an abstract syntax tree, but I'm kind of
> confused how that works and how spirit would work with it. The
> calculator overloaded a lot of operators, but I sort of got lost down
> the line in terms of what was supposed to be happening. Anyone willing
> to explain this would be greatly appreciated.

Hi Ty -

It looks like you are just getting started with Qi. You may find that my
boostcon'10 presentation on Spirit will get you up-to-speed quickly.

You can find the slides here:

and the video of the talk here:

There is an active Spirit ML that responds quickly to questions. The
Spirit web site also has a lot of information:


In the Sacramento/Folsom area?
** Profesional C++ Training mid-May **
Michael Caisse
Object Modeling Designs

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at