Much has been written over the years on implementing parsers, but the C preprocessor is not quite the same as any of the stages of a typical parser, and implementation thereof doubtless has its share of particular pitfalls to watch out for. Does anyone know of anything written on the topic of implementing a C preprocessor?
I found a useful discussion in the document mcpp-summary at http://mcpp.sourceforge.net/