I have checked this webpage http://www.boost.org/doc/libs/1_44_0/libs/spirit/doc/html/spirit/qi/quick_reference/compound_attribute_rules.html, and many others, but couldn't find an answer to my question.
I have a rule of the form C %= A % B, where B is a parser and NOT a literal, and it is of different type than A. The rule given on the webpage above says:
a: A, b: B --> (a % b): vector<A>
but given that in my case B is a parser and not of type A this rule doesn't seem to do the trick.
I have tried out this:
(a % b): variant<A, tuple<B,A>>
and as a consequence defined this structure:
struct equality_expression
{
variant<A,tuple<B,A>> equexp;
};
and thereafter
BOOST_FUSION_ADAPT_STRUCT(
equality_expression,
(variant<A,tuple<B,A>>, equexp);
)
but the compiler complains:
warning C4002: too many actual parameters for macro 'BOOST_FUSION_ADAPT_STRUCT_FILLER_0'
So, what's the correct way of doing this?