automaton__move Function

private pure function automaton__move(self, curr, symbol) result(res)

This function returns the dfa transition object, that contains the destination index and the corresponding set of transitionable NFA state.

Type Bound

automaton_t

Arguments

Type IntentOptional Attributes Name
class(automaton_t), intent(in) :: self
integer(kind=int32), intent(in) :: curr
character(len=*), intent(in) :: symbol

Return Value type(dfa_transition_t)


Source Code

   pure function automaton__move(self, curr, symbol) result(res)
      use :: forgex_lazy_dfa_node_m, only: dfa_transition_t
      implicit none
      class(automaton_t), intent(in) :: self
      integer(int32),     intent(in) :: curr    ! current index
      character(*),       intent(in) :: symbol  ! input symbol
      type(dfa_transition_t)         :: res

      type(nfa_state_set_t) :: set
      integer(int32)        :: next


      call self%destination(curr, symbol, next, set)

      ! Set the value of each component of the returned object.
      res%dst = next                      ! valid index of DFA node or DFA_INVALID_INDEX
      res%nfa_set = set

      ! res%c = symbol_to_segment(symbol) ! this component would not be used.
      ! res%own_j = DFA_INITIAL_INDEX     ! this component would not be used.
   end function automaton__move