6

Does anyone know if there is a Java/C/C++/C#/PHP to Pascal converter?

Vibeeshan Mahadeva
  • 7,147
  • 8
  • 52
  • 102
ThatJoeGuy
  • 121
  • 1
  • 2
  • 5
  • 4
    Language conversion is VERY finicky thing. – Dhaivat Pandya May 14 '11 at 17:42
  • 1
    @Dhaivat yes it is, extremely finicky. I remember converting C++ to Delphi one time and ran into huge problems with my program crashing because `@GetProcAddress` in Delphi isn't the same as `&GetProcAddress` in C++ (C++ takes the address of the function but Delphi takes the address of the _wrapper_ function for the real `GetProcAddress`.) *shiver* – Seth Carnegie May 14 '11 at 17:44
  • 1
    It looks like community wiki candidate –  May 14 '11 at 18:05
  • Is this a "I want to cheat on my homework" question? – Robin Green May 14 '11 at 18:09
  • Maybe yes but it would be fine to make a list of that –  May 14 '11 at 18:11
  • 1
    @Robin maybe, as you cannot really use Pascal except for educational purposes (maybe Delphi makes some sense, but even that's more of a legend to me). – Christian Rau May 14 '11 at 23:06
  • I don't think there is anyone who can write c/c++ code but can't write pascal code, but everyone has a right to make daft assumptions. – ThatJoeGuy May 15 '11 at 01:11

5 Answers5

3

H2Pas is a popular tool to convert C headers to Pascal. I don't know of any to actually convert C code to Pascal code though.

From a quick google search, I see several that may or may not be good:

I am tempted to say you'll have to do a lot of it by hand one way or another.

Seth Carnegie
  • 73,875
  • 22
  • 181
  • 249
  • Yeah, tried c2pas, but might as well write the program in pascal from scratch than use that. It may work for dead simple programs though. – ThatJoeGuy May 15 '11 at 00:38
1

Java to Pascal converter: http://www.pascalgamedevelopment.com/archive/index.php/t-4845.html

avra
  • 3,690
  • 19
  • 19
0

There was released Android2DelphiImport tool a short time ago. This tool is designed for XE5, and automates the import unit writing by generating a pascal wrapper unit from jar. It is a commercial package.
Here are another two similar tools - Utility to generate Java Android class and jar file interfaces for Delphi XE5 Firemonkey ('JavaToPas' and 'JavaImport For Android').

naXa stands with Ukraine
  • 35,493
  • 19
  • 190
  • 259
0

VB to Pascal converters:

  1. http://www.marcocantu.com/tools/vb2delphi.htm
  2. http://www.vbto.net
avra
  • 3,690
  • 19
  • 19