nfa_deallocate Subroutine

public pure subroutine nfa_deallocate(nfa)

Arguments

Type IntentOptional Attributes Name
type(nfa_state_node_t), intent(inout), allocatable :: nfa(:)

Source Code

   pure subroutine nfa_deallocate(nfa)
      implicit none
      type(nfa_state_node_t), allocatable, intent(inout) :: nfa(:)
      integer :: i

      if (.not. allocated(nfa)) return

      do i = NFA_STATE_BASE, ubound(nfa, dim=1)
         if (allocated(nfa(i)%forward)) deallocate(nfa(i)%forward)
         if (allocated(nfa(i)%backward)) deallocate(nfa(i)%backward)
      end do

      deallocate(nfa)
   end subroutine nfa_deallocate