By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,866 Members | 1,660 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,866 IT Pros & Developers. It's quick & easy.

pyparsing 1.3.2 released

P: n/a
"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

Jul 25 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Paul McGuire wrote:
"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 :-)
Jul 25 '05 #2

P: n/a
Garn! Twa' the de'ils wairk! I wad be laith to misquo' the Sco'ish
Bard!

I was trying to make sure I spelled "a-gley" - I lapsed into the
common, but incorrect, quotation.

(http://www.robertburns.org/works/75.shtml)

Thanks!
-- Paul

Jul 25 '05 #3

P: n/a
On 24 Jul 2005 17:27:07 -0700, "Paul McGuire" <pt***@austin.rr.com>
wrote:
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
Jul 26 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.