Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube. A Java™ to Pseudocode Converter BETA. Toggle navigation PseudoGen. Home; Converter; About.
java2python claims to be a simple but effective tool to translate Java source code into Python source code. Troy Melhase, the creator of the java2python project has announced the first release.
java2python is licensed under the GNU General Public License 2.0. To translate code, java2python requires python 2.5, ANTLR and PyANTLR.
The following is working with java2python 0.1 version:
* class definitions, inner class definitions
* method definitions
* most expressions
* if statements, for statements, while statements
* raises statement
* type translation (e.g, String -> str)
* class member access to instance attributes
Troy Melhasesays “I’ve written java2python with the idea that it should provide ahigh degree of customization to the generation process. It allows formultiple, cumulative configuration modules, which means you can have aconfiguration for an entire translation project, and also haveconfigurations for individual modules.
Let me add a few more waffles before concluding. Yes, I know Python isnot Java. Yes, I know that this tool doesn’t translate the meaning ofthe input source code. Yes, the tool does not produce idiomatic Python.And yes, I know the tool isn’t even close to perfect. But even with allof those problems, I know this is better than what I was doing.”
java2python is available on Google code at http://code.google.com/p/java2python/
Related
Pyjamas is for python, what Google Web Tooklit is for Java. Pyjamas takes python code and some widget libraries and runs it through a python-to-javascript translator. The result: Coding web appliations has never been easier! JSON calls and event handling is a breeze. Little projects that I've attempted doing in the past, using libaries such as jquery, have left me writing a lot of javascript by hand, which get's ugly.While I absolutley love pyjamas (and gwt for that matter), I really like the looks of extjs. The good news is that they have come out with extjs-gwt, which is 'a Java library for building rich internet applications with GWT.'
Javascript To Python Converter
In talking with some of the folks on the pyjamas mailing list, I've gathered that the process of making pyjamas involved hand-converting the java libaries (ie widgets) of gwt from java to python. (If you look at the source code of both pyjamas and gwt, you can see that it's a pretty straight-forward conversion).
Surprisingly, pyjamas is only about 8000 lines of source code, which is relatively long. Extjs-gwt, on the other hand, as one person on the mailing list commented, has over 33,000 lines of java code in widgets alone!
The task of hand-translating extjs-gwt would be daunting.
I'm currently investigating the possiblity of writing a java to python converter to at least help out with the translation. A google search let me to a blog post which led me to an unmaintained project called java2python.
Java To Python Program Converter
Because I'm personally interested in the workings of such technologies, and because I couldn't get java2python to work, I've decided to write my own translator.I found a great article by the author of antlr (the same lexer/parser/tree_generator that java2python uses) on how to do such a translation between languages.