Left recursion handling with loop.