55 ms·
I'm desperately looking for a C preprocessor that dumps the AST (preferable in JSON format) instead of expanding the macros. And it treats the C/C++ code as jus
by fizixer 11y ago
I'm desperately looking for a C preprocessor that dumps the AST (preferable in JSON format) instead of expanding the macros. And it treats the C/C++ code as just data.
I plan to take the rest of the code and send it through clang to get C/C++ AST dump. Currently I'm getting clang's AST dump which "includes" all the headers and the size of the AST just blows up (e.g., 300k lines of AST for a 4k line C++ file that has about 10 include files).
- daurnimator 11y agoTry CParser: https://github.com/MatzeB/cparser https://github.com/MatzeB/cparser
- parados 11y agoTry CPIP in Python: http://cpip.sourceforge.net/ http://cpip.sourceforge.net/