-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathuser.tex
402 lines (344 loc) · 10.2 KB
/
user.tex
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
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
% THE SUPERPASCAL USER MANUAL
% PER BRINCH HANSEN
% School of Computer and Information Science
% Syracuse University, Syracuse, NY 13244, USA
% 28 October 1993
% Copyright(c) 1993 Per Brinch Hansen
% LATEX PREAMBLE
\documentstyle[twoside,11pt]{article}
\pagestyle{myheadings}
\setlength{\topmargin}{7mm}
\setlength{\textheight}{200mm}
\setlength{\textwidth}{140mm}
\setlength{\oddsidemargin}{14mm}
\setlength{\evensidemargin}{12mm}
\newcommand{\acknowledgements}
{\section*{Acknowledgements}
\addcontentsline{toc}{section}
{Acknowledgements}
}
\newcommand{\blank}
{\mbox{\hspace{1.8em}}}
\newcommand{\blankline}
{\medskip}
\newcommand{\Copyright}
{Copyright {\copyright}}
\newcommand{\entry}
{\bibitem{}}
\newcommand{\example}
{{\it Example:}}
\newcommand{\examples}
{{\it Examples:}}
\newcommand{\mytitle}[3]
% [title,month,year]
{\markboth{Per Brinch Hansen}{#1}
\thispagestyle{empty}
\begin{center}
{\Large\bf #1}\\
% TITLE
\blankline
PER BRINCH HANSEN
\footnote{
\Copyright #3 % Year
Per Brinch Hansen. All rights reserved.}\\
\blankline
{\it
School of Computer and Information Science \\
Syracuse University, Syracuse, NY 13244, USA\\
}
\blankline
#2 #3\\
% Month Year
\end{center}
}
\newcommand{\Superpascal}
{\it SuperPascal}
\newenvironment{grammar}
{\begin{small}}
{\end{small}}
\newenvironment{myabstract}
{\begin{rm}
\noindent{\bf Abstract:}}
{\end{rm}}
\newenvironment{mybibliography}[1]
% [widestlabel]
{\begin{small}
\begin{thebibliography}{#1}
\addcontentsline{toc}
{section}{References}}
{ \end{thebibliography}
\end{small}}
\newenvironment{mykeywords}
{\begin{small}
\noindent{\bf Key Words:}}
{\end{small}}
\newenvironment{mytabular}[1]
% [columns]
{\begin{small}
\begin{center}
\begin{tabular}{#1}}
{ \end{tabular}
\end{center}
\end{small}}
\newenvironment{program}[1]
% [width]
{\begin{center}
\begin{minipage}{#1}}
{ \end{minipage}
\end{center}}
% Program Indentation
\newcommand{\PA}
{\noindent}
\newcommand{\PB}
{\mbox{\hspace{1em}}}
\newcommand{\PC}
{\mbox{\hspace{2em}}}
\newcommand{\PD}
{\mbox{\hspace{3em}}}
\newcommand{\PE}
{\mbox{\hspace{4em}}}
% DOCUMENT TEXT
\begin{document}
\mytitle{The SuperPascal User Manual}
{November}{1993}
\begin{myabstract}
This report explains how you compile and run {\Superpascal}
programs [Brinch Hansen 1993a].
\end{myabstract}
\section{Command Aliases}
If you are using {\Superpascal} under Unix, please define the
following command aliases in the file .{\it cshrc} in your
home directory:
\begin{program}{23.5em}
{\PA}alias sc $<${\it path name of an executable compiler sc}$>$ \\
{\PA}alias sr $<${\it path name of an executable interpreter sr}$>$\\
\end{program}
\section{Program Compilation}
You compile a {\Superpascal} program by typing the command
\begin{center}
{\it sc}
\end{center}
\noindent
followed by a return. When the message
\begin{center}
source =
\end{center}
\noindent
appears, type the name of a program textfile followed by a
return. After the message
\begin{center}
code =
\end{center}
\noindent
type the name of a new program codefile followed by a
return.
\blankline
\example
\begin{program}{10.5em}
{\PA}{\it sc} \\
{\PB}source = {\it sortprogram}\\
{\PB}code = {\it sortcode} \\
\end{program}
If the compiler finds errors in a program text, the errors
are reported both on the screen and in the textfile {\it
errors}, but no program code is output.
\section{Program Execution}
You run a compiled {\Superpascal} program by typing the
command
\begin{center}
{\it sr}
\end{center}
\noindent
followed by a return. When the message
\begin{center}
code =
\end{center}
\noindent
appears, type the name of a program codefile followed by a
return. After the message
\begin{center}
select files?
\end{center}
\noindent
you have a choice:
\blankline
1.~If you type {\it no} followed by a return, the program
will be executed with text input from the {\it keyboard}
and text output on the {\it screen}.
\blankline
2.~If you type {\it yes} followed by a return, you will
first be asked to name the input file:
\begin{center}
input =
\end{center}
\noindent
Type the name of an existing textfile or the word {\it
keyboard} followed by a return. Finally, you will be asked
to name the output:
\begin{center}
output =
\end{center}
\noindent
Type the name of a new textfile or the word {\it screen}
followed by a return.
\blankline
\examples
\begin{program}{8.1em}
{\PA}{\it sr} \\
{\PB}code = {\it sortcode} \\
{\PB}select files? {\it no} \\
{\PA} \\
{\PA}{\it sr} \\
{\PB}code = {\it sortcode} \\
{\PB}select files? {\it yes}\\
{\PB}input = {\it testdata} \\
{\PB}output = {\it screen} \\
\end{program}
\section{Compile-time Errors}
During compilation, the following program errors are
reported:
\begin{itemize}
\item
{\it Ambiguous case constant:} Two case constants denote
the same value.
\item
{\it Ambiguous identifier:} A program, a function
declaration, a procedure declaration, or a record type
introduces two named entities with the same identifier.
\item
{\it Forall statement error:} In a restricted {\it forall}
statement, the element statement uses a target variable.
\item
{\it Function block error:} A procedure statement occurs
in the statement part of a function block.
\item
{\it Function parameter error:} A function uses an
explicit or implicit variable parameter.
\item
{\it Identifier kind error:} A named entity of the wrong
kind is used in some context. (Constants, types, fields,
variables, functions and procedures are different kinds of
named entities.)
\item
{\it Incomplete comment:} The closing delimiter \} of a
comment is missing.
\item
{\it Index range error:} The index range of an array type
has a lower bound that exceeds the upper bound.
\item
{\it Number error:} A constant denotes a number outside
the range of integers or reals.
\item
{\it Parallel statement error:} In a restricted parallel
statement, a target variable of one process statement is
also a target or an expression variable of another process
statement.
\item
{\it Procedure statement error:} In a restricted procedure
statement, an entire variable is used more than once as a
restricted actual parameter.
\item
{\it Recursion error:} A recursive function or procedure
uses an implicit parameter.
\item
{\it Syntax error:} The program syntax is incorrect.
\item
{\it Type error:} The type of an operand is incompatible
with its use.
\item
{\it Undefined identifier:} An identifier is used without
being defined.
\end{itemize}
\section{Run-time Errors}
During program execution, the following program errors are
reported:
\begin{itemize}
\item
{\it Channel contention:} Two processes both attemp to
send or receive through the same channel.
\item
{\it Deadlock:} Every process is delayed by a send or
receive operation, but none of these operations match.
\item
{\it False assumption:} An assume statement denotes a
false assumption.
\item
{\it Message type error}: Two processes attempt to
communicate through the same channel, but the output
expression and the input variable are of different message
types.
\item
{\it Range error:} The value of an index expression or a
{\it chr, pred,} or {\it succ} function designator is out
of range.
\item
{\it Undefined case constant:} A case expression does not
denote a case constant.
\item
{\it Undefined channel reference:} A channel expression
does not denote a channel.
\end{itemize}
\section{Software Limits}
If a program is too large to be compiled or run, the software
displays one of the following messages and stops. Each
message indicates that the limit of a particular software
array type has been exceeded:
\begin{itemize}
\item
{\it Block limit exceeded:} The total number of blocks
defined by the program and its function declarations,
procedure declarations, {\it forall} statements, and
process statements exceeds the limit {\it maxblock}.
\item
{\it Branch limit exceeded:} The total number of branches
denoted by all statements in the program exceeds the limit
{\it maxlabel}.
\item
{\it Buffer limit exceeded:} The size of the compiled code
exceeds the limit {\it maxbuf}.
\item
{\it Case limit exceeded:} The number of case constants
exceeds the limit {\it maxcase}.
\item
{\it Channel limit exceeded:} The number of channels
opened exceeds the limit {\it maxchan}.
\item
{\it Character limit exceeded:} The total number of
characters in all word symbols and identifiers exceeds the
limit {\it maxchar}.
\item
{\it Memory limit exceeded:} The program execution exceeds
the limit {\it maxaddr}.
\item
{\it Nesting limit exceeded:} The level of nesting of the
program and its function declarations, procedure
declarations, parallel statements, and {\it forall}
statements exceeds the limit {\it maxlevel}.
\item
{\it String limit exceeded:} The number of characters in a
word symbol, an identifier, or a character string exceeds
the limit {\it maxstring}.
\end{itemize}
The standard {\it software limits} are:
\begin{mytabular}{llrllr}
maxaddr & = & 100000 & maxchar & = & 10000 \\
maxblock & = & 200 & maxlabel & = & 1000 \\
maxbuf & = & 10000 & maxlevel & = & 10 \\
maxcase & = & 128 & maxstring & = & 80 \\
maxchan & = & 10000 & & & \\
\end{mytabular}
If these limits are too small for compilation or execution of
a program, the limits must be increased by editing a common
declaration file and recompiling both the compiler and the
interpreter [Brinch Hansen 1993b].
\begin{mybibliography}{2}
\entry
Brinch Hansen, P. (1993a) The programming language
SuperPascal. School of Computer and Information Science,
Syracuse University, Syracuse, NY.
\entry
Brinch Hansen, P. (1993b) The SuperPascal software notes.
School of Computer and Information Science, Syracuse
University, Syracuse, NY.
\end{mybibliography}
\end{document}