VMS Help
PASCAL, Lexical Elements
*Conan The Librarian (sorry for the slow response - running on an old VAX)
|
|
A Pascal program is composed entirely of lexical elements.
These elements are individual symbols, such as arithmetic
operators, or they may be words that have special meanings in
Pascal. The basic unit of any lexical element is a character,
which must be a member of the ASCII character set.
The words used in a Pascal program are combinations of
alphabetic and numeric characters and occasionally a dollar sign
($), an underscore (_), or a percent sign (%). Some words are
reserved for the names of executable statements, operations, and
predefined data structures. Other words in a Pascal program are
identifiers. Predeclared identifiers represent routines and
data types provided by Compaq Pascal. Other identifiers are
created by the use to name programs, symbolic constants,
variables, and any necessary program elements that have not
already been named.
Compaq Pascal uses the extended American Standard Code for
Information Interchange (ASCII) character set. The is extended
ASCII character set contains 256 characters, which include the
following:
o Uppercase letters A through Z and lowercase letters a
through z
o Integers 0 through 9
o Special characters, such as the ampersand (&), question mark
(?), and equal sign (=)
o Nonprinting characters, such as the space, tab, line feed,
carriage return, and form feed (use of these characters may
improve the legibility of your programs)
o Extended, unspecified characters with numeric codes from 128
to 255
The Compaq Pascal compiler does not distinguish between
uppercase and lowercase letters except when they appear inside
apostrophes.
For a complete listing of the ASCII character set, see the
"Compaq Pascal Language Reference Manual."
Special symbols represent delimiters, operators, and other
syntactic elements. Some symbols are composed of more that one
character; you cannot place a space between the characters of
these special symbols. Examples of special symbols include the
apostrophe ('), the assignment operator (:=) and the not equal
sign (<>).
Reserved words are words that are reserved for the names of
statements, data types, directives, identifiers, specifiers,
statements, and operators. You cannot redefine these
identifiers. Examples of reserved words include AND, END, NOT,
IF, and WHILE.
Redefinable reserved words are used to name operators and
identifiers. You can redeclare these words, but, if you do, the
language feature becomes unavailable within the block in which
you redeclare the word. The redefinable reserved words are
AND_THEN, BREAK, CONTINUE, MODULE, OR_ELSE, OTHERWISE, REM,
RETURN, VALUE, and VARYING.
An identifier is a combination of letters, digits, dollar signs
($), and underscores (_) that conform to the following
restrictions:
o An identifier cannot start with a digit.
o An identifier cannot contain any space or special symbols.
o The first 31 characters must denote a unique name within the
block in which the identifier is declared. An identifier
longer than 31 characters generates a warning message; the
compiler ignores characters beyond the thirty-first
character. An identifier cannot start or end with an
underscore, nor can two adjacent
4.1 - Predeclared Identifiers
Predeclared identifiers name data types, symbolic constants and
file variables, procedures, and functions. You can redefine a
predeclared identifier, but, if you do, the original declaration
becomes unavailable within the block in which you redeclared the
word. Examples of predeclared identifiers include ADDRESS, COS,
ERR, INTEGER, SQR and TRUE.
4.2 - User Defined Identifiers
User identifiers denote the names of programs, modules, symbolic
constants, variables, procedures, functions, program sections,
and user-defined types. They represent significant data
structures, or values and actions that are not represented by
reserved words, predeclared identifiers, or special symbols.
[legal]
[privacy]
[GNU]
[policy]
[netiquette]
[sponsors]
[FAQ]
Polarhome, production since 1999.
Member of Polarhome portal.