"Formal languages and their relation to automata" - читать интересную книгу автора (Hopcroft J.E., Ullman J.D.)