This subroutine deallocate the syntax tree.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tree_node_t), | intent(inout), | allocatable | :: | tree(:) |
pure subroutine deallocate_tree(tree) implicit none type(tree_node_t), allocatable, intent(inout) :: tree(:) integer :: i do i = lbound(tree, dim=1), ubound(tree, dim=1) if (allocated(tree(i)%c)) deallocate(tree(i)%c) end do if (allocated(tree)) deallocate(tree) end subroutine deallocate_tree