pycparser
« Back to VersTracker
Description:
C parser in Python
Type: Formula  |  Tracked Since: Dec 28, 2025
Links: Homepage  |  formulae.brew.sh
Category: Developer tools
Tags: parser c-language ast python static-analysis
Install: brew install pycparser
About:
Pycparser is a complete, pure Python library for parsing and analyzing C source code. It constructs a Comprehensive C Abstract Syntax Tree (AST) that can be easily traversed and modified. Its primary value is enabling developers to perform static analysis, code instrumentation, or translation tasks programmatically without needing a C compiler.
Key Features:
  • Pure Python implementation with no external dependencies
  • Parses C99 and C11 standards into an AST
  • Provides a visitor pattern for easy AST traversal
  • Includes a code generator to convert ASTs back to C source
Use Cases:
  • Static analysis and code quality checking tools
  • Automated code refactoring or instrumentation
  • Transpiling C code to other languages
Alternatives:
  • libclang – Provides a more robust C/C++ parser but requires the Clang/LLVM toolchain and bindings.
  • pyclang – Another Python wrapper for libclang, offering direct access to the Clang AST.
Version History
Detected Version Rev Change Commit
Jan 21, 2026 2:27pm 0 REVISION_ONLY bf1e580f
Sep 9, 2025 10:11pm 0 VERSION_BUMP 14db8985