Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data FailureInfo = FailureInfo !Int Word64 [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 #
data ResultList g s r Source #
ResultList !(BinTree (ResultInfo g s r)) !FailureInfo |
Functor (ResultList g s) Source # | |
Show1 (ResultList g s) Source # | |
Show r => Show (ResultList g s r) Source # | |
Monoid (ResultList g s r) Source # | |
Parser for a context-free grammar with packrat-like sharing of parse results. It does not support left-recursive grammars.
Parser | |
|
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