Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data FailureInfo s = FailureInfo Int [Expected s]
- data ResultList g s r = ResultList ![ResultsOfLength g s r] !(FailureInfo s)
- newtype Parser g s r = Parser {
- applyParser :: [(s, g (ResultList g s))] -> ResultList g s r
- 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 ![ResultsOfLength 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
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