Boost logo

Boost :

From: Eric Niebler (eric_at_[hidden])
Date: 2005-09-25 20:28:19

Joel de Guzman wrote:
> Tom Brinkman wrote:
>>* What is your evaluation of the potential usefulness of the library?
>>As others have indicated, there is some overlap with other boost libraries.
>>However, the emphasis of xpressive is different and
>>somewhat more flexible.
> Flexible in what way please? ;-)
> I should know, so I could steal that "flexibility" :P

Certainly I would like to hear Tom's answer. But your question reminds
me that that I've spent some time describing how xpressive is different
than Boost.Regex, but none describing how it's different than Spirit. In
no particular order:

- Rather than relying exclusively on expression templates, which are
fixed at compile time, xpressive lets you write patterns as strings as
well, so you can specify than at runtime or read them from an
initialization file.

- xpressive has exhaustive backtracking semantics, which you can
selectively turn off using the keep() directive. Spirit doesn't have an
exhaustive backtracking option.

- xpressive::regex, unlike spirit::rule, has normal value semantics so
you can copy them and put them in std containers.

- xpressive::regex keeps its referenced regexes alive via reference
counting, so you can never have a dangling reference. spirit::rule
doesn't, nor does spirit::grammar<> IIUC.

Taken together, it means you can pretty quickly and easily put together
a grammar in an ad hoc manner.

Eric Niebler
Boost Consulting

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