1 1 The GNU C Preprocessor Internals 1 ******************************** 1
1 · Conventions · Lexer · Hash Nodes · Macro Expansion · Token Spacing · Line Numbering · Guard Macros · Files · Concept Index 1 1 1 Cpplib--the GNU C Preprocessor 1 ******************************** 1 1 The GNU C preprocessor is implemented as a library, "cpplib", so it can 1 be easily shared between a stand-alone preprocessor, and a preprocessor 1 integrated with the C, C++ and Objective-C front ends. It is also 1 available for use by other programs, though this is not recommended as 1 its exposed interface has not yet reached a point of reasonable 1 stability. 1 1 The library has been written to be re-entrant, so that it can be used 1 to preprocess many files simultaneously if necessary. It has also been 1 written with the preprocessing token as the fundamental unit; the 1 preprocessor in previous versions of GCC would operate on text strings 1 as the fundamental unit. 1 1 This brief manual documents the internals of cpplib, and explains 1 some of the tricky issues. It is intended that, along with the comments 1 in the source code, a reasonably competent C programmer should be able 1 to figure out what the code is doing, and why things have been 1 implemented the way they have. 1 · Menu1 · Conventions Conventions used in the code. · Lexer The combined C, C++ and Objective-C Lexer. · Hash Nodes All identifiers are entered into a hash table. · Macro Expansion Macro expansion algorithm. · Token Spacing Spacing and paste avoidance issues. · Line Numbering Tracking location within files. · Guard Macros Optimizing header files with guard macros. · Files File handling. · Concept Index Index. 1