Mercurial > lcfOS
diff python/ppci/core/value.py @ 110:9e552d34bd60
Work on compiler
author | Windel Bouwman |
---|---|
date | Fri, 04 Jan 2013 15:25:58 +0100 |
parents | ed230e947dc6 |
children |
line wrap: on
line diff
--- a/python/ppci/core/value.py Tue Jan 01 17:17:44 2013 +0100 +++ b/python/ppci/core/value.py Fri Jan 04 15:25:58 2013 +0100 @@ -1,13 +1,15 @@ class Value: - def __init__(self, vty): - self.valueType = ty + def __init__(self, vty=None): + self.valueType = vty self.name = None def getContext(self): return self.valueType.context def dump(self): print(self) + def getName(self): + return self.name def setName(self, name): if not self.name and not name: return @@ -17,4 +19,11 @@ pass else: pass + Name = property(getName, setName) +class Constant(Value): + def __init__(self, value, vty): + super().__init__(vty) + self.value = value + print('new constant value: ', value) +