Re: Is there a good Pascal to C++ Translator?

Ray Dillinger <bear@sonic.net>
6 Apr 2002 23:45:10 -0500

          From comp.compilers

Related articles
Is there a good Pascal to C++ Translator? s.c.siegel@web.de (2002-03-31)
Re: Is there a good Pascal to C++ Translator? bear@sonic.net (Ray Dillinger) (2002-04-06)
Re: Is there a good Pascal to C++ Translator? journeyman@compilerguru.com (2002-04-06)
Re: Is there a good Pascal to C++ Translator? s.c.siegel@web.de (2002-04-10)
Re: Is there a good Pascal to C++ Translator? rhyde@cs.ucr.edu (Randall Hyde) (2002-04-10)
Re: Is there a good Pascal to C++ Translator? journeyman@compilerguru.com (2002-04-13)
Re: Is there a good Pascal to C++ Translator? marcov@toad.stack.nl (Marco van de Voort) (2002-04-16)
| List of all articles for this month |

From: Ray Dillinger <bear@sonic.net>
Newsgroups: comp.compilers
Date: 6 Apr 2002 23:45:10 -0500
Organization: Compilers Central
References: 02-03-185
Keywords: Pascal, C++, translator, question, comment
Posted-Date: 06 Apr 2002 23:45:10 EST

Jascha wrote:
> I need a Pascal to C++ translator. I still use p2c 1.22-8, but I have
> problems, if i have two declarations of one function, but with
> different parameter types.
> Did any one know a way to do this or know a better Translator?


If you have two declarations of one function with different parameter
types, then you are not looking at Pascal code. In Pascal, multiple
function definitions of the same function are an error. p2c won't
handle it because it's not able to understand things that aren't
Pascal.


What you've got is some specific vendor's Pascal-like language with
some extensions, and what you need is p2c or equivalent that's been
hacked to understand those particular extensions. This is a common
problem with Pascal, unfortunately; because the language was
underspecified by Jensen & Wirth, every vendor who's ever done it has
extended it in a different incompatible direction.


The point is that you need to say what language you are using,
specifically, (whose implementation and what version) before anyone is
likely even to guess what translator you need. Alternatively, you
could translate your code into Pascal by hand (renaming the second and
subsequent versions of each multiply defined procedure) before letting
p2c look at it.


Good luck. Sorry I couldn't be more help....




Bear
[Surely you can have two functions with the same name and different
arguments if their scopes don't overlap. -John]


Post a followup to this message

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