looking for expression evaluation engine

Hi,
I need to find an expression evaluator for C/C++ able to support my own functions and my own data type definitions.
- the expression will typically be parsed once but evaluated many times
- the expression result may be of any type, not always float
- the expression arguments may be of any type
When I say "any type" I mean Boolean, String, Color, or anything.

The purpose is to parse and evaluate expressions like:
"if (boolAttr, '(0,255,0)', colorAttr)"
this expression returning a Color type value,
and '(0,255,0)' being a color type constant
and colorAttr being a color type variable

I found some open source projects in Java that fully meet my needs (e.g. the "Expression Engine" project). But until now I was not able to find any in C++

Do you know any library (preferably open source) that could help me ?

(I'm new to this forum - please tell me if this is not the right forum to post questions like this...)
Sounds like you want to build your own grammar. I'd recommend looking at either
(lex and yacc) or the boost::spirit parser generator library (http://www.boost.org/doc/libs/1_35_0/libs/spirit/index.html)

Either one though has a fairly steep learning curve.
Topic archived. No new replies allowed.