210
Pascal 4.0 User’s Guide
9
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:
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
array
integer
scalar
boolean
pointer
string
char
real
varying
file
record
Содержание SunSoft Pascal 4.0
Страница 14: ...xiv Pascal 4 0 User s Guide ...
Страница 16: ...xvi Pascal 4 0 User s Guide ...
Страница 30: ...6 Pascal 4 0 User s Guide 1 ...
Страница 160: ...136 Pascal 4 0 User s Guide 6 ...
Страница 268: ...244 Pascal 4 0 User s Guide 11 ...
Страница 320: ...296 Pascal 4 0 User s Guide B ...
Страница 331: ...Index 307 ...
Страница 333: ......