Generating the skeleton of the state machine