
Lexical Analysis 39
Example. The reserved words may be described simply by listing them. For example,
abstract
| b oolean
| char
.
.
.
| while
Likewise for operators. For example,
=
| ==
| >
.
.
.
| *
Identifiers are easily described; for example,
([a- zA -Z ] | _ | $ )([a -zA - Z0 -9] | _ | $ )*
which is to say, an identifier begins with a letter, an underscore, or a dollar sign, followed
by zero or more letters, digits, underscores, and dollar signs.
A full description of the lexical syntax for j-- may be found in Appendix B. In the next
section, we formalize state transition diagrams.
2.4 Finite State Automata
It turns out that for any language described by a regular ...