Boost logo

Boost :

Subject: Re: [boost] [preprocessing] Feedback requested on a C99 preprocessor written in pure universal Python
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2017-03-06 23:56:28


On Mon, Mar 6, 2017 at 11:46 PM, Niall Douglas via Boost
<boost_at_[hidden]> wrote:
> On 06/03/2017 19:10, Edward Diener via Boost wrote:
>> On 3/6/2017 5:45 AM, Niall Douglas via Boost wrote:
>>> 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:
>>>
>>> https://github.com/ned14/pcpp
>>
>> It would be nice, for the purpose of testing with Boost PP and Boost
>> VMD, if somehow your preprocessor could somehow be plugged in to one of
>> the compilers Boost supports, with VC++ being the most obvious choice
>> because its preprocessor is not C++ standard conforming.
>
> It's pretty straightforward in theory. pcpp can consume from stdin or a
> file, and can output to stdout or a file, so it's easy to insert into a
> sequence using the pipe operator (which works fine on Windows too).

Given that preprocessor checks are often used for compiler
workarounds, and pcpp is not a full C++ frontend, one would have to
make sure pcpp defines the same set of predefined macros the compiler
does. In the particular case of MSVC that would make libraries like
Boost.PP and Boost.VMD treat pcpp the same way they do MSVC, which is
probably suboptimal, if at all functional. I guess, for such tandem to
be workable, pcpp has to define its own predefined macros, and PP and
VMD have to test it before they test other compiler-specific macros.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk