Mercurial > lcfOS
annotate python/ir/module.py @ 170:4348da5ca307
Cleanup of ir dir
author | Windel Bouwman |
---|---|
date | Fri, 29 Mar 2013 17:33:17 +0100 |
parents | 9683a4cd848f |
children | 3eb9b9e2958d |
rev | line source |
---|---|
157 | 1 # IR-Structures: |
2 | |
155 | 3 class Module: |
170 | 4 """ Main container for a piece of code. """ |
155 | 5 def __init__(self, name): |
6 self.name = name | |
170 | 7 self.instructions = [] |
158 | 8 def __repr__(self): |
170 | 9 return 'IR-module [{0}]'.format(self.name) |
155 | 10 def getInstructions(self): |
11 return self.instructions | |
12 Instructions = property(getInstructions) | |
170 | 13 def dump(self): |
14 print(self) | |
15 for i in self.Instructions: | |
16 print(i) | |
17 print('END') | |
155 | 18 |