From WikiChip
c/preprocessor
< c
Revision as of 17:39, 23 December 2013 by David (talk | contribs) (initial page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The C preprocessor (CPP) is a program that implements the macro language used to transform C programming language program before they are compiled. Some CPPs can be used as a stand-lone utilities which are called by the C compiler during the first steps of the translation process. The C preprocessor provides the ability to include additional files, perform basic substitutions, generate errors. The C preprocessor supports conditional statements which allows conditional compilation based on some previously defined configurations.

Role

The C preprocessor is invoked during the first four phases of translation. The preprocessor's job is:

  1. Perform Trigraph replacement
  2. Perform escaped new-line characters removal
  3. Perform tokenization; replace comments with a single space character
  4. Perform macro expansion