comparison python/ppci/ir.py @ 310:e95e5572cd6d

Added utils doc page
author Windel Bouwman
date Fri, 13 Dec 2013 14:10:10 +0100
parents 68b01c8abf8a
children 2c9768114877
comparison
equal deleted inserted replaced
309:68b01c8abf8a 310:e95e5572cd6d
1 """ 1 """
2 Intermediate representation (IR) code classes. 2 Intermediate representation (IR) code classes.
3 """ 3 """
4
4 5
5 class Module: 6 class Module:
6 """ Container unit for variables and functions. """ 7 """ Container unit for variables and functions. """
7 def __init__(self, name): 8 def __init__(self, name):
8 self.name = name 9 self.name = name
367 def __init__(self, target): 368 def __init__(self, target):
368 self.Targets = [target] 369 self.Targets = [target]
369 370
370 def setTarget(self, t): 371 def setTarget(self, t):
371 self.Targets[0] = t 372 self.Targets[0] = t
373
372 target = property(lambda s: s.Targets[0], setTarget) 374 target = property(lambda s: s.Targets[0], setTarget)
373 375
374 def __repr__(self): 376 def __repr__(self):
375 return 'JUMP {}'.format(self.target.name) 377 return 'JUMP {}'.format(self.target.name)
376 378