Boost logo

Boost :

Subject: Re: [boost] Parsing commands with Spirit
From: edouard_at_[hidden]
Date: 2010-02-02 09:15:46


On Tue, 2 Feb 2010 08:01:51 -0600, "Hartmut Kaiser"
<hartmut.kaiser_at_[hidden]> wrote:

> b) whether you already know where the end of the string is, or otherwise
> you
> have to scan the string once to find the end anyways.
>
> If you don't know the string length upfront (you have to scan it once to
> find eos), then I'd remember the position of the last separator along
the
> way and parse the two parts separately. If you do know the eos without
> scanning, you could do two parse steps as well: using reverse_iterators
> rbegin/rend to recognize command2 from the end which gives you the last
> separator and then using the begin/lastsep iterators to recognize
command
> 1.

Thanks a lot, I think the two steps parsing is exactly what we need to do.
I should be able to implement this very quickly.

Kind regards.

-Edouard


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk