$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: Re: [Boost-users] [Spirit/qi] parsing order, exact matches
From: Jeff Flinn (jeffrey.flinn_at_[hidden])
Date: 2013-10-02 16:08:27
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:
Jeff