Preprocessor Macros Parser

Hi All,

I am attempting to implement a supercompilation method in optimizing the preprocessor.

So, I need to parse the preprocessor directives (best case scenario: build an AST of the macroses) before compilation.
Can anyone suggest a better way to do it? If it is quite hard to parse the macroses, it is ok to just get get all of them and then without clang usage.

(It would be nice but not necessary if it is possible to implement as an extension. But I still cannot find a way to do it.)

Thakns!