grammer remove left recursion, factoring