summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorJordan Wiens <jordan@psifertex.com>2018-02-16 10:48:13 -0500
committerPeter LaFosse <peter@vector35.com>2018-03-23 17:10:06 -0400
commit97381d636410ca5e9072206e7ac75c935de7bb87 (patch)
treed346e52df75740f900259931ae459c3d053c774c /python
parentc4de5e0bbe549133b12eac13ce819e2e726fa692 (diff)
implement missing get_semantic_flag_class_name and get_semantic_flag_group_name
Diffstat (limited to 'python')
-rw-r--r--python/architecture.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/python/architecture.py b/python/architecture.py
index 028fdeaa..51a7cfba 100644
--- a/python/architecture.py
+++ b/python/architecture.py
@@ -1831,6 +1831,21 @@ class Architecture(object):
return sem_class.index
return sem_class
+ def get_semantic_flag_class_name(self, class_index):
+ """
+ ``get_semantic_flag_class_name`` gets the name of a semantic flag class from the index.
+
+ :param int _index: class_index
+ :return: the name of the semantic flag class
+ :rtype: str
+ """
+ if not isinstance(class_index, int):
+ raise ValueError("argument 'class_index' must be an intege")
+ try:
+ return self._semantic_flag_classes_by_index[class_index]
+ except KeyError:
+ raise AttributeError("argument class_index is not a valid class index")
+
def get_semantic_flag_group_index(self, sem_group):
if isinstance(sem_group, str):
return self._semantic_flag_groups[sem_group]
@@ -1838,6 +1853,21 @@ class Architecture(object):
return sem_group.index
return sem_group
+ def get_semantic_flag_group_name(self, group_index):
+ """
+ ``get_semantic_flag_group_name`` gets the name of a semantic flag group from the index.
+
+ :param int group_index: group_index
+ :return: the name of the semantic flag group
+ :rtype: str
+ """
+ if not isinstance(group_index, int):
+ raise ValueError("argument 'group_index' must be an intege")
+ try:
+ return self._semantic_flag_groups_by_index[group_index]
+ except KeyError:
+ raise AttributeError("argument group_index is not a valid group index")
+
def get_intrinsic_name(self, intrinsic):
"""
``get_intrinsic_name`` gets an intrinsic name from an intrinsic number.