Boost logo

Boost Users :

From: Jean Vittor (jean.vittor_at_[hidden])
Date: 2008-04-01 17:01:08


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Richard a écrit :
> [Please do not mail me a copy of your followup]
>
> boost-users_at_[hidden] spake the secret code
> <47F1F383.5060802_at_[hidden]> thusly:
>
>> I'm trying to write a parser which can write on the input string (mainly
>> insert string at the current position).
>
> You're probably better off representing this as a transformation
> instead of an edit-in-place.
I'm afraid you're right but I wanted to avoid it.
>> Does spirit contain any stuff that can help me in that way ?
>
> AFAIK, Spirit doesn't contain any mechanisms for modifying the input
> -- that's considered beyond the scope of a parser. You could probably
> create your own out-of-band mechanism for doing it, but it would
> probably mess up spirit's idea of where it is within the input as you
> modified the input.
I haven't really thought but I guess I would need

    * to maintain iterators during each input transformation,
    * perhaps to trigger some "cut" or backtrack.

By the way, I was wondering if "multi_pass" could meet some of my
requirements but I haven't found any example.

Has someone seen an example illustrating multi_pass ?

Thanks,
Jean

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Mandriva - http://enigmail.mozdev.org

iD8DBQFH8qKUQ0w7PvnJLt4RAptmAJ0Uo2hqrhzVzGgO77uA8mnHnN6MHQCfZqWL
eT+OH4KC23Tnj99bAhybQdc=
=XVDq
-----END PGP SIGNATURE-----


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