home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / PASCAL / PTOC.ZIP / PTC.MAN < prev    next >
Encoding:
Text File  |  1988-02-20  |  2.0 KB  |  66 lines

  1.  
  2.                                PTC(1)
  3.  
  4.  
  5. NAME
  6.      ptc - Pascal to C translator
  7.  
  8. SYNOPSIS
  9.      ptc < pascal source > c source
  10.  
  11. DESCRIPTION
  12.      Ptc reads a correct Pascal    program    and prints a C program
  13.      with the same behaviour.  It is intended as a tool    for tran-
  14.      sporting finished applications to environments that lack
  15.      Pascal compilers, it is not intended for program develop-
  16.      ment.
  17.  
  18.      The input should comply with the ISO level    0 Pascal defini-
  19.      tion.  Two    common Pascal extensions are also recognized: the
  20.      keyword otherwise may be used for default entries in case-
  21.      statements, the keyword external may be used in place of the
  22.      forward directive to signify that a procedure or function is
  23.      defined in    a library.  Furthermore, the translator    does not
  24.      require a complete    Pascal program,    a consistent subset of
  25.      declarations can be translated.  Thus a primitive module
  26.      concept is    supported.
  27.  
  28. SEE ALSO
  29.      Ptc implementation    notes.
  30.  
  31. CAVEATS
  32.      The quality of an object program is of course highly depen-
  33.      dent on the C compiler that processes the translated code.
  34.      Arithmetic    operations are sometimes implemented in    a way
  35.      that is incompatible with the Pascal definition.  For exam-
  36.      ple, the translator assumes that:
  37.  
  38.       a := b mod c
  39.  
  40.      can be accurately translated into
  41.  
  42.       a = b    % c
  43.  
  44.      but that may not be true if c is negative.     A check on the
  45.      characteristics of    integer    and float arithmetic is    strongly
  46.      recommended.
  47.  
  48.      Some Pascal constructs are    impossible to express in C.  The
  49.      translator    will not object    to:
  50.  
  51.       type ptr = ^ ptr;
  52.  
  53.      but a C-compiler may balk at the resulting:
  54.  
  55.       typedef   ptr    * ptr;
  56.  
  57. BUGS
  58.      The program can't translate comments from Pascal to C.
  59.  
  60.      The translator does not do    complete typechecking so a Pascal
  61.      program that isn't    formally correct may cause malfunction.
  62.  
  63.      Passing a procedure as parameter to an enclosing recursive
  64.      procedure may produce erroneous code (see the implementation
  65.      notes).
  66.