A major revision of Berstel and Perrin's classic Theory of Codes, this book has been written with a more modern focus and a much broader coverage of the subject. It is a comprehensive reference on the theory of variable-length codes and their relation to automata.