pycparser is a complete C99 parser written in pure Python, designed to parse C source code for applications that need to analyze or transform it. It is useful for tasks like static code checking, building a front end for specialized C compilers, and generating information such as unit-test discovery, and it can integrate with CFFI to parse C function and type declarations.
Project status
- Actively maintained, with an upstream push and v3.12 update on October 22, 2026.
- Recent updates have been frequent, with three in October and a larger v3.0 update in January. This short burst does not establish a long-term cadence.
AI summary generated
Recent updates
release_v3.12
Release 3.12 includes parser and code-generator fixes for shared declarations, switch cases, pragmas, and several parsing edge cases. The code diff also adds broad opt-in C23 parsing support and raises the minimum supported Python version to 3.11, neither of which is called out in the release notes.
Featuresrelease_v3.11
Release v3.11 is a C11-focused update that adds parsing and code generation support for constructs like _Generic (generic selections/associations) and improves handling of C11 features such as _Static_assert and C11 threads-related keywords. The diff also includes non-trivial changes to lexer escape handling, atomic specifier qualifier normalization, and how code generation emits base type specifiers inside declaration lists.
Featuresrelease_v3.01
Release v3.01 of pycparser primarily includes bug fixes to the lexer/parser and generator around preprocessor directives, compound literals, and string literal unification. It also adds Python 3.15 support and includes CI/doc updates tied to the repo default branch change. The code diff shows several internal refactors and tooling changes that are not fully covered by the release notes.
BreakingFeaturesrelease_v3.00
Release v3.00 removes the PLY dependency by replacing the C parsing pipeline with a hand-written lexer and recursive-descent parser, with the intent to keep the same AST output. The release also updates CI/tooling to support Python 3.14 and refreshes project metadata for modern packaging.
Featuresrelease_v2.23
pycparser v2.23 adds several grammar support fixes (abstract declarator with static, labels/case/default with empty statements, and comment handling) and improves correctness for hex float typing. It also updates CI to test against Python 3.13 and adds new fake typedefs for GNU integer extensions and some common Linux types.
Featuresrelease_v2.22
Release v2.22 of pycparser updates parsing capabilities and broadens interpreter support. It adds pragma support (and fixes related parsing behavior), extends parse_file with an encoding parameter, and improves table caching behavior during build. It also adds support for Python 3.11 and 3.12.
Features