comparison python/ppci/core/module.py @ 106:f2d980eef509

improved code generation
author Windel Bouwman
date Mon, 31 Dec 2012 18:26:56 +0100
parents 6a303f835c6d
children 1544e7a4aa98
comparison
equal deleted inserted replaced
105:6a303f835c6d 106:f2d980eef509
5 class Module(Value): 5 class Module(Value):
6 """ 6 """
7 Main container for a piece of code. Contains globals and functions. 7 Main container for a piece of code. Contains globals and functions.
8 """ 8 """
9 def __init__(self): 9 def __init__(self):
10 self.functions = [] 10 self.identifier = None
11 self.globals_ = [] 11 self.functions = [] # Do functions come out of symbol table?
12 self.globals_ = [] # TODO: are globals in symbol table?
12 self.symtable = SymbolTable() 13 self.symtable = SymbolTable()
13 14
14 Globals = property(lambda self: self.globals_) 15 Globals = property(lambda self: self.globals_)
15 Functions = property(lambda self: self.functions) 16 Functions = property(lambda self: self.functions)
17 Identifier = property(lambda self: self.identifier)
16 18