Spirit for C++ style if expressions
Hi, I am thinking of using spirit for C++ style expressions and am wondering if it is the way to go What I have will be something like ( (A != 192) AND ( (V > 0) AND (V < "89") ) ) What I need is to be able to parse this replace the AND, > etc... with operations, replace string numbers with real numbers and then apply the operation to a large number of A and V. I would have thought this would be quite a common usage but I haven't seem any samples doing it of partictuar importance is the delayed evaluation Anyone have an example of this? Vin
Vincent Finn wrote:
I am thinking of using spirit for C++ style expressions and am wondering if it is the way to go
What I have will be something like ( (A != 192) AND ( (V > 0) AND (V < "89") ) )
What I need is to be able to parse this replace the AND, > etc... with operations, replace string numbers with real numbers and then apply the operation to a large number of A and V.
I would have thought this would be quite a common usage but I haven't seem any samples doing it of partictuar importance is the delayed evaluation
Anyone have an example of this?
You may want to have a look at Wave (a Standard conformant C++ preprocessor, documentation: http://spirit.sourceforge.net/index.php?doc=docs/wave_v0_9/index.html, download: http://spirit.sourceforge.net/index.php?doc=download/Wave_0_9.html), which is build with the help of the Boost.Spirit library and which contains a full fledged C++ expression evaluator (for the #if/#elif directives). Regards Hartmut
participants (2)
-
HartmutKaiser@t-online.de
-
Vincent Finn