Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(nfa_state_node_t), | intent(inout) | :: | self | |||
integer(kind=int32), | intent(in) | :: | src | |||
integer(kind=int32), | intent(in) | :: | dst | |||
type(segment_t), | intent(in) | :: | seg(:) |
pure subroutine nfa__add_transition (self, src, dst, seg) implicit none class(nfa_state_node_t), intent(inout) :: self integer(int32), intent(in) :: src, dst type(segment_t), intent(in) :: seg(:) integer :: j, k j = NFA_NULL_TRANSITION if (allocated(self%forward)) then do k = 1, self%forward_top if (dst == self%forward(k)%dst) then j = k end if end do end if if (j == NFA_NULL_TRANSITION) then j = self%forward_top end if if (.not. allocated(self%forward)) then call self%realloc_forward() end if if (any(seg == SEG_EPSILON)) then call self%forward(j)%c%flag_epsilon() else call self%forward(j)%c%add(seg) end if self%forward(j)%dst = dst self%forward(j)%is_registered = .true. if (j == self%forward_top) self%forward_top = self%forward_top + 1 end subroutine nfa__add_transition