Commit | Line | Data |
---|---|---|
8229e7ad BJ |
1 | .if \n(xx .bp |
2 | .if !\n(xx \{\ | |
3 | .so tmac.p \} | |
4 | .if n 'ND | |
5 | .nr H1 2 | |
6 | .NH | |
7 | Error diagnostics | |
8 | .PP | |
9 | This section of the | |
10 | .UM | |
11 | discusses the error diagnostics of the programs | |
12 | .PI | |
13 | and | |
14 | .X . | |
15 | .I Pix | |
16 | is a simple but useful program which invokes | |
17 | .PI | |
18 | and | |
19 | .X | |
20 | to do all the real processing. | |
21 | See its manual section | |
22 | .IX | |
23 | (1) | |
24 | and section 5.2 below for more details. | |
25 | .NH 2 | |
26 | Translator syntax errors | |
27 | .PP | |
28 | A few comments on the general nature of the syntax errors usually | |
29 | made by Pascal programmers | |
30 | and the recovery mechanisms of the current translator may help in using | |
31 | the system. | |
32 | .SH | |
33 | Illegal characters | |
34 | .PP | |
35 | Characters such as `$', `!', and `@' are not part of the language Pascal. | |
36 | If they are found in the source program, | |
37 | and are not part of a constant string, a constant character, or a comment, | |
38 | they are considered to be | |
39 | `illegal characters'. | |
40 | This can happen if you leave off an opening string quote `\(aa'. | |
41 | Note that the character `"', although used in English to quote strings, | |
42 | is not used to quote strings in Pascal. | |
43 | Most non-printing characters in your input are also illegal except | |
44 | in character constants and character strings. | |
45 | Except for the tab and form feed characters, | |
46 | which are used to ease formatting of the program, | |
47 | non-printing characters in the input file print as the character `?' | |
48 | so that they will show in your listing. | |
49 | .SH | |
50 | String errors | |
51 | .PP | |
52 | There is no character string of length 0 in Pascal. | |
53 | Consequently the input `\(aa\(aa' is not acceptable. | |
54 | Similarly, encountering an end-of-line after an opening string quote `\(aa' | |
55 | without encountering the matching closing quote yields the diagnostic | |
56 | ``Unmatched \(aa for string''. | |
57 | It is permissible to use the character `#' | |
58 | instead of `\'' | |
59 | to delimit character and constant strings for portability reasons. | |
60 | For this reason, a spuriously placed `#' sometimes causes the diagnostic | |
61 | about unbalanced quotes. | |
62 | Similarly, a `#' in column one is used when preparing programs which are to | |
63 | be kept in multiple files. | |
64 | See section 5.9 for details. | |
65 | .SH | |
66 | Comments in a comment, non-terminated comments | |
67 | .PP | |
68 | As we saw above, these errors are usually caused by leaving off a comment | |
69 | delimiter. | |
70 | You can convert parts of your program to comments | |
71 | without generating this diagnostic | |
72 | since there are two different kinds of comments \- those delimited by | |
73 | `{' and `}', and those delimited by `(*' and `*)'. | |
74 | Thus consider: | |
75 | .LS | |
76 | { This is a comment enclosing a piece of program | |
77 | a := functioncall; (* comment within comment *) | |
78 | procedurecall; | |
79 | lhs := rhs; (* another comment *) | |
80 | } | |
81 | .LE | |
82 | .PP | |
83 | By using one kind of comment exclusively in your program you can use | |
84 | the other delimiters when you need to | |
85 | ``comment out'' | |
86 | parts of your program\*(dg. | |
87 | .FS | |
88 | \*(dgIf you wish to transport your program, | |
89 | especially to the 6000-3.4 implementation, | |
90 | you should use the character sequence `(*' to delimit comments. | |
91 | For transportation over the | |
92 | .I rcslink | |
93 | to Pascal 6000-3.4, the character `#' should be used to delimit characters | |
94 | and constant strings. | |
95 | .FE | |
96 | In this way you will also allow the translator to help by detecting | |
97 | statements accidentally placed within comments. | |
98 | .PP | |
99 | If a comment does not terminate before the end of the input file, | |
100 | the translator will point to the beginning of the comment, | |
101 | indicating that the comment is not terminated. | |
102 | In this case processing will terminate immediately. | |
103 | See the discussion of ``QUIT'' below. | |
104 | .SH | |
105 | Digits in numbers | |
106 | .PP | |
107 | This part of the language is a minor nuisance. | |
108 | Pascal requires digits in real numbers both before and after the decimal | |
109 | point. | |
110 | Thus the following statements, which look quite reasonable to | |
111 | .SM | |
112 | FORTRAN | |
113 | .NL | |
114 | users, generate diagnostics in Pascal: | |
115 | .LS | |
116 | .so digitsout | |
117 | .LE | |
118 | These same constructs are also illegal as input to the Pascal interpreter | |
119 | .I px . | |
120 | .SH | |
121 | Replacements, insertions, and deletions | |
122 | .PP | |
123 | When a syntax error is encountered in the input text, | |
124 | the parser invokes an error recovery procedure. | |
125 | This procedure examines the input text immediately after the point | |
126 | of error and considers a set of simple corrections to see whether they | |
127 | will allow the analysis to continue. | |
128 | These corrections involve replacing an input token with a different | |
129 | token, | |
130 | inserting a token, | |
131 | or replacing an input token with a different token. | |
132 | Most of these changes will not cause fatal syntax errors. | |
133 | The exception is the insertion of or replacement with a symbol | |
134 | such as an identifier or a number; | |
135 | in this case the recovery makes no attempt to determine | |
136 | .I which | |
137 | identifier or | |
138 | .I what | |
139 | number should be inserted, | |
140 | hence these are considered fatal syntax errors. | |
141 | .PP | |
142 | Consider the following example. | |
143 | .LS | |
144 | % \*bpix -l synerr.p\fR | |
145 | .tr -- | |
146 | .so synerrout | |
147 | % | |
148 | .LE | |
149 | The only surprise here may be that Pascal does not have an exponentiation | |
150 | operator, hence the complaint about `**'. | |
151 | This error illustrates that, if you assume that the language has a feature | |
152 | which it does not, the translator diagnostic may not indicate this, | |
153 | as the translator is unlikely to recognize the construct you supply. | |
154 | .SH | |
155 | Undefined or improper identifiers | |
156 | .PP | |
157 | If an identifier is encountered in the input but is undefined, | |
158 | the error recovery will replace it with an identifier of the | |
159 | appropriate class. | |
160 | Further references to this identifier will be summarized at the | |
161 | end of the containing | |
162 | .B procedure | |
163 | or | |
164 | .B function | |
165 | or at the end of the | |
166 | .B program | |
167 | if the reference occurred in the main program. | |
168 | Similarly, | |
169 | if an identifier is used in an inappropriate way, | |
170 | e.g. if a | |
171 | .B type | |
172 | identifier is used in an assignment statement, | |
173 | or if a simple variable | |
174 | is used where a | |
175 | .B record | |
176 | variable is required, | |
177 | a diagnostic will be produced and an identifier of the appropriate | |
178 | type inserted. | |
179 | Further incorrect references to this identifier will be flagged only | |
180 | if they involve incorrect use in a different way, | |
181 | with all incorrect uses being summarized in the same way as undefined | |
182 | variable uses are. | |
183 | .SH | |
184 | Expected symbols, malformed constructs | |
185 | .PP | |
186 | If none of the above mentioned corrections appear reasonable, the | |
187 | error recovery will examine the input | |
188 | to the left of the point of error to see if there is only one symbol | |
189 | which can follow this input. | |
190 | If this is the case, the recovery will print a diagnostic which | |
191 | indicates that the given symbol was `Expected'. | |
192 | .PP | |
193 | In cases where none of these corrections resolve the problems | |
194 | in the input, | |
195 | the recovery may issue a diagnostic that indicates that the | |
196 | input is ``malformed''. | |
197 | If necessary, the translator may then skip forward in the input to | |
198 | a place where analysis can continue. | |
199 | This process may cause some errors in the text to be missed. | |
200 | .PP | |
201 | Consider the following example: | |
202 | .LS | |
203 | % \*bpix -l synerr2.p\fR | |
204 | .so synerr2out | |
205 | % | |
206 | .LE | |
207 | Here we misspelled | |
208 | .I input | |
209 | and gave a | |
210 | .SM FORTRAN | |
211 | style variable declaration | |
212 | which the translator diagnosed as a `Malformed declaration'. | |
213 | When, on line 6, we used `(' and `)' for subscripting | |
214 | (as in | |
215 | .SM FORTRAN ) | |
216 | rather than the `[' and `]' which are used in Pascal, | |
217 | the translator noted that | |
218 | .I a | |
219 | was not defined as a | |
220 | .B procedure . | |
221 | This occurred because | |
222 | .B procedure | |
223 | and | |
224 | .B function | |
225 | argument lists are delimited by parentheses in Pascal. | |
226 | As it is not permissible to assign to procedure calls the translator | |
227 | diagnosed a malformed statement at the point of assignment. | |
228 | .SH | |
229 | Expected and unexpected end-of-file, ``QUIT'' | |
230 | .PP | |
231 | If the translator finds a complete program, but there is more non-comment text | |
232 | in the input file, then it will indicate that an end-of-file was expected. | |
233 | This situation may occur after a bracketing error, or if too many | |
234 | .B end s | |
235 | are present in the input. | |
236 | The message may appear | |
237 | after the recovery says that it | |
238 | ``Expected \`.\'\|'' | |
239 | since `.' is the symbol that terminates a program. | |
240 | .PP | |
241 | If severe errors in the input prohibit further processing | |
242 | the translator may produce a diagnostic followed by ``QUIT''. | |
243 | One example of this was given above \- | |
244 | a non-terminated comment; | |
245 | another example is a line which is longer than 160 | |
246 | characters. | |
247 | Consider also the following example. | |
248 | .LS | |
249 | % \*bpix -l mism.p\fR | |
250 | .so mismout | |
251 | % | |
252 | .LE | |
253 | .NH 2 | |
254 | Translator semantic errors | |
255 | .PP | |
256 | The extremely large number of semantic diagnostic messages which the translator | |
257 | produces make it unreasonable to discuss each message or group of messages | |
258 | in detail. | |
259 | The messages are, however, very informative. | |
260 | We will here explain the typical formats and the terminology used in the error | |
261 | messages so that you will be able to make sense out of them. | |
262 | In any case in which a diagnostic is not completely comprehensible you can | |
263 | refer to the | |
264 | .I "User Manual" | |
265 | by Jensen and Wirth for examples. | |
266 | .SH | |
267 | Format of the error diagnostics | |
268 | .PP | |
269 | As we saw in the example program above, the error diagnostics from | |
270 | the Pascal translator include the number of a line in the text of the program | |
271 | as well as the text of the error message. | |
272 | While this number is most often the line where the error occurred, it | |
273 | is occasionally the number of a line containing a bracketing keyword | |
274 | like | |
275 | .B end | |
276 | or | |
277 | .B until . | |
278 | In this case, the diagnostic may refer to the previous statement. | |
279 | This occurs because of the method the translator uses for sampling line | |
280 | numbers. | |
281 | The absence of a trailing `;' in the previous statement causes the line | |
282 | number corresponding to the | |
283 | .B end | |
284 | or | |
285 | .B until . | |
286 | to become associated with the statement. | |
287 | As Pascal is a free-format language, the line number associations | |
288 | can only be approximate and may seem arbitrary to some users. | |
289 | This is the only notable exception, however, to reasonable associations. | |
290 | .SH | |
291 | Incompatible types | |
292 | .PP | |
293 | Since Pascal is a strongly typed language, many semantic errors manifest | |
294 | themselves as type errors. | |
295 | These are called `type clashes' by the translator. | |
296 | The types allowed for various operators in the language are summarized on page | |
297 | 108 of the | |
298 | Jensen-Wirth | |
299 | .I "User Manual" . | |
300 | It is important to know that the Pascal translator, in its diagnostics, | |
301 | distinguishes between the following type `classes': | |
302 | .br | |
303 | .ne 8 | |
304 | .TS | |
305 | center; | |
306 | lew(10) le le le le. | |
307 | array Boolean char file integer | |
308 | pointer real record scalar string | |
309 | .TE | |
310 | These words are plugged into a great number of error messages. | |
311 | Thus, if you tried to assign an | |
312 | .I integer | |
313 | value to a | |
314 | .I char | |
315 | variable you would receive a diagnostic like the following: | |
316 | .LS | |
317 | .so clashout | |
318 | .LE | |
319 | In this case, one error produced a two line error message. | |
320 | If the same error occurs more than once, the same explanatory | |
321 | diagnostic will be given each time. | |
322 | .SH | |
323 | Scalar | |
324 | .PP | |
325 | The only class whose meaning is not self-explanatory is | |
326 | `scalar'. | |
327 | Scalar has a precise meaning in the | |
328 | Jensen-Wirth | |
329 | .I "User Manual" | |
330 | where, in fact, it refers to | |
331 | .I char , | |
332 | .I integer , | |
333 | .I real , | |
334 | and | |
335 | .I Boolean | |
336 | types as well as the enumerated types. | |
337 | For the purposes of the Pascal translator, | |
338 | scalar | |
339 | in an error message refers to a user-defined, enumerated | |
340 | type, such as | |
341 | .I ops | |
342 | in the example above or | |
343 | .I color | |
344 | in | |
345 | .LS | |
346 | \*btype\fP color = (red, green, blue) | |
347 | .LE | |
348 | For integers, the more explicit denotation | |
349 | .I integer | |
350 | is used. | |
351 | Although it would be correct, in the context of the | |
352 | .I "User Manual" | |
353 | to refer to an integer variable as a | |
354 | .I scalar | |
355 | variable | |
356 | .PI | |
357 | prefers the more specific identification. | |
358 | .SH | |
359 | Function and procedure type errors | |
360 | .PP | |
361 | For built-in procedures and functions, two kinds of errors occur. | |
362 | If the routines are called with the wrong number of arguments a message similar to: | |
363 | .LS | |
364 | .so sinout1 | |
365 | .LE | |
366 | is given. | |
367 | If the type of the argument is wrong, a message like | |
368 | .LS | |
369 | .so sinout2 | |
370 | .LE | |
371 | is produced. | |
372 | A few functions and procedures implemented in Pascal 6000-3.4 are | |
373 | diagnosed as unimplemented in | |
374 | Berkeley | |
375 | Pascal, notably those related to | |
376 | .B segmented | |
377 | files. | |
378 | .SH | |
379 | Can't read and write scalars, etc. | |
380 | .PP | |
381 | The messages which state that scalar (user-defined) types | |
382 | cannot be written to and from files are often mysterious. | |
383 | It is in fact the case that if you define | |
384 | .LS | |
385 | \*btype\fP color = (red, green, blue) | |
386 | .LE | |
387 | the translator does not associate these constants with the strings | |
388 | `red', `green', and `blue' in any way. | |
389 | If you wish such an association to be made, you will have to write a routine | |
390 | to make it. | |
391 | Note, in particular, that you can only read characters, integers and real | |
392 | numbers from text files. | |
393 | You cannot read strings or Booleans. | |
394 | It is possible to make a | |
395 | .LS | |
396 | \*bfile of\fP color | |
397 | .LE | |
398 | but the representation is binary rather than string. | |
399 | .SH | |
400 | Expression diagnostics | |
401 | .PP | |
402 | The diagnostics for semantically ill-formed expressions are very explicit. | |
403 | Consider this sample translation: | |
404 | .LS | |
405 | % \*bpi -l expr.p\fP | |
406 | .so exprout | |
407 | % | |
408 | .LE | |
409 | This example is admittedly far-fetched, but illustrates that the error | |
410 | messages are sufficiently clear to allow easy determination of the | |
411 | problem in the expressions. | |
412 | .SH | |
413 | Type equivalence | |
414 | .PP | |
415 | Several diagnostics produced by the Pascal translator complain about | |
416 | `non-equivalent types'. | |
417 | In general, | |
418 | Berkeley | |
419 | Pascal considers variables to have the same type only if they were | |
420 | declared with the same constructed type or with the same type identifier. | |
421 | Thus, the variables | |
422 | .I x | |
423 | and | |
424 | .I y | |
425 | declared as | |
426 | .LS | |
427 | \*bvar\fP | |
428 | x: ^ integer; | |
429 | y: ^ integer; | |
430 | .LE | |
431 | do not have the same type. | |
432 | The assignment | |
433 | .LS | |
434 | x := y | |
435 | .LE | |
436 | thus produces the diagnostics: | |
437 | .LS | |
438 | .so typequout | |
439 | .LE | |
440 | Thus it is always necessary to declare a type such as | |
441 | .LS | |
442 | \*btype\fP intptr = ^ integer; | |
443 | .LE | |
444 | and use it to declare | |
445 | .LS | |
446 | \*bvar\fP x: intptr; y: intptr; | |
447 | .LE | |
448 | Note that if we had initially declared | |
449 | .LS | |
450 | \*bvar\fP x, y: ^ integer; | |
451 | .LE | |
452 | then the assignment statement would have worked. | |
453 | The statement | |
454 | .LS | |
455 | x^ := y^ | |
456 | .LE | |
457 | is allowed in either case. | |
458 | Since the parameter to a | |
459 | .B procedure | |
460 | or | |
461 | .B function | |
462 | must be declared with a | |
463 | type identifier rather than a constructed type, | |
464 | it is always necessary, in practice, | |
465 | to declare any type which will be used in this way. | |
466 | .SH | |
467 | Unreachable statements | |
468 | .PP | |
469 | Berkeley | |
470 | Pascal flags unreachable statements. | |
471 | Such statements usually correspond to errors in the program logic. | |
472 | Note that a statement is considered to be reachable | |
473 | if there is a potential path of control, | |
474 | even if it can never be taken. | |
475 | Thus, no diagnostic is produced for the statement: | |
476 | .LS | |
477 | \*bif\fP false \*bthen\fP | |
478 | writeln('impossible!') | |
479 | .LE | |
480 | .SH | |
481 | Goto's into structured statements | |
482 | .PP | |
483 | The translator detects and complains about | |
484 | .B goto | |
485 | statements which transfer control into structured statements (\c | |
486 | .B for , | |
487 | .B while , | |
488 | etc.) | |
489 | It does not allow such jumps, nor does it allow branching from the | |
490 | .B then | |
491 | part of an | |
492 | .B if | |
493 | statement into the | |
494 | .B else | |
495 | part. | |
496 | Such checks are made only within the body of a single procedure or | |
497 | function. | |
498 | .SH | |
499 | Unused variables, never set variables | |
500 | .PP | |
501 | Although | |
502 | Berkeley | |
503 | Pascal always clears variables to 0 at | |
504 | .B procedure | |
505 | and | |
506 | .B function | |
507 | entry, it is | |
508 | .B not | |
509 | good programming practice to rely on this initialization. | |
510 | To discourage this practice, and to help detect errors in program logic, | |
511 | .PI | |
512 | flags as a `w' warning error: | |
513 | .IP | |
514 | .RS | |
515 | .HP 1) | |
516 | Use of a variable which is never assigned a value. | |
517 | .IP 2) | |
518 | A variable which is declared but never used, distinguishing | |
519 | between those variables for which values are computed but which are never | |
520 | used, and those completely unused. | |
521 | .RE | |
522 | .LP | |
523 | In fact, these diagnostics are applied to all declared items. | |
524 | Thus a | |
525 | .B constant | |
526 | or a | |
527 | .B procedure | |
528 | which is declared but never used is flagged. | |
529 | The | |
530 | .B w | |
531 | option of | |
532 | .PI | |
533 | may be used to suppress these warnings; | |
534 | see sections 5.1 and 5.2. | |
535 | .NH 2 | |
536 | Translator panics, i/o errors | |
537 | .SH | |
538 | Panics | |
539 | .PP | |
540 | One class of error which rarely occurs, but which causes termination | |
541 | of all processing when it does is a panic. | |
542 | A panic indicates a translator-detected internal inconsistency. | |
543 | A typical panic message is: | |
544 | .LS | |
545 | snark (rvalue) line=110 yyline=109 | |
546 | Snark in pi | |
547 | .LE | |
548 | If you receive such a message, the translation will be quickly and perhaps | |
549 | ungracefully terminated. | |
550 | You should contact a teaching assistant or a member of the system staff, | |
551 | after saving a copy of your program for later inspection. | |
552 | If you were making changes to an existing program when the problem | |
553 | occurred, you may | |
554 | be able to work around the problem by ascertaining which change caused the | |
555 | .I snark | |
556 | and making a different change or correcting an error in the program. | |
557 | You should report the problem in any case. | |
558 | Pascal system bugs cannot be fixed unless they are reported. | |
559 | .SH | |
560 | Out of memory | |
561 | .PP | |
562 | The only other error which will abort translation when no errors are | |
563 | detected is running out of memory. | |
564 | All tables in the translator, with the exception of the parse stack, | |
565 | are dynamically allocated, and can grow to take up the full available | |
566 | process space of 64000 bytes on the \s-2PDP\s0-11. On the \s-2VAX\s0-11, | |
567 | table sizes are extremely generous and very large (10000) line programs | |
568 | have been easily accomodated. For the \s-2PDP\s0\-11, it is | |
569 | generally true that | |
570 | the size of the largest translatable program is directly related to | |
571 | .B procedure | |
572 | and | |
573 | .B function | |
574 | size. | |
575 | A number of non-trivial Pascal programs, including | |
576 | some with more than 2000 lines and 2500 statements | |
577 | have been translated and interpreted using | |
578 | Berkeley | |
579 | Pascal on \s-2PDP\s0-11's. | |
580 | Notable among these are the Pascal-S | |
581 | interpreter, | |
582 | a large set of programs for automated generation of | |
583 | code generators, | |
584 | and a general context-free parsing program which has been used to | |
585 | parse sentences with a grammar for a superset of English. | |
586 | .PP | |
587 | If you receive an out of space message from the translator | |
588 | during translation of a large | |
589 | .B procedure | |
590 | or | |
591 | .B function | |
592 | or one containing a large number of string constants | |
593 | you may yet be able | |
594 | to translate your program if you break this one | |
595 | .B procedure | |
596 | or | |
597 | .B function | |
598 | into several routines. | |
599 | .SH | |
600 | I/O errors | |
601 | .PP | |
602 | Other errors which you may encounter when running | |
603 | .PI | |
604 | relate to input-output. | |
605 | If | |
606 | .PI | |
607 | cannot open the file you specify, | |
608 | or if the file is empty, | |
609 | you will be so informed. | |
610 | .NH 2 | |
611 | Run-time errors | |
612 | .PP | |
613 | We saw, in our second example, a run-time error. | |
614 | We here give the general description of run-time errors. | |
615 | The more unusual interpreter error messages are explained | |
616 | briefly in the manual section for | |
617 | .I px | |
618 | (1). | |
619 | .SH | |
620 | Start-up errors | |
621 | .PP | |
622 | These errors occur when the object file to be executed is not available | |
623 | or appropriate. | |
624 | Typical errors here are caused by the specified object file not existing, | |
625 | not being a Pascal object, or being inaccessible to the user. | |
626 | .SH | |
627 | Program execution errors | |
628 | .PP | |
629 | These errors occur when the program interacts with the Pascal runtime | |
630 | environment in an inappropriate way. | |
631 | Typical errors are values or subscripts out of range, | |
632 | bad arguments to built-in functions, | |
633 | exceeding the statement limit because of an infinite loop, | |
634 | or running out of memory\*(dd. | |
635 | .FS | |
636 | \*(ddThe checks for running out of memory are not foolproof and there | |
637 | is a chance that the interpreter will fault, producing a core image | |
638 | when it runs out of memory. | |
639 | This situation occurs very rarely. | |
640 | .FE | |
641 | The interpreter will produce a backtrace after the error occurs, | |
642 | showing all the active routine calls, | |
643 | unless the | |
644 | .B p | |
645 | option was disabled when the program was translated. | |
646 | Unfortunately, no variable values are given and no way of extracting them | |
647 | is available.* | |
648 | .FS | |
649 | * On the \s-2VAX\s0-11, each stack frame, and each variable allocated with | |
650 | .B new | |
651 | is restricted to allocate at most 32000 bytes of storage (this is a | |
652 | \s-2PDP\s0-11ism that has survived to the \s-2VAX\s0.) The compiled | |
653 | version of the system, which is currently under development, will | |
654 | remove this restriction. | |
655 | .FE | |
656 | .PP | |
657 | As an example of such an error, assume that we have accidentally | |
658 | declared the constant | |
659 | .I n1 | |
660 | to be 6, instead of 7 | |
661 | on line 2 of the program primes as given in section 2.6 above. | |
662 | If we run this program we get the following response. | |
663 | .LS | |
664 | % \*bpix primes.p\fP | |
665 | .so primeout3 | |
666 | % | |
667 | .LE | |
668 | .PP | |
669 | Here the interpreter indicates that the program terminated | |
670 | abnormally due to a subscript out of range near line 14, | |
671 | which is eight lines into the body of the program primes. | |
672 | .SH | |
673 | Interrupts | |
674 | .PP | |
675 | If the program is interrupted while executing | |
676 | and the | |
677 | .B p | |
678 | option was not specified, | |
679 | then a backtrace will be printed.\*(dg | |
680 | .FS | |
681 | \*(dgOccasionally, the Pascal system will be in an inconsistent | |
682 | state when this occurs, | |
683 | e.g. when an interrupt terminates a | |
684 | .B procedure | |
685 | or | |
686 | .B function | |
687 | entry or exit. | |
688 | In this case, the backtrace will only contain the current line. | |
689 | A reverse call order list of procedures will not be given. | |
690 | .FE | |
691 | The file | |
692 | .I pmon.out | |
693 | of profile information will be written if the program was translated | |
694 | with the | |
695 | .B z | |
696 | option enabled to | |
697 | .PI | |
698 | or | |
699 | .IX . | |
700 | .SH | |
701 | I/O interaction errors | |
702 | .PP | |
703 | The final class of interpreter errors results from inappropriate | |
704 | interactions with files, including the user's terminal. | |
705 | Included here are bad formats for integer and real numbers (such as | |
706 | no digits after the decimal point) when reading. | |
707 | .SH | |
708 | Panics | |
709 | .PP | |
710 | A small number of panics are possible with | |
711 | .I px . | |
712 | These should be reported to a teaching assistant or to the system | |
713 | staff if they occur. |