def goto_definition(n, loc): "Return the declaration (as a node) under :param loc: or None" ref = find_def(n, loc) log.debug("for loc %u found node %s", loc, ref) if ref is None: return None log.debug("for loc %u id=%s", loc, name_table.Get_Name_Ptr(nodes.Get_Identifier(ref)).decode('utf-8')) ent = nodes.Get_Named_Entity(ref) return None if ent == nodes.Null_Iir else ent
def create_interfaces(inters): res = [] while inters != nodes.Null_Iir: res.append({ 'name': name_table.Get_Name_Ptr( nodes.Get_Identifier(inters)).decode('latin-1') }) inters = nodes.Get_Chain(inters) return res
def get_identifier_ptr(n): """Return the python string from node :param n: identifier""" return name_table.Get_Name_Ptr(nodes.Get_Identifier(n)).decode('utf-8')
def name_image(nameid): return name_table.Get_Name_Ptr(nameid).decode("utf-8")