generalize grammar