Re: Pascal to C translator

Edward Vielmetti <emv@math.lsa.umich.edu>
Mon, 05 Mar 90 23:01:37 EST

          From comp.compilers

Related articles
Pascal to C translator mar@sabrina.inesc.pt (1990-03-02)
Re: Pascal to C translator emv@math.lsa.umich.edu (Edward Vielmetti) (1990-03-05)
Pascal to C translator amnonb@taux01.nsc.com (Amnon Cohen) (1990-11-04)
| List of all articles for this month |
Date: Mon, 05 Mar 90 23:01:37 EST
From: Edward Vielmetti <emv@math.lsa.umich.edu>
Keywords: pascal,C

Here's a review of p2c, a Pascal to C translator, via comp.text.tex.


--Ed
Edward Vielmetti, U of Michigan math dept.


------- Forwarded Message


From: darrylo@hpnmdla.HP.COM (Darryl Okahata)
Newsgroups: comp.text.tex
Subject: Re: Info on WEB?
Message-ID: <9340001@hpnmdla.HP.COM>
Date: 21 Feb 90 22:31:24 GMT
Organization: HP Network Measurements Div, Santa Rosa, CA


          There is, in my opinion, an even better Pascal to C/C++ translator
available. At the end of this message, I've included a copy of a
posting from comp.archives that describes where/how to get it.


          Note that I'm just a happy user; I have NO connection with the
author of this program other than as a user.


          Not only does this translator produce human-readable code, it will
use *different* C code constructs depending on how many times an array
is referenced within a loop and on whether or not the procedure being
translated is a nested procedure. It is a very intelligent translator,
and actually spends quite a bit of time trying to reformat the
translated C code to a user-definable indentation specification; it can
actually make unreadable (i.e., poorly-formatted) Pascal code appear
readable.


Features:


1. It can handle more than one dialect of "Pascal" (note that Modula-2 is
      in this list):


                HP (default; Pascal Workstation version)
                MODCAL (HP's advanced Pascal)
                HP-UX (almost same as HP)
                TURBO (vers 5.0 for IBM PC)
                OREGON (Oregon Software Pascal-2 V2.1)
                VAX (VAX/VMS Pascal)
                MODULA (Modula-2)
                UCSD (almost same as TURBO)
                MPW (MPW Pascal 2.0 for the Mac)


2. It can translate to C (K&R or ANSI) or C++ code.


3. Target machines can be: HPUX-300, SUN-68K, BSD-VAX, BSD, or SYSV


          -- Darryl Okahata
UUCP: {hplabs!, hpcea!, hpfcla!} hpnmd!darrylo
Internet: darrylo%hpnmd@hpcea.HP.COM


DISCLAIMER: this message is the author's personal opinion and does not
constitute the support, opinion or policy of Hewlett-Packard or of the
little green men that have been following him all day.


- -------------------------------------------------------------------------------
From: reid@cpswh.cps.msu.edu (Dr Richard J. Reid)
Date: Sat, 13 Jan 1990 02:26:57 GMT
Subject: [comp.lang.c] Summary: Pascal_to_C Translator
Newsgroups: comp.archives


Archive-name: p2c/how-to-get
Original-posting-by: reid@cpswh.cps.msu.edu (Dr Richard J. Reid)
Original-subject: Summary: Pascal_to_C Translator
Archive-site: csvax.caltech.edu [192.12.18.1]
Reposted-by: emv@math.lsa.umich.edu (Edward Vielmetti)


Thanks to those who have responded. The translator is
available from the ftp source: csvax.caltech.edu
as p2c.


It was written by Dave Gillespie and has provisions
for recognizing several dialects of Pascal. The translator
also accepts a Modula-2 flag for that source.


There was one inquiry about the AT&T FORTRAN_2_C but
I can't find my references about that. I know I
saw it posted here somewhere within the last few weeks.
Any help?


Dick





Post a followup to this message

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