Return the toplevel *SymbolTable* for the source code. *filename* is the name of the file with the code and *compile_type* is the *compile()* mode argument.
(code, filename, compile_type)
| 10 | __all__ = ["symtable", "SymbolTable", "Class", "Function", "Symbol"] |
| 11 | |
| 12 | def symtable(code, filename, compile_type): |
| 13 | """ Return the toplevel *SymbolTable* for the source code. |
| 14 | |
| 15 | *filename* is the name of the file with the code |
| 16 | and *compile_type* is the *compile()* mode argument. |
| 17 | """ |
| 18 | top = _symtable.symtable(code, filename, compile_type) |
| 19 | return _newSymbolTable(top, filename) |
| 20 | |
| 21 | class SymbolTableFactory: |
| 22 | def __init__(self): |