Пример #1
0
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
Пример #2
0
 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
Пример #3
0
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')
Пример #4
0
def name_image(nameid):
    return name_table.Get_Name_Ptr(nameid).decode("utf-8")