detect left recursion by marking rule calls with current position