[comp.lang.c] Pascal to C conversion

crscott@sdrc.UUCP (Scott_Klosterman) (07/27/88)

   Does anyone know of a program which will convert Pascal
   source to C? We have quite a few applications written in
   Pascal and since we are going to a policy of Fortran or
   C only we must somehow convert them. Please reply E-Mail
   as I don't read all these groups.
                                     Scott Klosterman
                                     uunet!sdrc!crscott

pk-tle@nada.kth.se (Tommy Levitte) (07/29/88)

>   Does anyone know of a program which will convert Pascal
>   source to C? We have quite a few applications written in
>   Pascal and since we are going to a policy of Fortran or
>   C only we must somehow convert them. Please reply E-Mail
>   as I don't read all these groups.

Please tell me also (and send it to me). I NEED IT!

wytze@gouldnl.UUCP (Wytze van der Raay) (07/31/88)

In article <486@draken.nada.kth.se> pk-tle@draken.UUCP (Tommy Levitte) writes:
>>   Does anyone know of a program which will convert Pascal
>>   source to C? We have quite a few applications written in
>>   Pascal and since we are going to a policy of Fortran or
>>   C only we must somehow convert them. Please reply E-Mail
>>   as I don't read all these groups.
>
>Please tell me also (and send it to me). I NEED IT!

It's on the latest EUUG tape, distributed at the EUUG Spring Conference
in London (April 1988), and now available through euug-tapes@cwi.nl
It is named "ptc", and written by (information copied from the README file):
	Per Bergsten

Email:	perb%holtec.uucp@chalmers.csnet
	... mcvax!enea!chalmers!holtec!perb
aka:	bergsten@chalmers

Smail:	Holistic Technology AB
	Grona Gatan 59
	414 54 Gothenburg
	Sweden

Fax:	+46 31 247456

-- 
| Wytze van der Raay                      ...!mcvax!gouldnl!wytze |
| Gould European Unix Support Centre             wytze@gouldnl.nl |
| Maarssenbroek, The Netherlands          (USA)   ...!gould!wraay |

bph@buengc.BU.EDU (Blair P. Houghton) (08/01/88)

In article <486@draken.nada.kth.se> pk-tle@draken.UUCP (Tommy Levitte) writes:
>>   Does anyone know of a program which will convert Pascal
>>   source to C? We have quite a few applications written in
>>   Pascal and since we are going to a policy of Fortran or
>>   C only we must somehow convert them. Please reply E-Mail
>>   as I don't read all these groups.
>
>Please tell me also (and send it to me). I NEED IT!

Whatever happened to ptoc?

I have never had occasion to use it, and this computer hasn't installed
it, but it's right there in my manual (Umax, Ultrix, or Unix, they
all list it).  Any reason nobody can find the program?  I can't.

				--Blair

walter@garth.UUCP (Walter Bays) (08/04/88)

>>   Does anyone know of a program which will convert Pascal
>>   source to C?

Green Hills Software (818-246-5555) has a translator.  
It does not handle nested procedures, and the resulting C is not maintainable.
I have not tried it, and do not recommend for or against it.
-- 
------------------------------------------------------------------------------
My opinions are my own.  Objects in mirror are closer than they appear.
E-Mail route: ...!pyramid!garth!walter		(415) 852-2384
USPS: Intergraph APD, 2400 Geng Road, Palo Alto, California 94303
------------------------------------------------------------------------------

teb@execu.UUCP (Thomas E. Bernhard) (08/05/88)

In article <336@sdrc.UUCP> crscott@sdrc.UUCP (Scott_Klosterman) writes:
>
>   Does anyone know of a program which will convert Pascal
>   source to C? We have quite a few applications written in
>   Pascal and since we are going to a policy of Fortran or
>   C only we must somehow convert them. Please reply E-Mail
>   as I don't read all these groups.
>                                     Scott Klosterman
>                                     uunet!sdrc!crscott

There is a company called Maritime InfoSystems which sells a very good 
Pascal to C comversion program. They will also convert your code for
you at a price. My information is dated July 1, 1986 so I don't even know
if they are in business anymore. Anyway here's their calling card:

	Maritime Infosystems Ltd.
	6660 Reservoir Road
	Corvallis, Oregon 97333
	(503) 929-2552

-- Tom Bernhard (teb@execu)

bertanij@mist.cs.orst.edu (John Bertani) (08/05/88)

>In article <336@sdrc.UUCP> crscott@sdrc.UUCP (Scott_Klosterman) writes:
>>
>>   Does anyone know of a program which will convert Pascal
>>   source to C? We have quite a few applications written in
>>   Pascal and since we are going to a policy of Fortran or
>>   C only we must somehow convert them. Please reply E-Mail
>>   as I don't read all these groups.
>>                                     Scott Klosterman
>>                                     uunet!sdrc!crscott
>
>There is a company called Maritime InfoSystems which sells a very good 
>Pascal to C comversion program. They will also convert your code for
>you at a price. My information is dated July 1, 1986 so I don't even know
>if they are in business anymore. 

He's not!  He got a job as a sysop in New Zealand.

But he was just reselling the TGL Pascal-to-C Converters.  You can
get more info by writing to:

	Ted Lewis
	TGL, Inc.
	27096 Forest Springs Ln.
	Corvallis, OR  97330
	(503) 745-7476

What dialects? UCSD, MS, MT+, Metaware, Intel, Apollo Domain, and Turbo.
If it's not on the list, call anyway.

abbas@tellab5.tellabs.CHI.IL.US (Abbas Kord) (09/08/89)

Hi,
    Does any body know that there  is any books about how to convert the
    Turbo Pascal to Turbo C ? I thank you in advance.     

nagano@cod.NOSC.MIL (Michael Y. Nagano) (09/22/89)

In article <1569@tellab5.tellabs.CHI.IL.US> abbas@tellab5.tellabs.CHI.IL.US (Abbas Kord) writes:
>
>
>Hi,
>    Does any body know that there  is any books about how to convert the
>    Turbo Pascal to Turbo C ? I thank you in advance.     

I don't have a book but if you have Quick C or Microsoft C, Microsoft offered
a free Turbo Pascal to C conversion utility.  Just call the advertised 800 
number and ask for it.    I have no experience with it but you may be able
to request it through the compuserve conference.

Mike

phipps@garth.UUCP (Clay Phipps) (02/06/90)

We are also looking for an automatic Pascal-to-C source-code converter.

There are rumors of one being available at U.C. Berkeley.
If accurate, would someone please be a little more specific ?

A posting a few months ago made a reference to one on "the UUCP tape",
but that is apparently not a universally recognized designation for
that tape (communications is not my subfield), if it exists at all.

In article <52037@XAIT.Xerox.COM>,
rmeyer@XAIT.Xerox.COM (Richard Meyer) wrote:
>
>In your reply, please indicate the source for the converter, 
>price (if applicable), 
>any positive / negative experience you may have, 
>and language flavors supported.

I don't recall seeing anything about it in this news-group in the year 
or so that I've been back on the net (after an absence of 3 years).
Rather than replying privately to Meyer at Xerox, I encourage those
with answers to please go ahead and post the information.

Thanks for any help that you may be able to offer.
-- 
[The foregoing may or may not represent the position, if any, of my employer, ]
[ who is identified solely to allow the reader to account for personal biases.]
                                              
Clay Phipps 
Intergraph APD: 2400#4 Geng Road, Palo Alto, CA 94303; 415/852-2327
UseNet (Intergraph internal): ingr!apd!phipps
UseNet (external): {apple,pyramid,sri-unix}!garth!phipps        EcoNet: cphipps

gupta@cad.Berkeley.EDU (Rajesh Gupta) (02/06/90)

In article <3576@garth.UUCP> phipps@garth.UUCP writes:
>We are also looking for an automatic Pascal-to-C source-code converter.
>
>There are rumors of one being available at U.C. Berkeley.
>If accurate, would someone please be a little more specific ?
...
>In article <52037@XAIT.Xerox.COM>,
>rmeyer@XAIT.Xerox.COM (Richard Meyer) wrote:
>>
>>In your reply, please indicate the source for the converter, 
>>price (if applicable), 
>>any positive / negative experience you may have, 
>>and language flavors supported.
>
>I don't recall seeing anything about it in this news-group in the year 
>or so that I've been back on the net (after an absence of 3 years).
>Rather than replying privately to Meyer at Xerox, I encourage those
>with answers to please go ahead and post the information.
>

I have a pascal-to-c converter that sort of works. Though I have never
extensively used it.  If there is sufficient interest I can 
mail a copy on the net or mail it individually.

Rajesh Gupta
--
CSL
rgupta@sirius.stanford.edu

======================================================
gupta@cad.berkeley.edu.ARPA
gupta@esvax.berkeley.edu.ARPA
..ucbvax!ucbcad!gupta@berkeley.edu.ARPA

streich@boulder.Colorado.EDU (Mark Streich) (02/06/90)

You can get the source to a Pascal-to-C converter at csvax.caltech.edu that
is called p2c.  It handles a variety of pascals and modula-2 as well.

feg@clyde.ATT.COM (Forrest Gehrke,2C-119,7239,ATTBL) (02/07/90)

In article <3576@garth.UUCP>, phipps@garth.UUCP (Clay Phipps) writes:
> We are also looking for an automatic Pascal-to-C source-code converter.
> >
> >In your reply, please indicate the source for the converter, 
> >price (if applicable), 
> >any positive / negative experience you may have, 
> >and language flavors supported.




You will find a fairly good translator on SIMTEL20 archives
under MSDOS.C directory which was put out by Microsoft
a couple of years ago.  T2C.ARC   152K bytes

Its specially configured to translate TurboPascal to MSC, natch.

Although any of the these Pascal-C translators can handle 
most of the job, none of them can unravel Pascal's nested
functions.  The translators leave that task to humans.

Forrest Gehrke feg@clyde.ATT.COM

hemphill@cit-vax.Caltech.Edu (Scott Hemphill) (02/09/90)

In article <4007@cbnewsl.ATT.COM> feg@clyde.ATT.COM writes:
>
>Although any of the these Pascal-C translators can handle 
>most of the job, none of them can unravel Pascal's nested
>functions.  The translators leave that task to humans.

This is not true.  Here at Caltech, Dave Gillespie has written a truly
wonderful Pascal to C translator.  It is called p2c, and is available via
anonymous ftp from csvax.caltech.edu.  It is also in the queue to be posted
to comp.sources.unix.

It translates the following Pascal dialects:

  o  HP Pascal
  o  Turbo/UCSD Pascal
  o  VAX Pascal
  o  Oregon Software Pascal/2
  o  Macintosh Programmer's Workshop Pascal

It also supports Modula-2 syntax.  Output C code can be machine-independent,
or can be targeted for a specific machine and compiler.  It produces well-
formatted (you can configure it for your own indentation style) human readable
and maintainable C, using C idioms when possible.  Every program I have
translated has required no human intervention at all.  It even passes a large
part of a Pascal validation test suite.
-- 
Scott Hemphill	hemphill@csvax.caltech.edu	...!ames!elroy!cit-vax!hemphill

gsarff@meph.UUCP (Gary Sarff) (02/09/90)

In article <4007@cbnewsl.ATT.COM>, feg@clyde.ATT.COM (Forrest Gehrke,2C-119,7239,ATTBL) writes:
>In article <3576@garth.UUCP>, phipps@garth.UUCP (Clay Phipps) writes:
>> We are also looking for an automatic Pascal-to-C source-code converter.
>> >
>> >In your reply, please indicate the source for the converter, 
>> >price (if applicable), 
>> >any positive / negative experience you may have, 
>> >and language flavors supported.
>
>You will find a fairly good translator on SIMTEL20 archives
>under MSDOS.C directory which was put out by Microsoft
>a couple of years ago.  T2C.ARC   152K bytes
>
>Its specially configured to translate TurboPascal to MSC, natch.
>
>Although any of the these Pascal-C translators can handle 
>most of the job, none of them can unravel Pascal's nested
>functions.  The translators leave that task to humans.
>

I have one that does do nested procedures and functions.  It came off of
usenet a few years ago (2,3?) in comp.sources.unix I believe.  It is in
Pascal, (there was a C version posted, which was the pascal version run on
itself), and produced pretty bizarre looking code compared to what p2c
produces, but it did do nested procedures, variant records, pascal I/O, etc.

bills@XAIT.Xerox.COM (Bill Stackhouse) (03/15/90)

Can anyone point me to a Unix based program for converting or helping to
convert Pascal source to C source? I believe that I have seen reference to
one that can be FTP'd but I know not where from.


-- 
Bill Stackhouse
Cambridge, MA.
bills@XAIT.Xerox.COM

emv@math.lsa.umich.edu (Edward Vielmetti) (03/15/90)

p2c, get it from csvax.caltech.edu.  --Ed

ac4@cel.co.uk (adam cann) (10/02/90)

Hi news-folks, 
	A simple request I hope somebody can help me with.
I shall soon be involved with translating a project written in
Turbo Pascal on a 386 MS-DOS system into C for the same system.
The amount of source is not insignificant and I suspect that the Pascal
is highly non-standard due to the high graphics capabilities of the package.
Therefore I would like to know of any suggestions people may have to ease
the conversion process. My C is quite good, however it's been a while since 
I fooled around with Pascal. In addition there is a strong chance that porting
to the Mac may also be desired. Quite simply my basic questions are...

	1/ Pascal to C translation, an easy way to do it.

	2/ Recommendations for a Mac C-compiler.

	3/ Recommendations for a common graphics library for the Mac and IBM.
		(Not urgent, but nice if someone knows of one)
	4/ Any comments on my choice of C compiler (MSC 5.0 or 5.1)

Please Email as news here is rather truncated on occasion.
(If I done wrong in net-protocol don't flame me, It's been a year away from it)

				May the sun shine upon your hot-tub
						Adam Cann.