When Good Regular Expressions Go Bad

Gordon McMillan gmcm at hypernet.com
Fri Oct 1 12:39:38 EDT 1999


Aahz wrote:
> Tim Peters <tim_one at email.msn.com> wrote:
> >
> >Error detection and recovery is a Real Pain even with a Real
> >Parser; a mechanical trick like "report rightmost progress"
> >isn't going to turn the infinitely feebler regexp gimmick into a
> >solution.
> 
> Okay, okay, you've mostly convinced me.  Now, here's the hard
> part: got any recommendations for a parsing book similar to the
> O'Reilly Regex book?  (By "similar", I mean a good combined
> tutorial/reference that's aimed at the ignorant but generally
> well-educated techie.  Two or three books that combine to that
> goal would be fine.)

General parsing books are rare (most focus on some obscure 
corner of a very large turf), and the "intro" ones usually hand 
hold you through building one according to the author's choice 
of tools without conveying any deeper understanding, or any 
idea how big the turf really is.

The "best" book is available at   
http://www.cs.vu.nl/~dick/PTAPG.html
(thanks to Tim for this reference). This maps the turf very well, but you 
won't really learn "how".

For that, you'd do well to read John Aycock's paper from IPC7 and 
download his "Little Languages" framework. His design is very elegant - it 
makes it easy to understand the whole process, instead of following some 
cookbook rules and hoping for the best. It's definitely not a parser I'd care 
to embed in another app; but once you work out the rules, you could use 
one of the half dozen or so others that are around with some hope of 
success.

http://www.csr.uvic.ca/~aycock/python/

- Gordon




More information about the Python-list mailing list