Mercurial > lcfOS
comparison 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 |
comparison
equal
deleted
inserted
replaced
108:8267ba1dbce3 | 110:9e552d34bd60 |
---|---|
1 | 1 |
2 class Value: | 2 class Value: |
3 def __init__(self, vty): | 3 def __init__(self, vty=None): |
4 self.valueType = ty | 4 self.valueType = vty |
5 self.name = None | 5 self.name = None |
6 def getContext(self): | 6 def getContext(self): |
7 return self.valueType.context | 7 return self.valueType.context |
8 def dump(self): | 8 def dump(self): |
9 print(self) | 9 print(self) |
10 | 10 |
11 def getName(self): | |
12 return self.name | |
11 def setName(self, name): | 13 def setName(self, name): |
12 if not self.name and not name: | 14 if not self.name and not name: |
13 return | 15 return |
14 self.name = name | 16 self.name = name |
15 | 17 |
16 if self.st: | 18 if self.st: |
17 pass | 19 pass |
18 else: | 20 else: |
19 pass | 21 pass |
22 Name = property(getName, setName) | |
20 | 23 |
24 class Constant(Value): | |
25 def __init__(self, value, vty): | |
26 super().__init__(vty) | |
27 self.value = value | |
28 print('new constant value: ', value) | |
29 |