Dec 312017
 
EMX 0.8f GNU GCC 2.3.3 for OS/2, p2c Pascal front-end for GCC, gives Pascal programmers a 32bit developent system and programming power [ optional module for EMX ].
File P2C4OS2.ZIP from The Programmer’s Corner in
Category OS/2 Files
EMX 0.8f GNU GCC 2.3.3 for OS/2, p2c Pascal front-end for GCC, gives Pascal programmers a 32bit developent system and programming power [ optional module for EMX ].
File Name File Size Zip Size Zip Type
DISTRIB 0 0 stored
EXAMPLES 0 0 stored
BASIC.DOC 11758 4020 deflated
BASIC.P 68823 9791 deflated
C 0 0 stored
CREF.P 11639 2010 deflated
BASIC.C 55744 10115 deflated
CREF.C 8085 2416 deflated
E.C 2804 841 deflated
FACT.C 471 295 deflated
SELF.C 1631 767 deflated
E.P 2542 659 deflated
FACT.P 326 177 deflated
MAKEFILE 845 370 deflated
P2CRC 849 464 deflated
README 1418 717 deflated
SELF.P 1123 384 deflated
HP 0 0 stored
IMPORT 0 0 stored
ASM.IMP 1377 460 deflated
FS.IMP 5006 1214 deflated
GENERAL0.IMP 965 334 deflated
GENERAL1.IMP 666 278 deflated
GENERAL2.IMP 932 315 deflated
GENERAL3.IMP 243 187 deflated
GENERAL4.IMP 2028 464 deflated
HPIB_0.IMP 806 329 deflated
HPIB_1.IMP 1406 436 deflated
HPIB_2.IMP 1539 453 deflated
HPIB_3.IMP 1224 412 deflated
IODECL.IMP 11661 2191 deflated
MISC.IMP 2554 977 deflated
RND.IMP 228 155 deflated
SYSDEVS.IMP 16059 4929 deflated
SYSGLOBA.IMP 13342 4508 deflated
INCLUDE 0 0 stored
ASM.H 1717 505 deflated
FS.H 4552 1090 deflated
GENERAL0.H 861 331 deflated
GENERAL1.H 720 285 deflated
GENERAL2.H 894 298 deflated
GENERAL3.H 370 211 deflated
GENERAL4.H 1541 423 deflated
HPIB_0.H 460 226 deflated
HPIB_1.H 741 294 deflated
HPIB_2.H 970 324 deflated
HPIB_3.H 688 284 deflated
IODECL.H 6347 1705 deflated
MISC.H 2942 998 deflated
RND.H 176 94 deflated
SYSDEVS.H 12734 4176 deflated
SYSGLOBA.H 9063 3487 deflated
OS2 0 0 stored
COPYING 12737 4815 deflated
EMX.DLL 27730 14869 deflated
LIBP2C.A 7804 4050 deflated
LOC.P2C 142 111 deflated
P2C.DOC 52366 17954 deflated
P2C.EXE 396093 183179 deflated
P2C.H 13994 3906 deflated
P2CRC 81845 20194 deflated
README 2767 1294 deflated
STRING.PAS 1852 532 deflated
SYSTEM.IMP 3910 1029 deflated
SYSTEM.M2 849 354 deflated
TURBO.IMP 9726 2658 deflated
README 2932 1446 deflated
README.OS2 5526 2024 deflated
SRC 0 0 stored
CITMODS.C 32572 5858 deflated
COMMENT.C 10086 3168 deflated
COPYING 12737 4815 deflated
DECL.C 150022 29938 deflated
DIR.C 5521 2112 deflated
EXPR.C 148888 25571 deflated
FUNCS.C 149486 23620 deflated
HISTORY 27064 9240 deflated
HPMODS.C 3322 1112 deflated
LEX.C 90771 16893 deflated
LOC.P2C 142 111 deflated
LOCP2CLB.C 191 152 deflated
MAKEFILE 3372 1362 deflated
MAKEPROT.C 16898 3420 deflated
NOTES 33543 9725 deflated
OUT.C 37154 9773 deflated
P2C.CAT 85750 20213 deflated
P2C.H 13994 3906 deflated
P2C.HDR 32797 5295 deflated
P2C.MAN 49075 16868 deflated
P2C.PRO 20439 3182 deflated
P2CLIB.C 19244 5398 deflated
PARSE.C 130777 25607 deflated
PEXPR.C 113222 18536 deflated
README 3094 1460 deflated
STRING.PAS 1852 532 deflated
STUFF.C 14372 3769 deflated
SYS.P2C 81845 20194 deflated
SYSTEM.IMP 3910 1029 deflated
SYSTEM.M2 849 354 deflated
TAGS 34708 11840 deflated
TRANS.C 43216 9765 deflated
TRANS.H 82140 20132 deflated
TURBO.IMP 9726 2658 deflated

Download File P2C4OS2.ZIP Here

Contents of the README file



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
[email protected], 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.

To translate only: nmake trans or just nmake
To translate and compile: nmake 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.


This directory contains "p2c", a Pascal to C translator for OS/2 v 2.0.

"p2c" Copyright 1989, 1990, 1991 Free Software Foundation, Inc.

Written and maintained by: Dave Gillespie
256-80 Caltech
Pasadena CA 91125
[email protected], cit-vax!daveg

Ported to OS/2 by : Bernt Karasch
Ruhr-Universitaet Bochum
Institut fuer Mineralogie
Universitaetsstrasse 150
W-4630 Bochum 1
Federal Republic of Germany
[email protected]


This program is distributed under the terms of the GNU License Agreement.
See the file src/COPYING for details.

The GNU License Agreement restrictions do _not_ apply to code generated
by p2c, nor to the p2c run-time files "p2clib.c" and "p2c.h".


The file "system.imp" contains declarations for "predefined" functions
like "sqrt". These generally have custom translation code in funcs.c.
Functions with irregular syntaxes have their symbol table entries built
directly in funcs.c; they do not appear here. The default p2crc
(\emx\p2c\p2crc) causes p2c to read system.imp at the beginning of every job.

The file "system.m2" contains declarations for predefined Modula-2
functions. It should be substituted for "system.imp" when translating
Modula-2 programs.

The file "turbo.imp" contains declarations for all the Turbo Pascal
standard units like dos and crt. (These are very incomplete at
present.) The default p2crc (\emx\p2c\p2crc) causes p2c to read
turbo.imp as soon as any Turbo standard unit is used.

The file "string.pas" implements the Oregon Software dynamic strings
package. These are translated pretty completely into native C strings
using only the FuncMacro mechanism of p2c---no custom C code was
written to support these functions.

NO WARRANTY:
The program in this directory was developed for internal use at
Caltech and thus absolutely no guarantee is made that the program
will compile or run on other systems or that it will produce correct
code. P2c is _not_ a compiler, it is a translator; it strives to
produce correct code but reserves the right to sacrifice correctness
in extreme cases for readability in the general case. P2c is designed
to be extended (see funcs.c, hpmods.c and citmods.c for examples), but
some of the main code is pretty messy since the translator has grown
considerably beyond its original planned scale. Bug reports are
welcome at [email protected], but I may not have time to respond
to them immediately. Suggestions are welcome, too!


This directory contains "p2c" version 1.20, 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
[email protected], cit-vax!daveg


This program is distributed under the terms of the GNU License Agreement.
See the file src/COPYING for details.

The GNU License Agreement restrictions do _not_ apply to code generated
by p2c, nor to the p2c run-time files "p2clib.c" and "p2c.h".

The "examples" subdirectory contains a few sample Pascal programs and
a Makefile to translate and compile them.

HP Pascal Workstation System users will want to copy all of .\hp\include
into the p2c include directory (\emx\include), and copy all of .\HP\import
into the p2c home directory (\emx\p2c). You will have to write emulations
for the functions you use out of these modules.


!!! Incomplete interface texts for standard Turbo units are !!!
!!! included in turbo.imp. Turbo users will have to flesh these !!!
!!! out and write emulations for whatever parts of the Turbo runtime !!!
!!! library they need. !!!


If you wish to edit various system-wide configuration parameters, it is
better to put them in \emx\p2c\loc.p2c than in \emx\p2c\p2crc. As an
example, on a Turbo-oriented environment you may wish to add

Language Turbo

to the \emx\p2c\loc.p2c file to replace the normal default (HP Pascal).



PORTABILITY

P2c was originally developed on a homebrew C compiler on the HP Pascal
Workstation operating system. Current development takes place on HP-UX,
which is System V based. The translator has also been compiled and used
on Sun-3's, so presumably it is fairly portable among 32-bit Unix machines.

Many parts of the code will have to be adjusted in order for p2c to work
on a machine with 16-bit ints. I have never had reason or opportunity to
track these down since I don't have access to such a machine. Please note
that code _generated_ by p2c works with either size of int even though p2c
itself does not.

If your compiler supports ANSI prototypes, most of the 16-bit portability
problems will go away except for possible %d/%ld sloppiness in sprintf control
strings. There may be places where p2c tries to cast a pointer into an
int, but I believe all such cases use longs consistently. You will have
a problem if your long type is not large enough to store a pointer.

Because p2c was developed to run under Unix, it is sloppy about memory
allocation. Some data structures are allocated but never freed. Profiles
show that the waste is not too great in most cases, but if it is a problem
you may have to write a garbage collector (this shouldn't be too hard if you
only run the collector after translating each procedure).


This directory contains "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
[email protected], cit-vax!daveg


This program is distributed under the terms of the GNU License Agreement.
See the file src/COPYING for details.

The GNU License Agreement restrictions do _not_ apply to code generated
by p2c, nor to the p2c run-time files "p2clib.c" and "p2c.h".



The file "trans.c" includes an overview of the source files of p2c.
All p2c source files include the header "trans.h".

The file "dir.c" is intended to be modified by the user to install
code for custom translations of certain procedures. To add your own
custom code to p2c, modify CUSTSRCS and CUSTDEFS in the Makefile,
then recompile dir.c.

The file "system.imp" (copied to %H/system.imp) contains declarations
for "predefined" functions like "sqrt". These generally have custom
translation code in funcs.c. Functions with irregular syntaxes have
their symbol table entries built directly in funcs.c; they do not
appear here. The default sys.p2crc causes p2c to read system.imp at
the beginning of every job.

The file "system.m2" contains declarations for predefined Modula-2
functions. It should be substituted for "system.imp" when translating
Modula-2 programs.

The file "turbo.imp" contains declarations for all the Turbo Pascal
standard units like dos and crt. (These are very incomplete at
present.) The default sys.p2crc causes p2c to read turbo.imp as
soon as any Turbo standard unit is used.

The file "string.pas" implements the Oregon Software dynamic strings
package. These are translated pretty completely into native C strings
using only the FuncMacro mechanism of p2c---no custom C code was
written to support these functions.

The file "NOTES" contains the author's current bugs-and-plans list.
The file "HISTORY" contains the revision history of the program.

The "makeproto" program is an independent utility for scanning a large
C program with old-style declarations and building function prototypes
for all its functions. The "trans.h" file #includes the prototype
files for all of p2c.


NO WARRANTY:
The program in this directory was developed for internal use at
Caltech and thus absolutely no guarantee is made that the program
will compile or run on other systems or that it will produce correct
code. P2c is _not_ a compiler, it is a translator; it strives to
produce correct code but reserves the right to sacrifice correctness
in extreme cases for readability in the general case. P2c is designed
to be extended (see funcs.c, hpmods.c and citmods.c for examples), but
some of the main code is pretty messy since the translator has grown
considerably beyond its original planned scale. Bug reports are
welcome at [email protected], but I may not have time to respond
to them immediately. Suggestions are welcome, too!



 December 31, 2017  Add comments

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)