The topology of singularities of flagged parallel manipulators