Ann: Pyparsing 1.5.0 released

Paul McGuire ptmcg at austin.rr.com
Sun Jun 1 05:19:21 EDT 2008


I've just uploaded to SourceForge the latest update to pyparsing,
version 1.5.0.  This version includes a number of long-awaited
features, so I thought it was time to bump the minor rev version.

- parsing a complete string without having to add StringEnd() to the
  pyparsing grammar, by adding parseAll argument to the parseString
  method (default value is False to maintain compatibility with prior
  versions, set to True to force parsing of the full input string)

- support for indentation-based grammars (like Python's), using a
  new helper method, indentedBlock.

- improved syntax error detection and reporting, based on the
  ErrStop class submitted by Eike Welk on the  pyparsing forum,
  and Thomas/Poldy's proposal on the pyparsing wiki; the CHANGES
  file includes a detailed example showing how syntax errors can
  be designated by using '-' instead of '+' operators

Pyparsing 1.5.0 also includes a number of bug-fixes, described in
more
detail in the CHANGES file.

(Despite my best efforts, I have *not* been able to include support
for Python 3.0 using a common source code base.  For those who wish
to try out pyparsing with Python 3.0, there is a file pyparsing_py3.py
in the SourceForge Subversion repository.  I have done some testing
of this code, but many of my unit tests still need to be converted to
Python 3.)

Download pyparsing 1.5.0 at http://sourceforge.net/projects/pyparsing/.
The pyparsing Wiki is at http://pyparsing.wikispaces.com

-- Paul

========================================
Pyparsing is a pure-Python class library for quickly developing
recursive-descent parsers.  Parser grammars are assembled directly in
the calling Python code, using classes such as Literal, Word,
OneOrMore, Optional, etc., combined with operators '+', '|', and '^'
for And, MatchFirst, and Or.  No separate code-generation or external
files are required.  Pyparsing can be used in many cases in place of
regular expressions, with shorter learning curve and greater
readability and maintainability.  Pyparsing comes with a number of
parsing examples, including:
- "Hello, World!" (English, Korean, Greek, and Spanish(new))
- chemical formulas
- configuration file parser
- web page URL extractor
- 5-function arithmetic expression parser
- subset of CORBA IDL
- chess portable game notation
- simple SQL parser
- Mozilla calendar file parser
- EBNF parser/compiler
- Python value string parser (lists, dicts, tuples, with nesting)
  (safe alternative to eval)
- HTML tag stripper
- S-expression parser
- macro substitution preprocessor
- TAP output parser (new)



More information about the Python-list mailing list