grammar question

Michael Hudson mwh at
Thu Feb 28 05:20:08 EST 2002

Greg Ewing <greg at> writes:

> "Martin v. Loewis" wrote:
> > 
> > Notice that regular expressions also define LL(1) languages,
> > so the entire pgen parser is a "regular expression matching engine"
> > :-)
> Well, yes. But what I was trying to say is that the
> Python parser generator must be doing some sort of
> NFA-to-DFA processing on the productions in order
> to generate its tables.

Yes, I think that's right.

It might be time to bring out the quote from Parser/pgen.c:

        /* This algorithm is from a book written before
           the invention of structured programming... */

I think about all that can be meaningfully said about Python's parser
is that it works... if it was written today, I'd expect it to look
completely different.


  I think my standards have lowered enough that now I think ``good
  design'' is when the page doesn't irritate the living fuck out of 
  me.                        --

More information about the Python-list mailing list