PCp3: A C Front End for Preprocessor Analysis and Transformation

10/23/97


Click here to start presentation


Slides handouts (postscript)
Paper (postscript)

Table of Contents

PCp3: A C Front End for Preprocessor Analysis and Transformation

Simple C program

What...

Outline

Common approaches

How pervasive is C preprocessor use?

The PCp3 Approach

Visualizing the mapping

The PCp3 Infrastructure

Event hooks

Backcalls

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

Summary

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

Author: Greg J. Badros

Email: gjb@cs.washington.edu

Home Page: http://www.cs.washington.edu/homes/gjb