Add initial implementation of state machine generation.