blob: 4830f4d0ec1bfffe403150403d88e42a4405806b [file] [log] [blame]
eli.bendersky347497d2010-12-10 15:17:28 +02001<?xml version="1.0" encoding="utf-8" ?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6<meta name="generator" content="Docutils 0.6: http://docutils.sourceforge.net/" />
eli.benderskyb56e8f82011-03-06 07:56:55 +02007<title>pycparser v2.03</title>
eli.bendersky347497d2010-12-10 15:17:28 +02008<meta name="author" content="Eli Bendersky" />
9<style type="text/css">
10
11/*
12:Author: David Goodger (goodger@python.org)
13:Id: $Id: html4css1.css 5951 2009-05-18 18:03:10Z milde $
14:Copyright: This stylesheet has been placed in the public domain.
15
16Default cascading style sheet for the HTML output of Docutils.
17
18See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
19customize this style sheet.
20*/
21
22/* used to remove borders from tables and images */
23.borderless, table.borderless td, table.borderless th {
24 border: 0 }
25
26table.borderless td, table.borderless th {
27 /* Override padding for "table.docutils td" with "! important".
28 The right padding separates the table cells. */
29 padding: 0 0.5em 0 0 ! important }
30
31.first {
32 /* Override more specific margin styles with "! important". */
33 margin-top: 0 ! important }
34
35.last, .with-subtitle {
36 margin-bottom: 0 ! important }
37
38.hidden {
39 display: none }
40
41a.toc-backref {
42 text-decoration: none ;
43 color: black }
44
45blockquote.epigraph {
46 margin: 2em 5em ; }
47
48dl.docutils dd {
49 margin-bottom: 0.5em }
50
51/* Uncomment (and remove this text!) to get bold-faced definition list terms
52dl.docutils dt {
53 font-weight: bold }
54*/
55
56div.abstract {
57 margin: 2em 5em }
58
59div.abstract p.topic-title {
60 font-weight: bold ;
61 text-align: center }
62
63div.admonition, div.attention, div.caution, div.danger, div.error,
64div.hint, div.important, div.note, div.tip, div.warning {
65 margin: 2em ;
66 border: medium outset ;
67 padding: 1em }
68
69div.admonition p.admonition-title, div.hint p.admonition-title,
70div.important p.admonition-title, div.note p.admonition-title,
71div.tip p.admonition-title {
72 font-weight: bold ;
73 font-family: sans-serif }
74
75div.attention p.admonition-title, div.caution p.admonition-title,
76div.danger p.admonition-title, div.error p.admonition-title,
77div.warning p.admonition-title {
78 color: red ;
79 font-weight: bold ;
80 font-family: sans-serif }
81
82/* Uncomment (and remove this text!) to get reduced vertical space in
83 compound paragraphs.
84div.compound .compound-first, div.compound .compound-middle {
85 margin-bottom: 0.5em }
86
87div.compound .compound-last, div.compound .compound-middle {
88 margin-top: 0.5em }
89*/
90
91div.dedication {
92 margin: 2em 5em ;
93 text-align: center ;
94 font-style: italic }
95
96div.dedication p.topic-title {
97 font-weight: bold ;
98 font-style: normal }
99
100div.figure {
101 margin-left: 2em ;
102 margin-right: 2em }
103
104div.footer, div.header {
105 clear: both;
106 font-size: smaller }
107
108div.line-block {
109 display: block ;
110 margin-top: 1em ;
111 margin-bottom: 1em }
112
113div.line-block div.line-block {
114 margin-top: 0 ;
115 margin-bottom: 0 ;
116 margin-left: 1.5em }
117
118div.sidebar {
119 margin: 0 0 0.5em 1em ;
120 border: medium outset ;
121 padding: 1em ;
122 background-color: #ffffee ;
123 width: 40% ;
124 float: right ;
125 clear: right }
126
127div.sidebar p.rubric {
128 font-family: sans-serif ;
129 font-size: medium }
130
131div.system-messages {
132 margin: 5em }
133
134div.system-messages h1 {
135 color: red }
136
137div.system-message {
138 border: medium outset ;
139 padding: 1em }
140
141div.system-message p.system-message-title {
142 color: red ;
143 font-weight: bold }
144
145div.topic {
146 margin: 2em }
147
148h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
149h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
150 margin-top: 0.4em }
151
152h1.title {
153 text-align: center }
154
155h2.subtitle {
156 text-align: center }
157
158hr.docutils {
159 width: 75% }
160
161img.align-left, .figure.align-left{
162 clear: left ;
163 float: left ;
164 margin-right: 1em }
165
166img.align-right, .figure.align-right {
167 clear: right ;
168 float: right ;
169 margin-left: 1em }
170
171.align-left {
172 text-align: left }
173
174.align-center {
175 clear: both ;
176 text-align: center }
177
178.align-right {
179 text-align: right }
180
181/* reset inner alignment in figures */
182div.align-right {
183 text-align: left }
184
185/* div.align-center * { */
186/* text-align: left } */
187
188ol.simple, ul.simple {
189 margin-bottom: 1em }
190
191ol.arabic {
192 list-style: decimal }
193
194ol.loweralpha {
195 list-style: lower-alpha }
196
197ol.upperalpha {
198 list-style: upper-alpha }
199
200ol.lowerroman {
201 list-style: lower-roman }
202
203ol.upperroman {
204 list-style: upper-roman }
205
206p.attribution {
207 text-align: right ;
208 margin-left: 50% }
209
210p.caption {
211 font-style: italic }
212
213p.credits {
214 font-style: italic ;
215 font-size: smaller }
216
217p.label {
218 white-space: nowrap }
219
220p.rubric {
221 font-weight: bold ;
222 font-size: larger ;
223 color: maroon ;
224 text-align: center }
225
226p.sidebar-title {
227 font-family: sans-serif ;
228 font-weight: bold ;
229 font-size: larger }
230
231p.sidebar-subtitle {
232 font-family: sans-serif ;
233 font-weight: bold }
234
235p.topic-title {
236 font-weight: bold }
237
238pre.address {
239 margin-bottom: 0 ;
240 margin-top: 0 ;
241 font: inherit }
242
243pre.literal-block, pre.doctest-block {
244 margin-left: 2em ;
245 margin-right: 2em }
246
247span.classifier {
248 font-family: sans-serif ;
249 font-style: oblique }
250
251span.classifier-delimiter {
252 font-family: sans-serif ;
253 font-weight: bold }
254
255span.interpreted {
256 font-family: sans-serif }
257
258span.option {
259 white-space: nowrap }
260
261span.pre {
262 white-space: pre }
263
264span.problematic {
265 color: red }
266
267span.section-subtitle {
268 /* font-size relative to parent (h1..h6 element) */
269 font-size: 80% }
270
271table.citation {
272 border-left: solid 1px gray;
273 margin-left: 1px }
274
275table.docinfo {
276 margin: 2em 4em }
277
278table.docutils {
279 margin-top: 0.5em ;
280 margin-bottom: 0.5em }
281
282table.footnote {
283 border-left: solid 1px black;
284 margin-left: 1px }
285
286table.docutils td, table.docutils th,
287table.docinfo td, table.docinfo th {
288 padding-left: 0.5em ;
289 padding-right: 0.5em ;
290 vertical-align: top }
291
292table.docutils th.field-name, table.docinfo th.docinfo-name {
293 font-weight: bold ;
294 text-align: left ;
295 white-space: nowrap ;
296 padding-left: 0 }
297
298h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
299h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
300 font-size: 100% }
301
302ul.auto-toc {
303 list-style-type: none }
304
305</style>
306</head>
307<body>
eli.benderskyb56e8f82011-03-06 07:56:55 +0200308<div class="document" id="pycparser-v2-03">
309<h1 class="title">pycparser v2.03</h1>
eli.bendersky347497d2010-12-10 15:17:28 +0200310<table class="docinfo" frame="void" rules="none">
311<col class="docinfo-name" />
312<col class="docinfo-content" />
313<tbody valign="top">
314<tr><th class="docinfo-name">Author:</th>
315<td><a class="first reference external" href="http://eli.thegreenplace.net">Eli Bendersky</a></td></tr>
316</tbody>
317</table>
318<div class="contents topic" id="contents">
319<p class="topic-title first">Contents</p>
320<ul class="auto-toc simple">
321<li><a class="reference internal" href="#introduction" id="id2">1&nbsp;&nbsp;&nbsp;Introduction</a><ul class="auto-toc">
322<li><a class="reference internal" href="#what-is-pycparser" id="id3">1.1&nbsp;&nbsp;&nbsp;What is pycparser?</a></li>
323<li><a class="reference internal" href="#what-is-it-good-for" id="id4">1.2&nbsp;&nbsp;&nbsp;What is it good for?</a></li>
324<li><a class="reference internal" href="#which-version-of-c-does-pycparser-support" id="id5">1.3&nbsp;&nbsp;&nbsp;Which version of C does pycparser support?</a></li>
325<li><a class="reference internal" href="#what-grammar-does-pycparser-follow" id="id6">1.4&nbsp;&nbsp;&nbsp;What grammar does pycparser follow?</a></li>
eli.bendersky40d218b2011-02-10 07:04:47 +0200326<li><a class="reference internal" href="#how-is-pycparser-licensed" id="id7">1.5&nbsp;&nbsp;&nbsp;How is pycparser licensed?</a></li>
327<li><a class="reference internal" href="#contact-details" id="id8">1.6&nbsp;&nbsp;&nbsp;Contact details</a></li>
eli.bendersky347497d2010-12-10 15:17:28 +0200328</ul>
329</li>
eli.bendersky40d218b2011-02-10 07:04:47 +0200330<li><a class="reference internal" href="#installing" id="id9">2&nbsp;&nbsp;&nbsp;Installing</a><ul class="auto-toc">
331<li><a class="reference internal" href="#prerequisites" id="id10">2.1&nbsp;&nbsp;&nbsp;Prerequisites</a></li>
332<li><a class="reference internal" href="#installation-process" id="id11">2.2&nbsp;&nbsp;&nbsp;Installation process</a></li>
333<li><a class="reference internal" href="#known-problems" id="id12">2.3&nbsp;&nbsp;&nbsp;Known problems</a></li>
eli.bendersky347497d2010-12-10 15:17:28 +0200334</ul>
335</li>
eli.bendersky40d218b2011-02-10 07:04:47 +0200336<li><a class="reference internal" href="#using" id="id13">3&nbsp;&nbsp;&nbsp;Using</a><ul class="auto-toc">
337<li><a class="reference internal" href="#interaction-with-the-c-preprocessor" id="id14">3.1&nbsp;&nbsp;&nbsp;Interaction with the C preprocessor</a></li>
338<li><a class="reference internal" href="#what-about-the-standard-c-library-headers" id="id15">3.2&nbsp;&nbsp;&nbsp;What about the standard C library headers?</a></li>
339<li><a class="reference internal" href="#basic-usage" id="id16">3.3&nbsp;&nbsp;&nbsp;Basic usage</a></li>
340<li><a class="reference internal" href="#advanced-usage" id="id17">3.4&nbsp;&nbsp;&nbsp;Advanced usage</a></li>
eli.bendersky347497d2010-12-10 15:17:28 +0200341</ul>
342</li>
eli.bendersky40d218b2011-02-10 07:04:47 +0200343<li><a class="reference internal" href="#modifying" id="id18">4&nbsp;&nbsp;&nbsp;Modifying</a></li>
344<li><a class="reference internal" href="#package-contents" id="id19">5&nbsp;&nbsp;&nbsp;Package contents</a></li>
345<li><a class="reference internal" href="#contributors" id="id20">6&nbsp;&nbsp;&nbsp;Contributors</a></li>
346<li><a class="reference internal" href="#changelog" id="id21">7&nbsp;&nbsp;&nbsp;Changelog</a></li>
eli.bendersky347497d2010-12-10 15:17:28 +0200347</ul>
348</div>
349<div class="section" id="introduction">
350<h1>1&nbsp;&nbsp;&nbsp;Introduction</h1>
351<div class="section" id="what-is-pycparser">
352<h2>1.1&nbsp;&nbsp;&nbsp;What is pycparser?</h2>
353<p><tt class="docutils literal"><span class="pre">pycparser</span></tt> 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.</p>
354</div>
355<div class="section" id="what-is-it-good-for">
356<h2>1.2&nbsp;&nbsp;&nbsp;What is it good for?</h2>
357<p>Anything that needs C code to be parsed. The following are some uses for <tt class="docutils literal"><span class="pre">pycparser</span></tt>, taken from real user reports:</p>
358<ul class="simple">
359<li>C code obfuscator</li>
360<li>Front-end for various specialized C compilers</li>
361<li>Static code checker</li>
362<li>Automatic unit-test discovery</li>
363<li>Adding specialized extensions to the C language</li>
364</ul>
365<p><tt class="docutils literal"><span class="pre">pycparser</span></tt> 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, <tt class="docutils literal"><span class="pre">pycparser</span></tt>'s code will be simple to understand.</p>
366</div>
367<div class="section" id="which-version-of-c-does-pycparser-support">
368<h2>1.3&nbsp;&nbsp;&nbsp;Which version of C does pycparser support?</h2>
369<p><tt class="docutils literal"><span class="pre">pycparser</span></tt> aims to support the full C99 language (according to the standard ISO/IEC 9899). This is a new feature in the version 2.x series - earlier versions only supported C89. For more information on the change, read <a class="reference external" href="http://code.google.com/p/pycparser/wiki/C99support">this wiki page</a>.</p>
370<p><tt class="docutils literal"><span class="pre">pycparser</span></tt> doesn't support any GCC extensions.</p>
371</div>
372<div class="section" id="what-grammar-does-pycparser-follow">
373<h2>1.4&nbsp;&nbsp;&nbsp;What grammar does pycparser follow?</h2>
374<p><tt class="docutils literal"><span class="pre">pycparser</span></tt> very closely follows the C grammar provided in the end of the C99 standard document</p>
375</div>
eli.bendersky347497d2010-12-10 15:17:28 +0200376<div class="section" id="how-is-pycparser-licensed">
eli.bendersky40d218b2011-02-10 07:04:47 +0200377<h2>1.5&nbsp;&nbsp;&nbsp;How is pycparser licensed?</h2>
eli.bendersky347497d2010-12-10 15:17:28 +0200378<p><a class="reference external" href="http://www.gnu.org/licenses/lgpl.html">LGPL</a></p>
379</div>
380<div class="section" id="contact-details">
eli.bendersky40d218b2011-02-10 07:04:47 +0200381<h2>1.6&nbsp;&nbsp;&nbsp;Contact details</h2>
eli.bendersky347497d2010-12-10 15:17:28 +0200382<p>Drop me an email to <a class="reference external" href="mailto:eliben&#64;gmail.com">eliben&#64;gmail.com</a> for any questions regarding <tt class="docutils literal"><span class="pre">pycparser</span></tt>. For reporting problems with <tt class="docutils literal"><span class="pre">pycparser</span></tt> or submitting feature requests, the best way is to open an issue on the <a class="reference external" href="http://code.google.com/p/pycparser/">pycparser page at Google Code</a>.</p>
383</div>
384</div>
385<div class="section" id="installing">
386<h1>2&nbsp;&nbsp;&nbsp;Installing</h1>
387<div class="section" id="prerequisites">
388<h2>2.1&nbsp;&nbsp;&nbsp;Prerequisites</h2>
389<ul class="simple">
eli.benderskyb56e8f82011-03-06 07:56:55 +0200390<li><tt class="docutils literal"><span class="pre">pycparser</span></tt> was tested on Python 2.6 and 3.2, on both Linux and Windows. It should work on any later version (in both the 2.x and 3.x lines) as well.</li>
391<li><tt class="docutils literal"><span class="pre">pycparser</span></tt> uses the PLY module for the actual lexer and parser construction. Install PLY from <a class="reference external" href="http://www.dabeaz.com/ply/">its website</a>.</li>
eli.bendersky347497d2010-12-10 15:17:28 +0200392</ul>
393</div>
394<div class="section" id="installation-process">
395<h2>2.2&nbsp;&nbsp;&nbsp;Installation process</h2>
396<p>Installing <tt class="docutils literal"><span class="pre">pycparser</span></tt> is very simple. Once you download it from its <a class="reference external" href="http://code.google.com/p/pycparser/">website</a> and unzip the package, you just have to execute the standard <tt class="docutils literal"><span class="pre">python</span> <span class="pre">setup.py</span> <span class="pre">install</span></tt>. The setup script will then place the <tt class="docutils literal"><span class="pre">pycparser</span></tt> module into <tt class="docutils literal"><span class="pre">site-packages</span></tt> in your Python's installation library.</p>
397<p>It's recommended to run <tt class="docutils literal"><span class="pre">_build_tables.py</span></tt> in the <tt class="docutils literal"><span class="pre">pycparser</span></tt> code directory after installation to make sure the parsing tables of PLY are pre-generated. This can make your code run faster.</p>
398</div>
399<div class="section" id="known-problems">
400<h2>2.3&nbsp;&nbsp;&nbsp;Known problems</h2>
401<ul class="simple">
402<li>Some users who've installed a new version of <tt class="docutils literal"><span class="pre">pycparser</span></tt> over an existing version ran into a problem using the newly installed library. This has to do with parse tables staying around as <tt class="docutils literal"><span class="pre">.pyc</span></tt> files from the older version. If you see unexplained errors from <tt class="docutils literal"><span class="pre">pycparser</span></tt> after an upgrade, remove it (by deleting the <tt class="docutils literal"><span class="pre">pycparser</span></tt> directory in your Python's <tt class="docutils literal"><span class="pre">site-packages</span></tt>, or wherever you installed it) and install again.</li>
403</ul>
404</div>
405</div>
406<div class="section" id="using">
407<h1>3&nbsp;&nbsp;&nbsp;Using</h1>
408<div class="section" id="interaction-with-the-c-preprocessor">
409<h2>3.1&nbsp;&nbsp;&nbsp;Interaction with the C preprocessor</h2>
410<p>In order to be compilable, C code must be preprocessed by the C preprocessor - <tt class="docutils literal"><span class="pre">cpp</span></tt>. <tt class="docutils literal"><span class="pre">cpp</span></tt> handles preprocessing directives like <tt class="docutils literal"><span class="pre">#include</span></tt> and <tt class="docutils literal"><span class="pre">#define</span></tt>, removes comments, and does other minor tasks that prepare the C code for compilation.</p>
411<p>For all but the most trivial snippets of C code, <tt class="docutils literal"><span class="pre">pycparser</span></tt>, like a C compiler, must receive preprocessed C code in order to function correctly. If you import the top-level <tt class="docutils literal"><span class="pre">parse_file</span></tt> function from the <tt class="docutils literal"><span class="pre">pycparser</span></tt> package, it will interact with <tt class="docutils literal"><span class="pre">cpp</span></tt> for you, as long as it's in your PATH, or you provide a path to it.</p>
412<p>On the vast majority of Linux systems, <tt class="docutils literal"><span class="pre">cpp</span></tt> is installed and is in the PATH. If you're on Windows and don't have <tt class="docutils literal"><span class="pre">cpp</span></tt> somewhere, you can use the one provided in the <tt class="docutils literal"><span class="pre">utils</span></tt> directory in <tt class="docutils literal"><span class="pre">pycparser</span></tt>'s distribution. This <tt class="docutils literal"><span class="pre">cpp</span></tt> executable was compiled from the <a class="reference external" href="http://www.cs.princeton.edu/software/lcc/">LCC distribution</a>, and is provided under LCC's license terms.</p>
413</div>
414<div class="section" id="what-about-the-standard-c-library-headers">
415<h2>3.2&nbsp;&nbsp;&nbsp;What about the standard C library headers?</h2>
eli.benderskyb56e8f82011-03-06 07:56:55 +0200416<p>C code almost always includes various header files from the standard C library, like <tt class="docutils literal"><span class="pre">stdio.h</span></tt>. While, with some effort, <tt class="docutils literal"><span class="pre">pycparser</span></tt> can be made to parse the standard headers from any C compiler, it's much simpler to use the provided &quot;fake&quot; standard includes in <tt class="docutils literal"><span class="pre">utils/fake_libc_include</span></tt>. These are standard C header files that contain only the bare necessities to allow valid parsing of the files that use them. As a bonus, since they're minimal, it can significantly improve the performance of parsing C files.</p>
eli.bendersky347497d2010-12-10 15:17:28 +0200417<p>See the <tt class="docutils literal"><span class="pre">using_cpp_libc.py</span></tt> example for more details.</p>
418</div>
419<div class="section" id="basic-usage">
420<h2>3.3&nbsp;&nbsp;&nbsp;Basic usage</h2>
421<p>Take a look at the <tt class="docutils literal"><span class="pre">examples</span></tt> directory of the distribution for a few examples of using <tt class="docutils literal"><span class="pre">pycparser</span></tt>. These should be enough to get you started.</p>
422</div>
423<div class="section" id="advanced-usage">
424<h2>3.4&nbsp;&nbsp;&nbsp;Advanced usage</h2>
425<p>The public interface of <tt class="docutils literal"><span class="pre">pycparser</span></tt> is well documented with comments in <tt class="docutils literal"><span class="pre">pycparser/c_parser.py</span></tt>. For a detailed overview of the various AST nodes created by the parser, see <tt class="docutils literal"><span class="pre">pycparser/_c_ast.cfg</span></tt>.</p>
eli.bendersky40d218b2011-02-10 07:04:47 +0200426<p>There's also a <a class="reference external" href="http://code.google.com/p/pycparser/wiki/FAQ">FAQ available here</a>. In any case, you can always drop me an <a class="reference external" href="mailto:eliben&#64;gmail.com">email</a> for help.</p>
eli.bendersky347497d2010-12-10 15:17:28 +0200427</div>
428</div>
429<div class="section" id="modifying">
430<h1>4&nbsp;&nbsp;&nbsp;Modifying</h1>
431<p>There are a few points to keep in mind when modifying <tt class="docutils literal"><span class="pre">pycparser</span></tt>:</p>
432<ul class="simple">
433<li>The code for <tt class="docutils literal"><span class="pre">pycparser</span></tt>'s AST nodes is automatically generated from a configuration file - <tt class="docutils literal"><span class="pre">_c_ast.cfg</span></tt>, by <tt class="docutils literal"><span class="pre">_ast_gen.py</span></tt>. If you modify the AST configuration, make sure to re-generate the code.</li>
434<li>Make sure you understand the optimized mode of <tt class="docutils literal"><span class="pre">pycparser</span></tt> - for that you must read the docstring in the constructor of the <tt class="docutils literal"><span class="pre">CParser</span></tt> class. For development you should create the parser without optimizations, so that it will regenerate the Yacc and Lex tables when you change the grammar.</li>
435</ul>
436</div>
437<div class="section" id="package-contents">
438<h1>5&nbsp;&nbsp;&nbsp;Package contents</h1>
439<p>Once you unzip the <tt class="docutils literal"><span class="pre">pycparser</span></tt> package, you'll see the following files and directories:</p>
440<dl class="docutils">
441<dt>README.txt/html:</dt>
442<dd>This README file.</dd>
443<dt>setup.py:</dt>
444<dd>Installation script</dd>
445<dt>examples/:</dt>
446<dd>A directory with some examples of using <tt class="docutils literal"><span class="pre">pycparser</span></tt></dd>
447<dt>pycparser/:</dt>
448<dd>The <tt class="docutils literal"><span class="pre">pycparser</span></tt> module source code.</dd>
449<dt>tests/:</dt>
450<dd>Unit tests.</dd>
451<dt>utils/cpp.exe:</dt>
452<dd>A Windows executable of the C pre-processor suitable for working with pycparser</dd>
453<dt>utils/fake_libc_include:</dt>
454<dd>Minimal standard C library include files that should allow to parse any C code.</dd>
455<dt>utils/internal/:</dt>
456<dd>Internal utilities for my own use. You probably don't need them.</dd>
457</dl>
458</div>
459<div class="section" id="contributors">
460<h1>6&nbsp;&nbsp;&nbsp;Contributors</h1>
461<p>Some people have contributed to <tt class="docutils literal"><span class="pre">pycparser</span></tt> by opening issues on bugs they've found and/or submitting patches. The list of contributors is at <a class="reference external" href="http://code.google.com/p/pycparser/wiki/Contributors">this pycparser Wiki page</a>.</p>
462</div>
463<div class="section" id="changelog">
464<h1>7&nbsp;&nbsp;&nbsp;Changelog</h1>
465<ul class="simple">
eli.benderskyb56e8f82011-03-06 07:56:55 +0200466<li>Version 2.03 (06.03.2011)<ul>
467<li>Bug fixes:<ul>
468<li>Issue 17: empty file-level declarations</li>
469<li>Issue 18: empty statements and declarations in functions</li>
470<li>Issue 19: anonymous structs &amp; union fields</li>
471<li>Issue 23: fix coordinates of Cast nodes</li>
472</ul>
473</li>
474<li>New example added (<tt class="docutils literal"><span class="pre">examples/c-to-c.py</span></tt>) for translating ASTs generated by <tt class="docutils literal"><span class="pre">pycparser</span></tt> back into C code.</li>
475<li><tt class="docutils literal"><span class="pre">pycparser</span></tt> is now on PyPI (Python Package Index)</li>
476<li>Created <a class="reference external" href="http://code.google.com/p/pycparser/wiki/FAQ">FAQ</a> on the <tt class="docutils literal"><span class="pre">pycparser</span></tt> project page</li>
477<li>Removed support for Python 2.5. <tt class="docutils literal"><span class="pre">pycparser</span></tt> supports Python 2 from 2.6 and on, and Python 3.</li>
478</ul>
479</li>
eli.bendersky347497d2010-12-10 15:17:28 +0200480<li>Version 2.02 (10.12.2010)<ul>
481<li>The name of a <tt class="docutils literal"><span class="pre">NamedInitializer</span></tt> node was turned into a sequence of nodes
482instead of an attribute, to make it discoverable by the AST node visitor.</li>
483<li>Documentation updates</li>
484</ul>
485</li>
486<li>Version 2.01 (04.12.2010)<ul>
487<li>Removed dependency on YAML. Parsing of the AST node configuration file is done with a simple parser.</li>
488<li>Fixed issue 12: installation problems</li>
489</ul>
490</li>
491<li>Version 2.00 (31.10.2010)<ul>
492<li>Support for C99 (read <a class="reference external" href="http://code.google.com/p/pycparser/wiki/C99support">this wiki page</a> for more information).</li>
493</ul>
494</li>
495<li>Version 1.08 (09.10.2010)<ul>
496<li>Bug fixes:<ul>
497<li>Correct handling of <tt class="docutils literal"><span class="pre">do{}</span> <span class="pre">...</span> <span class="pre">while</span></tt> statements in some cases</li>
498<li>Issues 6 &amp; 7: Concatenation of string literals</li>
499<li>Issue 9: Support for unnamed bitfields in structs</li>
500</ul>
501</li>
502</ul>
503</li>
504<li>Version 1.07 (18.05.2010)<ul>
505<li>Python 3.1 compatibility: <tt class="docutils literal"><span class="pre">pycparser</span></tt> was modified to run on Python 3.1 as well as 2.6</li>
506</ul>
507</li>
508<li>Version 1.06 (10.04.2010)<ul>
509<li>Bug fixes:<ul>
510<li>coord not propagated to FuncCall nodes</li>
511<li>lexing of the ^= token (XOREQUALS)</li>
512<li>parsing failed on some abstract declarator rules</li>
513</ul>
514</li>
515<li>Linux compatibility: fixed end-of-line and <tt class="docutils literal"><span class="pre">cpp</span></tt> path issues to allow all tests and examples run on Linux</li>
516</ul>
517</li>
518<li>Version 1.05 (16.10.2009)<ul>
519<li>Fixed the <tt class="docutils literal"><span class="pre">parse_file</span></tt> auxiliary function to handle multiple arguments to <tt class="docutils literal"><span class="pre">cpp</span></tt> correctly</li>
520</ul>
521</li>
522<li>Version 1.04 (22.05.2009)<ul>
523<li>Added the <tt class="docutils literal"><span class="pre">fake_libc_include</span></tt> directory to allow parsing of C code that uses standard C library include files without dependency on a real C library.</li>
524<li>Tested with Python 2.6 and PLY 3.2</li>
525</ul>
526</li>
527<li>Version 1.03 (31.01.2009)<ul>
528<li>Accept enumeration lists with a comma after the last item (C99 feature).</li>
529</ul>
530</li>
531<li>Version 1.02 (16.01.2009)<ul>
532<li>Fixed problem of parsing struct/enum/union names that were named similarly to previously defined <tt class="docutils literal"><span class="pre">typedef</span></tt> types.</li>
533</ul>
534</li>
535<li>Version 1.01 (09.01.2009)<ul>
536<li>Fixed subprocess invocation in the helper function parse_file - now it's more portable</li>
537</ul>
538</li>
539<li>Version 1.0 (15.11.2008)<ul>
540<li>Initial release</li>
541<li>Support for ANSI C89</li>
542</ul>
543</li>
544</ul>
545</div>
546</div>
547</body>
548</html>