示例#1
0
    bool parse_sequence(
        Left const& left, Right const& right
      , Iterator& first, Iterator const& last
      , Context const& context, Attribute& attr, traits::plain_attribute)
    {
        typedef typename traits::attribute_of<Left>::type l_attr_type;
        typedef typename traits::attribute_of<Right>::type r_attr_type;
        typedef traits::make_attribute<l_attr_type, Attribute> l_make_attribute;
        typedef traits::make_attribute<r_attr_type, Attribute> r_make_attribute;

        typename l_make_attribute::type l_attr = l_make_attribute::call(attr);
        typename r_make_attribute::type r_attr = r_make_attribute::call(attr);

        Iterator save = first;
        if (left.parse(first, last, context, l_attr)
            && right.parse(first, last, context, r_attr))
            return true;
        first = save;
        return false;
    }
示例#2
0
    bool parse_sequence(
        Left const& left, Right const& right
      , Iterator& first, Iterator const& last
      , Context const& context, Attribute& attr, traits::tuple_attribute)
    {
        typedef detail::partition_attribute<Left, Right, Attribute> partition;
        typedef typename partition::l_pass l_pass;
        typedef typename partition::r_pass r_pass;

        typename partition::l_part l_part = partition::left(attr);
        typename partition::r_part r_part = partition::right(attr);
        typename l_pass::type l_attr = l_pass::call(l_part);
        typename r_pass::type r_attr = r_pass::call(r_part);

        Iterator save = first;
        if (left.parse(first, last, context, l_attr)
            && right.parse(first, last, context, r_attr))
            return true;
        first = save;
        return false;
    }