Index of /ldr199410/DISC2/LIVE/USR/DOC/P2C
Name Last modified Size Description
Parent Directory 19-Apr-2005 03:22 -
BASIC.DOC 01-Nov-1989 21:24 11k
BASIC.P 02-Nov-1989 02:15 65k
CREF.P 07-Nov-1989 06:42 11k
E.P 01-Nov-1989 18:13 2k
FACT.P 01-Nov-1989 18:14 1k
MAKEFILE 18-Sep-1992 19:14 1k
P2CRC 24-Apr-1991 05:30 1k
SELF.P 01-Nov-1989 19:20 1k
YMTRANS.TBL 06-Oct-1994 12:05 1k
This directory contains examples for "p2c", a Pascal to C translator.
"p2c" Copyright 1989, 1990, 1991 Free Software Foundation, Inc.
Written and maintained by: Dave Gillespie
256-80 Caltech
Pasadena CA 91125
daveg@csvax.cs.caltech.edu, cit-vax!daveg
Here are some sample programs you can run through p2c. The Makefile
for this directory knows how to translate and compile all programs.
The "c" subdirectory contains pre-translated files you can compare
with your p2c output. (The "c" subdirectory is present in the ftp
distribution only, not in the shar distribution.)
To translate only: make trans or just make
To translate and compile: make comp
These programs have been culled from various places around the Caltech
C.S. educational lab. All programs are by Dave Gillespie except as
noted, and are in the HP Pascal dialect.
fact.p The obligatory recursive factorial program. Try this
one first: "make fact.c" to translate, or "make fact"
to translate and compile.
e.p Program for computing "e" to high precision.
(Courtesy of Scott Hemphill.)
self.p A self-printing program in Pascal. Try translating,
running, and diff'ing the output with self.p.
cref.p A cross-referencer for Pascal programs. Enter source
file name(s), then a blank line, then output file name.
basic.p An interpreter for the Basic language, just for kicks!
See "basic.doc" for documentation.