Conversion of Delphi code to Java

 picture · Sep 30, 2009 · Viewed 15.7k times · Source

Does a parser exist for Delphi which can be used to convert the Delphi code into Java code automatically?

Answer

Brian Rasmussen picture Brian Rasmussen · Sep 30, 2009

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.