Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (517)
Games in Android Showcase (123)
games submitted by our members
Games in WIP (578)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  C/C++ to Java translation  (Read 1992 times)
0 Members and 1 Guest are viewing this topic.
Offline erikd

JGO Ninja


Medals: 16
Projects: 4
Exp: 14 years


Maximumisness


« Posted 2003-04-07 07:34:01 »

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

Offline sma

Junior Duke





« Reply #1 - Posted 2003-04-07 10:51:02 »

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.

.: Truth Until Paradox!
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

DarkCart (23 views)
2014-10-31 21:44:48

DarkCart (29 views)
2014-10-31 21:43:57

TehJavaDev (40 views)
2014-10-27 03:28:38

TehJavaDev (31 views)
2014-10-27 03:27:51

DarkCart (45 views)
2014-10-26 19:37:11

Luminem (27 views)
2014-10-26 10:17:50

Luminem (31 views)
2014-10-26 10:14:04

theagentd (36 views)
2014-10-25 15:46:29

Longarmx (64 views)
2014-10-17 03:59:02

Norakomi (62 views)
2014-10-16 15:22:06
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!