Passing in the parent instance to the child is a nice approach.  In the
end they still seem like separate entities though.  That is, the parent
is an object that the child can look at but the child hasn't actually
become the parent.  I'd like the child to become the parent including
all its previous attributes, good or otherwise.

You read a header and it says, I'm a shape at position (4,5).  So you
instantiate a shape at position (4,5).  Now you read further and it
says it is a square.  You'd now like the shape to change its class to
become a square with its additional attributes.

The way I've always followed is just to wait until later in the parsing
until knowing exactly what kind of an object you want to instantiate
and than using mmap or other ways to expose previously read data.  But
what if there is a lot of data in the header and what if the unions are
nested.  What about a more complex example like an animal or plant
phyla or taxon where there are many levels.  It seems there should be a
way to refine an object's classification as more detail is discovered
about it, and it seems that each level of classification should only
need to know about the next level below it.  The knowledge for
classification is contained within the class structure and
instantiation rather than in something external to the classes.

Kind regards,
Bob Anderson