pycparser now supports C99

October 31st, 2010 at 7:42 am

Today I released pycparser version 2.00, with support for C99 syntax. The following features were implemented:

  • Mix of declarations and statements inside a block
  • long long type, including corresponding integer literals
  • New keywords: restrict, inline
  • Variable-length arrays (VLAs), including the [*] notation for function parameter lists
  • Declaration in the first expression of for loops
  • Named initializers, including support for anonymous objects (compound literals)

The API (specifically, some of the AST nodes) of version 2.00 is slightly incompatible with that of 1.xx as described here. For this reason I intend to keep the 1.xx alive and available for download for a long time – it’s a very functional parser fully supporting the old ANSI/ISO C89/C90. However, most future development effort will be invested in version 2.xx, which can be thought as a superset of 1.xx

Related posts:

  1. pycparser v1.0 is out!
  2. From C to AST and back to C with pycparser
  3. pycparser v1.06 released
  4. Faking standard C header files for pycparser
  5. Implementing cdecl with pycparser

5 Responses to “pycparser now supports C99”

  1. James RoweNo Gravatar Says:

    I can’t seem to find a reference to actual license of pycparser. The package states LGPL in various places and there is a link to the official GNU page, but it would nice if the license version was specified somewhere.

    [Would also be nice if the "enable javascript" message was before you filled out the comment ;) ]

  2. elibenNo Gravatar Says:

    @James,

    The license link is unambiguous, I think :-) It links to http://www.gnu.org/licenses/lgpl.html, which is currently LGPL v3. Correct me if I’m wrong.

  3. James RoweNo Gravatar Says:

    @eliben,

    Fair enough, and thanks for the reply. I guess I’m just used to more explicit license definitions.

    I’m not the only person who feels this way. (Please don’t take offense at the title of the page I linked, but it has good advice.)

  4. Michael Van VeenNo Gravatar Says:

    You are my hero!!!!

    I used your library two summers ago for a static analysis suite. I was targeting C99 but didn’t realize the parser wasn’t C99 compatible and didn’t have enough time left in my internship to get the parser up to spec. Your work on pycparsing is tremendously useful and I can’t thank you enough for your efforts!

    Best Regards,

    Michael Van Veen

  5. elibenNo Gravatar Says:

    Michael,

    Thank you for the kind feedback :) I’m glad you find pycparser useful.

Leave a Reply

To post code with preserved formatting, enclose it in `backticks` (even multiple lines)