Lang gram automata