Java to Python translation

Michal Wallace sabren at manifestation.com
Wed Apr 3 16:31:46 EST 2002


On Wed, 3 Apr 2002, vio wrote:

> I need to translate a (rather voluminous 100MB) java
> program to python. After a few searches on google,
> apparently the best tools for this task are Lex-Yacc
> (Flex-Bison on linux). While I am working on the Lex-YACC
> HOWTO, I would be very interested in hearing of others'
> successful experiences/feedback at this. Any pointers of
> interest would similarily be appreciated.

Hi Vio,

I agree with what everyone else is saying about Jython.
That's definitely the place to start.. At least that
way you can change only certain classes at a time, and
gradually move towards python. (And then switch to plain
python if you want to after the transition is complete)

But... I would aslo suggest that if you do decide to
automate part of the transition, you might want to take a
look at ANTLR...

   http://www.antlr.org/ 

It's a java-based tool, with a somewhat different
theoretical background than lex/yacc... And it actually
comes with a grammar for the java language built in. I'm not
a parsing pro by any means, but even back when I was a
complete beginner to java, I was able to figure out ANTLR
and make my own little interpreter (for a prolog-like
language, not java).

Cheers,

- Michal   http://www.sabren.net/   sabren at manifestation.com 
------------------------------------------------------------
Give your ideas the perfect home: http://www.cornerhost.com/
 cvs - weblogs - php - linux shell - perl/python/cgi - java
------------------------------------------------------------






More information about the Python-list mailing list