1ptop.cfg(5)           ptop source beautifier config file           ptop.cfg(5)
2
3
4

NAME

6       ptop.cfg - The ptop source-beautifier configuration file.
7
8       ptop is the source beautifier of the FreePascal project.
9
10       Origin probably Pascal-TO-Pascal.cfg
11
12

DESCRIPTION

14       This is the main configuration file of the ptop FPC source beautifier
15
16       The  configuration  file for ptop(1) isn't necessarily called ptop.cfg,
17       and is also not auto-loaded, so the  name  doesn't  matter  much.  This
18       man-page  describes  the  structure  of  such  a configuration file for
19       ptop(1)
20
21

STRUCTURE

23       The structure of a ptop configuration file is a simple  building  block
24       repeated  several  (60-70) times, once for each pascal keyword known to
25       the ptop program. (see  the  default  configuration  file  or  ptopu.pp
26       source to find out which keywords are known)
27
28       The basic building block of the configuration file consists out of one,
29       two or three lines, describing how ptop should react on a certain  key‐
30       word.  First a line without square brackets with the following format:
31
32       keyword=option1,option2,option3,...
33
34       If one of the options is "dindonkey" (see further below), a second line
35       (with square brackets) is needed like this:
36
37       [keyword]=otherkeyword1,otherkeyword2,otherkeyword3,...
38
39       Then if one of the options is "gobsym", a third line (with angle brack‐
40       ets) is needed like this:
41
42       <keyword>=terminalword1,terminalword2,terminalword3,...
43
44       As  you  can  see  the  block  contains  two types of identifiers, key‐
45       words(keyword, otherkeyword1..3 and terminalword1..3 in the above exam‐
46       ple) and options, (option1..3 above).
47
48       Keywords  are  the built-in valid Pascal structure-identifiers like BE‐
49       GIN, END, CASE, IF, THEN, ELSE, IMPLEMENTATION. The default  configura‐
50       tion file lists most of these.
51
52       Besides the real Pascal keywords, some other codewords are used for op‐
53       erators and comment expressions. These are listed in the following  ta‐
54       ble:
55
56       Name of codeword         operator
57       -------------            -----
58       casevar                  : in a case label (<>'colon')
59       becomes                  :=
60       delphicomment            //
61       opencomment              { or (*
62       closecomment             } or *)
63       semicolon                ;
64       colon                    :
65       equals                   =
66       openparen                [
67       closeparen               ]
68       period                   .
69
70       The  Options  codewords define actions to be taken when the keyword be‐
71       fore the equal sign is found.
72
73       Option              does what
74       -------             ---------
75       crsupp              suppress CR before the keyword.
76       crbefore            force CR before keyword
77                           (doesn't go with crsupp :) )
78       blinbefore          blank line before keyword.
79       dindonkey           de-indent on associated keywords (see below)
80       dindent             de-indent (always)
81       spbef               space before
82       spaft               space after
83       gobsym              Print symbols which follow a keyword,
84                           but which do not affect layout.
85                           Prints until terminators occur.
86       inbytab             indent by tab.
87       crafter             force CR after keyword.
88       upper               prints keyword all uppercase
89       lower               prints keyword all lowercase
90       capital             capitalizes keyword: 1st letter
91                           uppercase, rest lowercase.
92
93       The option "dindonkey" requires some extra parameters, which are set by
94       a  second  line  for  that  keyword (the one with the square brackets),
95       which is therefore only needed  if  the  options  contain  "dinkdonkey"
96       (contraction of de-indent on assiociated keyword).
97
98       "dinkdonkey"  deindents  if  any of the keywords specified by the extra
99       options of the square-bracket line is found.
100
101       In a similar manner the option "gobsym", short for gobble symbols,  re‐
102       quires  some  additional  information in order to perform its function.
103       The "gobsym" option indicates that all symbols  following  the  keyword
104       should  be passed through unchanged until a terminal symbol is reached.
105       The list of acceptable termial symbols is provided by the angle-bracket
106       line.
107

EXAMPLES

109       The block
110
111       else=crbefore,dindonkey,inbytab,upper
112       [else]=if,then,else
113
114       Means:
115
116       The keyword this is about is else , it's on the LEFT side of both equal
117       signs.
118
119       When the ptop parser finds ELSE, the options tell it to do the  follow‐
120       ing things:
121
122       - (crbefore) Don't allow other code on the line before
123          the keyword. (ELSE alone on a line)
124       - (dindonkey) De-indent on the keywords
125          in square brackets line (if,then,else)
126       - (inbytab) indent by tab.
127       - (upper) uppercase the keyword (ELSE)
128
129       The block
130
131       case=spaft,gobsym,inbytab,crafter,capital
132       <case>=ofsym
133
134       Means:
135
136       The keyword this is about is case , it's on the LEFT side of both equal
137       signs.
138
139       When case is found, the options tell it to do the following things:
140
141       - (spaft) Insure that there is a space
142          after the keyword. (case)
143       - (gobsym) pass symbols through unchanced until one of
144          the words in the angle brackets line (of) is found.
145       - (crafter) Make sure terminator (of) ends the line.
146       - (inbytab) indent by tab.
147       - (capital) Capitalize the keyword (case becomes Case).
148
149
150       Try to play with the configfile until you find the effect  you  desire.
151       The  configurability and possibilities of ptop are quite large compared
152       to other shareware source beautifiers found on e.g. SIMTEL.
153

ACKNOWLEDGEMENTS

155       The writer of the program, Michael van Canneyt, who also helped out ex‐
156       plaining the format of ptop.cfg.
157
158       Questions/corrections   can   be   mailed   to  fpc-devel@vekoll.satur‐
159       nus.vein.hu
160
161       Also thanks to the rest of the FPC development team.
162
163

SEE ALSO

165       ptop binary
166              ptop(1)
167
168       Compiler
169              ppc386(1)
170
171       Other FPC utils
172              ppdep(1) ppudump(1) ppumove(1) h2pas(1)
173
174
175
176FreePascal                      25 January 2007                    ptop.cfg(5)
Impressum