view python/ir/module.py @ 149:74241ca312cc

Fixes on parser and semantics
author Windel Bouwman
date Fri, 01 Mar 2013 11:43:52 +0100
parents 4e79484a9d47
children b28a11c01dbe
line wrap: on
line source

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)