Hi,
Does anyone have experience with C/C++ to Java translation tools such as http://sol.pace.edu/~tilevich/c2j.html or http://ovid.tigris.org/?
Is it useful or can you as well translate it by hand?
Thanks,
Erik
Hi,
Does anyone have experience with C/C++ to Java translation tools such as http://sol.pace.edu/~tilevich/c2j.html or http://ovid.tigris.org/?
Is it useful or can you as well translate it by hand?
Thanks,
Erik
I once looked at the c2j translator and found it useless if you want to continue to develop and maintain the code in Java. I don’t know the other tool.
I’ve some experiences in manually translating C to Java.
I did this for the JRuby parser some time ago and I also ported the original Hack to Java as a kind of experiment to learn something about the difficulties of porting larger C applications. I wrote an article/diary about this project in German language: http://www.3plus4software.de/sma/jrogue/index.html. Please try http://www.google.com/language_tools to translate it to your language. (Don’t bother to try the linked source code - it’s old and buggy, I’ve a more recent and working version offline)
To summarize, if the C code doesn’t contain to much pointer arithmetics or gotos, it’s quite doable. I used some global copy/replace operations but otherwise did it “the hard way”. Rogue was ported at about 400-800 lines an hour. I should have tried to not directly introduce booleans and String operations but to stay with the C way until everything runs. By modifying the semantics I introduced some stupid errors. I should have more used the advanced refactoring of Eclipse instead to make the source to more look like Java afterwards.