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

John J. Lee jjl at pobox.com
Tue Jun 24 23:41:57 CEST 2003


Are there any parser / lexer generators useable from both CPython and
Java?  I don't mind much if the Python-useable output is in Python or
C (as long as the C can be wrapped automatically, of course).  If I
could run the same source files through two different tools, that
would be just as good.

I'm aware that I could use ANTLR from Jython or perhaps Python+JPE,
but I was looking for something accessible from CPython without having
Java installed, too (speed, and ease of use direct from C++ and C
would be a bonus).  And no, I don't want to use JNI!

Failing that, do tools exist for which one could write spec. files for
lexer / parser generators that produce code useable from CPython, and
then apply some minimal tweaks and run them through another tool(s)
that generates Java code?  YAPPS for Python and ANTLR for Java,
perhaps -- anybody tried that?


John




More information about the Python-list mailing list