Boost logo

Boost Users :

Subject: Re: [Boost-users] Interested in parsing tools
From: Joel de Guzman (joel_at_[hidden])
Date: 2009-09-12 22:48:57


OvermindDL1 wrote:
>
> Static Xpressive (not dynamic Xpressive, you can think of dynamic
> Xpressive as being Boost.Regex exactly) and Spirit are both C++ DSEL's
> and compile to rather fast code, but Xpressive is a REGEX parser, and
> as such has limitations, where Spirit2.1 is a PEG (Parsing Expression
> Grammer as I recall, wiki it) grammar.

To be fair, regexes have advantages too, like non-greedy loops,
and full backtracking. In general, PEG and Regex have different
characteristics, if you add LL, LALR, LR into the mix, then you
have more parsing/text processing creatures all with different
characteristics. Sometimes the lines blur. For instance,
traditionally, regexes cannot handle recursive parsing such as
parsing xml/html. Xpressive, however, got beyond that limitation.

Also, while Spirit is static (at the moment), boost.regex is
dynamic and boost.xpressive can both be static and dynamic.
IOTW, you can define your regexes at runtime.

So bottom line: use the right tool for the job.

Regards,

-- 
Joel de Guzman
http://www.boostpro.com
http://spirit.sf.net

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