Converting Pascal to C++, C# or VB

"Steve" <steve@rh12.co.uk>
3 Apr 2006 01:39:03 -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# or VB marcov@stack.nl (Marco van de Voort) (2006-04-08)
Re: Converting Pascal to C++, C# or VB torbenm@app-4.diku.dk (2006-04-08)
Re: Converting Pascal to C++, C# or VB john@elmcrest.demon.co.uk (John O'Harrow) (2006-04-08)
Re: Converting Pascal to C++, C# or VB DrDiettrich@compuserve.de (Hans-Peter Diettrich) (2006-04-08)
Re: Converting Pascal to C++, C# or VB englere.geo@yahoo.com (Eric) (2006-04-08)
Re: Converting Pascal to C++, C# or VB gneuner2@comcast.net (George Neuner) (2006-04-08)
[12 later articles]
| List of all articles for this month |

From: "Steve" <steve@rh12.co.uk>
Newsgroups: comp.compilers
Date: 3 Apr 2006 01:39:03 -0400
Organization: Compilers Central
Keywords: translator, question
Posted-Date: 03 Apr 2006 01:39:03 EDT

I have some legacy machine control code written in ISO std Pascal that I
would like to convert to one of the languages supported by our current
development environment : MS Visual Studio .NET 2003. So that means C++, C
sharp or VB.


It's a big chunk of code - about 500k lines in 200 files. I currently have a
translator that converts it to Delphi. This enables us to run it on a PC,
but it will not fit easily with our newer code which is in C++ and C#. I
plan to extend this translator to generate the new language too. The
translator creates an AST for all the source, and keeps track of
publics/externs. Several passes are then made over the AST to generate the
Delphi units. It's a complicated process, especially for the structured
constants.


So the question is which language to use? I know C++ a little, but the other
two are new to me.


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++. Initial investigation
suggests that the struct in C# might be a suitable alternative. It has to
allow access to constants, types and variables declared in an outer scope.


We also have a few instances of Pascal procedural parameters. Can these be
emulated?


Fortunately no-one ever used conformant arrays. :)


I welcome comments/advice.



Post a followup to this message

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