Re: Translating Pascal to C

schwartz@shire.cs.psu.edu (Scott Schwartz)
2 Jun 89 00:33:26 GMT

          From comp.compilers

Related articles
Translating Pascal to C chrism@mtuxo.att.com (1989-05-27)
Re: Translating Pascal to C schwartz@shire.cs.psu.edu (1989-06-02)
| List of all articles for this month |
Newsgroups: comp.compilers
Date: 2 Jun 89 00:33:26 GMT
References: <4727@mtuxo.att.com>
From: schwartz@shire.cs.psu.edu (Scott Schwartz)
Distribution: usa
Organization: Pennsylvania State University, Computer Science
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 <schwartz@shire.cs.psu.edu>
--


Post a followup to this message

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