Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data FailureInfo = FailureInfo 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 # | |
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 | |
|
GrammarParsing Parser Source # | |
MultiParsing Parser Source # | Memoizing parser guarantees O(n²) performance for grammars with unambiguous productions, but provides no left recursion support.
|
MonoidParsing (Parser g) Source # | |
Monad (Parser g i) Source # | |
Functor (Parser g i) Source # | |
Applicative (Parser g i) Source # | |
Alternative (Parser g i) Source # | |
MonadPlus (Parser g s) Source # | |
(Lexical g, LexicalConstraint Parser g s, Show s, TextualMonoid s) => TokenParsing (Parser g s) Source # | |
MonoidNull s => LookAheadParsing (Parser g s) Source # | |
(Show s, TextualMonoid s) => CharParsing (Parser g s) Source # | |
MonoidNull s => Parsing (Parser g s) Source # | |
Semigroup x => Semigroup (Parser g s x) Source # | |
Monoid x => Monoid (Parser g s x) Source # | |
type GrammarFunctor Parser Source # | |
type ResultFunctor Parser Source # | |
type GrammarConstraint Parser g 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