70
|
1
|
|
2 class Value:
|
110
|
3 def __init__(self, vty=None):
|
|
4 self.valueType = vty
|
70
|
5 self.name = None
|
|
6 def getContext(self):
|
|
7 return self.valueType.context
|
104
|
8 def dump(self):
|
|
9 print(self)
|
110
|
10 def getName(self):
|
|
11 return self.name
|
70
|
12 def setName(self, name):
|
|
13 if not self.name and not name:
|
|
14 return
|
|
15 self.name = name
|
110
|
16 Name = property(getName, setName)
|
158
|
17 def __repr__(self):
|
|
18 return 'VALUE {0}'.format(self.name)
|
70
|
19
|
110
|
20 class Constant(Value):
|
|
21 def __init__(self, value, vty):
|
|
22 super().__init__(vty)
|
|
23 self.value = value
|
|
24 print('new constant value: ', value)
|
|
25
|