Reformat the grammar