Reommended compiler toolkit

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


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

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

> ply (which I like most)
> SPARK
> 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
|cookedm(at)physics(dot)mcmaster(dot)ca



More information about the Python-list mailing list