104
|
1 from .value import Value
|
105
|
2 from .symboltable import SymbolTable
|
104
|
3
|
|
4 class Module(Value):
|
105
|
5 """
|
|
6 Main container for a piece of code. Contains globals and functions.
|
|
7 """
|
107
|
8 def __init__(self, identifier=None):
|
|
9 self.identifier = identifier
|
106
|
10 self.functions = [] # Do functions come out of symbol table?
|
|
11 self.globals_ = [] # TODO: are globals in symbol table?
|
105
|
12 self.symtable = SymbolTable()
|
|
13
|
|
14 Globals = property(lambda self: self.globals_)
|
|
15 Functions = property(lambda self: self.functions)
|
106
|
16 Identifier = property(lambda self: self.identifier)
|
94
|
17
|