Meta-language for mxTextTools

Tony J. Ibbs (Tibs) tony at lsl.co.uk
Fri Jul 16 04:37:17 EDT 1999


Christian Tismer wrote:
>Can you express the parser for the little language with the tagging
>engine? That would be a funny bootstrap :-)


My intention is to write the parser to the little language *in* the little
language, and then to hand-translate it to tuples. It may be that I don't
have to implement all of the little language before I can use it to
bootstrap the rest (I seem to remember languages like BCPL worked in this
manner).

> me> 2. I can't help feeling that "jump-to-label" (aka
> me> skip-forwards/backwards-N-statements) is intrinsically necessary in
such an
> me> engine, and I can't see any way of doing that sensible whilst keeping
to
> me> Python syntax.
>
>if target_of_jump_is("thisone"):
>   # do this
>if target_of_jump_is("thatone"):
>   # do that
>
>... and so on.

Hmm. I think that this requires slightly more complex translations to
achieve. For this first project, I want to keep close to the "flavour" of
the original tag tables. This is partly because I have a sneaky feeling that
there are going to be cases where it is easier (for some sense of "easier")
to generate the tuples by hand, and in that case keeping the two
representations close is an advantage (the obvious case would be if I
*can't* represent all possible tables with the little language). Proof will
be in the pudding...

>This is the syntax which I use for my computed goto example with
>continuations. Man, this is all so similar. Where does the yourney go.


I don't pretend to understand where stackless Python might lead us, except
to say that I am boggled by the implications - it's certainly always
reassuring when apparently unrelated things turn out to be able to use each
other and make life simpler in unexpected ways. But I still want something
that works in (conventional) CPython first...

>Is it allowed to go until 4 in this joke? I don't remember :-)


In Python, I don't know. In the Goons or Firesign Theatre, it definitely
would be...

>Isn't a tagging engine a number of comparisons, head
>movements, and gotos? Continuations could do that.


I believe you. Honestly, I do, I do. Really. You can explain in detail
later, when I've written some code for this vapourware. But I suspect that I
would categorise understanding that as "needs actual thought", whereas what
I'm trying to do definitely doesn't (it's actually just an excuse to
understand how mxTextTools works, believe it or not!).

Tibs
--
Tony J Ibbs (Tibs)      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