Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data FailureInfo s = FailureInfo Int [Expected s]
- data ResultList g s r = ResultList !(BinTree (ResultInfo g s r)) !(FailureInfo s)
- newtype Parser g s r = Parser {
- applyParser :: [(s, g (ResultList g s))] -> ResultList g s r
- data BinTree a
- fromResultList :: (Eq s, FactorialMonoid s) => s -> ResultList g s r -> ParseResults s [(s, r)]
- reparseTails :: Functor g => g (Parser g s) -> [(s, g (ResultList g s))] -> [(s, g (ResultList g s))]
- longest :: Parser g s a -> Parser g [(s, g (ResultList g s))] a
- peg :: Parser g [(s, g (ResultList g s))] a -> Parser g s a
- terminalPEG :: Monoid s => Parser g s a -> Parser g s a
Documentation
data FailureInfo s Source #
FailureInfo Int [Expected s] |
Instances
Eq s => Eq (FailureInfo s) Source # | |
Defined in Text.Grampa.Internal (==) :: FailureInfo s -> FailureInfo s -> Bool # (/=) :: FailureInfo s -> FailureInfo s -> Bool # | |
Show s => Show (FailureInfo s) Source # | |
Defined in Text.Grampa.Internal showsPrec :: Int -> FailureInfo s -> ShowS # show :: FailureInfo s -> String # showList :: [FailureInfo s] -> ShowS # | |
Semigroup (FailureInfo s) Source # | |
Defined in Text.Grampa.Internal (<>) :: FailureInfo s -> FailureInfo s -> FailureInfo s # sconcat :: NonEmpty (FailureInfo s) -> FailureInfo s # stimes :: Integral b => b -> FailureInfo s -> FailureInfo s # | |
Monoid (FailureInfo s) Source # | |
Defined in Text.Grampa.Internal mempty :: FailureInfo s # mappend :: FailureInfo s -> FailureInfo s -> FailureInfo s # mconcat :: [FailureInfo s] -> FailureInfo s # |
data ResultList g s r Source #
ResultList !(BinTree (ResultInfo g s r)) !(FailureInfo s) |
Instances
Parser for a context-free grammar with packrat-like sharing of parse results. It does not support left-recursive grammars.
Parser | |
|
Instances
Instances
Functor BinTree Source # | |
Foldable BinTree Source # | |
Defined in Text.Grampa.Internal fold :: Monoid m => BinTree m -> m # foldMap :: Monoid m => (a -> m) -> BinTree a -> m # foldMap' :: Monoid m => (a -> m) -> BinTree a -> m # foldr :: (a -> b -> b) -> b -> BinTree a -> b # foldr' :: (a -> b -> b) -> b -> BinTree a -> b # foldl :: (b -> a -> b) -> b -> BinTree a -> b # foldl' :: (b -> a -> b) -> b -> BinTree a -> b # foldr1 :: (a -> a -> a) -> BinTree a -> a # foldl1 :: (a -> a -> a) -> BinTree a -> a # elem :: Eq a => a -> BinTree a -> Bool # maximum :: Ord a => BinTree a -> a # minimum :: Ord a => BinTree a -> a # | |
Show a => Show (BinTree a) Source # | |
Semigroup (BinTree a) Source # | |
Monoid (BinTree a) Source # | |
fromResultList :: (Eq s, FactorialMonoid s) => s -> ResultList g s r -> ParseResults s [(s, r)] Source #
reparseTails :: Functor g => g (Parser g s) -> [(s, g (ResultList g s))] -> [(s, g (ResultList g s))] Source #
longest :: Parser g s a -> Parser g [(s, g (ResultList g s))] a Source #
Turns a context-free parser into a backtracking PEG parser that consumes the longest possible prefix of the list
of input tails, opposite of peg
peg :: Parser g [(s, g (ResultList g s))] a -> Parser g s a Source #
Turns a backtracking PEG parser of the list of input tails into a context-free parser, opposite of longest
terminalPEG :: Monoid s => Parser g s a -> Parser g s a Source #
Turns a backtracking PEG parser into a context-free parser