2 Oct
2013
2 Oct
'13
8:08 p.m.
On 10/2/2013 2:31 PM, beet wrote:
Dear Boost-User list,
I have modified the calc6-example from the Spirit docs, so that it uses double variables rather than integers. I have then added a number of mathematical functions.
The rule for the unary functions (reduced to just sin and sinh here for readability) is:
unary_function_rule_ = (string_("sin") > '(' > expression_rule_ > ')') | (string_("sinh") > '(' > expression_rule_ > ')') ;
For this specific case you can reverse the order:
(string_("sinh") > '(' > expression_rule_ > ')') | (string_("sin") > '(' > expression_rule_ > ')')
for the more general case see: http://www.boost.org/doc/libs/1_41_0/libs/spirit/repository/doc/html/spirit_... Jeff