Unit content
Source preprocessing and translation units
Before a compiler can analyse a source program, some languages perform a preprocessing stage that transforms the source text.
C and C++ provide a concrete example through directives such as #include, #define and conditional compilation.
Header inclusion
Conceptually, an include directive inserts declarations from another file into the current source before ordinary compilation. The resulting preprocessed source forms part of a translation unit.
Macros
A macro performs token-level substitution before the compiler applies the language's ordinary type and expression rules.
Because this happens before semantic analysis, macros are fundamentally different from functions or typed constants even when the resulting source looks similar.
Conditional compilation
Preprocessor conditions can include or exclude source according to configuration symbols, target platform or build options.
Generated source is still source
Preprocessing does not directly produce machine instructions. It creates the source representation that the compiler proper will tokenize, parse and analyse.
Not every compiled language has a C-style preprocessor, but separating source transformation from compilation clarifies the first stage of the C/C++ toolchain.