_________________ SOAP USER'S GUIDE SOAP is a routine which inputs IMP source programs and outputs them formatted according to predefined control options. It is assumed that the input source will compile under the standard IMP compilers. Statements which are found to be syntactically incorrect are output unchanged. 1 = = __________ USING SOAP Before using SOAP for the first time it is nescessary to connect the library in which it resides. This is done with the command: APPENDLIB(ECSC17.IMPILIB) Providing that this has been done, SOAP can be called with one of the following types of command: 1. SOAP(INPUT/OUTPUT) 2. SOAP(INPUT,OPTIONS/OUTPUT) 3. SOAP(INPUT) 4. SOAP(INPUT,OPTIONS) 1&3 specify that all default options are to be used. 2&4 specify changes to be made to the default options. 1&2 define a new output file. If this new file exists and is different from the input file, the output file is left alone and the output is in a temporary file 'SP#WORK'. This is indicated by the message: RENAME SP#WORK FAILS 3&4 specify that the output file is the same as the input file. NOTE: '.TT' ______ cannot be used for the input file. 2 = = ________________________ CHANGING DEFAULT OPTIONS In the examples of calling SOAP 'OPTIONS' can have two forms:- 1. The name of a file (including.'.tt') from which the list of options (terminated with *) is to be taken. 2. The list of options enclosed in square brackets. e.g. SOAP(FRED,.TT/JIM) SOAP(FRED,OPFILE/JIM) SOAP(FRED,[LL=120,CT=80]/JIM) Any options not mentioned retain their default values. The format of the option list is (term),(term), ......... ,(term),* where (term) = OPTION __ __ or \OPTION or OPTION=VALUE and any comma may be replaced with a newline. If the [....] form is used the final * may be omitted (NOTE that the command interpreter deletes newlines within commands !) ________ EXAMPLES EM enable extra margin \EM disable extra margin MI=4 set margin increment to 4 The default options are: \IB, \LB, SB, IB, \SK, \PN, \SS, \CN BC, LS, \JA, \LR, SC, DR, SL, SE, SL, EM \LO, CR, EC MI=3, LL=72, CT=40, ML=40, LC=100 CE=5, XN=2, IM=7, SM=3, CL=20 lc= value of LL 3 = = _________________ OPTIONS AVAILABLE _____________________________________________ OPTION DEFAULT DESCRIPTION IB \IB Isolate Brackets Spaces will be inserted before left brackets and after right brackets. LB \LB Leave Blank lines Blank lines in the input will be transfered to the output. SB SB Separate Blocks A newline will be inserted before BEGIN, ROUTINE, FN, MAP. IB IB Indent Blocks The start of a block will increase the margin by 'MARGIN INCREMENT' SK \SK Split Keywords All keywords will be split into their components e.g. %BYTE %INTEGER X PN \PN Pack Names Spaces will be removed from names. SS \SS Split Statements All separators will become newlines on output. CN \CN Comments Normal Comments will be treated as ordinary statements i.e. they will not be tabbed to the comment margin etc. BC BC Break Comments Comments will be broken into as many smaller comments as will be needed to aviod overflowing the output line. If this option is turned off, large comments will be right justified. LS LS Leave Stars Comments of the form !*...... will start at the beginning of a line. This is to preserve block comments exclosed in stars. 4 = = JA \JA Justify All comments All comments (excluding those controled by 'LS') will be indented to the comment tab. If this option is turned off, comments will be indented according to the following scheme: 1. The output comment will start at the beginning of the line if did the input comment. 2. If the input comment started after the current value of the comment limit (see 'CR') the output comment will be indented to the comment tab. 3. Otherwise the comment will be tabbed to the current margin setting. LR \LR Labels Relative Labels will be tabbed to the margin which was current when the enclosing block was encountered. If this option is disabled all labels are output at the start of a line. SC SC Split Conditions The keywords '%THEN' and '%ELSE' are separated from any ajoining keywords e.g. %FINISH %ELSE %START 'SC' is implied by 'SK' DR DR Declarations Relative Declarations will be tabbed to the margin of the enclosing block. SL SL Space Lists Spaces will be inserted after commas. SE SE Space Equals etc. Spaces will be inserted around '=', '==', '#', '<=' etc. IL IL Isolate Loops An extra newline will be inserted before '%CYCLE' and after '%REPEAT'. 5 = = EM EM Extra Margin This also implies '\TB' and 'DR' Each time the margin is increased from zero the increment will be 'IM' and thereafter 'MI' LO \LO Leave Owns Declarations of %OWN and %CONST arrays will be output exactly as found. If this option is turned off, the declaration will be formatted up to and including the '=' (if it exists) CR CR Comments Relative The comment limit (see 'JA') will echo the value of the current margin. Otherwise it will be set to 'CL' EC EC Extend Comments If a comment is the second or subsequent statement on the input line and the previous statements exceed the comment tab, this option will increase the comment tab (for this comment only) 'XN' times by 'CE' spaces in an attempt to make the comment fit on the current output line. If this process fails, or the option is disabled, the comment will be placed on a line of its own. MI= MI=3 Margin Increment The amount by which the margin will be altered. (see 'TB', 'DR' and 'EM') LL= LL=72 Line Length The length of the output line (see 'LC') CT= CT=40 Comment Tab The position to which comments will be tabbed (see 'JA' etc.). ML= ML=40 Margin Limit The margin will not be increased once it reaches this limit. 6 = = CE= CE=5 Comment Extension The amount by which 'EC' will extend the comment tab. XN= XN=2 eXtension Number The number of times 'EC' will apply 'CE'. IM= IM=7 Initial Margin The initial margin for 'EM'. SM= SM=3 Secondary Margin The extra margin added when a line is split by '%C'. CL= CL=20 Comment Limit The static limit for 'CR'. LC= LC=100 Line length for Comments A line length for comments which overrides 'LL'. _________________ PETER S ROBERTSON ____________________________ C/O DEPT OF COMPUTER SCIENCE 7