forgex_lazy_dfa_graph_m Module

This module defines a derived-type dfa_graph_t that contains all the states of the DFA.



Derived Types

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
procedure, public :: free => lazy_dfa__deallocate
procedure, public :: preprocess => lazy_dfa__preprocess
procedure, public :: reallocate => lazy_dfa__reallocate
procedure, public :: registered => lazy_dfa__registered_index

Functions

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)


Subroutines

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

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

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

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