I haven't started but I plan one day write a C parser that can read a normal C file but
with a different model for preprocessor.
Before start this project I want to think how this could work.
On item to "solve" is #include.
We can (even in parser phase) do text inclusion. It would be just a diversion
of normal parsing. But I think we had to consider other alternatives.
Something I can do to test is to compile header files (without linking) from c libraries etc
to see if they depend on some previous state (macros, declarations) or if each header is
self-sufficient.
In any project for instance we can compile header files
for instance gcc -c header.h
to see if they are self-sufficient. This is not a perfect guarantee
because some header can have #ifdef X and X can be or not defined
by previous headers.
I can prepare a normal compiler to detect this as well and emit a warning
if it uses a macro or declaration from the external world.