    def to_file(self, filename: str):
        """Serialize the SymbolTable to a file.

        Every line in the symbol table file has two fields separated by
        space(s), tab(s) or both. The following is an example file:

        .. code-block::

            <eps> 0
            a 1
            b 2
            c 3

        Args:
          filename:
            Name of the symbol table file. Its format is documented above.
        """
        with open(filename, "w") as f:
            for idx, symbol in sorted(self._id2sym.items()):
                print(symbol, idx, file=f)
Serialize the SymbolTable to a file.

Every line in the symbol table file has two fields separated by
space(s), tab(s) or both. The following is an example file:

.. code-block::

<eps> 0
a 1
b 2
c 3

Args:
filename:
Name of the symbol table file. Its format is documented above.
utils/symbol_table.py