re: Converting Pascal to C++, C

"Bob Sheff" <bsheff2@gmail.com>
14 Apr 2006 21:17:18 -0400

          From comp.compilers

Related articles
Converting Pascal to C++, C# or VB steve@rh12.co.uk (Steve) (2006-04-03)
re: Converting Pascal to C++, C bsheff2@gmail.com (Bob Sheff) (2006-04-14)
| List of all articles for this month |

From: "Bob Sheff" <bsheff2@gmail.com>
Newsgroups: comp.compilers
Date: 14 Apr 2006 21:17:18 -0400
Organization: Compilers Central
References: 06-04-017
Keywords: translator, Pascal
Posted-Date: 14 Apr 2006 21:17:18 EDT

"Steve" stated:
>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,
<snip>
>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
www.actworld.com


regards, Bob Sheff
bsheff2 at yahoo dot com


Post a followup to this message

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