9

When you compile mism.p, the end-of-file is reached before an end delimiter

hostname% pc mism.p

 

E 26020-------

^---

Malformed declaration

15130-------

^---

Unexpected end-of-file - QUIT

 

 

 

Compiler Semantic Errors

The following sections explain the typical formats and terminology used in

Pascal error messages.

Format of the Error Diagnostics

In the example program above, the error diagnostics from the Pascal compiler include the line number in the text of the program, as well as the text of the error message. While this number is most often the line where the error occurred, it can refer to the line number containing a bracketing keyword like end or until. If so, the diagnostic may refer to the previous statement. This diagnostic occurs because of the method the compiler uses for sampling line numbers. The absence of a trailing semicolon (;) in the previous statement causes the line number corresponding to the end or until to become associated with the statement.

As Pascal is a free-format language, the line number associations can only be approximate and may seem arbitrary in some cases.

Incompatible Types

Since Pascal is a strongly-typed language, many type errors can occur, which are called type clashes by the compiler.

The Pascal compiler distinguishes among the following type classes in its diagnostics:

array

integer

scalar

boolean

pointer

string

char

real

varying

file

record

 

 

 

 

210

Pascal 4.0 User’s Guide