pyparsing 1.3.2 released

P

Paul McGuire

"The best laid plans o' mice an' men / Gang aft a-gley"

So said Robert Burns (who really should do something about that speech
impediment!). And so said I about 6 weeks ago, when I thought that I
would leave pyparsing alone for awhile, after the 1.3.1 release.

Well, here we are, and I'm announcing the 1.3.2 release, with some
changes that I'd like to get released quickly. Here is the excerpt
from the change log:


Version 1.3.2 - July 24, 2005
-----------------------------
- Added Each class as an enhanced version of And. 'Each' requires
that all given expressions be present, but may occur in any order.
Special handling is provided to group ZeroOrMore and OneOrMore
elements that occur out-of-order in the input string. You can also
construct 'Each' objects by joining expressions with the '&'
operator. When using the Each class, results names are strongly
recommended for accessing the matched tokens. (Suggested by Pradam
Amini - thanks, Pradam!)

- Stricter interpretation of 'max' qualifier on Word elements. If the
'max' attribute is specified, matching will fail if an input field
contains more than 'max' consecutive body characters. For example,
previously, Word(nums,max=3) would match the first three characters
of '0123456', returning '012' and continuing parsing at '3'. Now,
when constructed using the max attribute, Word will raise an
exception with this string.

- Cleaner handling of nested dictionaries returned by Dict. No
longer necessary to dereference sub-dictionaries as element [0] of
their parents.
=== NOTE: THIS CHANGE MAY BREAK SOME EXISTING CODE, BUT ONLY IF
PARSING NESTED DICTIONARIES USING THE LITTLE-USED DICT CLASS ===
(Prompted by discussion thread on the Python Tutor list, with
contributions from Danny Yoo, Kent Johnson, and original post by
Liam Clarke - thanks all!)

Download pyparsing at http://pyparsing.sourceforge.net.

-- 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!"
- 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
 
J

John Machin

Paul said:
"The best laid plans o' mice an' men / Gang aft a-gley"

So said Robert Burns (who really should do something about that speech
impediment!).

If "schemes" sounds like "plans", perhaps the impediment is in the
region of your ears :)
 
D

'Dang' Daniel Griffith

Well, here we are, and I'm announcing the 1.3.2 release, with some
changes that I'd like to get released quickly. Here is the excerpt
from the change log:
....snip...

I did a quick check with my Delphi DFM parser, and they seem to work
fine. Keep up the good work!
--dang
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top