improved rag iterators w.r.t. lemon compatibility