dfa_graph_t Derived Type

type, public :: dfa_graph_t

This type has the entire graph of DFA states.


Components

Type Visibility Attributes Name Initial
integer(kind=int32), public :: alloc_count_node = 0
integer(kind=int32), public :: dfa_base = DFA_STATE_BASE
integer(kind=int32), public :: dfa_limit = DFA_STATE_UNIT
integer(kind=int32), public :: dfa_top = DFA_INVALID_INDEX
type(dfa_state_node_t), public, allocatable :: nodes(:)

Type-Bound Procedures

procedure, public :: add_transition => lazy_dfa__add_transition

  • private pure subroutine lazy_dfa__add_transition(self, state_set, src, dst, seg)

    This subroutine construct an new transition object from the arguments, and invokes the type-bound procedure of dfa_state_node_t with it.

    Arguments

    Type IntentOptional Attributes Name
    class(dfa_graph_t), intent(inout) :: self
    type(nfa_state_set_t), intent(in) :: state_set
    integer, intent(in) :: src
    integer, intent(in) :: dst
    type(segment_t), intent(in) :: seg

procedure, public :: free => lazy_dfa__deallocate

  • private pure subroutine lazy_dfa__deallocate(self)

    This subroutine performs deallocation of the arrays representing the DFA node transitions for every node in the DFA graph.

    Arguments

    Type IntentOptional Attributes Name
    class(dfa_graph_t), intent(inout) :: self

procedure, public :: preprocess => lazy_dfa__preprocess

  • private pure subroutine lazy_dfa__preprocess(self)

    This subroutine determines the number of DFA nodes the graph has and allocate the array.

    Arguments

    Type IntentOptional Attributes Name
    class(dfa_graph_t), intent(inout) :: self

procedure, public :: reallocate => lazy_dfa__reallocate

  • private pure subroutine lazy_dfa__reallocate(self)

    This subroutine performs reallocating array that represents the DFA graph.

    Read more…

    Arguments

    Type IntentOptional Attributes Name
    class(dfa_graph_t), intent(inout) :: self

procedure, public :: registered => lazy_dfa__registered_index

  • private pure function lazy_dfa__registered_index(self, set) result(res)

    Returns whether the DFA state is already registered by index, or DFA_INVALID_INDEX if it is not registered.

    Arguments

    Type IntentOptional Attributes Name
    class(dfa_graph_t), intent(in) :: self
    type(nfa_state_set_t), intent(in) :: set

    Return Value integer(kind=int32)

Source Code

   type, public :: dfa_graph_t
      !! This type has the entire graph of DFA states.
      type(dfa_state_node_t), allocatable :: nodes(:)
      integer(int32) :: dfa_base  = DFA_STATE_BASE
      integer(int32) :: dfa_limit = DFA_STATE_UNIT
      integer(int32) :: dfa_top   = DFA_INVALID_INDEX
      integer(int32) :: alloc_count_node = 0
   contains
      procedure :: preprocess     => lazy_dfa__preprocess
      procedure :: registered     => lazy_dfa__registered_index
      procedure :: add_transition => lazy_dfa__add_transition
      procedure :: free           => lazy_dfa__deallocate
      procedure :: reallocate     => lazy_dfa__reallocate
   end type dfa_graph_t