CPP denotational semantics

Jean-Marie Favré · 2004

We show that CPP, the preprocessor of the C language, can be seen as a programming language in which directives are statements, parametrized macros are functions, files are procedures, directories are modules, and command lines are programs. The semantics of CPP can therefore be described using traditional techniques. We describe the semantics of CPP in a denotational style. By contrast with previous work, the full semantics is taken into account including nontrivial aspects such as recursive macros, stringification and concatenation.

Read the paper · More papers on PaperTik