Does a parser exist for Delphi which can be used to convert the Delphi code into Java code automatically?
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.
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.
Free Pascal supports compilation for the Java Virtual Machine (JVM):
Java-bytecode target added to the Free Pascal compiler.
A new target has been added to Free Pascal compiler. It is now possible to compile applications to Java bytecode. This means that these Free Pascal applications can run in a Java Virtual Machine (JVM), so that it can run on any platform that has Java support.
However, this target does only support the basic Pascal language and some functionality of the system unit.
Before there was a program called Delphi2J to convert, but I couldn't find the link to download it.
Another way:
- Try to Convert Delphi code to C# code using the Delphi2CS
- Then use VB & C# to Java Converter there is demo, I didn't try it.
© 2022 - 2024 — McMap. All rights reserved.