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  buildingblock
24       repeated  several  (20-30)  times, for each pascal keyword known to the
25       ptop program. (see the default configuration file or ptopu.pp source to
26       find out which keywords are known)
27
28       The  basic building block of the configuration file consists out of one
29       or two lines, describing how ptop should react on  a  certain  keyword.
30       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       As you can see the  block  contains  two  types  of  identifiers,  key‐
40       words(keyword  and  otherkeyword1..3  in  above  example)  and options,
41       (option1..3 above).
42
43       Keywords are  the  built-in  valid  Pascal  structure-identifiers  like
44       BEGIN,  END, CASE, IF, THEN, ELSE, IMPLEMENTATION. The default configu‐
45       ration file lists most of these.
46
47       Besides the real Pascal keywords, some other  codewords  are  used  for
48       operators  and  comment  expressions. These are listed in the following
49       table:
50
51       Name of codeword         operator
52       -------------            -----
53       casevar                  : in a case label (<>'colon')
54       becomes                  :=
55       delphicomment            //
56       opencomment              { or (*
57       closecomment             } or *)
58       semicolon                ;
59       colon                    :
60       equals                   =
61       openparen                [
62       closeparen               ]
63       period                   .
64
65       The Options codewords define actions  to  be  taken  when  the  keyword
66       before the equal sign is found.
67
68       Option              does what
69       -------             ---------
70       crsupp              suppress CR before the keyword.
71       crbefore            force           CR          before          keyword
72                           (doesn't go with crsupp :) )
73       blinbefore          blank line before keyword.
74       dindonkey           de-indent       on       assiociated       keywords
75                           (see below)
76       dindent             deindent (always)
77       spbef               space before
78       spaft               space after
79       gobsym              Print symbols which follow a
80                           keyword but which do not
81                           affect layout. prints until
82                           terminators occur.
83                           (terminators are hard-coded in pptop,
84                           still needs changing)
85       inbytab             indent by tab.
86       crafter             force CR after keyword.
87       upper               prints keyword all uppercase
88       lower               prints keyword all lowercase
89       capital             capitalizes keyword: 1st letter
90                           uppercase, rest lowercase.
91
92       The option "dindonkey" requires some extra parameters, which are set by
93       a second line for that keyword (the  one  with  the  square  brackets),
94       which  is  therefore  only  needed  if the options contain "dinkdonkey"
95       (contraction of de-indent on assiociated keyword).
96
97       "dinkdonkey" deindents if any of the keywords specified  by  the  extra
98       options of the square-bracket line is found.
99

Example

101       The line
102
103       else=crbefore,dindonkey,inbytab,upper
104       [else]=if,then,else
105
106       Means:
107
108       The keyword this is about is else , it's on the LEFT side of both equal
109       signs.
110
111       When the ptop parser finds ELSE, the options tell it to do the  follow‐
112       ing things:
113
114       - (crbefore) Don't allow other code on the line before
115          the keyword. (ELSE alone on a line)
116       - (dindonkey) De-indent on the keywords
117            in square brackets line (if,then,else)
118       - (inbytab) indent by tab.
119       - (upper) uppercase the keyword (ELSE)
120
121       Try  to  play with the configfile until you find the effect you desire.
122       The configurability and possibilities of ptop are quite large  compared
123       to shareware source beautifier found on e.g. SIMTEL.
124

Acknowledgements

126       The  writer  of  the  program, Michael van Canneyt, who also helped out
127       explaining the format of ptop.cfg.
128
129       Questions/corrections  can   be   mailed   to   fpc-devel@vekoll.satur‐
130       nus.vein.hu
131
132       Also thanks to the rest of the FPC development team.
133
134

SEE ALSO

136       ptop binary
137              ptop(1)
138
139       Compiler
140              ppc386(1)
141
142       Other FPC utils
143              ppdep(1) ppudump(1) ppumove(1) h2pas(1)
144
145
146
147FreePascal                        31 may 1999                      ptop.cfg(5)
Impressum