ANN: Metalanguage (v0.3) for mxTextTools

Tony J. Ibbs (Tibs) tony at lsl.co.uk
Wed Nov 17 05:12:06 EST 1999


This is to announce v0.3 (tiepin) of my metalanguage translator for
mxTextTools.

Marc-André Lemburg provides mxTextTools, a package of fast text manipulation
tools for use with Python. The tagging engine within that package takes as
input a set of tuples, the Tag Table, which tells it what to do. Although
simple in format, these tuples aren't particularly readable, and indeed
Marc-André himself says:

"I admit, these tables don't look very elegant. In fact I would much rather
write them in some meta language that gets compiled into these tables
instead of handcoding them. But I've never had time to do much research into
this, so unless someone volunteers, it will stay like this for some time."

This version of the metalanguage translator implements enough notation to
allow its own tag tables to be written in the metalanguage. Although it
doesn't yet support various things (notably, strings with escaped quotation
marks, function calls, and embedded tables with T/F conditions) it already
provides enough power for most of my own needs, and should hopefully be
useful to other people.

Significant advantages of using the metalanguage are:
* it avoids the problem of counting (and recounting) offsets between tuples
* it avoids the pitfall of forgetting a comma between two tuples (which on
   my Windows machine at home is enough to crash Python)
* it enforces indentation for meaning in the same way that Python itself
   does
* it provides an "if" construct
* obviously, I believe it to be more readable than the bare tuple notation

Licensing: I like the Python Powered license at
     http://starship.python.net/~just/pythonpowered/
so please apply that with suitable amendments. Although Marc-André is aware
of this work, it is in no way his fault (apart from the quote above and some
helpful comments, for which thanks), so don't blame him...

Note that mxTextTools v1.1.1 or later is required to use the translator.

The metalanguage description and translator is available at
    http://www.tibsnjoan.demon.co.uk/mxtext/Metalang.html

mxTextTools itself is available at
    http://starship.python.net/crew/lemburg/mxTextTools.html

<P><A
HREF="http://www.tibsnjoan.demon.co.uk/mxtext/Metalang.html">Metalanguage
v0.3 for mxTextTools</A> - A little language (and its translator) to make it
easier to write mxTextTools tag tables. (16-Nov-99)

--
Tony J Ibbs (Tibs)      tony at lsl.co.uk  http://www.tibsnjoan.demon.co.uk/
Feet first with 5 wheels...
My views! Mine! Mine! (Unless Laser-Scan ask nicely to borrow them.)





More information about the Python-list mailing list