Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C syntax parser [closed]

Are there any libs out there that can parse C syntax?

For example I would like to write my own code/scripts that will analyze c files given the c syntax. Number of "if" statements per function/file, lines of comments per lines of code in a function and so on.....

I have no problem writing all this custom code just wanted to make the job easier if there was already some lib that I can use to jump start instead of starting with the parser.

Thanks!

like image 756
jox Avatar asked Mar 07 '26 21:03

jox


1 Answers

Besides the clang suggestion already made, consider pycparser and Boost.Wave.

like image 106
Brian Cain Avatar answered Mar 09 '26 10:03

Brian Cain



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!