subroutineapply_oneprivate
subroutine apply_one(e, u, value)
Apply attribute value, from a statement in unit u, to entity e.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| e | type(entity_t) | inout | the entity | |
| u | type(entity_t) | in | the unit | |
| value | character(len=*) | in | the attribute |
Calls
Source
Show the code
subroutine apply_one(e, u, value)
type(entity_t), intent(inout) :: e !! the entity
type(entity_t), intent(in) :: u !! the unit
character(len=*), intent(in) :: value !! the attribute
integer :: k, at
select case (value)
case ('public', 'private', 'protected')
e%permission = value
return
end select
if (e%kind == E_VARIABLE) then
if (starts_with(value, 'intent(')) then
e%intent = value(8:len(value) - 1)
return
end if
if (value == 'parameter') then
call push(e%attribs, value)
do k = 1, size(u%more%parameters)
if (u%more%parameters(k)%name == lowercase(e%name)) e%initial = u%more%parameters(k)%value
end do
return
end if
at = index(value, '(')
if (at > 0 .and. (starts_with(value, 'pointer') .or. starts_with(value, 'allocatable'))) then
call push(e%attribs, value(:at - 1))
e%dimension = value(at:)
return
end if
else if (starts_with(value, 'bind')) then
e%more%bind_c = value(6:len(value) - 1)
return
end if
call push(e%attribs, value)
end subroutine apply_one