'Dump the grammar tables to a pickle file.
dump() recursively changes all dict to OrderedDict, so the pickled file
is not exactly the same as what was passed in to dump(). load() uses the
pickled file to create the tables, but  only changes OrderedDict to dict
at the top level; it does not recursively change OrderedDict to dict.
So, the loaded tables are different from the original tables that were
passed to load() in that some of the OrderedDict (from the pickled file)
are not changed back to dict. For parsing, this has no effect on
performance because OrderedDict uses dict\'s __getitem__ with nothing in
between.'

def dump(self, filename):

    with open(filename, 'wb') as f:
        d = _make_deterministic(self.__dict__)
        pickle.dump(d, f, 2)
