Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Fixed p g s a
- type Parser = Fixed Parser
- data SeparatedParser p g s a
- = FrontParser (p g s a)
- | CycleParser {
- cycleParser :: p g s a
- backParser :: p g s a
- appendResultsArrow :: ResultAppend g s a
- dependencies :: g (Const Bool)
- | BackParser {
- backParser :: p g s a
- longest :: Fixed Parser g s a -> Fixed Parser g [(s, g (ResultList g s))] a
- peg :: Fixed Parser g [(s, g (ResultList g s))] a -> Fixed Parser g s a
- terminalPEG :: Monoid s => Fixed Parser g s a -> Fixed Parser g s a
- parseSeparated :: forall g s. (Apply g, Foldable g, FactorialMonoid s) => g (SeparatedParser Parser g s) -> s -> [(s, g (ResultList g s))]
- separated :: forall g s. (Apply g, Distributive g, Traversable g) => g (Parser g s) -> g (SeparatedParser Parser g s)
- (<<|>) :: Parser g s a -> Parser g s a -> Parser g s a
Documentation
data SeparatedParser p g s a Source #
FrontParser (p g s a) | |
CycleParser | |
| |
BackParser | |
|
longest :: Fixed Parser g s a -> Fixed 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 :: Fixed Parser g [(s, g (ResultList g s))] a -> Fixed 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 => Fixed Parser g s a -> Fixed Parser g s a Source #
Turns a backtracking PEG parser into a context-free parser
parseSeparated :: forall g s. (Apply g, Foldable g, FactorialMonoid s) => g (SeparatedParser Parser g s) -> s -> [(s, g (ResultList g s))] Source #
Parse the given input using a context-free grammar separated into two parts: the first specifying all the left-recursive productions, the second all others. The first function argument specifies the left-recursive dependencies among the grammar productions.
separated :: forall g s. (Apply g, Distributive g, Traversable g) => g (Parser g s) -> g (SeparatedParser Parser g s) Source #