regex-pderiv-0.1.3: Replaces/Enhances Text.Regex. Implementing regular expression matching using Antimirov's partial derivatives.

Safe HaskellSafe-Infered

Text.Regex.PDeriv.Nfa

Description

This module defines data types, type classes and instances for NFA

Synopsis

Documentation

class Nfa s a | s -> a whereSource

The type class of Nfa

Methods

pDeriv :: s -> a -> [s]Source

sigma :: s -> [a]Source

empty :: s -> BoolSource

buildNFA :: (Nfa s a, Eq s, Eq a) => s -> NFA s aSource

A function that builds an NFA

data NFA s a Source

the NFA data type

Constructors

NFA 

Fields

all_states :: [s]
 
delta_states :: [(s, a, s)]
 
init_states :: [s]
 
final_states :: [s]
 

Instances

(Show s, Show a) => Show (NFA s a) 

data SNFA s a Source

the optimized NFA using Int to represent states, IntMap to represent delta

Constructors

SNFA 

Fields

mapping_states :: s -> Int
 
sall_states :: [Int]
 
sdelta_states :: [(Int, a, Int)]
 
sinit_states :: [Int]
 
sfinal_states :: [Int]
 

Instances

Show a => Show (SNFA s a) 

toSNFA :: (Eq s, Eq a) => NFA s a -> SNFA s aSource

The function toSNFA converts from an NFA to an SNFA