Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- type SaTTH tag = [(Code Q tag, ERE)]
- satth :: forall tag. SaTTH tag -> Code Q (ByteString -> Maybe (tag, ByteString, ByteString))
- data ERE
- empty :: ERE
- eps :: ERE
- char :: Word8 -> ERE
- charRange :: Word8 -> Word8 -> ERE
- utf8Char :: Char -> ERE
- anyChar :: ERE
- anyUtf8Char :: ERE
- appends :: [ERE] -> ERE
- unions :: [ERE] -> ERE
- intersections :: [ERE] -> ERE
- star :: ERE -> ERE
- plus :: ERE -> ERE
- string :: [Word8] -> ERE
- utf8String :: String -> ERE
- complement :: ERE -> ERE
- satisfy :: (Word8 -> Bool) -> ERE
- digit :: ERE
SaTTH, staged Sasha the lexer.
type SaTTH tag = [(Code Q tag, ERE)] Source #
Lexer grammar specification: tag codes and regular expressions.
satth :: forall tag. SaTTH tag -> Code Q (ByteString -> Maybe (tag, ByteString, ByteString)) Source #
Generate a scanner code.
ERE specification
Extended regular expression
Instances
Arbitrary ERE Source # | Uses smart constructors. |
IsString ERE Source # | Uses |
Defined in Sasha.Internal.ERE fromString :: String -> ERE # | |
Monoid ERE Source # | |
Semigroup ERE Source # | |
Show ERE Source # | |
Eq ERE Source # | |
Ord ERE Source # | |
BoundedJoinSemiLattice ERE Source # | |
Defined in Sasha.Internal.ERE | |
BoundedMeetSemiLattice ERE Source # | |
Defined in Sasha.Internal.ERE | |
Lattice ERE Source # | |
anyUtf8Char :: ERE Source #
appends :: [ERE] -> ERE Source #
Concatenate regular expressions.
r <> empty === empty
empty <> r === empty
( r <> s) <> t === r <> (s <> t)
r <> eps === r
eps <> r === r
unions :: [ERE] -> ERE Source #
Union of regular expressions.
r \/ r === r
r \/ s === s \/ r
( r \/ s) \/ t === r \/ (s \/ t)
empty \/ r === r
r \/ empty === r
everything \/ r === everything
r \/ everything === everything
intersections :: [ERE] -> ERE Source #
Intersection of regular expressions.
r /\ r === r
r /\ s === s /\ r
( r /\ s) /\ t === r /\ (s /\ t)
empty /\ r === empty
r /\ empty === empty
everything /\ r === r
r /\ everything === r
Kleene star.
star (star r) === star ( r)
star eps === eps
star empty === eps
star anyChar === everything
star (r \/ eps) === star r
star (char c \/ eps) === star (char c)
star (empty \/ eps) === eps
utf8String :: String -> ERE Source #
UTF8 string
complement :: ERE -> ERE Source #
Complement.
complement (complement r) === r