Skip to content

justuni/javapyler

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

96 Commits
 
 
 
 
 
 
 
 

Repository files navigation

This project is in alpha state and needs lots of testing.
The majority of gwt code can be parsed and converted to python code.


Install
=======

Download antlr-3.3-complete.jar from http://www.antlr.org/
	http://www.antlr.org/download/antlr-3.3-complete.jar

Put it in src/javaparser/

Install jython:
sudo apt-get install jython

and run bootstrap.py

# Copy and paste:
# wget http://www.antlr.org/download/antlr-3.3-complete.jar
# mv antlr-3.3-complete.jar src/javaparser/
# apt-get install jython
# python bootstrap.py



Now you should have a bin/javapyler and a bin/gwtpyler

See src/gwtpyler.cfg for an example config file

There's a javaparser.jar in the repo, bit if you want to generate
it yourself:
cd src/javaparser
./build-java.sh


Example usage for gwtpyler:
Edit (a copy of) gwtpyler.cfg and put the correct values
for src and output in the [DEFAULT] section.

Then:
bin/gwtpyler --config gwtpyler.cfg


The contents of src/java/__init__.py should go to the __pyjamas__.py (for d
esktop) and to the translator __pyjamas__ for pyjs. In the latter case some 
additional fixes are needed for POST/PRE INC/DEC. However, most ++/-- are 
converted to straight AugAssign asts (eg. foo += 1).


Example usage
=============

What I've done is:

$ cd javapyler
$ mkdir gwt
$ cp ../src/gwtpyler.cfg .
$ ln -s <source path>/gwt/user/src/com .
$ mkdir out
$ ../bin/gwtpyler

Another location to do this is probably neater

For some other java project, you could do somethin similar, but invoke
the ../bin/javapyler in stead of ../bin/gwtpyler.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 81.2%
  • Python 16.0%
  • GAP 2.8%