Finite automata and non-self-embedding grammars