katydid-0.4.0.1: A haskell implementation of Katydid

Safe HaskellSafe
LanguageHaskell2010

Data.Katydid.Relapse.Smart

Description

This module describes the smart constructors for Relapse patterns.

Synopsis

Documentation

data Pattern Source #

Pattern recursively describes a Relapse Pattern.

Constructors

Empty 
Node 

Fields

Concat 

Fields

Or 

Fields

And 

Fields

ZeroOrMore 

Fields

Reference 

Fields

Not 

Fields

ZAny 
Contains 

Fields

Optional 

Fields

Interleave 

Fields

Instances
Eq Pattern Source # 
Instance details

Defined in Data.Katydid.Relapse.Smart

Methods

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

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

Ord Pattern Source # 
Instance details

Defined in Data.Katydid.Relapse.Smart

Show Pattern Source # 
Instance details

Defined in Data.Katydid.Relapse.Smart

data Grammar Source #

Grammar is a map from reference name to pattern and describes a relapse grammar.

Instances
Eq Grammar Source # 
Instance details

Defined in Data.Katydid.Relapse.Smart

Methods

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

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

Show Grammar Source # 
Instance details

Defined in Data.Katydid.Relapse.Smart

lookupRef :: Grammar -> ValidRef -> Pattern Source #

lookupRef looks up a pattern in the reference map, given a reference name.

compile :: Grammar -> Either String Grammar Source #

compile complies an ast into a smart grammar.

emptyPat :: Pattern Source #

emptyPat is the smart constructor for the empty pattern.

zanyPat :: Pattern Source #

zanyPat is the smart constructor for the zany pattern.

nodePat :: Expr Bool -> Pattern -> Pattern Source #

nodePat is the smart constructor for the node pattern.

orPat :: Pattern -> Pattern -> Pattern Source #

orPat is the smart constructor for the or pattern.

andPat :: Pattern -> Pattern -> Pattern Source #

andPat is the smart constructor for the and pattern.

notPat :: Pattern -> Pattern Source #

notPat is the smart constructor for the not pattern.

concatPat :: Pattern -> Pattern -> Pattern Source #

concatPat is the smart constructor for the concat pattern.

interleavePat :: Pattern -> Pattern -> Pattern Source #

interleavePat is the smart constructor for the interleave pattern.

zeroOrMorePat :: Pattern -> Pattern Source #

zeroOrMorePat is the smart constructor for the zeroOrMore pattern.

optionalPat :: Pattern -> Pattern Source #

optionalPat is the smart constructor for the optional pattern.

containsPat :: Pattern -> Pattern Source #

containsPat is the smart constructor for the contains pattern.

refPat :: Map String Bool -> String -> Either String Pattern Source #

refPat is the smart constructor for the reference pattern.

emptySet :: Pattern Source #

emptySet is the smart constructor for the !(*) pattern.

unescapable :: Pattern -> Bool Source #

unescapable is used for short circuiting. A part of the tree can be skipped if all patterns are unescapable.

nullable :: Pattern -> Bool Source #

nullable returns whether the pattern matches the empty string.

lookupMain :: Grammar -> Pattern Source #

lookupMain retrieves the main pattern from the grammar.