fdoc

subroutineparse_statementprivate

subroutine parse_statement(list, unit, line, doc, s)

Read a statement that opens nothing, if it declares anything.

Arguments

NameTypeIntentAttributesDescription
listtype(entity_list_t)inout

the entities

unitintegerin

the entity it is in

linecharacter(len=*)in

the statement

doctype(doc_lines_t)in

the statement's documentation

stype(settings_t)in

the settings

Calls

Source

Show the code
subroutine parse_statement(list, unit, line, doc, s)
    type(entity_list_t), intent(inout) :: list  !! the entities
    integer, intent(in) :: unit                 !! the entity it is in
    character(len=*), intent(in) :: line        !! the statement
    type(doc_lines_t), intent(in) :: doc        !! the statement's documentation
    type(settings_t), intent(in) :: s           !! the settings
    character(len=len(line)) :: low

    if (len(line) == 0) return
    low = lowercase(line)
    associate (u => list%box(unit)%e)
        if (.not. allocated(u%name)) return
        select case (trim(low))
        case ('public', 'private', 'protected')
            u%child_permission = trim(low)
            if (u%kind /= E_TYPE) u%permission = trim(low)
            return
        case ('sequence')
            u%sequence = .true.
            return
        end select
        if (u%kind == E_FILE) return

        if (starts_word(low, 'use')) then
            call read_use(u, line)
        else if (u%kind == E_TYPE .and. u%in_contains .and. &
                 (starts_word(low, 'procedure') .or. starts_word(low, 'generic'))) then
            call read_binding(list, unit, line, doc, s)
        else if (u%kind == E_TYPE .and. u%in_contains .and. starts_word(low, 'final')) then
            call read_final(list, unit, line)
        else if (u%kind == E_INTERFACE .and. (starts_word(low, 'module') .or. starts_word(low, 'procedure'))) then
            call read_module_procedures(u, line)
        else if (starts_word(low, 'namelist')) then
            call read_namelist(list, unit, line, doc, s)
        else if (starts_word(low, 'common')) then
            call read_common(list, unit, line, doc, s)
        else if (is_attribute_statement(low)) then
            call read_attribute_statement(u, line, low)
        else if (is_type_declaration(low)) then
            call read_declaration(list, unit, line, doc, s)
        end if
    end associate
end subroutine parse_statement

Graphs

Calls

Called by