fdoc

subroutinelink_bindingprivate

subroutine link_binding(p, id)

Find what a type-bound procedure binds to and its interface.

Arguments

NameTypeIntentAttributesDescription
ptype(project_t)inout

the project

idintegerin

the binding

Calls

Source

Show the code
subroutine link_binding(p, id)
    type(project_t), intent(inout) :: p     !! the project
    integer, intent(in) :: id               !! the binding
    integer :: parent, k, found

    parent = p%list%box(id)%e%parent
    associate (b => p%list%box(id)%e)
        allocate (b%more%binding_ids(size(b%more%bindings)))
        b%more%binding_ids = 0
        if (allocated(b%more%proto_text)) then
            b%proto_id = find_symbol(p, parent, lowercase(b%more%proto_text), 1)
            if (b%proto_id == 0) b%proto_id = find_symbol(p, parent, lowercase(b%more%proto_text), 2)
        end if
        do k = 1, size(b%more%bindings)
            if (b%generic) then
                found = type_binding(p, parent, lowercase(b%more%bindings(k)%s))
            else if (b%deferred) then
                found = 0
            else
                found = find_symbol(p, parent, lowercase(b%more%bindings(k)%s), 1)
                if (found > 0) p%list%box(found)%e%bound_to = parent
            end if
            b%more%binding_ids(k) = found
        end do
    end associate
end subroutine link_binding

Graphs

Calls

Called by