home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / TP6SB.ZIP / TP6SB.DOC < prev    next >
Encoding:
Text File  |  1993-01-15  |  7.1 KB  |  244 lines

  1. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  2. █ TP6SB 1.01 █
  3. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  4.  
  5. TP6SB 1.01 is a Source Butifier for Turbo Pascal (up to Version 6.0)
  6. sources. Use it only on your own risk!
  7. Please report all bugs and comments to the author:
  8.  
  9.        Jozsef Ferincz
  10.        Bleibtreustr. 32
  11.        D-1000 Berlin 15
  12.        Germany
  13.  
  14.        Phone:  +49 30 8835822
  15.        E-Mail: ferincz@chemie.fu-berlin.de
  16.                ferincz@fub.uucp
  17.  
  18. TP6SB is NOT a FreeWare. You may try it for 21 days before registering.
  19.  
  20. Turbo Pascal is a trademark of Borland International.
  21.  
  22.  
  23.  
  24. ════════════════════════════════════════════════════════════════════════════
  25.  
  26.  
  27. Introduction
  28. ────────────
  29.  
  30. TP6SB is a useful tool with many options to format Pascal code in a
  31. consistent form. TP6SB uses default values to reformat the source
  32. code, but with the options you can develop some other shape. It
  33. makes your code OPTICALLY beautiful.
  34.  
  35. TP6SB - if you want - makes keyword conversion (lower, mixed, upper
  36.       case or according to your own pattern).
  37. TP6SB - if you want - structures loops.
  38. TP6SB - if you want - arranges record and object structures.
  39. TP6SB - if you want - sets the length of source code line.
  40. TP6SB - if you want - inserts space characters to make your source
  41.       code better readable.
  42.  
  43. But TP6SB does not check for syntax errors.
  44.  
  45. The original source file will be saved as a *.BAK backup file.
  46. You don't use .BAK, .TPU, .EXE, .COM or .OBJ files as input.
  47. If you don't use extension after the input file name, .PAS will 
  48. be added. Standard wildcards may be used.
  49.  
  50. TP6SB 1.01 recognizes following builtin keywords:
  51.    85 functions
  52.   138 procedures
  53.    62 reserved words
  54.    33 types
  55.   226 variables and constants
  56.  
  57.  
  58.  
  59.  
  60. ════════════════════════════════════════════════════════════════════════════
  61.  
  62.  
  63. Using TP6SB Optionen
  64. ────────────────────
  65.  
  66. Syntax:
  67.  
  68. TP6SB [options] source[.PAS]
  69. options are:
  70. -a       : about TP6SB
  71. -b:<f|p|r|t|v> : (one of them) show builtin
  72.            functions or procedures or reserved words or types or variables
  73. -c:file  : get options from a file, separators are <CrLf(EoLn), ,EoF>
  74.            all options are allowed except -a, -b:<f|p|r|t|v> and -c:file
  75. -d:n     : n=depth of loops, default=2, max=10, n=0 => no structuring loops
  76. -f:<u|l> : functions in upper or lower case, default is mixed case
  77. -k       : keep source compact
  78. -o:file  : file=collection of own words, length of words 1-20 character(s)
  79.            contents of line from # ignored, builtin words will be overwritten
  80. -p:<u|l> : procedures in upper or lower case, default is mixed case
  81. -r:<u|l> : reserved words in upper or lower case, default is mixed case
  82. -s:m     : m=length of line in the source, default(max)=255, min=40
  83. -t:<u|l> : types in upper or lower case, default is mixed case
  84. -v:<u|l> : variables in upper or lower case, default is mixed case
  85. -w       : no converting builtin keywords
  86. -y:z     : z=position of lines beginning with { or (*, default is structured
  87.  
  88. The order of arguments is not significant. The arguments are not
  89. case sensitive. If you use -a or -b:<f|p|r|t|v> options, you will
  90. get your information on a standard output and after that the
  91. program terminates also if you use other command options.
  92.  
  93. Command options followed by : (colon) must have ONE parameter,
  94. which will follow immediatelly after the option with no space.
  95. < > (angle brackets) give you a possible list of option
  96. parameters which must be present.
  97.  
  98. Comments in { } or in (* *) and strings in ' ' will not alter.
  99.  
  100. Options:
  101. ────────
  102.  
  103. -a     Gives you a short info about TP6SB.
  104.  
  105. -b:<f|p|r|t|v>     Puts the builtin keywords to a standard output.
  106. The keyword groups are: f-functions, p-procedures, r-reserved words,
  107. t-types, v-variables and constants. If you will see more than one
  108. keyword group, you may use this option several times.
  109.  
  110.   TP6SB -b:f -b:p -b:r -b:t -b:v | more
  111.  
  112. -c:file     Like a configurations file.
  113. You may save the frequently used options in a file. You may use
  114. the options also in several lines. The contents of line ignored
  115. from a # character. The separator of options are the space, end
  116. of line and end of file characters. The options in the file may
  117. be updated by a command line. You may save all options in the
  118. file except -a, -b:<f|p|r|t|v> and -c:file. If file isn't in the
  119. active directory, you should use the complete path.
  120.  
  121. If myoptions.cfg is:
  122.  
  123. -d:3 -f:u
  124. #-y:5
  125. -y:6
  126. -r:u
  127.  
  128. You may use:
  129.  
  130.   TP6SB -c:myoptions.cfg -y:1 mysource.pas
  131.  
  132. -d:n     Switch structuring off or set the depth of stuctures.
  133. Allowed values of n are between 0 and 10. Default value of n is 2.
  134. If n is 0, the source code will be not structured, the original
  135. structure will be kept.
  136.  
  137.   TP6SB -d:3 mysource.pas
  138.  
  139. -<f|p|r|t|v>:<u|l>     Switch case of builtin keywords.
  140. Default is mixed case: WriteLn. In u-upper case: WRITELN, in l-lower
  141. case writeln.
  142.  
  143.   TP6SB -r:u -t:l -v:u mysource.pas
  144.  
  145. -k     keep source compact
  146. If you use this option, the TP6SB will not insert space characters,
  147. will not structure record and object definitions.
  148. If mysource.pas look like:
  149.  
  150. type
  151. Date=record
  152. D,
  153. M,
  154. Y:Integer;
  155. end;
  156.  
  157. ...
  158.  
  159. if(a<b)or(c=d)then
  160. begin
  161. writeln((a+b)*c,(d^.e-5)/f[(a+b)*g.h]);
  162. a:=d^.e
  163. end;
  164.  
  165. Tp6SB will not make:
  166.  
  167. {TP6SB mysource.pas}
  168. Type
  169.   Date = Record
  170.            D,
  171.            M,
  172.            Y: Integer;
  173.          End;
  174.  
  175. ...
  176.  
  177.   If (a < b) Or (c = d) Then
  178.   Begin
  179.     WriteLn ( (a + b) * c, (d^. e - 5) / f [ (a + b) * g. h] );
  180.     a := d^. e
  181.   End;
  182.  
  183. but you will get:
  184.  
  185. {TP6SB -k mysource.pas}
  186. Type
  187.   Date=Record
  188.     D,
  189.     M,
  190.     Y:Integer;
  191.   End;
  192.  
  193. ...
  194.  
  195.   If(a<b)Or(c=d)Then
  196.   Begin
  197.     WriteLn((a+b)*c,(d^.e-5)/f[(a+b)*g.h]);
  198.     a:=d^.e
  199.   End;
  200.  
  201. -o:file  : use collection of own words
  202. You may give the format of your own words (variables, constants,
  203. types, functions, procedures, ...) in your source code. You may
  204. redefinate also the bultin keywords. TP6SB will use this collection
  205. of own words like the builtin keywords. The words in this file
  206. may have characters only from [a..z,_,A..Z]. All other characters
  207. will interpreted as separator of words. If you use one word several
  208. times, the last version will be used. The contents of line of
  209. collection file be will ignored from # character. The own words 
  210. may have a maximal length of 20 characters.
  211.  
  212. If mywords.txt is:
  213.  
  214. MyFunction MyCONSTANT
  215. #WRITEln
  216. writeLN, MYvar
  217.  
  218. You may use:
  219.  
  220.   TP6SB -o:mywords.txt mysource.pas
  221.  
  222. -s:m     length of line in the source code
  223. Default (max.) value is 255 characters, the source may not make the
  224. source shorter than 40 characters.
  225.  
  226.   TP6SB -s:120 mysource.pas
  227.  
  228. -w     no converting builtin keywords
  229. But you may use your own words and all other functions.
  230.  
  231.   TP6SB -w mysource.pas
  232.  
  233. -y:z     position of lines beginning with { or (* character(s)
  234. If line in the source code begins with comment or compiler directive,
  235. you may definate at which column of source this line begins. The 
  236. numbering of columns begins with 1. If you don't use this option, 
  237. the lines beginning with { or (* character(s) will be structured, 
  238. like other lines.
  239.  
  240.   TP6SB -y:1 mysource.pas
  241.  
  242. ════════════════════════════════════════════════════════════════════════════
  243.  
  244.