view python/ppci/core/module.py @ 118:db8aafe00d27

Added elf file read scripts
author Windel Bouwman
date Sat, 12 Jan 2013 09:39:23 +0100
parents 1544e7a4aa98
children
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)