fdoc

subroutineparse_chunksrecursiveprivate

recursive subroutine parse_chunks(t, parent, chunks)

Parse chunks into node parent.

Arguments

NameTypeIntentAttributesDescription
ttype(tree_t)inout

the conversion

parentintegerin

the node

chunkstype(string_t)indimension(:)

the chunks

Calls

Source

Show the code
recursive subroutine parse_chunks(t, parent, chunks)
    type(tree_t), intent(inout) :: t                !! the conversion
    integer, intent(in) :: parent                   !! the node
    type(string_t), intent(in) :: chunks(:)         !! the chunks
    type(string_t), allocatable :: stack(:)
    character(len=:), allocatable :: block
    integer :: n, k

    t%depth = t%depth + 1
    n = size(chunks)
    allocate (stack(n))
    do k = 1, n
        stack(n - k + 1)%s = chunks(k)%s
    end do
    do while (n > 0)
        call move_alloc(stack(n)%s, block)
        n = n - 1
        call parse_block(t, parent, block, stack, n)
    end do
    t%depth = t%depth - 1
end subroutine parse_chunks

Graphs

Calls

Called by