A generic finite state machine compiler.