Detects left recursion which leads to StackOverflowError in recursive descent algorithm.