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