Subject: Re: The SRE regular-expression notation
From: rpw3@rigden.engr.sgi.com (Rob Warnock)
Date: 1998/08/29
Newsgroups: comp.lang.lisp
Message-ID: <6s8kua$1okd@fido.engr.sgi.com>
Pierre Mai  <dent@dent.isdn.cs.tu-berlin.de> wrote:
+---------------
| In this respect, the article "Pragmatic Parsing in Common Lisp" by
| Henry G. Baker, in ACM Lisp Pointers IV,2 (April/June 1991), provides
| an interesting approach to parsing/regexps in Lisp.  The article can
| probably be downloaded from Henry Baker's site at
| ftp://ftp.netcom.com/pub/hb/hbaker/
+---------------

IIRC, Baker didn't actually do "regexp" per se, he did a rough emulation
(as a hairy CL macro) of the "META" family of parsers, which are top-down
recursive-descent with limited backtracking (specifically, you can't
backtrack past a point at which any "action" has been committed), as
applied to parsing character patterns. Similar to regexps, but if I'm
correct the META parsers can accept a larger class of grammars than
regexps (since they can do context-sensitive matches, much like SNOBOL
patterns).

That's not to say that doing a Baker/META macro for Scheme wouldn't
be *useful* -- it definitely would. I'm just saying it's not quite
"the same as" regexps...


-Rob

p.s. Historical note: In Spring of 1971, I wrote a subset BLISS-10
compiler in META-II from scratch in a weekend. Generated *lousy* code
(totally unoptimized stack-like MACRO-10 assembler code), but it worked.
IMHO (and Baker's, I think one could safely say), the META meme has
never gotten the acclaim it deserves...

-----
Rob Warnock, 8L-855		rpw3@sgi.com
Applied Networking		http://reality.sgi.com/rpw3/
Silicon Graphics, Inc.		Phone: 650-933-1673
2011 N. Shoreline Blvd.		FAX: 650-964-0811
Mountain View, CA  94043	PP-ASEL-IA