semantic: Gather foreach statements.