deallocate_tree Subroutine

private pure subroutine deallocate_tree(tree)

This subroutine deallocate the syntax tree.

Arguments

Type IntentOptional Attributes Name
type(tree_node_t), intent(inout), allocatable :: tree(:)

Source Code

   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