home *** CD-ROM | disk | FTP | other *** search
- Welcome to the AMIGA version of P2C 1.20, the Pascal to C translator.
- The original distribution has been downloaded via FTP from
- 'csvax.cs.caltech.edu'. This version is a bit old but I haven't found a
- newer one.
-
- To use P2C on the AMIGA:
-
- *****************************************
- * SET YOUR STACK SIZE TO AT LEAST 30000 *
- *****************************************
-
- (If you want to know exactly how much stack size is needed use
- my program 'StackCheck' from Fish-disk 870. I don't know what the highest
- possible value is.)
-
- - Workbench 1.3 or higher and enough memory is required
-
- - Place the executable file 'P2C' and the shell scripts anywhere in
- your search path.
-
- - Ensure that the following files are found:
- P2C:home/p2crc
- P2C:home/loc.p2crc
- P2C:home/string.pas
- P2C:home/system.imp
- P2C:home/system.m2
- P2C:home/turbo.imp
- (for example with the command assign P2C: HD:P2C)
- the 'P2C:HP' - directory is normally not needed
-
- - Create a local 'p2crc' file according to your requirements. (See the file
- P2C:home/p2crc and the manual for more)
-
- - You can stop p2c by pressing CTRL-C. In some cases you have to wait a bit.
-
- - If you want to compile the created C files install the linker libraries
- and the include file 'p2c.h' so that your compiler can find them.
- (look in the directory 'Aztec' and 'GCC' for more)
- Users with other compilers have to create the linker library by
- themselves. Look at the makefiles and your compiler manual for more.
-
- - To use P2C as an ad hoc Pascal compiler enter:
- Pcompile.aztec Pascal-File Executable-File
- or
- Pcompile.GCC Pascal-File Executable-File
- while "Pascal-File" is your Pascal-Source and "Executable-File" is the
- name of the program to create
-
- - To get a printed manual:
- - set the printing style with your preferences program
- - enter the command:
- type P2C:src/p2c.cat >PRT:
- - NOTE: You have to set the correct page length at your printer if you
- are using fanfold paper.
-
- - To look at the manual on the screen enter:
- more P2C:src/p2c.cat
-
- Hints:
- ******
-
- - If you don't specify a Pascal file to translate 'p2c' will read it from the
- standard input. If you haven't redirected the standard input 'p2c' will read
- from the console. Press CTRL-\ to stop this. Then the created C file will be
- written to standard output.
-
- - With the default setup Pascal's 'rewrite' function will create a tempo-
- rary file if you don't specify a file name as a second argument of the
- 'rewrite' function. This temporary file will be deleted when the program
- finishes. If you set 'LiteralFiles' to 2 the file will not be deleted if
- it appears in the 'program' statement. The name of the FILE variable will
- be used as the file name. With this setting 'p2c' will be more closer
- to ISO standard Pascal.
-
-
- Implementation notes:
- *********************
-
- - P2C has been compiled with Aztec C 5.2a and all optimizations turned on.
- It should also compile with GNU C.
-
- - For the supplied example files this implementation creates exactly
- the same sources as the original version used by the author.
-
- - P2C has been tested with Mungwall but not with Enforcer. (I don't have
- access to a machine with MMU)
-
-
- Changes made to to the original distribution:
- *********************************************
-
- All the changes are surrounded by #ifdef's, therefore they will not be applied
- if you are not using an AMIGA to compile. You can easily find them in the
- source if you are searching for the words 'MCH_AMIGA' or 'AZTEC_C'.
-
- - Added the executables 'p2c', 'makeproto' and 'basic'.
-
- - The files 'makefile.aztec', 'makefile.GCC', 'Pcompile.aztec',
- 'Pcompile.GCC' and the directories 'Aztec' and 'GCC' are new.
-
- - The file 'p2c.cat' has been slightly modified to allow printing via PRT:
-
- - Modified the files 'p2c.h' and 'trans.h' to set EXIT_FAILURE to 20.
-
- - Modified the files 'trans.c', 'out.c' and 'makeproto.c' to replace exit(1)
- with exit(EXIT_FAILURE).
-
- - Modified the files 'p2clib.c' and 'p2c.h' to print error messages in the
- following situations: division by zero or other math errors, bus or
- address errors, illegal instructions and pressing CTRL-C. This will work
- with all programs created by 'p2c'. (currently only when Aztec C or GNU C
- is used)
-
- - The file 'trans.c' has been modified to avoid using the 'sbrk()'-function
- when GCC is used, to support Aztec's getenv() function which will
- release its buffer on the next getenv() call, to support AMIGA pathnames
- and to print a message when CTRL-C is pressed.
-
- - The file 'out.c' has been modified to avoid an error message from the Aztec
- compiler.
-
- - Removed the files 'p2c.proto' and 'p2c.hdrs', they will be created by
- makeproto.
-
- - The 'home'-directory contains now all the files that are needed when P2C is
- invoked.
-
- - Removed the C source files for the example Pascal files, you can create
- them with P2C. (Note that the local 'p2crc' file from the examples directory
- is needed to create 'basic.c' correctly)
-
- - Added some options to the local 'p2crc' file in the 'examples' directory
-
- - Added some hacks to 'basic.p' to allow interrupting BASIC programs by
- pressing CTRL-C.
-
-
- My address:
- ***********
-
- Günther Röhrich
- Lerchenbergstr. 4
- 73733 Esslingen
- Germany
-
- (Note that I can only answer to questions that are specific to the AMIGA
- implementation. See the file 'README' on how to contact the original author.)
-