java2rust is a naive attempt to produce a shortcut to translate Java code into Rust code.
It is the very first time that I used Antlr4.
I hope it can help someone in somehow.
It contains the original parser build using Java9.g4
It contains a Netbeans 11 project that actually converts Java code into Rust code.
Most converted code will need manual intervention to compile and run properly.
At this time you have to modify Main class to compile your code.
There are 2 different methods todo so:
-
compileAT(String srcFileName, String dstFileName) which reads a single file and generate its Rust counterpar.
-
compileProject(String srcPath, String dstPath) which traverses a every folder and compiles Java ones.