ptoc(1)

NAME
ptoc - PASCAL to C translator

SYNOPSIS
ptoc [options] file ...

DESCRIPTION
Ptoc is a PASCAL to C translator. All argument files ending with .p, will be translated into C code, which will be written in a file with the same basename and extension .c. Argument files ending in .P will be processed by the C preprocessor before being translated to C files.

The resulting C files may then be compiled with a C compiler and linked together with the runtime library -lsqlptc into an executable file.

The following options are recognized by ptoc:

-C  Compile code to produce runtime checks on array subscripts and assignments of ordinal types other than integer.

-Dname=def

-Dname
    Define the name to the C preprocessor, as if by `define'. If no definition is given, the name is defined as "1". (.P suffix files only.)

-d  Cause the control program ptoc to print out the invocation of the translator pgenc with all it's options and arguments.

-e  Enable '\' escape character in string constants; this escape character must be followed by a hex number, consisting of 2 hex digits, representing the code of the escaped character.

-fxx
    Fill local variables when entering a function with the byte pattern given by the hex number xx consisting of 2 hex digits.

-gxx
    Fill PASCAL FOR loop control variables when leaving the loop with the byte pattern given by the hex number xx consisting of 2 hex digits (the control variable will not be filled if the loop is left by a GOTO statement).

-Idir
    `#include' files whose names do not begin with `/' are always sought first in the directory of the file argument, then in directories named in -I options, then in directories on a standard list. (.P suffix files only.)

-Kb Break pointer types, i.e. pointers pointing to a type which is not used in the module are declared to be pointers to integers.

-Kd Disable delayed parameter copy, i.e. when this option is not specified value parameters of type array or set will be passed as pointers and only in the called function/procedure a copy of them will be made.

-Kt Disable deleting of unused types, i.e. when this option is not specified type declarations which are not referenced will not be output in the C code.

-Kv Disable deleting of unsused variables, i.e. when this option is not specified declarations of variables which are not referenced will not be output in the C code.

-l  Make a program listing during translation.

-O  Invoke a code optimizer. The optimizer sometimes significantly increases compile time and, under normal circumstances, should only be invoked when development of the program is complete. The optimizer attempts to detect all uses of and assignments to a program's variables. Programs that communicate via shared memory or invoke signal handlers that modify variables accessed elsewhere in the program are candidates for incorrect optimization. The optimizer should be used on any program where execution speed is important.

-qn Allocate bytes and shorts for subranges, enumerated types and sets as appropriate.

-s  Accept standard PASCAL source only. Non-standard constructs will cause error diagnostics.

-v  Print global optimization statistics.

-Wn Issue a warning for value parameters, which have a size greater than the decimal number n specified in the option.

-Xa Generate ANSI C function prototypes for PASCAL forward and external functions/procedures.

-Xc Generate symbolic constants instead of literal constants for PASCAL const definitions and enumerations.

-Xp Allow pointer expressions like those in the C language (i.e. <ptr> + <int>, <ptr> - <int> and <ptr> - <ptr>).

-Xx Generate static link structures for nested procedures in PASCAL; this option must be used if the PASCAL program contains nested functions/procedures in which non-local/non-global variables are referenced.

-ypc
    Special options to allow PASCAL extensions from Pyramid Technology Corp.; this option is especially used for the ptoc sources.

The following options are only used to produce debug output for ptoc and are not relevant for the ptoc user:

-W  Produce some debug output in the C source code.

-XD Print HDG node numbers in the generated C code.

-XH Print the HDG tree on standard output.

-Xi Inhibit the flushing of the debug output.

-XQ Produce debug output from the C code generator.

-XT Print the symbol table on standard output.

For all other options ptoc will issue a warning and ignore them. Also for any file name that doesn't have the suffix .p or .P a warning will be issued and the name will be ignored.

FILES

file.p
    pascal source files

/bin/ptoc
    control program

/lib/pgenc
    translator

/lib/how_pc
    basic usage explanation

/lib/libsqlptc.a
    runtime library

DOCUMENTATION
Targon Pascal.

Nixdorf Computer AG
Edition: 01.03.88, Order no. 10268.00.3.93-02

For a basic explanation, type:

          ptoc

LIMITATIONS

Non-local GOTO from PASCAL is not supported by ptoc.