diff python/ir/module.py @ 147:4e79484a9d47

Moved core to ir folder
author Windel Bouwman
date Fri, 22 Feb 2013 10:33:48 +0100
parents python/ppci/core/module.py@1544e7a4aa98
children b28a11c01dbe
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/python/ir/module.py	Fri Feb 22 10:33:48 2013 +0100
@@ -0,0 +1,17 @@
+from .value import Value
+from .symboltable import SymbolTable
+
+class Module(Value):
+   """
+      Main container for a piece of code. Contains globals and functions.
+   """
+   def __init__(self, identifier=None):
+      self.identifier = identifier
+      self.functions = [] # Do functions come out of symbol table?
+      self.globals_ = [] # TODO: are globals in symbol table?
+      self.symtable = SymbolTable()
+
+   Globals = property(lambda self: self.globals_)
+   Functions = property(lambda self: self.functions)
+   Identifier = property(lambda self: self.identifier)
+