-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsdcl.rno
executable file
·300 lines (299 loc) · 8.45 KB
/
sdcl.rno
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
.NO FLAGS LOWERCASE
.PAGE SIZE 62,66
.IF NOPAGING
.NO PAGING
.ELSE NOPAGING
.! Set up running headers
.TITLE sdcl -- Structured DCL preprocessor
.ENDIF NOPAGING
.SET PARAGRAPH 0
.STYLE HEADERS , 0
.LM 8
.RM 72
.I -8
Name
.S
sdcl -- Structured DCL preprocessor
.S
.I -8
Synopsis
.S
sdcl [-b] [-h] [-v] [-o outfile] [input-file ...]
.S
.I -8
Description
.P
SDCL is a structured DCL preprocessor, in the tradition of
RATFOR: it adds several control structures to DCL, such as
break statement, do-while loops, the if-else statement, the
next statement, repeat loops, and while loops.
.S
.I -8
Options
.S
.LM +8
.I -8
-b######Do not insert DCL line continuation sequences in long
lines. By default, SDCL inserts continuation
sequences to break long lines into seperate physical
lines for readability.
.S
.I -8
-h######Display the help message.
.S
.I -8
-o######Specifies the output file name, which must follow it
immediately or seperated by whitespace.
.S
.I -8
-v######Produce verbose output.
.S
.LM -8
.I -8
Input and Output Files
.P
If no output file is specified, each input file is processed
and written out seperately to files in the current directory.
These files have the same name as their corresponding input
file, except that ".COM" is substituted for whatever followed
the last period in the input file name. Label renumbering
starts over at at 23000 for every new output file.
.P
If an output file is specified, all the input files are
processed and all the results are written out to the specified
output file.
.P
If no input files are specified, the standard input is read.
.P
If no input files are specified and no output file is
specified, the input is taken from the standard input and the
output is written to the standard output, allowing SDCL to be
used as a filter in a pipe.
.P
Unix-style i/o redirection using "<", ">", ">>", "2>", and
"2>>" is supported, as are VMS wildcards.
.IFNOT NOPAGING
.PAGE
.ELSE NOPAGING
.S
.ENDIF NOPAGING
.I -8
SDCL Language
.P
The BNF for SDCL is as follows; the non-terminals are in angle
brackets (<>).
.S
.LT
<program> : <statement>
| <program> <statement>
<statement> : if (<condition>) <statement>
| if (<condition>) <statement> else <statement>
| while (<condition>) <statement>
| for (<intialize> ; <condition> ; <reinitalize>)
<statement>
| do <statement> while (<condition>)
| repeat <statement> until (<condition>)
| repeat <statement>
| break <integer>
| break
| next <integer>
| next
| { <program> }
| <label>: <statement>
| <other>
| //<DCL inclusion>
.EL
.S
.i -8
Language Notes
.LS
.LE
Lines do not start with the dollar sign ($), unlike DCL.
.LE
Comments start with the pound sign (_#) and extend to the end
of the line.
.LE
Labels consist of a letter or underscore followed by zero or
more letters, dollar signs, digits, or underscores.
Whitespace may seperate the label from the colon, but the
colon must be on the same line as the label. Note that in the
statement
.S
.LM +4
.LT
ds :== dir/size=all/width=(filename=40)
.EL
.LM -4
.S
the "ds :" is *NOT* a label, because the colon is part of the
":==" token. SDCL handles this case correctly as one
statement, not as a label followed by a statement beginning
with "==".
.P
Note that SDCL does not recognize the DCL label "100$:"
because it starts with a digit, rather than a letter or
underscore, so any SDCL constructs that appear on that line
will not be recognized. Such labels may still be used, but
they must not appear on the same line as an SDCL construct.
.P
The labels that SDCL uses internally consist of decimal
numbers starting with 23000. Avoid using such labels in your
own programs. When output is being written to multiple files
the labels will start over at 23000 with each output file. When
output is being to one file the line numbers DO NOT start over
for each input file!
.LE
Multiple statements can be enclosed between braces ({}) to
make a compound statement.
.LE
SDCL keywords and braces are only recognized as the first
word of a DCL command. This means that, given
.S
.LM +4
.LT
wso :== write sys$output
.EL
.LM -4
.S
then
.S
.LM +4
.LT
if (c1) if (c2) wso "inside cond2 true"
.EL
.LM -4
.S
is legal, but
.S
.LM +4
.LT
if (c1) if (c2) wso "cond2 true" else wso "cond2 false"
.EL
.LM -4
.S
is not legal, because the else keyword is not recognized.
.P
It also means that
.S
.LM +4
.LT
if (cond) { wso "cond true" } else { wso "cond false" }
.EL
.LM -4
.S
is not legal because the first "}" is not recognized.
.P
(Otherwise you couldn't use keywords or braces in DCL commands
in SDCL, like write sys$output "{here!}")
.LE
Multiple line <initialize> and <reinitialize> clauses in a
for loop are legal, like this:
.S
.LM +4
.LT
for (i = 0
s = "";
i .lt. 10;
i = i + 1
s = s + ".")
write sys$output "i: ", i, " s: ", s
write sys$output "at end: i: ", i, " s: ", s
.EL
.LM -4
.LE
The break statement without an integer argument exits the
immediately enclosing loop. With an integer argument of n, it
exits the n'th enclosing loop. The integer argument MUST be
on the same line as the "break". (Rationale: that way
SDCL doesn't go looking across lines and possibly finding the
integer that begins a label on the next line.)
.LE
The next statement without an integer argument starts the
next iteration of the immediately enclosing loop, starting at
the test of the continuation condition for the loop, if any.
With an integer argument of n, it starts the next iteration of
the n'th enclosing loop. The integer argument MUST be on the
same line as the "next". (Rationale: that way SDCL doesn't
go looking across lines and possibly finding the integer that
begins a label on the next line.)
.LE
The repeat loop without an until part repeats forever.
.LE
<other> statements are anything not otherwise recognized by
SDCL. If SDCL does not recognize the first token in a
statement, that statement is assumed to be an <other>, and
tokens are output until the end of the statement (which is the
end of the logical line, taking into account backslash line
continuation). The statement is emitted preceded by a dollar
sign ($) and with appropriate continuation lines if it is more
than 80 characters long.
.LE
Lines may be continued with the backslash character (\). A
backslash followed by whitespace (blanks or tabs, possibly
including a comment after the first whitespace character) and
a newline indicates that the line is continued. If the
whitespace is terminated by anything other than a newline, the
intervening backslash and whitespace are ignored. Do not use
the dash (-) as the continuation character, as it doesn't mean
anything to SDCL.
.P
Inside SDCL control structures (such as the <condition> part
of a loop) the backslash continuation character need not be
used because SDCL knows to continue over lines until the end
of the structure.
.LE
A statement starting with two slashes ('//') is called a DCL
inclusion and extends to the next newline. It is output
without a preceeding dollar sign ($) and without squashing
spaces and tabs to one space.
.P
If '//' is encountered as part of an <other> statement,
everything from the '//' to the end of the line is output as
part of the <other> statment without further processing by
SDCL (without squashing spaces and tabs to one space).
.P
The special significance of characters such as the
backslash, etc., can be eliminated by preceding them with a
backslash. If a backslash followed by a non-whitespace
character is encountered, the backslash is ignored and the
following character is treated as a normal character despite
any special meaning it may have elsewhere to SDCL.
.ELS
.S
.I -8
Limitations
.S
.LS
.LE
Lines are limited to 512 characters.
.LE
Tokens are limited to
512 characters.
.LE
DCL inclusions ('//' lines) are limited to
512 characters.
.LE
<reinitalize> sequences are limited to 512
characters.
.ELS
Except for the last, these limits aren't a
serious problem, since DCL's line buffer is shorter than that.
.LS
.NUMBER LIST 5
.LE
Error reporting is primitive.
.LE
Only labels that start with letters or underscores and contain
only letters, underscores, dollar signs, and digits are
recognized.
.ELS
.s
.i -8
Authors
.p
The original SDCL was written by Sohail Aslam, of the
University of Colorado at Colorado Springs, and is available
from the DECUS program library as VAX-143.
.p
This version was completely rewritten from scratch by
T. Kurt Bond, with additions and changes to the SDCL syntax.