mxTools (was Re: why no "do : until"?)

Mike Fletcher mfletch at tpresence.com
Tue Jan 9 15:29:39 EST 2001


I've built a parser generator on top of mxTextTools, which was actually a
port from a system originally built on top of the regex module (i.e. re's
precursor).  The basic thing is, you _can_ build just about anything you can
build with mxTextTools using re and some hacking. The question is how much
hacking...

mxTextTools adds the automated generation of parse-tree history to a
text-head-scanning system.  In effect, to duplicate it's effects, you create
low-level RE-style parse-elements (such as seen in Aycock's(sp?) parser)
that you script together at the higher level to create the various group
types for defining a parser (the low-level elements can be anything that
doesn't require returning a repeating series of items).  mxTextTools can do
that scripting using its state-transition table definitions, and as a
result, can run the entire parsing process in C code.  There are some
effects that I've never seen used (your state transitions can be seriously
wacky) that possibly couldn't be achieved with RE, but with sufficient
perversity almost anything can be achieved.

mxTextTools makes it _much_ easier to build a parser, but it's not an actual
requirement.  I like the package, and use it for my packages, but until we
have a lot more modules using mxTextTools (or modules built on top of it), I
can't see including it in the core, it's just not widely-used enough to
require it everywhere.

mxDateTime, on the other hand, is widely applicable (date math in
particular), and might be considered suitable for "core" systems (it defines
a data type which is very widely understood (one of the "fundamental data
types" of many applications), and provides a useful "pythonic" interface to
those types), whereas mxTextTools is a particular engine for text-annotation
that doesn't really exemplify the "normal practice" of parsing systems
(though it's really cool).

Enjoy yourselves,
Mike


-----Original Message-----
From: Fredrik Lundh
To: python-list at python.org
Sent: 1/9/2001 2:45 PM
Subject: Re: mxTools (was Re: why no "do : until"?)

Donn Cave wrote:
> I have never used mxDateTime, so I have 0 cents on that, but I have
> used mxTextTools.  I found it to be efficient and powerful, and ought
> to be useful in a significant number of applications and modules
> that have text to parse -- if it were already available with the
> distribution.

can anyone summarize what mxTextTools can do that you
cannot do with the 're' module?

cheers /F


-- 
http://www.python.org/mailman/listinfo/python-list




More information about the Python-list mailing list