Boost logo

Boost :

From: Joel de Guzman (djowel_at_[hidden])
Date: 2002-10-23 20:50:45

----- Original Message -----
From: "Andrei Alexandrescu" <andrewalex_at_[hidden]>

> And by the way, how's Spirit doing in that respect? If I can do easily with
> Spirit what I can do with regex, and if it compiles in only what I actually
> use, then I'd gladly use Spirit. I know the power is there but only when I
> need it!

Spirit is layered. It is header only and you pay only for what you use.
For small parsing tasks such as the date/time, numbers, calculators,
the code size is dominated by the std::lib support, especially iostream.
For example, CW reports 25K code size and 7K data size for the
comma separated number list parser, this includes the vector and
iostream. The actual instantiated parser, is 5K code size and 1.3K data
size (including the semantic action that stuffs the numbers in the vector
and the driver code that creates a scanner from a std::string).

> Another approach to an alternative regex library would be similar to Spirit:
> use expression templates and C++ operators to emulate regex syntax. I did
> participate to developing such a lib at a corporate job, but didn't have
> time to take it too far. The main limitation is that you can't specify
> patterns at runtime, which most re users don't need anyway.

It is DFA/NFA based?

I'd be very interested to continue what you've started. It would be a nice
addition especially in the development of Spirit-lexers. In my spare time,
I am playing around with fully static metaprogrammed lexer ideas.

> That way indeed you pay as you go, because only the used operators will be
> instantiated.

We'll surely be seeing more of this type of static-regexing. Surely! :-)


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