go to previous page   go to home page   go to next page



Here, the driver made three attempts to start the car, moving in and out of the "crank" state, then gave up and removed the key.

The automaton merely shows the position of the ignition switch. A better model might have states that show both the state of the engine and the state of the switch. For example, there could be automaton states "key in run position, engine not running" and "key in run position, engine running".

Several Characters per Arrow

finite automaton

The set of all Java identifiers is a regular language. The new example automaton accepts strings from that language. An identifier can start with any letter (upper or lower case), a dollar sign, or an underscore. To show all these possibilities in a compact form, a single transition is labeled:

$, _, a-z, A-Z

Ranges are indicated with a dash '-' and choices are separated with commas.


Is a single dollar sign a legal Java identifier?