forgex_lazy_dfa_node_m Module

The forgex_lazy_dfa_node_m module defines the state nodes and transitions of DFA.



Derived Types

type, public ::  dfa_state_node_t

Components

Type Visibility Attributes Name Initial
logical, public :: accepted = .false.
integer(kind=int32), public :: alloc_count_f = ALLOC_COUNT_INITTIAL
logical, public :: initialized = .false.
type(nfa_state_set_t), public :: nfa_set
integer(kind=int32), public :: own_i = DFA_NOT_INIT
logical, public :: registered = .false.
type(dfa_transition_t), public, allocatable :: transition(:)
integer(kind=int32), private :: tra_top = DFA_NOT_INIT_TRAENSITION_TOP

Type-Bound Procedures

procedure, public :: add_transition => dfa_state_node__add_transition
procedure, public :: free => dfa_state_node__deallocate
procedure, public :: get_tra_top => dfa_state_node__get_transition_top
procedure, public :: increment_tra_top => dfa_state_node__increment_transition_top
procedure, public :: init_tra_top => dfa_state_node__initialize_transition_top
procedure, public :: is_registered_tra => dfa_state_node__is_registered_transition
procedure, public :: realloc_f => dfa_state_node__reallocate_transition_forward

type, public ::  dfa_transition_t

Components

Type Visibility Attributes Name Initial
type(segment_t), public :: c
integer(kind=int32), public :: dst = DFA_NOT_INIT
type(nfa_state_set_t), public :: nfa_set
integer(kind=int32), public :: own_j = DFA_NOT_INIT

Functions

private pure function dfa_state_node__get_transition_top(self) result(res)

This function returns the index of top transition in the list dfa_state_node_t has.

Arguments

Type IntentOptional Attributes Name
class(dfa_state_node_t), intent(in) :: self

Return Value integer

private pure function dfa_state_node__is_registered_transition(self, dst, symbol) result(res)

Arguments

Type IntentOptional Attributes Name
class(dfa_state_node_t), intent(in) :: self
integer, intent(in) :: dst
character(len=*), intent(in) :: symbol

Return Value logical


Subroutines

public pure subroutine copy_dfa_transition(src, dst)

This subroutine copies the data of a specified transition into the variables of another dfa_transition_t.

Arguments

Type IntentOptional Attributes Name
type(dfa_transition_t), intent(in) :: src
type(dfa_transition_t), intent(inout) :: dst

private pure subroutine dfa_state_node__add_transition(self, tra)

This subroutine processes to add the given transition to the list which dfa_state_node_t has.

Arguments

Type IntentOptional Attributes Name
class(dfa_state_node_t), intent(inout) :: self
type(dfa_transition_t), intent(in) :: tra

private pure subroutine dfa_state_node__deallocate(self)

This subroutine deallocates the transition array of a DFA state node.

Arguments

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

private pure subroutine dfa_state_node__increment_transition_top(self)

This subroutine increments the value of top transition index.

Arguments

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

private pure subroutine dfa_state_node__initialize_transition_top(self, top)

This subroutine initialize the top index of the transition array of the dfa node with the value of the given argument.

Arguments

Type IntentOptional Attributes Name
class(dfa_state_node_t), intent(inout) :: self
integer, intent(in) :: top

private pure subroutine dfa_state_node__reallocate_transition_forward(self)

This subroutine performs allocating initial or additional transition arrays.

Read more…

Arguments

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