comparison python/ppci/core/module.py @ 107:1544e7a4aa98

Improvements
author Windel Bouwman
date Tue, 01 Jan 2013 17:16:05 +0100
parents f2d980eef509
children
comparison
equal deleted inserted replaced
106:f2d980eef509 107:1544e7a4aa98
1
2 from .value import Value 1 from .value import Value
3 from .symboltable import SymbolTable 2 from .symboltable import SymbolTable
4 3
5 class Module(Value): 4 class Module(Value):
6 """ 5 """
7 Main container for a piece of code. Contains globals and functions. 6 Main container for a piece of code. Contains globals and functions.
8 """ 7 """
9 def __init__(self): 8 def __init__(self, identifier=None):
10 self.identifier = None 9 self.identifier = identifier
11 self.functions = [] # Do functions come out of symbol table? 10 self.functions = [] # Do functions come out of symbol table?
12 self.globals_ = [] # TODO: are globals in symbol table? 11 self.globals_ = [] # TODO: are globals in symbol table?
13 self.symtable = SymbolTable() 12 self.symtable = SymbolTable()
14 13
15 Globals = property(lambda self: self.globals_) 14 Globals = property(lambda self: self.globals_)