C to Java converter
History
Some time ago I needed to convert one C program to Java. It is tedious and not interesting job to do. So I developed C to Java converter. I can not say, that it is fully functional or have no bugs. But you may find it useful to use this tool first, before making changes by hand.
Features
This program assumes, that C preprocessing is already done (so there should not be any defines and includes). Problems with allocation of memory is not solved (maloc needs to be replaced with new). One of my main problems was 'goto' operator. To solve this problem I am using dummy while loops and exceptions.
Usage
There is a jar file with C to Java converter (You need to rename it to c2java.jar to use).
Output of this program will be generated in directory 'output'. So you need to create it before you run converter.
To run it type:
set classpath=%classpath%;c2java.zip
java C2Java
or
java -classpath c2java.zip C2Java your_C_file.c
In latter example I am using jdk 1.2. If you are using ealier java verions you need to write:
To compile generated code you will also need java file GotoException.java
java -classpath %classpath%;c2java.zip C2Java your_C_file.c
Links
For other similar tolls you may look at MathTools.