Boost logo

Boost Users :

Subject: Re: [Boost-users] help with boost::spirit:parsing out a list of menuitems
From: Igor R (boost.lists_at_[hidden])
Date: 2011-10-13 12:18:28


Please, use plain text for better readability.

>> By either auto attribute propagation or semantic action. I suggest the former if possible.
>
> I'm not sure how to use the first. The second seems sort of easy, I would just use a function to do that, no?

The former is even more simple: just pass std::vector as an attribute.
The attribute of (a % b) is vector<A>
http://www.boost.org/doc/libs/1_47_0/libs/spirit/doc/html/spirit/qi/quick_reference/qi_parsers/operator.html

>> const std::string &data -> char const* data
>> std::string::const_ iterator -> char const*
>> data.begin() -> data
>> data.end() -> data + length
>> ...and so on
>
> awesome, thanks. I didn't know that I could use that rather than an iterator

char * is also iterator (random access iterator).


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