mirror of
https://github.com/RRZE-HPC/OSACA.git
synced 2026-01-04 18:20:09 +01:00
Changed style to conform to PEP-8 conventions; Added source and destination attributes to parent Operand class
This commit is contained in:
@@ -2,19 +2,37 @@
|
||||
|
||||
|
||||
class Operand:
|
||||
def __init__(self, NAME_ID):
|
||||
self._NAME_ID = NAME_ID
|
||||
def __init__(self, name_id, source=False, destination=False):
|
||||
self._name_id = name_id
|
||||
self._source = source
|
||||
self._destination = destination
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
return self._NAME_ID
|
||||
return self._name_id
|
||||
|
||||
@property
|
||||
def source(self):
|
||||
return self._source
|
||||
|
||||
@property
|
||||
def destination(self):
|
||||
return self._destination
|
||||
|
||||
@name.setter
|
||||
def name(self, name):
|
||||
self._NAME_ID = name
|
||||
self._name_id = name
|
||||
|
||||
@name.setter
|
||||
def source(self, source):
|
||||
self._source = source
|
||||
|
||||
@destination.setter
|
||||
def destination(self, destination):
|
||||
self._destination = destination
|
||||
|
||||
def __repr__(self):
|
||||
return f"Operand(NAME_ID={self._NAME_ID}"
|
||||
return f"Operand(name_id={self._name_id},source={self._source},destination={self._destination})"
|
||||
|
||||
def __str__(self):
|
||||
return f"Name: {self._NAME_ID}"
|
||||
return f"Name: {self._name_id}, Source: {self._source}, Destination: {self._destination}"
|
||||
|
||||
Reference in New Issue
Block a user