|
Boost Users : |
Subject: Re: [Boost-users] String processing algorithms
From: OvermindDL1 (overminddl1_at_[hidden])
Date: 2009-03-29 19:00:23
On Sat, Mar 28, 2009 at 11:08 AM, Aggelidis Nikos
<aggelidis.news_at_[hidden]> wrote:
> hi to all,i am interested in implementing some string processing
> algorithms{eg boyer-moore , knuth morris prat} for educational purposes.
>
>
> This is the first "real" exposure i will have with boost. I've done a
> bit of searching and i think Xpressive is the corresponding library
> of boost, for string processing. From what i read Xpressive is a
> header-only template library, so i will have to study xpressive.hpp .
>
> Any other directions i should follow?
>
> thanks in advance for your trouble,
If you are wanting to do string searching and matching and all such,
yep, boost.xpressive is designed for that. If you are interesting in
PEG grammars, can do the same stuff as xpressive, but xpressive is a
regex style, Spirit2(x) can do the same stuff, but of a PEG syntax. A
PEG syntax has no ambiguities and is capable of recursively calling
itself (that is the one main thing that regex style grammars cannot
do). Boost.Xpressive will be perfect if you are more comfortable with
regex, but Boost.Spirit2(x) is more powerful for compile time language
constructs. If you are interested in Boost.Spirit2(x), feel free to
join the mailing list, lot of helpful people there too.
However, both Xpressive and Spirit2(x) already do string searches as
part of their very language, from what you said (the boyer-moore
method and so forth), it sounds like just doing a standalone thing
might work best. If you were to implement it as a C++ grammar, then
Spirit2x might fit better (you can get a link to the ltaest in the
Spirit mailing list) as it can do matching styles exactly that of what
you stated. Still though, might be better to do it manually since
those are more low-level ways...
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