Try to perform the elimination of left recursion, the input grammar should have no cycles or ϵ-productions.