parsers / lexers usable from Python and Java (and C++/C)?

John J. Lee jjl at pobox.com
Wed Jun 25 13:35:03 CEST 2003


"Mike Rovner" <mike at nospam.com> writes:

> John J. Lee wrote:
> > Are there any parser / lexer generators useable from both CPython and
> > Java?
> 
> PLY (http://systems.cs.uchicago.edu/ply/) implemented entirely in Python,
> so it might be possible to use it from both implementations of Python.

No, I really did mean CPython and Java, not CPython and Jython.


> You may look at http://www.python.org/cgi-bin/moinmoin/LanguageParsing for
> other tools.

Thanks.  There doesn't seem to be anything promising there,
unfortunately.

All I've found so far are some threads in which Tim Peters complains
about the lack of a Python interface of some kind to lex.  Maybe I can
automatically SWIG-wrap lex's lexers, and use jflex for Java.  For
parsing (and maybe lexing too), *maybe* it's possible to auto-wrap the
C++ ANTLR outputs, but wrapping C++ (even generated C++) in an
automated way without pain seems unlikely.


John




More information about the Python-list mailing list