This module defines procedures for building a fully compiled DFA for debugging and benchmarking.
This procedure reads a text, performs regular expression matching using compiled DFA,
and returns .true.
if it matches exactly.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(automaton_t), | intent(in) | :: | automaton | |||
character(len=*), | intent(in) | :: | string |
This function calculates a set of possible NFA states from the current DFA state.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(automaton_t), | intent(in) | :: | automaton | |||
integer, | intent(in) | :: | curr |
This function returns the dfa transition object, that contains the destination index and the corresponding set of transitionable NFA state.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(automaton_t), | intent(in) | :: | automaton | |||
integer(kind=int32), | intent(in) | :: | curr |
This function returns the index of the destination DFA state from the index of the current automaton DFA state array and the input symbol.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(automaton_t), | intent(in) | :: | automaton | |||
integer(kind=int32), | intent(in) | :: | curr_i | |||
character(len=*), | intent(in) | :: | symbol |
This subroutine convert an NFA into a fully compiled DFA.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(automaton_t), | intent(inout) | :: | automaton | |||
integer(kind=int32), | intent(in) | :: | curr_i |
This procedure reads a text, performs regular expression matching using an automaton, and stores the string index in the argument if it contains a match.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(automaton_t), | intent(in) | :: | automaton | |||
character(len=*), | intent(in) | :: | string | |||
integer, | intent(inout) | :: | from | |||
integer, | intent(inout) | :: | to |
This subroutine gets the next DFA nodes index from current index,
and stores the result in next
and next_set
.
If the DFA state is already registered, it returns the index,
otherwise it returns DFA_INVALID_INDEX
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(automaton_t), | intent(in) | :: | automaton | |||
integer(kind=int32), | intent(in) | :: | curr | |||
integer(kind=int32), | intent(inout) | :: | next | |||
type(nfa_state_set_t), | intent(inout) | :: | next_set |