ptop.cfg.5 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. .TH ptop.cfg 5 "31 may 1999" FreePascal "ptop source beautifier config file"
  2. .SH NAME
  3. ptop.cfg \- The ptop source\-beautifier configuration file.
  4. ptop is the source beautifier of the FreePascal project.
  5. Origin probably Pascal\-TO\-Pascal.cfg
  6. .SH DESCRIPTION
  7. This is the main configuration file of the
  8. .I ptop FPC source beautifier
  9. .PP
  10. The configuration file for
  11. .BR ptop (1)
  12. isn't necessarily called ptop.cfg, and is also
  13. not auto-loaded, so the name doesn't matter much. This man\-page describes
  14. the structure of such a configuration file for
  15. .BR ptop (1)
  16. .SH Structure
  17. The structure of a ptop configuration file is a simple buildingblock repeated several (20-30) times,
  18. for each pascal keyword known to the ptop program. (see the default configuration file or ptopu.pp source to
  19. find out which keywords are known)
  20. .PP
  21. The basic building block of the configuration file consists out of one or two lines,
  22. describing how ptop should react on a certain keyword.
  23. First a line without square brackets with the following format:
  24. .PP
  25. keyword=option1,option2,option3,...
  26. .PP
  27. If one of the options is "dindonkey" (see further below), a second line
  28. (with square brackets) is needed like this:
  29. .PP
  30. [keyword]=otherkeyword1,otherkeyword2,otherkeyword3,...
  31. .PP
  32. As you can see the block contains two types of identifiers, keywords(keyword and otherkeyword1..3 in above example)
  33. and options, (option1..3 above).
  34. .PP
  35. \fIKeywords\fP
  36. are the built-in valid Pascal structure-identifiers like BEGIN, END, CASE, IF,
  37. THEN, ELSE, IMPLEMENTATION. The default configuration file lists most of these.
  38. .PP
  39. Besides the real Pascal keywords, some other codewords are used for operators
  40. and comment expressions. These are listed in the following table:
  41. Name of codeword\ \ operator
  42. .br
  43. -------------\ \ \ -----
  44. .br
  45. casevar\ \ \ \ : in a case label (<>'colon')
  46. .br
  47. becomes\ \ \ \ :=
  48. .br
  49. delphicomment\ \ \ //
  50. .br
  51. opencomment\ \ \ { or (*
  52. .br
  53. closecomment\ \ \ } or *)
  54. .br
  55. semicolon\ \ \ \ ;
  56. .br
  57. colon\ \ \ \ :
  58. .br
  59. equals\ \ \ \ =
  60. .br
  61. openparen\ \ \ \ [
  62. .br
  63. closeparen\ \ \ ]
  64. .br
  65. period\ \ \ \ .
  66. .PP
  67. The \fIOptions\fP codewords define actions to be taken when the keyword before
  68. the equal sign is found.
  69. .PP
  70. Option \ \ does what
  71. .br
  72. -------\ \ \ ---------
  73. .br
  74. crsupp\ \ \ suppress CR before the keyword.
  75. .br
  76. crbefore\ \ \ force CR before keyword
  77. \ \ \ \ (doesn't go with crsupp :) )
  78. .br
  79. blinbefore\ \ blank line before keyword.
  80. .br
  81. dindonkey\ \ \ de\-indent on assiociated keywords
  82. \ \ \ \ (see below)
  83. .br
  84. dindent\ \ \ deindent (always)
  85. .br
  86. spbef\ \ \ space before
  87. .br
  88. spaft\ \ \ space after
  89. .br
  90. gobsym\ \ \ Print symbols which follow a
  91. .br
  92. \ \ \ \ keyword but which do not
  93. .br
  94. \ \ \ \ affect layout. prints until
  95. .br
  96. \ \ \ \ terminators occur.
  97. .br
  98. \ \ \ \ (terminators are hard-coded in pptop,
  99. .br
  100. \ \ \ \ still needs changing)
  101. .br
  102. inbytab\ \ \ indent by tab.
  103. .br
  104. crafter\ \ \ force CR after keyword.
  105. .br
  106. upper\ \ \ prints keyword all uppercase
  107. .br
  108. lower\ \ \ prints keyword all lowercase
  109. .br
  110. capital\ \ \ capitalizes keyword: 1st letter
  111. .br
  112. \ \ \ \ uppercase, rest lowercase.
  113. .PP
  114. The option "dindonkey" requires some extra parameters, which are
  115. set by a second line for that keyword (the one with the square brackets), which is
  116. therefore only needed if the options contain "dinkdonkey" (contraction of
  117. de\-indent on assiociated keyword).
  118. .PP
  119. "dinkdonkey" deindents if any of the keywords specified by the extra options of the
  120. square-bracket line is found.
  121. .PP
  122. .SH Example
  123. The line
  124. else=crbefore,dindonkey,inbytab,upper
  125. .br
  126. [else]=if,then,else
  127. .PP
  128. Means:
  129. The keyword this is about is
  130. .I else
  131. , it's on the LEFT side of both equal signs.
  132. .PP
  133. When the ptop parser finds ELSE, the options tell it to do the following
  134. things:
  135. \- (crbefore) Don't allow other code on the line before
  136. .br
  137. \ the keyword. (ELSE alone on a line)
  138. .br
  139. \- (dindonkey) De\-indent on the keywords
  140. .br
  141. \ in square brackets line (if,then,else)
  142. .br
  143. \- (inbytab) indent by tab.
  144. .br
  145. \- (upper) uppercase the keyword (ELSE)
  146. .PP
  147. Try to play with the configfile until you find the effect you desire. The
  148. configurability and possibilities of ptop are quite large compared to shareware
  149. source beautifier found on e.g. SIMTEL.
  150. .PP
  151. .SH Acknowledgements
  152. The writer of the program, Michael van Canneyt, who also helped out explaining
  153. the format of ptop.cfg.
  154. .PP
  155. Questions/corrections can be mailed to fpc\[email protected]
  156. .PP
  157. Also thanks to the rest of the FPC development team.
  158. .SH SEE ALSO
  159. .IP "ptop binary"
  160. .BR ptop (1)
  161. .IP "Compiler"
  162. .BR ppc386 (1)
  163. .IP "Other FPC utils"
  164. .BR ppdep (1)
  165. .BR ppudump (1)
  166. .BR ppumove (1)
  167. .BR h2pas (1)