generates C++ code for a fsm machine from a list of transitions