Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
This module describes the smart constructors for Relapse patterns.
Synopsis
- data Pattern
- data Grammar
- lookupRef :: Grammar -> ValidRef -> Pattern
- compile :: Grammar -> Either String Grammar
- emptyPat :: Pattern
- zanyPat :: Pattern
- nodePat :: Expr Bool -> Pattern -> Pattern
- orPat :: Pattern -> Pattern -> Pattern
- andPat :: Pattern -> Pattern -> Pattern
- notPat :: Pattern -> Pattern
- concatPat :: Pattern -> Pattern -> Pattern
- interleavePat :: Pattern -> Pattern -> Pattern
- zeroOrMorePat :: Pattern -> Pattern
- optionalPat :: Pattern -> Pattern
- containsPat :: Pattern -> Pattern
- refPat :: Map String Bool -> String -> Either String Pattern
- emptySet :: Pattern
- unescapable :: Pattern -> Bool
- nullable :: Pattern -> Bool
- lookupMain :: Grammar -> Pattern
Documentation
Pattern recursively describes a Relapse Pattern.
Grammar is a map from reference name to pattern and describes a relapse grammar.
lookupRef :: Grammar -> ValidRef -> Pattern Source #
lookupRef looks up a pattern in the reference map, given a reference name.
nodePat :: Expr Bool -> Pattern -> Pattern Source #
nodePat is the smart constructor for the node pattern.
andPat :: Pattern -> Pattern -> Pattern Source #
andPat is the smart constructor for the and 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.
unescapable :: Pattern -> Bool Source #
unescapable is used for short circuiting. A part of the tree can be skipped if all patterns are unescapable.
lookupMain :: Grammar -> Pattern Source #
lookupMain retrieves the main pattern from the grammar.