Commit b1760f5d authored by Stefano Rivera's avatar Stefano Rivera

New upstream version 2.19

parent 3da92cb0
+ Version 2.18 (04.07.2017)
+ Version 2.19 (2018.09.19)
- PR #277: Fix parsing of floating point literals
- PR #254: Add support for parsing empty structs
- PR #240: Fix enum formatting in generated C code (also #216)
- PR #222: Add support for #pragma in struct declarations
+ Version 2.18 (2017.07.04)
- PR #161 & #184: Update bundled PLY version to 3.10
- PR #158: Add support for the __int128 type.
- PR #169: Handle more tricky TYPEID in declarators.
- PR #178: Add columns to the coord of each node
+ Version 2.17 (29.10.2016)
+ Version 2.17 (2016.10.29)
- Again functionality identical to 2.15 and 2.16; the difference is that the
tarball now contains Python files with properly set permissions.
+ Version 2.16 (18.10.2016)
+ Version 2.16 (2016.10.18)
- Functionally identical to 2.15, but fixes a packaging problem that caused
failed installation (_build_tables wasn't rerun in the pycparser/ dir).
+ Version 2.15 (18.10.2016)
+ Version 2.15 (2016.10.18)
- PR #121: Update bundled PLY version to 3.8
- Issue #117: Fix parsing of extra semi-colons inside structure declarations.
......@@ -28,7 +35,7 @@
- Issue #116: Fix line numbers recorded for empty and compound statements.
- Minor performance improvement to the invalid string literal regex.
+ Version 2.14 (09.06.2015)
+ Version 2.14 (2015.06.09)
- Added CParser parameter to specify output directory for generated parsing
tables (#84).
......@@ -36,7 +43,7 @@
is no longer recommended, now that Clang has binary builds available for
Windows.
+ Version 2.13 (12.05.2015)
+ Version 2.13 (2015.05.12)
- Added support for offsetof() the way gcc implements it (special builtin
that takes a type as an argument).
......@@ -45,13 +52,13 @@
like Git and SQLite without modifications to pycparser.
- Added support for empty initializer lists (#79).
+ Version 2.12 (21.04.2015)
+ Version 2.12 (2015.04.21)
- This is a fix release for 2.11; the memory optimization with __slots__ on
Coord and AST nodes didn't take weakrefs into account, which broke cffi and
its many dependents (issue #76). Fixed by adding __weakref__ to __slots__.
+ Version 2.11 (21.04.2015)
+ Version 2.11 (2015.04.21)
- Add support for C99 6.5.3.7 p7 - qualifiers within array dimensions in
function declarations. Started with issue #21 (reported with initial patch
......@@ -65,7 +72,7 @@
- Reduce memory usage of AST nodes (issue #72).
- Parsing order of nested pointer declarations fixed (issue #68).
+ Version 2.10 (03.08.2013)
+ Version 2.10 (2013.08.03)
- A number of improvements in the handling of typedef-name ambiguities,
contributed by Sye van der Veen in GitHub issue #1:
......@@ -81,13 +88,13 @@
- Relax the lexer a bit w.r.t. some integer suffixes and $ in identifier names
(which is supported by some other compilers).
+ Version 2.09.1 (29.12.2012)
+ Version 2.09.1 (2012.12.29)
- No actual functionality changes.
- The source distribution was re-packaged to contain the pre-generated Lex and
Yacc tables of PLY.
+ Version 2.09 (27.12.2012)
+ Version 2.09 (2012.12.27)
- The pycparser project has moved to Bitbucket. For this version, issue
numbers still refer to the old Googlecode project, unless stated otherwise.
......@@ -104,7 +111,7 @@
- Issues #86 and #87: improve location reporting for parse errors.
- Issue #89: fix C generation for K&R-style function definitions.
+ Version 2.08 (10.08.2012)
+ Version 2.08 (2012.08.10)
- Issue 73: initial support for #pragma directives. Consume them without
errors and ignore (no tokens are returned). Line numbers are preserved.
......@@ -118,7 +125,7 @@
can also be used as a utility.
- Issue 74: some Windows include paths were handled incorrectly.
+ Version 2.07 (16.06.2012)
+ Version 2.07 (2012.06.16)
- Issue 54: added an optional parser argument to parse_file
- Issue 59: added some more fake headers for C99
......@@ -126,7 +133,7 @@
- Issue 57: support for C99 hexadecimal float constants
- Made running tests that call on 'cpp' a bit more robust.
+ Version 2.06 (04.02.2012)
+ Version 2.06 (2012.02.04)
- Issue 48: gracefully handle parsing of empty files
- Issues 49 & 50: handle more escaped chars in paths to #line - "..\..\test.h".
......@@ -139,7 +146,7 @@
- Improved the AST created for switch statements, making it closer to the
semantic meaning than to the grammar.
+ Version 2.05 (16.10.2011)
+ Version 2.05 (2011.10.16)
- Added support for the C99 ``_Bool`` type and ``stdbool.h`` header file
- Expanded ``examples/explore_ast.py`` with more details on working with the
......@@ -150,7 +157,7 @@
* Fixed spacing issue for some type declarations
* Issue 47: display empty statements (lone ';') correctly after parsing
+ Version 2.04 (21.05.2011)
+ Version 2.04 (2011.05.21)
- License changed from LGPL to BSD
- Bug fixes:
......@@ -161,7 +168,7 @@
- Added C99 integer types to fake headers
- Added unit tests for the c-to-c.py example
+ Version 2.03 (06.03.2011)
+ Version 2.03 (2011.03.06)
- Bug fixes:
......@@ -178,7 +185,7 @@
- Removed support for Python 2.5. ``pycparser`` supports Python 2
from 2.6 and on, and Python 3.
+ Version 2.02 (10.12.2010)
+ Version 2.02 (2010.12.10)
* The name of a ``NamedInitializer`` node was turned into a sequence of nodes
instead of an attribute, to make it discoverable by the AST node visitor.
......@@ -190,13 +197,13 @@
is done with a simple parser.
* Fixed issue 12: installation problems
+ Version 2.00 (31.10.2010)
+ Version 2.00 (2010.10.31)
* Support for C99 (read
`this wiki page <http://code.google.com/p/pycparser/wiki/C99support>`_
for more information).
+ Version 1.08 (09.10.2010)
+ Version 1.08 (2010.10.09)
* Bug fixes:
......@@ -204,12 +211,12 @@
+ Issues 6 & 7: Concatenation of string literals
+ Issue 9: Support for unnamed bitfields in structs
+ Version 1.07 (18.05.2010)
+ Version 1.07 (2010.05.18)
* Python 3.1 compatibility: ``pycparser`` was modified to run
on Python 3.1 as well as 2.6
+ Version 1.06 (10.04.2010)
+ Version 1.06 (2010.04.10)
* Bug fixes:
......@@ -220,33 +227,33 @@
* Linux compatibility: fixed end-of-line and ``cpp`` path issues to allow
all tests and examples run on Linux
+ Version 1.05 (16.10.2009)
+ Version 1.05 (2009.10.16)
* Fixed the ``parse_file`` auxiliary function to handle multiple arguments to
``cpp`` correctly
+ Version 1.04 (22.05.2009)
+ Version 1.04 (2009.05.22)
* Added the ``fake_libc_include`` directory to allow parsing of C code that
uses standard C library include files without dependency on a real C
library.
* Tested with Python 2.6 and PLY 3.2
+ Version 1.03 (31.01.2009)
+ Version 1.03 (2009.01.31)
* Accept enumeration lists with a comma after the last item (C99 feature).
+ Version 1.02 (16.01.2009)
+ Version 1.02 (2009.01.16)
* Fixed problem of parsing struct/enum/union names that were named similarly
to previously defined ``typedef`` types.
+ Version 1.01 (09.01.2009)
+ Version 1.01 (2009.01.09)
* Fixed subprocess invocation in the helper function parse_file - now
it's more portable
+ Version 1.0 (15.11.2008)
+ Version 1.0 (2008.11.15)
* Initial release
* Support for ANSI C89
......@@ -6,6 +6,7 @@ include README.*
include LICENSE
include CHANGES
include setup.*
exclude setup.pyc
recursive-exclude tests yacctab.* lextab.*
recursive-exclude examples yacctab.* lextab.*
Metadata-Version: 1.1
Metadata-Version: 1.2
Name: pycparser
Version: 2.18
Version: 2.19
Summary: C parser in Python
Home-page: https://github.com/eliben/pycparser
Author: Eli Bendersky
......@@ -13,5 +13,12 @@ Description:
C compilers or analysis tools.
Platform: Cross Platform
Classifier: Development Status :: 5 - Production/Stable
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*
===============
pycparser v2.18
pycparser v2.19
===============
:Author: `Eli Bendersky <http://eli.thegreenplace.net>`_
:Author: `Eli Bendersky <https://eli.thegreenplace.net/>`_
.. contents::
......@@ -79,7 +79,7 @@ Installing
Prerequisites
-------------
* **pycparser** was tested on Python 2.7, 3.4 and 3.5, on both Linux and
* **pycparser** was tested on Python 2.7, 3.4-3.6, on both Linux and
Windows. It should work on any later version (in both the 2.x and 3.x lines)
as well.
......@@ -87,6 +87,13 @@ Prerequisites
uses is PLY, which is bundled in ``pycparser/ply``. The current PLY version is
3.10, retrieved from `<http://www.dabeaz.com/ply/>`_
Note that **pycparser** (and PLY) uses docstrings for grammar specifications.
Python installations that strip docstrings (such as when using the Python
``-OO`` option) will fail to instantiate and use **pycparser**. You can try to
work around this problem by making sure the PLY parsing tables are pre-generated
in normal mode; this isn't an officially supported/tested mode of operation,
though.
Installation process
--------------------
......@@ -96,7 +103,7 @@ setup script will then place the ``pycparser`` module into ``site-packages`` in
your Python's installation library.
Alternatively, since **pycparser** is listed in the `Python Package Index
<http://pypi.python.org/pypi/pycparser>`_ (PyPI), you can install it using your
<https://pypi.org/project/pycparser/>`_ (PyPI), you can install it using your
favorite Python packaging/distribution tool, for example with::
> pip install pycparser
......@@ -151,14 +158,21 @@ the source is a previously defined type. This is essential in order to be able
to parse C correctly.
See `this blog post
<http://eli.thegreenplace.net/2015/on-parsing-c-type-declarations-and-fake-headers>`_
<https://eli.thegreenplace.net/2015/on-parsing-c-type-declarations-and-fake-headers>`_
for more details.
Basic usage
-----------
Take a look at the ``examples`` directory of the distribution for a few examples
of using **pycparser**. These should be enough to get you started.
Take a look at the |examples|_ directory of the distribution for a few examples
of using **pycparser**. These should be enough to get you started. Please note
that most realistic C code samples would require running the C preprocessor
before passing the code to **pycparser**; see the previous sections for more
details.
.. |examples| replace:: ``examples``
.. _examples: examples
Advanced usage
--------------
......
......@@ -4,7 +4,7 @@
# Example of using pycparser.c_generator, serving as a simplistic translator
# from C to AST and back to C.
#
# Eli Bendersky [http://eli.thegreenplace.net]
# Eli Bendersky [https://eli.thegreenplace.net/]
# License: BSD
#------------------------------------------------------------------------------
from __future__ import print_function
......
......@@ -2,7 +2,7 @@
// Statically-allocated memory manager
//
// by Eli Bendersky (eliben@gmail.com)
//
//
// This code is in the public domain.
//----------------------------------------------------------------
#include "memmgr.h"
......@@ -11,7 +11,7 @@ typedef ulong Align;
union mem_header_union
{
struct
struct
{
// Pointer to the next block in the free list
//
......@@ -19,7 +19,7 @@ union mem_header_union
// Size of the block (in quantas of sizeof(mem_header_t))
//
ulong size;
ulong size;
} s;
// Used to align headers in memory to a boundary
......@@ -80,9 +80,9 @@ static mem_header_t* get_mem_from_pool(ulong nquantas)
// Allocations are done in 'quantas' of header size.
// The search for a free block of adequate size begins at the point 'freep'
// The search for a free block of adequate size begins at the point 'freep'
// where the last block was found.
// If a too-big block is found, it is split and the tail is returned (this
// If a too-big block is found, it is split and the tail is returned (this
// way the header of the original needs only to have its size adjusted).
// The pointer returned to the user points to the free space within the block,
// which begins one quanta after the header.
......@@ -100,7 +100,7 @@ void* memmgr_alloc(ulong nbytes)
// First alloc call, and no free list yet ? Use 'base' for an initial
// denegerate block of size 0, which points to itself
//
//
if ((prevp = freep) == 0)
{
base.s.next = freep = prevp = &base;
......@@ -110,7 +110,7 @@ void* memmgr_alloc(ulong nbytes)
for (p = prevp->s.next; ; prevp = p, p = p->s.next)
{
// big enough ?
if (p->s.size >= nquantas)
if (p->s.size >= nquantas)
{
// exactly ?
if (p->s.size == nquantas)
......@@ -151,7 +151,7 @@ void* memmgr_alloc(ulong nbytes)
}
// Scans the free list, starting at freep, looking the the place to insert the
// Scans the free list, starting at freep, looking the the place to insert the
// free block. This is either between two existing blocks or at the end of the
// list. In any case, if the block being freed is adjacent to either neighbor,
// the adjacent blocks are combined.
......@@ -169,9 +169,9 @@ void memmgr_free(void* ap)
//
for (p = freep; !(block > p && block < p->s.next); p = p->s.next)
{
// Since the free list is circular, there is one link where a
// higher-addressed block points to a lower-addressed block.
// This condition checks if the block should be actually
// Since the free list is circular, there is one link where a
// higher-addressed block points to a lower-addressed block.
// This condition checks if the block should be actually
// inserted between them
//
if (p >= p->s.next && (block > p || block < p->s.next))
......
......@@ -2,45 +2,45 @@
// Statically-allocated memory manager
//
// by Eli Bendersky (eliben@gmail.com)
//
//
// This code is in the public domain.
//----------------------------------------------------------------
#ifndef MEMMGR_H
#define MEMMGR_H
//
// Memory manager: dynamically allocates memory from
// Memory manager: dynamically allocates memory from
// a fixed pool that is allocated statically at link-time.
//
// Usage: after calling memmgr_init() in your
//
// Usage: after calling memmgr_init() in your
// initialization routine, just use memmgr_alloc() instead
// of malloc() and memmgr_free() instead of free().
// Naturally, you can use the preprocessor to define
// malloc() and free() as aliases to memmgr_alloc() and
// memmgr_free(). This way the manager will be a drop-in
// Naturally, you can use the preprocessor to define
// malloc() and free() as aliases to memmgr_alloc() and
// memmgr_free(). This way the manager will be a drop-in
// replacement for the standard C library allocators, and can
// be useful for debugging memory allocation problems and
// be useful for debugging memory allocation problems and
// leaks.
//
// Preprocessor flags you can define to customize the
// Preprocessor flags you can define to customize the
// memory manager:
//
// DEBUG_MEMMGR_FATAL
// Allow printing out a message when allocations fail
//
// DEBUG_MEMMGR_SUPPORT_STATS
// Allow printing out of stats in function
// memmgr_print_stats When this is disabled,
// Allow printing out of stats in function
// memmgr_print_stats When this is disabled,
// memmgr_print_stats does nothing.
//
// Note that in production code on an embedded system
// Note that in production code on an embedded system
// you'll probably want to keep those undefined, because
// they cause printf to be called.
//
// POOL_SIZE
// Size of the pool for new allocations. This is
// effectively the heap size of the application, and can
// be changed in accordance with the available memory
// Size of the pool for new allocations. This is
// effectively the heap size of the application, and can
// be changed in accordance with the available memory
// resources.
//
// MIN_POOL_ALLOC_QUANTAS
......@@ -49,19 +49,19 @@
// minimize pool fragmentation in case of multiple allocations
// and deallocations, it is advisable to not allocate
// blocks that are too small.
// This flag sets the minimal ammount of quantas for
// This flag sets the minimal ammount of quantas for
// an allocation. If the size of a ulong is 4 and you
// set this flag to 16, the minimal size of an allocation
// will be 4 * 2 * 16 = 128 bytes
// If you have a lot of small allocations, keep this value
// low to conserve memory. If you have mostly large
// allocations, it is best to make it higher, to avoid
// low to conserve memory. If you have mostly large
// allocations, it is best to make it higher, to avoid
// fragmentation.
//
// Notes:
// 1. This memory manager is *not thread safe*. Use it only
// for single thread/task applications.
//
//
#define DEBUG_MEMMGR_SUPPORT_STATS 1
......
......@@ -29,7 +29,7 @@
# explain_c_declaration(c_decl, expand_struct=True)
# => p is a struct P containing {x is a int, y is a int}
#
# Eli Bendersky [http://eli.thegreenplace.net]
# Eli Bendersky [https://eli.thegreenplace.net/]
# License: BSD
#-----------------------------------------------------------------
import copy
......
......@@ -3,7 +3,7 @@
#
# Basic example of parsing a file and dumping its parsed AST.
#
# Eli Bendersky [http://eli.thegreenplace.net]
# Eli Bendersky [https://eli.thegreenplace.net/]
# License: BSD
#-----------------------------------------------------------------
from __future__ import print_function
......
......@@ -9,7 +9,7 @@
# information from the AST.
# It helps to have the pycparser/_c_ast.cfg file in front of you.
#
# Eli Bendersky [http://eli.thegreenplace.net]
# Eli Bendersky [https://eli.thegreenplace.net/]
# License: BSD
#-----------------------------------------------------------------
from __future__ import print_function
......
......@@ -4,7 +4,7 @@
# Using pycparser for printing out all the calls of some function
# in a C file.
#
# Eli Bendersky [http://eli.thegreenplace.net]
# Eli Bendersky [https://eli.thegreenplace.net/]
# License: BSD
#-----------------------------------------------------------------
from __future__ import print_function
......
......@@ -7,7 +7,7 @@
# This is a simple example of traversing the AST generated by
# pycparser. Call it from the root directory of pycparser.
#
# Eli Bendersky [http://eli.thegreenplace.net]
# Eli Bendersky [https://eli.thegreenplace.net/]
# License: BSD
#-----------------------------------------------------------------
from __future__ import print_function
......
......@@ -3,7 +3,7 @@
#
# Tiny example of rewriting a AST node
#
# Eli Bendersky [http://eli.thegreenplace.net]
# Eli Bendersky [https://eli.thegreenplace.net/]
# License: BSD
#-----------------------------------------------------------------
from __future__ import print_function
......
......@@ -4,7 +4,7 @@
# Simple example of serializing AST
#
# Hart Chu [https://github.com/CtheSky]
# Eli Bendersky [http://eli.thegreenplace.net]
# Eli Bendersky [https://eli.thegreenplace.net/]
# License: BSD
#-----------------------------------------------------------------
from __future__ import print_function
......
......@@ -5,7 +5,7 @@
# the 'real' cpp if you're on Linux/Unix) and "fake" libc includes
# to parse a file that includes standard C headers.
#
# Eli Bendersky [http://eli.thegreenplace.net]
# Eli Bendersky [https://eli.thegreenplace.net/]
# License: BSD
#-----------------------------------------------------------------
import sys
......
......@@ -5,7 +5,7 @@
# of 'cpp'. The same can be achieved with Clang instead of gcc. If you have
# Clang installed, simply replace 'gcc' with 'clang' here.
#
# Eli Bendersky [http://eli.thegreenplace.net]
# Eli Bendersky [https://eli.thegreenplace.net/]
# License: BSD
#-------------------------------------------------------------------------------
import sys
......
Metadata-Version: 1.1
Metadata-Version: 1.2
Name: pycparser
Version: 2.18
Version: 2.19
Summary: C parser in Python
Home-page: https://github.com/eliben/pycparser
Author: Eli Bendersky
......@@ -13,5 +13,12 @@ Description:
C compilers or analysis tools.
Platform: Cross Platform
Classifier: Development Status :: 5 - Production/Stable
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*
......@@ -61,11 +61,13 @@ utils/fake_libc_include/_ansi.h
utils/fake_libc_include/_fake_defines.h
utils/fake_libc_include/_fake_typedefs.h
utils/fake_libc_include/_syslist.h
utils/fake_libc_include/aio.h
utils/fake_libc_include/alloca.h
utils/fake_libc_include/ar.h
utils/fake_libc_include/argz.h
utils/fake_libc_include/assert.h
utils/fake_libc_include/complex.h
utils/fake_libc_include/cpio.h
utils/fake_libc_include/ctype.h
utils/fake_libc_include/dirent.h
utils/fake_libc_include/dlfcn.h
......@@ -77,7 +79,11 @@ utils/fake_libc_include/fcntl.h
utils/fake_libc_include/features.h
utils/fake_libc_include/fenv.h
utils/fake_libc_include/float.h
utils/fake_libc_include/fmtmsg.h
utils/fake_libc_include/fnmatch.h
utils/fake_libc_include/ftw.h
utils/fake_libc_include/getopt.h
utils/fake_libc_include/glob.h
utils/fake_libc_include/grp.h
utils/fake_libc_include/iconv.h
utils/fake_libc_include/ieeefp.h
......@@ -90,9 +96,14 @@ utils/fake_libc_include/limits.h
utils/fake_libc_include/locale.h
utils/fake_libc_include/malloc.h
utils/fake_libc_include/math.h
utils/fake_libc_include/monetary.h
utils/fake_libc_include/mqueue.h
utils/fake_libc_include/ndbm.h
utils/fake_libc_include/netdb.h
utils/fake_libc_include/newlib.h
utils/fake_libc_include/nl_types.h
utils/fake_libc_include/paths.h
utils/fake_libc_include/poll.h
utils/fake_libc_include/process.h
utils/fake_libc_include/pthread.h
utils/fake_libc_include/pwd.h
......@@ -104,6 +115,7 @@ utils/fake_libc_include/search.h
utils/fake_libc_include/semaphore.h
utils/fake_libc_include/setjmp.h
utils/fake_libc_include/signal.h
utils/fake_libc_include/spawn.h
utils/fake_libc_include/stdarg.h
utils/fake_libc_include/stdbool.h
utils/fake_libc_include/stddef.h
......@@ -111,24 +123,34 @@ utils/fake_libc_include/stdint.h
utils/fake_libc_include/stdio.h
utils/fake_libc_include/stdlib.h
utils/fake_libc_include/string.h
utils/fake_libc_include/strings.h
utils/fake_libc_include/stropts.h
utils/fake_libc_include/syslog.h
utils/fake_libc_include/tar.h
utils/fake_libc_include/termios.h
utils/fake_libc_include/tgmath.h
utils/fake_libc_include/time.h
utils/fake_libc_include/trace.h
utils/fake_libc_include/ulimit.h
utils/fake_libc_include/unctrl.h
utils/fake_libc_include/unistd.h
utils/fake_libc_include/utime.h
utils/fake_libc_include/utmp.h
utils/fake_libc_include/utmpx.h
utils/fake_libc_include/wchar.h
utils/fake_libc_include/wctype.h
utils/fake_libc_include/wordexp.h
utils/fake_libc_include/zlib.h
utils/fake_libc_include/X11/Intrinsic.h
utils/fake_libc_include/X11/Xlib.h
utils/fake_libc_include/X11/_X11_fake_defines.h
utils/fake_libc_include/X11/_X11_fake_typedefs.h
utils/fake_libc_include/arpa/inet.h
utils/fake_libc_include/asm-generic/int-ll64.h
utils/fake_libc_include/linux/socket.h
utils/fake_libc_include/linux/version.h
utils/fake_libc_include/mir_toolkit/client_types.h
utils/fake_libc_include/net/if.h
utils/fake_libc_include/netinet/in.h
utils/fake_libc_include/netinet/tcp.h
utils/fake_libc_include/openssl/err.h
......@@ -137,14 +159,20 @@ utils/fake_libc_include/openssl/hmac.h
utils/fake_libc_include/openssl/ssl.h
utils/fake_libc_include/openssl/x509v3.h
utils/fake_libc_include/sys/ioctl.h
utils/fake_libc_include/sys/ipc.h
utils/fake_libc_include/sys/mman.h
utils/fake_libc_include/sys/msg.h
utils/fake_libc_include/sys/poll.h
utils/fake_libc_include/sys/resource.h
utils/fake_libc_include/sys/select.h
utils/fake_libc_include/sys/sem.h
utils/fake_libc_include/sys/shm.h
utils/fake_libc_include/sys/socket.h
utils/fake_libc_include/sys/stat.h
utils/fake_libc_include/sys/statvfs.h
utils/fake_libc_include/sys/sysctl.h
utils/fake_libc_include/sys/time.h
utils/fake_libc_include/sys/times.h
utils/fake_libc_include/sys/types.h
utils/fake_libc_include/sys/uio.h
utils/fake_libc_include/sys/un.h
......
......@@ -4,13 +4,14 @@
# This package file exports some convenience functions for
# interacting with pycparser
#
# Eli Bendersky [http://eli.thegreenplace.net]
# Eli Bendersky [https://eli.thegreenplace.net/]
# License: BSD
#-----------------------------------------------------------------
__all__ = ['c_lexer', 'c_parser', 'c_ast']
__version__ = '2.18'
__version__ = '2.19'
from subprocess import Popen, PIPE
import io
from subprocess import check_output
from .c_parser import CParser
......@@ -38,11 +39,7 @@ def preprocess_file(filename, cpp_path='cpp', cpp_args=''):
try:
# Note the use of universal_newlines to treat all newlines
# as \n for Python's purpose
#
pipe = Popen( path_list,
stdout=PIPE,
universal_newlines=True)
text = pipe.communicate()[0]
text = check_output(path_list, universal_newlines=True)
except OSError as e:
raise RuntimeError("Unable to invoke 'cpp'. " +
'Make sure its path was passed correctly\n' +
......@@ -85,7 +82,7 @@ def parse_file(filename, use_cpp=False, cpp_path='cpp', cpp_args='',
if use_cpp:
text = preprocess_file(filename, cpp_path, cpp_args)
else:
with open(filename, 'rU') as f:
with io.open(filename) as f:
text = f.read()
if parser is None:
......
......@@ -7,7 +7,7 @@
# The design of this module was inspired by astgen.py from the
# Python 2.5 code-base.
#
# Eli Bendersky [http://eli.thegreenplace.net]