Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!math.lsa.umich.edu!emv From: hemphill@cit-vax.Caltech.Edu (Scott Hemphill) Newsgroups: comp.archives Subject: [comp.lang.c...] Good Pascal to C translator available at Caltech Message-ID: <10858@stag.math.lsa.umich.edu> Date: 9 Feb 90 22:19:14 GMT Sender: news@math.lsa.umich.edu Reply-To: hemphill@cit-vax.UUCP (Scott Hemphill) Followup-To: comp.lang.c,comp.lang.pascal,comp.lang.misc Lines: 33 Approved: emv@math.lsa.umich.edu (Edward Vielmetti) Archive-name: p2c/08-Feb-90 Original-posting-by: hemphill@cit-vax.Caltech.Edu (Scott Hemphill) Original-subject: Re: Pascal to C Conversion Archive-site: csvax.caltech.edu [192.12.18.1] Reposted-by: emv@math.lsa.umich.edu (Edward Vielmetti) 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