Re: Converting Pascal to C++, C# or VB

Marco van de Voort <marcov@stack.nl>
8 Apr 2006 16:02:09 -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)
Re: Converting Pascal to C++, C# or VB martin@gkc.org.uk (Martin Ward) (2006-04-08)
[10 later articles]
| List of all articles for this month |

From: Marco van de Voort <marcov@stack.nl>
Newsgroups: comp.compilers
Date: 8 Apr 2006 16:02:09 -0400
Organization: Stack Usenet News Service
References: 06-04-017
Keywords: Pascal, translator
Posted-Date: 08 Apr 2006 16:02:09 EDT

On 2006-04-03, Steve <steve@rh12.co.uk> wrote:
> 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?


C/C++ have callbacks too, so for the simple case not that much of a problem,
but when nested procs get involved, it might be hard.


Specially since that under ISO nested procedures passed to other functions as procedure
variables have access to their parents context (this is one of the things
the Borland line doesn't support). IOW, such procedures are not pure
function pointers, but functionpointer + a framepointer.


So the first thing would be to check if nested procedures are passed as
prcvar and if they access parent procedures frames (parameters, vars)


Post a followup to this message

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