Reommended compiler toolkit

David M. Cooke cookedm+news at
Tue Apr 13 22:55:41 CEST 2004

At some point, Miki Tebeka <miki.tebeka at> wrote:

> Hello All,
> I'm looking for a pure python compiler toolkit (lexer + parser, like
> flex + bison).

> ply (which I like most)
> Yapps
> kwParsing

[don't know about these]

> Plex

This is just a lexer. You'll have to write your own parser. Pyrex uses
it, along with a hand-written recursive-descent parser. Although it
shouldn't be too hard to plug the lexer from this into one of the
other packages to do parsing.

> PyLR
> FlexModule

These two aren't pure python. PyLR has a C extension, and looks like
it hasn't been updated since 1997. FlexModule uses flex to make a
lexer, and also works with BisonModule (which uses bison) to make the parser.

I'm guessing for speed FlexModule is probably the fastest, but does
anybody have any experience with benchmarking different Python lexer/parsers?

|David M. Cooke

More information about the Python-list mailing list