PCp3: A C Front End for Preprocessor Analysis and Transformation

Simple C program



Common approaches

How pervasive is C preprocessor use?

The PCp3 Approach

Visualizing the mapping

The PCp3 Infrastructure

Event hooks


Example PCp3 analysis

C++ Language Features to replace uses of Cpp

Replacing macros with language-proper constants

PCp3 analysis will notice

Transformed code

How PCp3 compares

Future work


Extra slides.....

The C Preprocessor

Most definitions are simple

Difficult macros are used more than simple ones

Syntactic macros hinder lexical tools

Expansion mechanism

Nested macro expansion

Intentional programming groupís approach (MS)

Griswold & Atkinsonís approach for TAWK

Multiple translation units

Details of processing entire source

Processing all the source code