|Converting Pascal to C++, C# or VB email@example.com (Steve) (2006-04-03)|
|re: Converting Pascal to C++, C firstname.lastname@example.org (Bob Sheff) (2006-04-14)|
|From:||"Bob Sheff" <email@example.com>|
|Date:||14 Apr 2006 21:17:18 -0400|
|Posted-Date:||14 Apr 2006 21:17:18 EDT|
>It's a big chunk of code - about 500k lines in 200 files. I currently have a
Large systems typically have millions of lines and thousands of files.
>translator that converts it to Delphi. This enables us to run it on a PC,
>So far the main obstacle I can see with C++ is the nested routines of
>Pascal. I don't know of any way to do this in C++.
The Applied Conversion Tech translator "Pas-C" pops out the imbedded
routines by appending in-scope variables as arguments to the routine
definition and invocations (by reference if needed). It may need to
modify the procdure name (by pre-pending the imbedor's name) if there
are identicall named routines elsewhere in the system. This is done
recursively and automatically.
This proceedure was originally developed for a very large project
involving (Pascal-like) CHILL to C++ involving very large files, some
of which had multiple, sinliar recursive definitions more than 3 deep.
After CHILL, Pascal was easy.
>We also have a few instances of Pascal procedural parameters. Can
>these be emulated?
Certainly, as pointer to function
>Fortunately no-one ever used conformant arrays. :)
One could perhaps do this with a #define macro for the invocation such as:
#define foo(array) foo_conform( array, sizeof(array) )
and overload the definition with a size argument.
if there were enough of them in a system, a special rule could be
designed to do this automatically.
If you would like a fixed price bid on conversion, contact me or the
regards, Bob Sheff
bsheff2 at yahoo dot com
Return to the
Search the comp.compilers archives again.