| single |
===============
pycparser v3.00
===============
----
.. contents::
:backlinks: none
.. sectnum::
Introduction
============
What is pycparser?
------------------
**pycparser** is a parser for the C language, written in pure Python. It is
a
module designed to be easily integrated into applications that need to
parse
C source code.
What is it good for?
--------------------
Anything that needs C code to be parsed. The following are some uses for
**pycparser**, taken from real user reports:
* C code obfuscator
* Front-end for various specialized C compilers
* Static code checker
* Automatic unit-test discovery
* Adding specialized extensions to the C language
One of the most popular uses of **pycparser** is in the [cffi
] library, which uses it to parse the
declarations of C functions and types in order to auto-generate FFIs.
**pycparser** is unique in the sense that it's written in pure Python - a
very
high level language that's easy to experiment with and tweak. To people
familiar
with Lex and Yacc, **pycparser**'s code will be simple to understand. It
also
has no external dependencies (except for a Python interpreter), making it
very
simple to install and deploy.
Which version of C does pycparser support?
------------------------------------------
**pycparser** aims to support the full C99 language (according to the
standard
ISO/IEC 9899). Some features from C11 are also supported, and patches to
support
more are welcome.
**pycparser** supports very few GCC extensions, but it's fairly easy to set
things up so that it parses code with a lot of GCC-isms successfully. See
the
[FAQ] for more details.
What grammar does pycparser follow?
-----------------------------------
**pycparser** very closely follows the C grammar provided in Annex A of the
C99
standard (ISO/IEC 9899).
How is pycparser licensed?
--------------------------
[BSD license].
Contact details
---------------
For reporting problems with **pycparser** or submitting feature requests,
please
open an [issue], or submit a
pull request.
Installing
==========
Prerequisites
-------------
**pycparser** is being tested with modern versions of Python on
Linux, macOS and Windows. See [the CI dashboard]
for details.
**pycparser** has no external dependencies.
Installation process
--------------------
The recommended way to install **pycparser** is with pip::
|