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

Safe HaskellSafe
LanguageHaskell98

Text.Regex.PDeriv.RE

Synopsis

Documentation

data RE Source #

data type of the regular expresions

Constructors

Phi 
Empty

an empty exp

L Char

a literal / a character

Choice RE RE GFlag

a choice exp 'r1 + r2'

Seq RE RE

a pair exp '(r1,r2)'

Star RE GFlag

a kleene's star exp 'r*'

Any

.

Not [Char]

excluding characters e.g. [^abc]

Instances

Eq RE Source #

the eq instance

Methods

(==) :: RE -> RE -> Bool #

(/=) :: RE -> RE -> Bool #

Show RE Source #

A pretty printing function for regular expression

Methods

showsPrec :: Int -> RE -> ShowS #

show :: RE -> String #

showList :: [RE] -> ShowS #

Key RE Source # 

Methods

hash :: RE -> [Int] Source #

IsGreedy RE Source # 

Methods

isGreedy :: RE -> Bool Source #

Simplifiable RE Source # 

Methods

simplify :: RE -> RE Source #

IsPhi RE Source # 

Methods

isPhi :: RE -> Bool Source #

IsEpsilon RE Source #

function isEpsilon checks whether epsilon = r

Methods

isEpsilon :: RE -> Bool Source #

PosEpsilon RE Source # 

Methods

posEpsilon :: RE -> Bool Source #

resToRE :: [RE] -> RE Source #

function resToRE sums up a list of regular expressions with the choice operation.

partDeriv :: RE -> Char -> [RE] Source #

function partDeriv implements the partial derivative operations for regular expressions. We don't pay attention to the greediness flag here.

sigmaRE :: RE -> [Char] Source #

function sigmaRE returns all characters appearing in a reg exp.