Generating Error Control Codes With Automata and Transducers