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

Safe HaskellSafe
LanguageHaskell98

Text.Regex.PDeriv.Nfa

Description

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

Synopsis

Documentation

class Nfa s a | s -> a where Source #

The type class of Nfa

Minimal complete definition

pDeriv, sigma, empty

Methods

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

sigma :: s -> [a] Source #

empty :: s -> Bool Source #

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

A function that builds an NFA

data NFA s a Source #

the NFA data type

Constructors

NFA 

Fields

Instances

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

Methods

showsPrec :: Int -> NFA s a -> ShowS #

show :: NFA s a -> String #

showList :: [NFA s a] -> ShowS #

data SNFA s a Source #

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

Constructors

SNFA 

Fields

Instances

Show a => Show (SNFA s a) Source # 

Methods

showsPrec :: Int -> SNFA s a -> ShowS #

show :: SNFA s a -> String #

showList :: [SNFA s a] -> ShowS #

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

The function toSNFA converts from an NFA to an SNFA

nofDelta :: NFA t1 t -> Int Source #