Quick start manual

Syntactic elements
4-1
Chapter
4
Chapter4
Syntactic elements
The Delphi Language uses the ASCII character set, including the letters A through Z
and a through z, the digits 0 through 9, and other standard characters. It is not case-
sensitive. The space character (ASCII 32) and the control characters (ASCII 0 through
31—including ASCII 13, the return or end-of-line character) are called blanks.
Fundamental syntactic elements, called tokens, combine to form expressions,
declarations, and statements. A statement describes an algorithmic action that can be
executed within a program. An expression is a syntactic unit that occurs within a
statement and denotes a value. A declaration defines an identifier (such as the name of
a function or variable) that can be used in expressions and statements, and, where
appropriate, allocates memory for the identifier.
Fundamental syntactic elements
On the simplest level, a program is a sequence of tokens delimited by separators. A
token is the smallest meaningful unit of text in a program. A separator is either a blank
or a comment. Strictly speaking, it is not always necessary to place a separator
between two tokens; for example, the code fragment
Size:=20;Price:=10;
is perfectly legal. Convention and readability, however, dictate that we write this as
Size := 20;
Price := 10;
Tokens are categorized as special symbols, identifiers, reserved words, directives, numerals,
labels, and character strings. A separator can be part of a token only if the token is a
character string. Adjacent identifiers, reserved words, numerals, and labels must
have one or more separators between them.