Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!ucsd!ucbvax!tut.cis.ohio-state.edu!ukma!xanth!mcnc!decvax!ima!compilers-sender From: schwartz@shire.cs.psu.edu (Scott Schwartz) Newsgroups: comp.compilers Subject: Re: Translating Pascal to C Message-ID: <4018@ima.ima.isc.com> Date: 2 Jun 89 00:33:26 GMT References: <4727@mtuxo.att.com> Sender: compilers-sender@ima.ima.isc.com Reply-To: schwartz@shire.cs.psu.edu (Scott Schwartz) Distribution: usa Organization: Pennsylvania State University, Computer Science Lines: 25 Approved: compilers@ima.UUCP In-Reply-To: chrism@mtuxo.att.com (XMRJ4-C.MCCABE) In article <4727@mtuxo.att.com>, chrism@mtuxo (XMRJ4-C.MCCABE) writes: >I'm going to create a Pascal-to-C utility program, and am having >some trouble locating books in this area. Such a thing was posted to usenet (comp.sources.unix I think) about two years ago, with a set of patches sometime later. It was called "ptc". >[I've never seen anything in depth on this sort of thing. My experience is >that source-to-source translators are if anything more difficult than regular >compilers, both because there are things that are easy to say in Pascal that >are hard to say in C, e.g. nested scopes, and because in a translator you want >the output to be readable by humans as well as by computers. -John] Ptc does pretty well on most of that. Its major failing is that it tries to generate clever C code (using macros) for pascal I/O statements, and gets some things wrong. :-( -- Scott Schwartz -- Send compilers articles to compilers@ima.isc.com or, perhaps, Levine@YALE.EDU Plausible paths are { decvax | harvard | yale | bbn}!ima Please send responses to the originator of the message -- I cannot forward mail accidentally sent back to compilers. Meta-mail to ima!compilers-request