Here is the required syntax for an identifier in BNF format:
identifier ::= letter { [ "_" ] letter_or_digit }
letter_or_digit ::= letter | digit
All characters of an identifier are significant, and Ada compilers must support lines and identifier lengths of at least 200 (!) characters. Hopefully you won't use that many, of course, but the idea is to be very flexible.
One implication of this syntax is that underscores must not be adjacent to each other. This was intentional, because on some printers two adjacent underscores look the same as one underscore. Underscores also can't begin or end an identifier.
The Ada language permits the single letters "L" and "O" to be identifiers, but I recommend against it - a lower case "L" is nearly indistinguishable from a one, and an upper case "O" is nearly indistinguishable from a zero on some systems.
Go back to the previous section
Go up to the outline of lesson 3
David A. Wheeler (wheeler@ida.org)