Boost logo

Boost :

From: Hartmut Kaiser (hartmutkaiser_at_[hidden])
Date: 2004-01-26 01:28:02

Hi all,

This is a request for review for "Wave, a Standards conformant C++
preprocessor library", since a recent polling showed some interest among the
Boost community.

The Wave C++ preprocessor library uses the Spirit parser construction
library to implement a C++/C99 lexer with ISO/ANSI Standard conformant
preprocessing capabilities. It exposes an iterator interface, which returns
the current preprocessed token from the input stream. This preprocessed
token is generated on the fly while iterating over the preprocessor iterator
sequence (in the terminology of the STL these iterators are forward

The current documentation for the library is included with the review
candidate sources (see below).

The main goals for the Wave project are:

. full conformance with the C++ standard (ISO/IEC 14882:1998) and with the
C99 standard (INCITS/ISO/IEC 9899:1999)
. usage of Spirit for the parsing parts of the game (certainly :-)
. maximal usage of STL and/or Boost libraries (for compactness and
. straightforward extendability for the implementation of additional
. building a flexible library for different C++ lexing and preprocessing

At the first steps it is not planned to make a very high performance or very
small C++ preprocessor. If you are looking for these objectives you probably
have to look at other places. Although the Wave C++ preprocessor library
works as expected and is usable as a reference implementation. Nevertheless
recent work has lead to surprising performance enhancements (if compared
with earlier versions). Wave is still somewhat slower as for instance EDG
based preprocessors (Intel, Comeau) on simple input files, however, as
complexity increases, time dilates expontentially on EDG. Preprocessing time
dilates linearly under Wave, which causes it to easily outperform EDG based
preprocessors when complexity increases.

As tests showed, the Wave library preprocessor is very conformant to the C++
Standard, such that it compiles several strict conformant macro definitions,
which are not even compilable with EDG based preprocessors (i.e. Comeau or
Intel). The only preprocessor known to have similar Standards conformance
today is the preprocessor of the gcc.

You may find the review candidate sources in the boost-sandbox CVS
(boost/boost, boost/libs and boost/tools subdirectories). Please note, that
you'll need to download the current version of the program_options library
(recently accepted into Boost) from here: (please
unpack it into the boost directory structure).

The Wave library requires a fairly conformant C++ compiler/std library to be
compiled, but it has been proven to compile and work on the following
platforms (other results welcome):

- VC7.1
- Intel V7.1, V8.0
- Cygwin, gcc 3.3.1

- Comeau 4.3.3
- Intel V8.0
- gcc 3.2.3
- gcc 3.3.2

There are still some issues to be fixed on gcc 3.4 and Intel V7.1 (linux).

Regards Hartmut

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