Changes by: Aleksey Nogin (nogin at cs.caltech.edu)
Date: 2005-03-16 22:33:31 -0800 (Wed, 16 Mar 2005)
Revision: 6959
Log message:
(Bug 405) When loading a .cmiz or .cmoz file, the grammar needs to be
reconstructed correctly.
It used to be the case that the following invariant may be assumed to be true
"among all the extended parents, at most one will have a non-empty grammar, or
the current module will have its own copy of the grammar". However now that
the filter-grammar keeps track of the grammar inheritance, this is no longer
true (one parent may have a grammar that contains the grammars of all other
parents). In other words, when loading a file and scanning parents, one now
has to take a _union_ of grammars (knowing that this lazy union will either
become singleton when flattened, or it will be shadowed by a PRLGrammar).
Also, when loading a .cmoz, we need to start by loading the grammar from .cmiz
(because this is what filter_parse starts with when parsing an .ml file).