subroutineparse_statementprivate
subroutine parse_statement(list, unit, line, doc, s)
Read a statement that opens nothing, if it declares anything.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| list | type(entity_list_t) | inout | the entities | |
| unit | integer | in | the entity it is in | |
| line | character(len=*) | in | the statement | |
| doc | type(doc_lines_t) | in | the statement's documentation | |
| s | type(settings_t) | in | the settings |
Calls
- starts_word
- read_use
- read_binding
- read_final
- read_module_procedures
- read_namelist
- read_common
- is_attribute_statement
- read_attribute_statement
- is_type_declaration
- read_declaration
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