PDA

View Full Version : Java to Pascal translator?



paul_nicholls
21-02-2008, 05:39 AM
Hi all,
I am wanting to translate a Java application to pascal, and I was wondering if anyone knows of a Java to Pascal converter program to help me get started.

I have googled, but to no avail...

I do have an open-source C to pascal converter called OpenC2Pas, but I am unsure if that would be good enough for converting Java...

There is nothing graphical about the program (no GUI, etc), it is just classes to do physic simulations.

Cheers,
Paul.

paul_nicholls
22-02-2008, 03:28 AM
I have found a java to delphi converter from a Korean web page here
http://www.codeway.co.kr/board/bbs/board.php?bo_table=Delphi_PDS&wr_id=300&sfl=&stx=&sst=wr_datetime&sod=asc&sop=and&page=7.

See the java2delphi.20070629.zip link near the top of the page

I downloaded it and tried running it as per the instructions on the example
java file like so:


java -jar java2delphi.jar Formatter.java

I got these errors:


Exception in thread "main" java.lang.UnsupportedClassVersionError:
javacc/JavaParser (Unsupported major.minor version 49.0)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknow n Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)

Anyone know what this means, and how to fix it?
The Java source code for the parser is included in the download if this helps...

cheers,
Paul

paul_nicholls
22-02-2008, 04:32 AM
Hi guys,
on a whim, I searched my harddrive and found I had at least 3 version of a java.exe file on it...I pointed the path to the latest version I had (1.5.0_09) and tried the parser again.

It now works!
It will save heaps of time :-)

I hope it will help someone else here :)

cheers,
Paul

arthurprs
23-02-2008, 09:23 PM
very good

farcodev_
27-03-2008, 05:25 PM
impressive !!! :shock:

Thanks for the info :D

Robert Kosek
27-03-2008, 05:52 PM
Wow, that'd be a handy utility! There's a lot of decent Java source code out there.

paul_nicholls
27-03-2008, 09:36 PM
I'm glad I found the translator for you guys :)

I haven't used it much yet myself though...

cheers,
Paul