[alt.sources.wanted] WANTED: Pascal to C translator

smagt@fwi.uva.nl (Patrick van der Smagt) (03/01/91)

Hi,

I'm looking for a program that can translate Pascal to C source code,
pref. running under UNIX (sun4).  Any help would be very much
appreciated.

					
						Patrick van der Smagt 
Organisation: Faculty of Mathematics & Computer Science
              University of Amsterdam, Kruislaan 403,
              NL-1098 SJ  Amsterdam, The Netherlands
Phone:        +31 20  525 7524
Fax:          +31 20  525 7490

email:        smagt@fwi.uva.nl

tml@tik.vtt.fi (Tor Lillqvist) (03/05/91)

In article <1991Mar1.124857.28326@fwi.uva.nl> smagt@fwi.uva.nl (Patrick van der Smagt) writes:
   I'm looking for a program that can translate Pascal to C source code,
   pref. running under UNIX (sun4).  Any help would be very much
   appreciated.

There are two Pascal-to-C translators freely available that I know of.

One is called ptc, was written by Per Bergsten, and posted back in
1987, probably to what was called mod.sources then (?).  I have a
somewhat enhanced version available for ftp here, in
tik.vtt.fi:pub/ptc.  You might find the originally posted version,
plus a set of patches, from your favorite archive site.  Ptc handles
standard Pascal, with some small extensions.

Then there is p2c by Dave Gillepsie, posted to comp.sources.unix last
year (Volume 21, Issues 46--77 (yes, 32 parts)).  It has more features, for
example handles HP Pascal extensions (probably of no use to you).  P2c
should be available at various archive sites.

I have used ptc successfully to compile TeX, and can recommend it.
P2c also seems to be well written and tested, but I haven't used it.
--
Tor Lillqvist,
working, but not speaking, for the Technical Research Centre of Finland

leland@cs.columbia.edu (Lee Woodbury) (03/06/91)

In article <TML.91Mar4181753@hemuli.tik.vtt.fi> tml@tik.vtt.fi (Tor Lillqvist) writes:
>There are two Pascal-to-C translators freely available that I know of.
>
>One is called ptc, was written by Per Bergsten, and posted back in
>1987, probably to what was called mod.sources then (?).  I have a

The program itself was indeed called "ptc", but note that it was posted
to comp.sources.unix with the name "ptoc".  It's in Volume 10, 12 parts.

Leland Woodbury
-- 
ARPANET/INTERNET: leland@cs.columbia.edu
	  USENET: ...!columbia!cs.columbia.edu!leland
	  BITNET: leland%cs.columbia.edu@cuvmb
	  USMAIL: Columbia Univ., 457 CS, 500 W. 120 St., NYC 10027-6699

pl150789@mtecv2.mty.itesm.mx (Gabriel Almaguer) (03/06/91)

  Hi :  
     And turbo Pascal ==> C or turbo C


===============================================================================
      __________           __________                 
     /\ \\      \         /_\     \\ \       
    /  \ \\      \       /___\     \\ \   GABRIEL ALMAGUER GARZA   
   /    \ \\      \     /_____\     \\ \  pl150789@mtecv2.mty.itesm.mx   
  /      \ \\      \   /_______\     \\ \ pl150789@131.178.1.5   
 /        \ \\      \ /_________\     \\ \              
<          \ \\      \----/______>----->>->             
 \          \ \\      \--/______/     // /            
  \          \ \\      \/______/     // /                      
   \          \ \\      \_____/     // / MONTERREY N.L. MEXICO.     
    \          \ \\      \___/     // /                  
     \          \ \\      \_/     // /             
  ******************************************************************************
                  INGENIERIA EN SISTEMAS ELECTRONICOS.            
          INSTITUTO TECNOLOGICO DE ESTUDIOS SUPERIORES DE MONTERREY
                       CAMPUS MONTERREY                                   

dcurtis@crc.ac.uk (Dr. David Curtis) (03/06/91)

In article <1991Mar1.124857.28326@fwi.uva.nl> smagt@fwi.uva.nl (Patrick van der Smagt) writes:
>Hi,
>
>I'm looking for a program that can translate Pascal to C source code,
>pref. running under UNIX (sun4).  Any help would be very much
>appreciated.
>
>					
>						Patrick van der Smagt 

There is a public domain program to convert Turbo Pascal to Quick C
which was written by Glockenspiel (apparently sponsored by Microsoft).
It is available from the British public domain software collection
pdsoft@uk.ac.lancs but they don't like to mail stuff abroad. I've never
seen anyone else mention it, so I assume it is not available from many
other archives. How about suggesting to Simtel and Timo Salmi that they
start stocking it?


Dave Curtis

Academic Department of Psychiatry,    Janet:       dc@UK.AC.UCL.SM.PSYCH
Middlesex Hospital,                   Elsewhere:   dc@PSYCH.SM.UCL.AC.UK
Mortimer Street, London W1N 8AA.      EARN/Bitnet: dc%PSYCH.SM.UCL@UKACRL
Tel 071-636 8333 Fax 071-323 1459     Usenet: ...!mcsun!ukc!mrccrc!D.Curtis

daveg@near.cs.caltech.edu (Dave Gillespie) (03/06/91)

You can get p2c, my Pascal to C translator, from anonymous FTP on
csvax.cs.caltech.edu.  Or, you can get it from any comp.sources.unix
archive.  It can read many popular Pascal dialects including Sun Pascal,
Turbo Pascal, VAX Pascal, etc., and can generate ANSI or traditional C
code.  It also does a good job of formatting the output to be readable.

Patches for version 1.19 of p2c were just posted to comp.sources.unix.

                                                                -- Dave
--
Dave Gillespie
  256-80 Caltech Pasadena CA USA 91125
  daveg@csvax.cs.caltech.edu, ...!cit-vax!daveg

hleroy@irisa.fr (Hugues Leroy) (03/06/91)

try anonymous ftp from irisa.irisa.fr 
directory: ~ftp/pub/pascal-to-c

makefile.Z , ptc.p.Z, ptc.1.Z

======
source:

Copyright (C) 1987 by Per Bergsten, Gothenburg, Sweden
......
Several bugs were fixed by Claude Jard, Irisa Rennes, France 1988
======

eversole@acae037.cadence.com (Richard Eversole; x6239) (03/12/91)

-- 
I've used the Glockenspiel translator. It is not the greatest. It works but
it supplies it's own C versions of the Turbo Pascal functions. The problem
is there is no source for these functions. (At least not in the version
I got from Microsoft.)

The first 3 programs I tried to translate required extensive editing
before and after translation to get them to work.

It was such a bother to use that I almost would recommend hand translation.

I have not tried ptc or p2c.
  
  =====================================================================

    eversole@cadence.com