|Is there a good Pascal to C++ Translator? email@example.com (2002-03-31)|
|Re: Is there a good Pascal to C++ Translator? firstname.lastname@example.org (Ray Dillinger) (2002-04-06)|
|Re: Is there a good Pascal to C++ Translator? email@example.com (2002-04-06)|
|Re: Is there a good Pascal to C++ Translator? firstname.lastname@example.org (2002-04-10)|
|Re: Is there a good Pascal to C++ Translator? email@example.com (Randall Hyde) (2002-04-10)|
|Re: Is there a good Pascal to C++ Translator? firstname.lastname@example.org (2002-04-13)|
|Re: Is there a good Pascal to C++ Translator? email@example.com (Marco van de Voort) (2002-04-16)|
|From:||Ray Dillinger <firstname.lastname@example.org>|
|Date:||6 Apr 2002 23:45:10 -0500|
|Keywords:||Pascal, C++, translator, question, comment|
|Posted-Date:||06 Apr 2002 23:45:10 EST|
> 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
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....
[Surely you can have two functions with the same name and different
arguments if their scopes don't overlap. -John]
Return to the
Search the comp.compilers archives again.