[comp.sys.next] p2c for NeXT

kirchner@umn-cs.cs.umn.edu (Roger B. Kirchner) (07/30/90)

p2c, the Pascal to C translator by David Gillespie available from
csvax.cs.caltech.edu (as pub/p2c-1.18.tar.Z), can be compiled on a NeXT
by making one change to one file.

Scott Hess from Gustavus Adolphus located the problem and David Gillespie
suggested a more general fix.  The change may be incorporated in p2c-1.19.

The change (for p2c-1.18) is this:  In src/trans.h, change line 80 from

#ifdef BSD

to

#if defined(BSD) && !defined(__STDC__)


The C code generated by p2c is quite readable, and either old style or
ANSI C code can be generated.  p2c is not designed to be a Pascal
compiler, but it is sufficient for nonproduction programs.  Several
dialects of Pascal can be translated, including HP, Turbo 5.0, UCSD,
DEC VAX, Oregon Software Pascal/2, Macintosh Programmer's Workshop
and Sun/Berkeley Pascal.  Modula-2 syntax is also supported.

The command 'p2c prog.xxx' translates a Pascal program prog.xxx to prog.c.
Then 'cc prog.c -lp2c -lsys_s -o prog' translates prog.c to the executable
prog using the p2c library and the NeXT shared library.

One of the test programs is a neat little BASIC which Gillespie calls
Chipmunk BASIC!

Roger Kirchner
rkirchne@mathcs.carleton.edu

kirchner@umn-cs.cs.umn.edu (Roger B. Kirchner) (09/24/90)

p2c, David Gillespie's Pascal to C translator, can be obtained from
csvax.cs.caltech.edu in pub/p2c-1.18.tar.Z.

It compiles on the NeXT by changing line 80 of src/trans.h from
#ifdef BSD
to
#if defined(BSD) && !defined(__STDC__)

It translates many dialects of Pascal including Turbo, VAX, Sun/Berkeley.

Roger Kirchner
rkirchne@mathcs.carleton.edu