views:

964

answers:

3

Does a parser exist for delphi which can be used to convert the delphi code into Java code automatically? Please Help!!!

+3  A: 

I am not aware of such a converter, but keep in mind that such conversions will only get you so far.

For instance there's a Java to C# convert that ships with Visual Studio. It does an excellent job, but for anything beyond the most trivial example you still have to do a lot of cleanup/refactoring yourself in my experience. Also, bad code in the original language will usually get converted to just as bad or possible worse code in the new language. So the code will be hard to maintain.

The point is there's no free lunch. Even with a converter you most likely will have to do a significant bit of porting yourself. If that is out of the question (due to time, money, whatever) you may have to rethink the project.

I am sorry I could not point you to a useful tool (hopefully others will) but I have seen these projects a couple of times and people are usually surprised by the cleanup work needed after a conversion.

Brian Rasmussen
I know of one successful product that someone decided should be in another language, so they auto-translated it. Worked fine, until someone wanted to add a new feature and NO ONE knew anything about how the code worked now. They lost a year while they re-wrote it again.
mj2008
A: 

before there was a program called Delphi2J to convert, but I couldn't find the link to download it.

Another way:

  1. try to Convert Delphi code to C# code using the Delphi2CS

  2. then use VB & C# to Java Converter there is demo, I didn't try it.

Wael Dalloul
+1  A: 

The best solution I can think of would be: grab a Java-Developer and do some extreme programming (you: reading the Delphi sourcecode and explaining to him what it should do - he: writing all down in Java)

Because even if you find a Delphi-to-Java Converter - it might produce bad sourcecode.