regex-tdfa-1.3.2.2: Pure Haskell Tagged DFA Backend for "Text.Regex" (regex-base)

Safe Haskell | None
Language | Haskell2010

Text.Regex.TDFA.TDFA

Description

Text.Regex.TDFA.TDFA converts the QNFA from TNFA into the DFA. A DFA state corresponds to a Set of QNFA states, represented as list of Index which are used to lookup the DFA state in a lazy Trie which holds all possible subsets of QNFA states.

Synopsis

- patternToRegex :: (Pattern, (GroupIndex, DoPa)) -> CompOption -> ExecOption -> Regex
- data DFA = DFA {
  - d_id :: SetIndex
  - d_dt :: DT
  }
- data DT
  - = Simple' {
    - dt_win :: IntMap Instructions
    - dt_trans :: CharMap Transition
    - dt_other :: Transition
    }
  - | Testing' {
    - dt_test :: WhichTest
    - dt_dopas :: EnumSet DoPa
    - dt_a :: DT
    - dt_b :: DT
    }
- examineDFA :: Regex -> String
- nfaToDFA :: ((Index, Array Index QNFA), Array Tag OP, Array GroupIndex [GroupInfo]) -> CompOption -> ExecOption -> Regex
- dfaMap :: DFA -> Map SetIndex DFA

# Documentation

patternToRegex :: (Pattern, (GroupIndex, DoPa)) -> CompOption -> ExecOption -> Regex #

data DFA #

Internal DFA node, identified by the Set of indices of the QNFA nodes it represents.

Constructors

DFA |

Fields

- d_id :: SetIndex
- d_dt :: DT

#### Instances

Instances details

Show DFA # |
Instance details Defined in Text.Regex.TDFA.Common Methods showsPrec :: Int -> DFA -> ShowS # show :: DFA -> String # showList :: [DFA] -> ShowS #

data DT #

Internal to the DFA node

Constructors

Simple' |

Fields

- dt_win :: IntMap Instructions

  Actions to perform to win

- dt_trans :: CharMap Transition

  Transition to accept Char

- dt_other :: Transition

  default accepting transition

Testing' |

Fields

- dt_test :: WhichTest

  The test to perform

- dt_dopas :: EnumSet DoPa

  location(s) of the anchor(s) in the original regexp

- dt_a :: DT

  use dt_a if test is True else use dt_b

- dt_b :: DT

  use dt_a if test is True else use dt_b

#### Instances

Instances details

Show DT # |
Instance details Defined in Text.Regex.TDFA.Common Methods showsPrec :: Int -> DT -> ShowS # show :: DT -> String # showList :: [DT] -> ShowS #

examineDFA :: Regex -> String #

nfaToDFA :: ((Index, Array Index QNFA), Array Tag OP, Array GroupIndex [GroupInfo]) -> CompOption -> ExecOption -> Regex #

dfaMap :: DFA -> Map SetIndex DFA #