Converter from Object-Pascal (Delphi) to C++

Detlef Meyer-Eltz <>
Thu, 19 Nov 2009 13:55:46 +0100

          From comp.compilers

Related articles
Converter from Object-Pascal (Delphi) to C++ (Detlef Meyer-Eltz) (2009-11-19)
| List of all articles for this month |

From: Detlef Meyer-Eltz <>
Newsgroups: comp.compilers
Date: Thu, 19 Nov 2009 13:55:46 +0100
Organization: Compilers Central
Keywords: Pascal, C++, translator
Posted-Date: 20 Nov 2009 12:56:11 EST

The program Delphi2Cpp just has been released at:

Delphi2Cpp helps to convert Delphi source code to C++. The program
saves all simple purely mechanical syntactical substitutions and
rearrangements of the code in which the largest portion of the
translation consists. A lot of more complex translation steps are
executed too. But in most cases a manual post-processing of the
produced code will be required. Details are listed here:

Delphi2Cpp is based on the parser and pretty-printer for Delphi 4/5,
which I have announced here recently. The formatting actions, which
are executed of the pretty-printer while processing a parse-tree
mostly remained unchanged. The real translation work is done at the
same time as the Delphi code is parsed, by constructing a tree which
already has the C++ form. This is possible in a recursive LL-parser
quite well, because the stack of the parser rules already is a kind of
tree, with the needed informations.

When the VCL is included, the translator becomes quite slow, because
it is made by the C++-subset of the TextTransformer interpreter only.
There is a lot of searching over unsorted tree-nodes. I haven't
decided yet, whether I will improve the TextTransformer
C++-interpreter or simply overwrite some functions of the exported
code to accelerate the program. Since the program normally will be
used once only, the speed isn't very important, however.

Though Delphi2Cpp is far from being perfect I am quite proud of it,
because it is one of the projects, which have motivated me to begin
with TextTransformer seven year ago and which has been improved and
used for testing all the time.

The still desirable improvements of the translator are a task
requiring great diligence and depend on the financing. I decided to
publish a first version of the translator now for a low price to test
whether there is a demand on the market at all. The price will be
increased with each relevant update in the future. Early buyers will
get these updates for free.

Detlef Meyer-Eltz

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.