Boost logo

Boost Users :

Subject: [Boost-users] Boost spirit "%="
From: Space Ship Traveller (space.ship.traveller_at_[hidden])
Date: 2009-06-25 06:00:34


Hi,

I'm looking at (say):

template <typename Iterator>
struct employee_parser : qi::grammar<Iterator, employee(),
ascii::space_type>
{
     employee_parser() : employee_parser::base_type(start)
     {
         using qi::int_;
         using qi::lit;
         using qi::double_;
         using qi::lexeme;
         using ascii::char_;

         quoted_string %= lexeme['"' >> +(char_ - '"') >> '"'];

         start %=
             lit("employee")
>> '{'
>> int_ >> ','
>> quoted_string >> ','
>> quoted_string >> ','
>> double_
>> '}'
             ;
     }

     qi::rule<Iterator, std::string(), ascii::space_type> quoted_string;
     qi::rule<Iterator, employee(), ascii::space_type> start;
};

 From http://svn.boost.org/svn/boost/trunk/libs/spirit/doc/html/spirit/qi/tutorials/employee___parsing_into_structs.html

I can't find any information as to what "%=" does. I know that from
previous examples

        int_ % ","

parses a list of ints separated by commas, but there is no information
as to what %= does. If I took a guess it seems to imply that:

        r = r % ","
                - is equivalent to -
        r %= ","

Can someone point me to some documentation?

Kind regards,
Samuel



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net