javapyler Code
Brought to you by:
keesbos
File | Date | Author | Commit |
---|---|---|---|
src | 2011-09-27 |
![]() |
[b500fe] Use 'is'/'is not' in comparison in stead of |
.gitignore | 2011-03-28 |
![]() |
[9fa022] Initial code |
README | 2011-08-16 |
![]() |
[4e4b94] Updated gwtconfig and README |
bootstrap.py | 2011-05-13 |
![]() |
[c189e9] Added example environment settings for bin/java... |
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.