Writes anonymous components (except junctions) to cmp.txt and then assigns names to them.