Skip to content

stategen/C-To-Delphi-Pro

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C-To-Delphi-Pro

Screenshot

Description

After spending a month manually modifying the Pascal code translated by C-To-Delphi, I'm exhausted, and the progress I made feels close to zero. After searching again on the internet, I had to start over and rewrite C-To-Delphi. Initially, I thought C-To-Delphi had completed 90% of the work, and I would just need to fix a few bugs. However, once I started the task, I realized that C-To-Delphi had only done 10%, leaving the remaining 90% of the conversion details unhandled. It took me a whole six months to complete that 90%. Hence, the software is named C2Delphi Pro(c/c++ to delphi/pascal pro). I want to express my gratitude to the author of C-To-Delphi for providing the initial framework and idea. C-To-Delphi Pro is a niche software designed for those who need to accurately and efficiently translate C or C++ code into Delphi(pascal), saving time. Don't underestimate the complexity of the C++ language and avoid attempting manual translation. Account settings

C2Delphi pro Download

The following screenshots are all actual conversions:

1.Inner Type

img

>

img

2.inline class within a function

img

>

img

3.auto-adding parentheses

img

>

img

4 c for to delphi/pascal for

img

>

img

5.c for(non i++) to delphi/pascal while

img

>

img

6.c for(non i++) to delphi/pascal while

img

>

img

7.auto char to byte

img

>

img

8.auto char to number

img

>

img

9 Ternary operation to function

img

>

img

10 Ternary operation to ifThen

img

>

img

11 anonymous function signature is passed as a parameter

img

>

img

img

12. Initialize array pointer

img

>

img

13. Initialize array

img

>

img

14. effectively convert while expressions

img

>

img

15. effectively convert if expressions

img

>

img

16 i-- in the expression

img

>

img

17. --i in the expression

img

>

img

18. i++ in the expression

img

>

img

19 normal i-- i++

img

>

img

20 super inheriited

img

>

img

21 super class inheriited

img

>

img

22 new to create

img

>

img

23 switch case default expression

img

>

img

24 case expression auto with begin end

img

>

img

25 retain the content of a pointer

img

>

img

26 type convert

img

>

img

27 Initialize record

img

>

img

28. pointers and accessing pointers

img

>

img

29 Initialize record array

img

>

img

28 c stack object to delphi/pascal heap object

img

>

img

29 new with params

img

>

img

31 inline variant

img

>

img

33 c delete memory to delphi/pascal free

img

>

img

34 return value

img

>

img

35 return

img

>

img

36 Assigning inside an if expression

img

>

img

37 c call param

img

>

img

38 Assigning add

img

>

img

39 1D array

img

>

img

34 nD complex array

img

>

img

41 1D array record

img

>

img

42 ignore release

img

>

img

43 ignore AddRef

img

>

img

44 C interface class to delphi/pascal Interface class

img

>

img

45 functions within inner classes

img

>

img

46 static constants within inner classes

img

>

img

It contains a split view, with C on the left and Delphi(pascal)on the right. The Delphi/pascal code gets updated in realtime when you edit the C code. The editors are kept in sync, so you can easily find how a specific piece of code was converted.

  • The Syntax checks of the generated code is verified. (uses DelphiAST)

  • You can even run the generated code by pressing F9 (uses DWS)

  • You can drag/drop multiple C files to the application. It'll find the .h files that belong to it, and convert all to .pas files in the same folder.

Features:

  • If function main exists, a program will be generated. Otherwise a pascal unit with interface/implementation sections.
  • Merge header and implementation file to one dephi file
  • Aggregate scattered implementation code across different c/c++ files.
  • Converts routines and arguments
  • Converts for loops(check use for or for-to-while, "count" as "to count -1" )
  • Converts case statements(remove breaks,auto surround with begin...end)
  • Smart Convers if-statement
  • Smart Surround 'and' and 'or' with parentheses on both sides.
  • Converts structs
  • Converts enums
  • Converts 1 and 2 dimensional arrays
  • Converts many other common routines to Delphi equivalents (strcpy,strcat,strlen,printf,argv,argc,etc)
  • Converts classes
  • Nested class ,structs,enums
  • Inline class ,structs,enums
  • Inline method,
  • Method as variable.
  • C interface to Delphi interface
  • C stack object to Delphi heap object with smart call constructor
  • C pointer to Delphi var parameter
  • Smart keep @ ^
  • Smart C (Type) to Delphi Type()
  • C String to Delphi String with delphi chars #10,#13,#0...
  • Auto C Const to delphi Const or ar
  • Nested Const Var initialization
  • Custom regular conversion or fix
  • Custom file name prefix and suffix

About

C To Delphi converter Pro

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published