Contents | Prev | Next

2.8.1 What are identifiers?

Identifiers are sequences of letters, digits, and underscores that start with a letter or an underscore (_). NOTE: Standard Pascal does not allow underscores in identifiers. By default identifiers are not case-sensitive so for example

grade    and     Grade    and     GRADE

are normally considered to be the same identifier. NOTE: There is a compiler option that will make reserved words and identifiers case-sensitive. Some programmers prefer case-sensitive languages since these languages consider identifiers that differ only in case to be different identifiers. This is often used to allow strongly related identifiers to have the same spelling (i.e. differ only in case).

Example

For example consider the code fragment below.

type
   STUDENT = record
      name : string;
      address : string;
      grade : integer;
   end;
var
   student : STUDENT;

The use of the same spelling for the variable student and its type STUDENT emphasize the connection between the two.

You should use this compiler option with caution (or not at all) since this feature of Irie Pascal is not supported by many (if any) other Pascal compilers.

Syntax

   identifier = letter { letter | digit }

   letter = 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h' | 'i' | 'j' |
               'k' | 'l' | 'm' | 'n' | 'o' | 'p' | 'q' | 'r' | 's' | 't' |
               'u' | 'v' | 'w' | 'x' | 'y' | 'z' |
               '_'

   digit = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'

Contents | Prev | Next