Re: [Boost-users] [Spirit] Building an expression parser with boost.spirit

Thank you Hartmut. I've found some simple examples using Google and an expression parser, exactly as what I described, which is built on boost.spirit: http://idlebox.net/2007/stx-exparser/#subsec_grammar Best regards Max ----- Original Message ----- From: Hartmut Kaiser To: Subject: Re: [Boost-users] [Spirit] Building an expression parser with boost.spirit or any other Date: 2008-12-23 22:41:43
There are several parsing tool libs in boost, say spirit and wave,
pheonix, etc.
But I am just not quite clear of the relation between each of them.
I've skimmed through some of the documentation some time ago, but it
seems to be too tough to me till now.
My question is, giving the huge power of these libs, is it simple to
construct an traditional expression parser which accepts formulea like:
1+2/3
sin(0.34)/power(tan(.4),3)
and so on
Or, preferably, is there already a sample program like this anywhere?
I'd say, go with Spirit. Examples are for instance in the Spirit distribution ($BOOST_ROOT/libs/spirit/examples) and here: http://spirit.sourceforge.net/repository/applications/show_contents.php. HTH Regards Hartmut ------------------------------------------------------------------- 新浪空间——与朋友开心分享网络新生活!(http://space.sina.com.cn/ )

Max wrote:
Thank you Hartmut.
I've found some simple examples using Google and an expression parser, exactly as what I described, which is built on boost.spirit:
Also, see http://spirit.sourceforge.net/repository/applications/show_contents.php <plug> Spirit2 has extensive calculator examples from the simplest expression evaluator progressing incrementally to a full C-like compiler. </plug> Regards, -- Joel de Guzman http://www.boostpro.com http://spirit.sf.net
participants (2)
-
Joel de Guzman
-
Max