Boost logo

Boost :

Subject: [boost] [preprocessing] Feedback requested on a C99 preprocessor written in pure universal Python
From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2017-03-06 10:45:46

Those of you who watch reddit/r/cpp will know I've been working for the
past month on a pure Python implementation of a C99 conforming
preprocessor. I am pleased to be able to ask for Boost feedback on a
fairly high quality implementation:

It passes the C11 standard's list of "tricky" preprocessor expansions
and the mcpp test suite. It has no issue correctly handling the
preprocessor metaprogramming I've thrown at it from my Boost libraries.
I'm not going to claim it can handle Boost.Preprocessor or especially
Boost.VMD and I've tried neither, but pull requests with source code
fixes adding support for those (with accompanying unit tests) would be

My main use case for writing this is to assemble my header only Boost
libraries into a single "drop in and go" file. To that end it has a
(still buggy) --passthru mode which passes through #define and #undef
plus any #if logic which uses an undefined macro. I'm still working on
pass through mode so expect showstopper bugs in that configuration, but
as a straight highly standards conforming preprocessor it's ready for
others to use and I welcome any feedback. There are a multitude of use
cases, everything from running as a conforming preprocessor before
invoking MSVC to compile right through to parsing, reflection and
introspection of source code.

(and yes it is also a Python library as well as a command line tool, you
can find API reference docs at

I look forward to any feedback and my thanks in advance for it.


ned Productions Limited Consulting

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