Boost logo

Boost :

From: Dave Jenkins (david_at_[hidden])
Date: 2007-11-23 16:16:35

"Jorge Lodos Vigil" <lodos_at_[hidden]> wrote in message
> I have to thank you again, this is a better solution than the prepocessing
> I was thinking about. This solves our problem. The only caveat is that
> proto is not yet a boost library, but I hope this will imply just a header
> change when definitely accepted and BOOST_PROTO_AUTO will not change.
> So far you came with 2 different ideas, the first one modifying the way we
> traverse the sequence, now an elegant way of modifying the grammar. There
> is still the alternative of modiying the algorithm to use an additional
> skip regex. I wonder, performance wise, what should be the best option for
> arbitrary texts? Do you (or someone else) could shed some light on this?

If you're worried about using Proto, you could use:

    regex_skip skip_spaces = nil[check(&not_space::enable)];
    regex_skip normal = nil[check(&not_space::disable)];

instead of:

    BOOST_PROTO_AUTO( skip_spaces, nil[check(&not_space::enable)] );
    BOOST_PROTO_AUTO( normal, nil[check(&not_space::disable)] );

They do the same thing. I've just found BOOST_PROTO_AUTO is faster for
small, nested regexes where you're not interested in the match info.

As for performance, I don't know how a modified algorithm would compare with
the modified iterator that I used. I presume you are thinking about
something like icase (which ignores case), but that ignores spaces. Maybe
Eric can answer that one.

Boost list run by bdawes at, gregod at, cpdaniel at, john at