Boost logo

Boost Users :

Subject: [Boost-users] converting bison to boost::spirit
From: Littlefield, Tyler (tyler_at_[hidden])
Date: 2011-04-27 12:37:13


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.

-- 
Thanks,
Ty

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net