make grammar left-recursive