home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / prgramer / pascal2c / readme < prev    next >
Text File  |  1992-08-03  |  3KB  |  68 lines

  1.  
  2. This directory contains "p2c" version 1.20, a Pascal to C translator.
  3.  
  4. "p2c"  Copyright 1989, 1990, 1991  Free Software Foundation, Inc.
  5.  
  6. Written and maintained by:   Dave Gillespie
  7.                  256-80 Caltech
  8.                  Pasadena CA 91125
  9.                  daveg@csvax.cs.caltech.edu, cit-vax!daveg
  10.  
  11.  
  12. This program is distributed under the terms of the GNU License Agreement.
  13. See the file src/COPYING for details.
  14.  
  15. The GNU License Agreement restrictions do _not_ apply to code generated
  16. by p2c, nor to the p2c run-time files "p2clib.c" and "p2c.h".
  17.  
  18. The "examples" subdirectory contains a few sample Pascal programs and
  19. a Makefile to translate and compile them.
  20.  
  21. HP Pascal Workstation System users will want to copy all of .\hp\include
  22. into the p2c include directory (\emx\include), and copy all of .\HP\import
  23. into the p2c home directory (\emx\p2c).  You will have to write emulations
  24. for the functions you use out of these modules.
  25.  
  26.  
  27. !!!  Incomplete interface texts for standard Turbo units are           !!!
  28. !!!  included in turbo.imp.  Turbo users will have to flesh these      !!!
  29. !!!  out and write emulations for whatever parts of the Turbo runtime  !!!
  30. !!!  library they need.                                                !!!
  31.  
  32.  
  33. If you wish to edit various system-wide configuration parameters, it is
  34. better to put them in \emx\p2c\loc.p2c than in \emx\p2c\p2crc.  As an
  35. example, on a Turbo-oriented environment you may wish to add
  36.  
  37.     Language Turbo
  38.  
  39. to the \emx\p2c\loc.p2c file to replace the normal default (HP Pascal).
  40.  
  41.  
  42.  
  43. PORTABILITY
  44.  
  45. P2c was originally developed on a homebrew C compiler on the HP Pascal
  46. Workstation operating system.  Current development takes place on HP-UX,
  47. which is System V based.  The translator has also been compiled and used
  48. on Sun-3's, so presumably it is fairly portable among 32-bit Unix machines.
  49.  
  50. Many parts of the code will have to be adjusted in order for p2c to work
  51. on a machine with 16-bit ints.  I have never had reason or opportunity to
  52. track these down since I don't have access to such a machine.  Please note
  53. that code _generated_ by p2c works with either size of int even though p2c
  54. itself does not.
  55.  
  56. If your compiler supports ANSI prototypes, most of the 16-bit portability
  57. problems will go away except for possible %d/%ld sloppiness in sprintf control
  58. strings.  There may be places where p2c tries to cast a pointer into an
  59. int, but I believe all such cases use longs consistently.  You will have
  60. a problem if your long type is not large enough to store a pointer.
  61.  
  62. Because p2c was developed to run under Unix, it is sloppy about memory
  63. allocation.  Some data structures are allocated but never freed.  Profiles
  64. show that the waste is not too great in most cases, but if it is a problem
  65. you may have to write a garbage collector (this shouldn't be too hard if you
  66. only run the collector after translating each procedure).
  67.  
  68.