pycparser is a C99 parser library that converts C source code into an abstract syntax tree consisting of Python objects. It functions as an abstract syntax tree generator, transforming preprocessed C code into a structured hierarchy for programmatic analysis and transformation.
The library integrates with a C preprocessor to handle directives before parsing. It also features a stub header parser, which uses minimal mock headers to allow the parsing of C code without requiring a full system C library installation.
The project provides tools for static code analysis, C program analysis, and source-to-source transformation. Its parsing engine is generated from a formal C99 grammar using Python Lex-Yacc.