diff options
| author | Jordan Wiens <jordan@psifertex.com> | 2018-02-16 10:48:13 -0500 |
|---|---|---|
| committer | Jordan Wiens <jordan@psifertex.com> | 2018-02-16 10:48:13 -0500 |
| commit | 73b3f7fc2ff9dab40f29da2031a0c6c71220d93c (patch) | |
| tree | d346e52df75740f900259931ae459c3d053c774c /python/architecture.py | |
| parent | d785ee1870ecd7ce0f5259d56d80cbf2e3f3c94d (diff) | |
implement missing get_semantic_flag_class_name and get_semantic_flag_group_name
Diffstat (limited to 'python/architecture.py')
| -rw-r--r-- | python/architecture.py | 30 |
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. |
