Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data FailureInfo = FailureInfo Int [String]
- data ResultList g s r = ResultList !(BinTree (ResultInfo g s r)) !FailureInfo
- newtype Parser g s r = Parser {
- applyParser :: [(s, g (ResultList g s))] -> ResultList g s r
- data BinTree a
- (<<|>) :: Parser g s a -> Parser g s a -> Parser g s a
- fromResultList :: FactorialMonoid s => s -> ResultList g s r -> ParseResults [(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 Source #
Instances
Eq FailureInfo Source # | |
Defined in Text.Grampa.Internal (==) :: FailureInfo -> FailureInfo -> Bool # (/=) :: FailureInfo -> FailureInfo -> Bool # | |
Show FailureInfo Source # | |
Defined in Text.Grampa.Internal showsPrec :: Int -> FailureInfo -> ShowS # show :: FailureInfo -> String # showList :: [FailureInfo] -> ShowS # | |
Semigroup FailureInfo Source # | |
Defined in Text.Grampa.Internal (<>) :: FailureInfo -> FailureInfo -> FailureInfo # sconcat :: NonEmpty FailureInfo -> FailureInfo # stimes :: Integral b => b -> FailureInfo -> FailureInfo # | |
Monoid FailureInfo Source # | |
Defined in Text.Grampa.Internal mempty :: FailureInfo # mappend :: FailureInfo -> FailureInfo -> FailureInfo # mconcat :: [FailureInfo] -> FailureInfo # |
data ResultList g s r Source #
ResultList !(BinTree (ResultInfo g s r)) !FailureInfo |
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 # 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 :: FactorialMonoid s => s -> ResultList g s r -> ParseResults [(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