Add left recursion detection