Exemplo n.º 1
0
def allInherits(interface):
    assert isinstance(interface, idlast.Interface)

    # It is possible to inherit from an interface through a chain of
    # typedef nodes. These need to be removed...

    # breadth first search
    def bfs(current, bfs):
        if current == []:
            return []

        # extend search one level deeper than current
        next = []
        for c in current:
            next.extend(map(remove_ast_typedefs_and_forwards, c.inherits()))

        return next + bfs(next, bfs)

    start = map(remove_ast_typedefs_and_forwards, interface.inherits())
    list = start + bfs(start, bfs)

    return util.setify(list)
Exemplo n.º 2
0
def allInherits(interface):
    assert isinstance(interface, idlast.Interface)
    
    # It is possible to inherit from an interface through a chain of
    # typedef nodes. These need to be removed...

    # breadth first search
    def bfs(current, bfs):
        if current == []:
            return []
        
        # extend search one level deeper than current
        next = []
        for c in current:
            next.extend(map(remove_ast_typedefs_and_forwards, c.inherits()))

        return next + bfs(next, bfs)

    start = map(remove_ast_typedefs_and_forwards, interface.inherits())
    list  = start + bfs(start, bfs)

    return util.setify(list)