home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / pascal / bp7sb100.zip / BP7SB.DOC < prev    next >
Text File  |  1993-03-15  |  7KB  |  241 lines

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