home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / LANGUAGES / p2c.lha / p2crc.small < prev    next >
Text File  |  1993-03-06  |  15KB  |  379 lines

  1. Debug                            # Level of debugging output
  2. DoubleReals 1                    # 1=convert Pascal real to C double
  3.  
  4. ExternWords   external            # Words analogous to "forward" for declaring
  5. ExternWords      extern            # procedures or functions external.
  6. ExternWords      fortran
  7.  
  8. CExternWords  nonpascal            # Words like ExternWords but for which any
  9. CExternWords                    # leading and/or trailing "_" is removed
  10. CExternWords                    # from the Pascal function/variable names.
  11.  
  12.  
  13. # TARGET LANGUAGE
  14.  
  15. AnsiC 2                         # 2=use GNU C language extensions
  16.  
  17. C++ 0                            # 0=use straight C,
  18.  
  19. Void* 1                         # 1=use "void *" for anyptr's
  20.  
  21. HasSignedChar 1                 # 1="signed char" and "signed int" are legal
  22.  
  23.  
  24. # TARGET MACHINE
  25.  
  26. SignedChar 0                    # 1=char is signed, 0=char is unsigned,
  27.  
  28. SignedField                     # default=don't know but probably signed
  29.  
  30. SignedShift                     # default=don't know but probably signed
  31.  
  32. CharSize 8                        # size in bits of a char, default at least 8
  33. ShortSize 16                    # size in bits of a short, default at least 16
  34. IntSize 32                        # size in bits of an int, default at least 16
  35. LongSize 32                     # size in bits of a long, default at least 32
  36. PtrSize 32                        # size in bits of a pointer.  If not all
  37.                                 # pointers have same size, must leave blank.
  38. FloatSize 32                    # size in bits of a float
  39. DoubleSize 64                    # size in bits of a double
  40. EnumSize                        # size in bits of an enum
  41.  
  42. Size_T_Long                     # default=don't know, probably long
  43.  
  44.  
  45. # INDENTATION
  46.  
  47. PhysTabSize 4                    # Spacing of tab-character tabs; default=8.
  48.  
  49. Indent +4                        # Basic indentation delta; default=+2.
  50.  
  51. CaseIndent -4                    # Indentation delta for case labels; applied
  52.  
  53.  
  54. ExtraInitIndent +4                # Indentation delta for nested struct/array
  55.  
  56.  
  57. # LINE BREAKING
  58.  
  59. LineWidth 240                   # Target max output line width; default=78.
  60.  
  61. MaxLineWidth 250                # Absolute max output line width; default=90.
  62.  
  63. OneSpecialArg    printf            # List of functions like printf for which the
  64. OneSpecialArg                    # first argument is "special", remaining args
  65. OneSpecialArg                    # are uniform.
  66.  
  67. TwoSpecialArgs    sprintf         # List of functions like fprintf for which the
  68. TwoSpecialArgs    fprintf         # first two arguments are "special".
  69.  
  70.  
  71. # COMMENTS AND BLANK LINES
  72.  
  73.  
  74. # SPECIAL COMMENTS
  75.  
  76. FixedComment        FIXED        # Comment for fixed upper limit of FOR loops:
  77.  
  78. PermanentComment    PERMANENT    # Comment for permanently imported modules,
  79.  
  80. InterfaceComment    INTF-ONLY    # Comment for include files which are to be
  81.  
  82. EmbedComment        EMBED        # Comment for embedded C code in Pascal:
  83.  
  84. SkipComment            SKIP        # Comment for code to skip in p2c only:
  85.  
  86. NoSkipComment        NOSKIP        # Comment for code to skip except in p2c:
  87.  
  88. SignedComment        SIGNED    # Type annotation: var c : {SIGNED} char;
  89.  
  90. UnsignedComment        UNSIGNE    # Type annotation: type uc = {UNSIGNED} char;
  91.  
  92.  
  93. # STYLISTIC OPTIONS
  94.  
  95.  
  96. # NAMING CONVENTIONS
  97.  
  98. CodeFileName      %Rs.c         # Name of .c output file for a program,
  99.                                 # %s=input file name.
  100.  
  101. ModuleFileName      %_S.c         # Name of .c output file for a module,
  102.                                 # %s=input file name, %S=module name.
  103.  
  104. HeaderFileName      %_S.h         # Name of .h output file for a module,
  105.                                 # %s=input file name, %S=module name.
  106.  
  107. HeaderFileName2                 # If defined, different format to use when
  108.                                 # generating #include's, otherwise same.
  109.                                 # May be quoted as in IncludeFrom.
  110.  
  111. LogFileName       %RS.log        # Name of log file name for -V mode.
  112.                                 # %s=input file name, %S=output file name.
  113.  
  114. IncludeFileName                 # Format for translating Pascal include-file
  115.                                 # names.
  116.  
  117. ReturnValueName   Result        # Return value holding variable; [%s=func name]
  118. UnitInitName      _%s_init        # Turbo Pascal unit initializer; %s=unit name
  119. HSymbolName       %s_H            # Name of "_H" symbol, if any; %s=unit name
  120. GSymbolName       %s_G            # Name of "_G" symbol; [%s=unit name]
  121. StringMaxName      MAX_%s        # VAR STRING hidden variable; %s=param name
  122. ArrayMinName      %s_LOW        # Lower bound hidden variable; %s=param name
  123. ArrayMaxName      %s_HIGH        # Upper bound hidden variable; %s=param name
  124. CopyParName       %s_            # Alternate name for parameter %s
  125. StaticLinkName      LINK            # Static link parameter name; [%s=func name]
  126. LocalVarsStruct   LOC_%s        # Name of struct type for locals; %s=func name
  127. LocalVarsName      V             # Name of struct var for locals; [%s=func name]
  128. FwdStructName      %s            # Name of forward-used structs; %s=type name
  129.                                 # (may simply be %s if you don't mind confusion)
  130. EnumListName      %s_NAMES        # Name of array to hold names for enum %s
  131. UnionName          UU            # Name of variant union
  132. UnionPartName      %s            # Name of variant element; %s=tag value name
  133. FakeStructName      _REC_%s        # Name of "temporary" structs; %s=base name
  134. LabelName          _L%s            # Name of GOTO label; %s=label name
  135. LabelVarName      _JL%s            # Name of GOTO label jmp_buf variable; %s=label
  136. TempName          TEMP%s        # Name of general temporary vars; %s=unique id
  137. DummyName          DUMMY%s        # Name of throwaway "dummy" vars; %s=unique id
  138. WithName          WITH%s        # Name of WITH statement temp ptr; %s=unique id
  139. ForName           FORLIM%s        # Name of FOR statement temp limit; %s=unique id
  140. PtrName           PTR%s         # Name of NIL-checking temp ptr; %s=unique id
  141. StringName          STR%s         # Name of temporary string vars; %s=unique id
  142. SetName           SET%s         # Name of temporary set vars; %s=unique id
  143. FNVarName          %s_NAME        # Name of file-name vars; %s=file var
  144. FNSizeName          _FNSIZE        # Maximum length of file name (macro or integer)
  145.  
  146. AlternateName1      %s_            # Way to produce a second C symbol for a Pascal
  147.                                 # symbol, where original symbol was %s.  Default
  148.                                 # is to use AlternateName with %d=1.
  149.  
  150. AvoidName          getc            # If any of these names appear in the code,
  151. AvoidName          putc            # use an alternate name so as to avoid
  152. AvoidName          getchar        # library conflicts.
  153. AvoidName          putchar
  154. AvoidName          feof            # These are typically macro names whose use
  155. AvoidName          ferror        # would be disasterous under any
  156. AvoidName          clearerr        # circumstances.
  157. AvoidName          fileno
  158. AvoidName          BUFSIZ    NULL    EOF
  159. AvoidName          stdin     stdout    stderr
  160. AvoidName          true false assert
  161. AvoidName          Anyptr Void Char PP PV
  162. AvoidName          Signed Const Volatile Register Static Local Inline
  163. AvoidName          cdecl far near huge
  164. AvoidName          isalpha isupper islower isdigit isxdigit isspace ispunct
  165. AvoidName          isalnum isprint isgraph iscntrl isascii toascii
  166. AvoidName          toupper tolower
  167. AvoidName            LINK SEXT
  168.  
  169. AvoidGlobalName   fopen         # These names should be avoided in global
  170. AvoidGlobalName   fclose        # contexts, but they are okay as local names.
  171. AvoidGlobalName   fseek
  172. AvoidGlobalName   exit        main
  173. AvoidGlobalName   strcpy    strcat
  174. AvoidGlobalName   printf    fprintf sprintf
  175. AvoidGlobalName   scanf     fscanf    sscanf
  176. AvoidGlobalName   malloc    realloc free
  177. AvoidGlobalName   y0 y1 yn j0 j1 jn    # from math.h -- urghhh!
  178.                                 # ... we should define lots more of these!
  179.  
  180.  
  181. # TARGET LIBRARY
  182.  
  183. IncludeFrom iodeclarations <p2c/iodecl.h>
  184. IncludeFrom system
  185. IncludeFrom printer
  186. IncludeFrom dos
  187. IncludeFrom crt
  188.  
  189. ImportFrom    system            %H/turbo.imp
  190. ImportFrom    printer            %H/turbo.imp
  191. ImportFrom    dos                %H/turbo.imp
  192. ImportFrom    crt                %H/turbo.imp
  193. ImportFrom    graph            %H/turbo.imp
  194.  
  195. ImportDir    %_s.pas             # Search list of other places to look for
  196. ImportDir    %_s.text            # the module named %s.
  197. ImportDir    %H/%_s.imp
  198.  
  199. IncludeDir    %_s                 # Search list of places to look for the
  200. IncludeDir    %_s.pas             # Pascal include file %s.
  201. IncludeDir    %_s.text
  202. IncludeDir    %H/%_s.pas
  203.  
  204. LibraryFile %H/system.imp        # Names of import-text files to search
  205. LibraryFile                     # always (as if "-s name" were used).
  206.  
  207. StructFunction      sprintf        # Names of "structured functions".
  208. StructFunction      memcpy  memmove
  209. StructFunction      strcpy    strsub     strrtrim     strrpt
  210. StructFunction      P_addset    P_addsetr  P_remset
  211.  
  212. StrlapFunction      P_setunion    # Names of "structured functions" which
  213. StrlapFunction      P_setint        # allow duplication of their arguments.
  214. StrlapFunction      P_setdiff
  215. StrlapFunction      P_setxor
  216. StrlapFunction      P_expset      strlower     strupper    strpad
  217.  
  218. NoSideEffects      strcmp memcmp # Names of functions which have absolutely
  219.  
  220. Deterministic      abs sin cos    # Names of functions which satisfy all
  221.  
  222. HeaderName          <p2c/p2c.h>    # Name of standard p2c header file
  223.  
  224. UCharName          uchar         # Name of a typedef for "unsigned char";
  225.                                 # default="char" or "unsigned char".
  226.  
  227. SCharName          schar         # Name of a typedef for "signed char";
  228.                                 # default="char" or "signed char".
  229.  
  230. BooleanName       boolean        # Name of a typedef for booleans; default=char.
  231.  
  232. TrueName          true            # Name of a boolean "true" constant (optional)
  233. FalseName          false         # Name of a boolean "false" constant (opt.)
  234.  
  235. NullName          NULL            # Name of a NULL pointer constant
  236.  
  237. ProcTypeName      _PROCEDURE    # Name of procedure-pointer typedef
  238.  
  239. EscapeCodeName      P_escapecode    # Names of error-handling variables
  240. IOResultName      P_ioresult
  241.  
  242. ArgCName          P_argc        # Name of global copy of argc
  243. ArgVName          P_argv        # Name of global copy of argv
  244.  
  245. MainName          PASCAL_MAIN    # Name of program setup function
  246.  
  247. EscapeName          _Escape        # Name of error-generation function
  248.  
  249. EscIOName          _EscIO        # Name of I/O-error-generation function
  250.  
  251. CheckIOName       _CHKIO        # Name of I/O-error-checking function
  252.  
  253. SetIOName          _SETIO        # Name of I/O-error-setting function
  254.  
  255. FileNotFoundName  FileNotFound    # Name or number of "File Not Found" ioresult
  256.  
  257. FileNotOpenName   FileNotOpen    # Name or number of "File Not Open" ioresult
  258.  
  259. FileWriteErrorName FileWriteError # Name of num of "File Write Error" ioresult
  260.  
  261. BadInputFormatName BadInputFormat # Name or num of "Bad Input Format" ioresult
  262.  
  263. EndOfFileName      EndOfFile     # Name or number of "End of File" ioresult
  264.  
  265. OutMemName          _OutMem        # Name of out-of-memory error function
  266.  
  267. CaseCheckName      _CaseCheck    # Name of case-out-of-range error function
  268.  
  269. NilCheckName      _NilCheck    # Name of nil-pointer error function
  270.  
  271. AbsName           abs            # Name of function for computing ABS of a
  272.  
  273. SwapName          _swap         # Name of Turbo-like swap() function.
  274.  
  275. StrCICmpName      strcicmp        # Name of a strcicmp-like function; no default
  276. StrSubName          strsub        # Name of a strsub-like function; no default
  277. StrPosName          strpos2        # Name of a strpos2-like function; no default
  278. StrDeleteName      strdelete     # Name of a strdelete-like function; no default
  279. StrInsertName      strinsert     # Name of a strinsert-like function; no default
  280. StrMoveName      strmove        # Name of a strmove-like function; no default
  281. StrLTrimName      strltrim        # Name of a strltrim-like function; no default
  282. StrRTrimName      strrtrim        # Name of a strrtrim-like function; no default
  283. StrRptName          strrpt        # Name of a strrpt-like function; no default
  284. StrPadName          strpad        # Name of a pad-like function; no default
  285.  
  286. MallocName          Malloc        # Name of a malloc-like function; default=malloc
  287. FreeName          Free            # Name of a dispose-like function; default=free
  288. FreeRvalueName      FreeR         # Name of a free-like function; default=free
  289.  
  290. RandRealName      _randreal     # Name of a Turbo "random" function; no default
  291. RandIntName       _randint        # Name of a Turbo "random()" function; no def
  292. RandomizeName      _randomize    # Name of a Turbo "randomize" procedure
  293.  
  294. SkipSpaceName      _skipspaces    # Name of a Turbo seekeof/seekeoln skipper
  295.  
  296. EofName           P_eof         # Name of "feof" with Pascal semantics.
  297. EolnName          P_eoln        # Name of "eoln" function.
  298. FilePosName       ftell         # Name of "filepos" function.
  299. MaxPosName          P_maxpos        # Name of "maxpos" function.
  300.  
  301. SetUnionName      P_setunion    # Name of a set "+" function; no default
  302. SetIntName          P_setint        # Name of a set "*" function; no default
  303. SetDiffName       P_setdiff     # Name of a set "-" function; no default
  304. SetXorName          P_setxor        # Name of a set "/" function; no default
  305. SetInName          P_inset        # Name of a set "IN" function; no default
  306. SetAddName          P_addset        # Name of a set "a:=a+[x]" function; no default
  307. SetAddRangeName   P_addsetr     # Name of a set "a:=a+[x..y]" function; no def
  308. SetRemName          P_remset        # Name of a set "a:=a-[x]" function; no default
  309. SetEqualName      P_setequal    # Name of a set "=" function; no default
  310. SubSetName          P_subset        # Name of a set "<=" function; no default
  311. SetCopyName       P_setcpy        # Name of a set ":=" function; no default
  312. SetExpandName      P_expset        # Name of small-set-to-set expander; no default
  313. SetPackName       P_packset     # Name of set-to-small-set packer; no default
  314.  
  315. SignExtendName      SEXT            # Name of macro to sign-extend a number.
  316.  
  317. GetBitsName       *P_getbits_%s # Name of family of array-unpacking functions.
  318.                                 # Precede name with '*' if a macro.  %s will
  319.                                 # expand to S (for signed) or U (for unsigned),
  320.                                 # followed by B (big array) or S (small array).
  321.  
  322. PutBitsName       *P_putbits_%s # Name of family of functions which 'OR' a
  323.                                 # value into an element of a packed array.
  324.                                 # %s expands to S or U, followed by B or S.
  325.                                 # Use '*' if macro.  Default=use StoreBits.
  326.  
  327. ClrBitsName       *P_clrbits_%s # Name of family of functions which zero an
  328.                                 # element of a packed array.  %s expands
  329.                                 # to B or S only.  Use '*' if macro.
  330.                                 # Default=use StoreBits.
  331.  
  332. StoreBitsName                    # Name of a family of functions or macros
  333.                                 # which act just like PutBits, but overwrite
  334.                                 # the array element rather than OR'ing.
  335.                                 # Default=use ClrBits followed by PutBits.
  336.                                 # At least StoreBits or both PutBits and
  337.                                 # ClrBits must be defined.
  338.  
  339. DeclBufName        FILEBUF        # Name of a macro for declaring the file
  340.                                 # buffer for a file using GET and PUT.
  341.  
  342. DeclBufNCName                    # Name of a DeclBufName-like macro with two
  343.                                 # arguments (no storage class), in case your
  344.                                 # compiler can't handle null macro arguments.
  345.  
  346. ResetBufName       RESETBUF     # Name of a macro for setting up a file
  347.                                 # buffer in "read" mode.  (For RESET.)
  348.  
  349. SetupBufName       SETUPBUF        # Name of a macro for setting up a file
  350.                                 # buffer in read/write mode.  (For OPEN, SEEK.)
  351.  
  352. GetFBufName        GETFBUF        # Name of a macro for accessing a file
  353.                                 # buffer using "file^" notation.
  354.  
  355. GetName            GET            # Name of a macro for advancing
  356.                                 # to the next element of an input file.
  357.  
  358. PutFBufName        PUTFBUF        # Name of a macro for storing an element
  359.                                 # of a file using "file^" notation.
  360.  
  361. PutName            PUT            # Name of a macro for advancing
  362.                                 # to the next element of an output file.
  363.  
  364. CharGetFBufName    P_peek        # A special GetFBuf for text and files of char.
  365.  
  366. CharGetName        getc         # A special Get for text and files of char.
  367.  
  368. CharPutFBufName    CPUTFBUF     # A special PutFBuf for text and files of char.
  369.  
  370. CharPutName        CPUT         # A special Put for text and files of char.
  371.  
  372. ArrayGetFBufName   AGETFBUF        # A special GetFBuf for files of arrays.
  373.  
  374. ArrayGetName                    # A special Get for files of arrays.
  375.  
  376. ArrayPutFBufName   APUTFBUF        # A special PutFBuf for files of arrays.
  377.  
  378. ArrayPutName                    # A special Put for files of arrays.
  379.