The Phases of Preprocessing


Preprocessing is defined to occur in several phases. The phases of preprocessing are as follows.

  1. System dependent characters are replaced. End of line characters are replaced as required. Trigraph substitutions are performed.

  2. Lines ending with a backslash followed by a new line sequence are merged with the subsequent line.

  3. The source is parsed into preprocessing tokens and white space. Each comment is replaced by a single space.

  4. Preprocessing directives are acted upon and macro substitutions made.

  5. Escape sequences in string literals and character constants are replaced.

  6. Adjacent string literals are concatenated.

The output of the preprocessing phase of compilation is passed to the C++ compiler.