Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data FailureInfo = FailureInfo Word64 [String]
- data ResultList g s r = ResultList ![ResultsOfLength g s r] !FailureInfo
- newtype Parser g s r = Parser {
- applyParser :: [(s, g (ResultList g s))] -> ResultList g s r
- (<<|>) :: Parser g s a -> Parser g s a -> Parser g s a
- 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 ![ResultsOfLength g s r] !FailureInfo |
Functor (ResultList g s) Source # | |
Show1 (ResultList g s) Source # | |
Show r => Show (ResultList g s r) Source # | |
Semigroup (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 | |
|
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