Creating and distributing a con guration le for ptop is not necesarry, unless you want to modify the standard behaviour of ptop. The con guration le is never preloaded, so if you want to use it you should always specify it with a -c ptop.cfg parameter.
The structure of a ptop con guration le is a simple buildingblock repeated several (20-30) times, for each pascal keyword known to the ptop program. (see the default con guration le or ptopu.pp source to nd out which keywords are known)
The basic building block of the con guration le consists out of one or two lines, describing how ptop should react on a certain keyword. First a line without square brackets with the following format:
keyword=option1,option2,option3,...
If one of the options is "dindonkey" (see further below), a second line (with square brackets) is needed like this:
[keyword]=otherkeyword1,otherkeyword2,otherkeyword3,...
As you can see the block contains two types of identi ers, keywords(keyword and otherkeyword1..3 in above example) and options, (option1..3 above).
Keywords are the built-in valid Pascal structure-identi ers like BEGIN, END, CASE, IF, THEN, ELSE, IMPLEMENTATION. The default con guration le lists most of these.
Besides the real Pascal keywords, some other codewords are used for operators and comment expressions. table (8.1)
|
The Options codewords de ne actions to be taken when the keyword before the equal sign is found, table (8.2)
|
The option "dindonkey" requires some extra parameters, which are set by a second line for that option (the one with the square brackets), which is therefore is only needed if the options contain "dinkdonkey" (contraction of de-indent on assiociated keyword).
"dinkdonkey" deindents if any of the keywords speci ed by the extra options of the square-bracket line is found.
Example: The lines
else=crbefore,dindonkey,inbytab,upper
[else]=if,then,else |
mean the following:
Try to play with the con g le step by step until you nd the e ect you desire. The con gurability and possibilities of ptop are quite large. E.g. I like all keywords uppercased instead of capitalized, so I replaced all capital keywords in the default le by upper.
ptop is still development software, so it is wise to visually check the generated source and try to compile it, to see if ptop hasn't made any errors.