A state machine program is generated from a state machine. The state machine has states, transitions and events. A basic structure for the state machine program is generated... A statement is generated within the structure for transitioning the current state to the next state.