Re: Qi parse retval vs iterators

Joel de Guzman <[email protected]>
Newsgroups gmane.comp.parsers.spirit.general
Message-ID <[email protected]>
On 05/12/2017 6:51 AM, Richard wrote:
> In article <CAMEoF_GPuqcUTESbvfyXRJjauohRWB-voNoLf54DdAU9Z58drw@mail.gmail.com>,
>      Michael Powell <[email protected]> writes:
> 
>> Something of a mind bender for me, how is it that qi::parse(...) can
>> succeed (return true) and yet the iterator still not reach the end?
> 
> Because you might want to do something with the remaining input that
> is independent of the grammar?
> 
> This is why many of the examples define success as: i) the parser
> returned true and ii) the entire input was consumed.

Yes, that is correct. The grammar consumes only as much as it wants to.
It can be totally greedy. Or not. It's really up to you, the one writing
the grammar. There's such a thing as a partial match.

Hello everyone!

Regards,
-- 
Joel de Guzman
http://www.ciere.com
http://boost-spirit.com
http://www.cycfi.com/


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.