Article View: bit.listserv.simula
Article #389Re: Source code formatter for Simula???
From: Rob Pooley
Date: Tue, 11 Jul 1995 00:00
Date: Tue, 11 Jul 1995 00:00
184 lines
7162 bytes
7162 bytes
Indeed SIMED was a fairly versatile source code formatter. It was developed
in Sweden and released as part of the LIBSIM libraries along with the DEC 10
system. It was later released with the VAX/VMS system which Iused to sell. The
rights to it were also purchased by Lund Software and I thought it was included
on the Lund release tape, but I am not sure. I do not have a copy easily to
hand, but have no objections to it being made available if Lund also agree.
The help file from VMS follows.
Rob Pooley
Department of Computer Science
Edinburgh University
Kings Buildings
Mayfield
Edinburgh EH9 3JZ
Scotland
Tel. +44 131 650 5123
Fax. +44 131 667 7209
--------------------------
SIMED
--- SIMULA Editor and Indentation program Version 2 ---
The SIMED program edits SIMULA source program files into more
readable form.
SIMED can be used to indent a SIMULA program (for better
readability) according to the BEGIN-END structure. This is
especially useful when the program contains BEGIN-END nesting
errors, which usually will produce unhelpful compiler messages.
SIMED may also be used to convert reserved words, standard and
user identifiers to -
1) UPPER CASE 2) lower case 3) Edit Case (1st char. upper case).
Lines which become too long when indented will be split up at an
appropriate position.
If one of the following conditions holds, comments are not
indented -
a) The start of the line is part of a comment or
b) The end of the line is part of an (unfinished) comment.
(Thus labels are left unindented if preceded by !<CR><LF>
;LAB:...)
Lines starting with % will not be indented nor edited, they will
just be copied into the output file.
Command format for SIMED (example):
outfile=infile/i:4/r:80/e:13200
Default switches:
/I:4 Indent step 4. A non-positive argument
implies that leading tabs and blanks
will be preserved and indented according to
Abs(arg).
/E:13200 Edit Reserved words, standard ids, own ids,
/E:UEL00 Comments and Options, Text and Character
constants resp. 1 (U) = Upper CASE,
2 (L) = Lower Case, 3 (E) = Edit case,
0 = no change.
Thus /E:000 will suppress all editing.
/R:80 Outfile record length 80.
/TABS Use tabs in indentation (default)
/C Check for non-unique identifiers
with length >=12 (producing warnings).
Other switches:
/SIMSET Recognize SIMSET identifiers
(default for SIMSET and SIMULATION blocks)
/-SIMSET Do not recognize SIMSET ids
/SIMULATION Recognize SIMULATION identifiers
(default for SIMULATION blocks)
/-SIMULATION Do not recognize SIMULATION ids
/-TABS Do not use tabs
/NUMBERED:xx Produce line numbers, incr. xx (def. 100)
(default if input file has numbers).
/-NUMBERED Suppress line numbers on output.
(default if input file has no line numbers).
/-C Do not check long id:s (5-20% cheaper).
/Z:n Suppress indentation for n block levels. May
be < 0, >= -10, assuming surrounding levels.
Default /Z:0.
!xxx Run program XXX after processing, if SOS
then start in CCL entry.
Thus ABC!SOS will return to SOS editing
last file edited. The command !SOS or !TECO
is also legal.
Special interpretations:
!1 will compile the output file (COMPILE).
!2 will as well load it (LOAD/COM).
!3 will also start it (EXECUTE/COM).
Your own default switches can also be given in a file SWITCH.INI
on your area. You need only have one or more lines of the form:
SIMED /switch/switch...
Example: If you want files to be edited with reserved words in
lower case, your own identifiers in upper case, and standard
identifiers with upper case initial letter, standard
indentation=2, record length=100, put the following line in
SWITCH.INI:
SIMED /E:LEU/I:2/R:100
Trailing zeros in the E switch may be omitted - the system
default will be used in those positions. You can always override
the default values in the command to SIMED.
Default extension is SIM. Default outfile name is infile name.
(NUL: and TTY: are accepted.)
If you want only default values, the command string to edit the
file X.SIM with the same output file name is simply X.
The shortest possible command to apply SIMED to a file X.SIM is -
.SIMED X (@SIMED -X in TOPS-20)
SIMED will process the file named as if given as the first
command and exit after editing. CONTINUE will put SIMED in
command mode, expecting further commands. START or
START-<command-string> may also be used.
Just typing -
.SIMED
will - if extension is .SIM -
then start SIMED editing the last TECO/SOS edited file (by
reading TMP:EDS) using default switches (possibly redefined in
SWITCH.INI). Whenever possible, semicolon will be interpreted as
the name of the file last edited. If the file last edited was
X.SIM, the following commands will all have the same effect (i.e.
processing X.SIM) -
.SIMED;
.SIMED-;
.SIMED-;=;
.SIMED;=X
.SIMED;=;
.SIMED (thus .SIMED is equivalent to .R SIMED; IF the
extension was .SIM)
Exit from SIMED by entering ^Z or ^C.
Restrictions:
Input lines may not exceed 200 characters.
Split up lines will not be indented properly if they contain
BEGIN or END.
Also, numerical constants containing blanks may occasionally be
improperly split. The programmer is recommended to start source
code lines with BEGIN and END resp.
Additional feature:
If a text constant includes <CR><LF> SIMED will ask the user for
permission to continue, in order to prevent a possible messing up
of the file. Otherwise if one of the quotes is missing all
subsequent (correct) text constants might be destroyed by
Upper/lower case editing. "Proper" text constants containing
<CR><LF> will be changed to new concatenated text constants as
now allowed in SIMULA.
Author:
Mats Ohlin, Swedish Research Institute of National Defence
FOA 1, Fack, S-104 50 STOCKHOLM 80, SWEDEN
<End of SIMED.HLP 80-12-19>
Technical Details
Message-ID:
<22433.9507111142@auskerry.dcs.ed.ac.uk>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<199507060939.AA21719@utciva.civ.utwente.nl>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 113dd9,3c437ea33174c4e8 X-Google-Attributes: gid113dd9,public From: Rob Pooley <rjp@DCS.ED.AC.UK> Subject: Re: Source code formatter for Simula??? Date: 1995/07/11 Message-ID: <22433.9507111142@auskerry.dcs.ed.ac.uk> X-Deja-AN: 106050279 sender: The SIMULA Language List <SIMULA@uga.cc.uga.edu> references: <199507060939.AA21719@utciva.civ.utwente.nl> comments: Gated by NETNEWS@AUVM.AMERICAN.EDU content-length: 6458 newsgroups: bit.listserv.simula