Safe Haskell | None |
---|---|
Language | Haskell2010 |
Backtracking parser for Parsing Expression Grammars
Synopsis
- newtype Parser g s r = Parser {
- applyParser :: s -> Result g s r
- data Result (g :: (* -> *) -> *) s v
- = Parsed {
- parsedPrefix :: !v
- parsedSuffix :: !s
- | NoParse FailureInfo
- = Parsed {
- alt :: Parser g s a -> Parser g s a -> Parser g s a
Documentation
Parser type for Parsing Expression Grammars that uses a backtracking algorithm, fast for grammars in LL(1) class but with potentially exponential performance for longer ambiguous prefixes.
Parser | |
|
Instances
MultiParsing Parser Source # | Backtracking PEG parser
|
Defined in Text.Grampa.PEG.Backtrack type ResultFunctor Parser :: Type -> Type Source # type GrammarConstraint Parser g :: Constraint Source # parseComplete :: (GrammarConstraint Parser g, FactorialMonoid s) => g (Parser g s) -> s -> g (ResultFunctor Parser) Source # parsePrefix :: (GrammarConstraint Parser g, FactorialMonoid s) => g (Parser g s) -> s -> g (Compose (ResultFunctor Parser) ((,) s)) Source # | |
MonoidParsing (Parser g) Source # | |
Defined in Text.Grampa.PEG.Backtrack endOfInput :: FactorialMonoid s => Parser g s () Source # getInput :: FactorialMonoid s => Parser g s s Source # getSourcePos :: FactorialMonoid s => Parser g s (Position s) Source # anyToken :: FactorialMonoid s => Parser g s s Source # satisfy :: FactorialMonoid s => (s -> Bool) -> Parser g s s Source # satisfyChar :: TextualMonoid s => (Char -> Bool) -> Parser g s Char Source # satisfyCharInput :: TextualMonoid s => (Char -> Bool) -> Parser g s s Source # notSatisfy :: FactorialMonoid s => (s -> Bool) -> Parser g s () Source # notSatisfyChar :: TextualMonoid s => (Char -> Bool) -> Parser g s () Source # scan :: FactorialMonoid t => s -> (s -> t -> Maybe s) -> Parser g t t Source # scanChars :: TextualMonoid t => s -> (s -> Char -> Maybe s) -> Parser g t t Source # string :: (FactorialMonoid s, LeftReductiveMonoid s, Show s) => s -> Parser g s s Source # takeWhile :: FactorialMonoid s => (s -> Bool) -> Parser g s s Source # takeWhile1 :: FactorialMonoid s => (s -> Bool) -> Parser g s s Source # takeCharsWhile :: TextualMonoid s => (Char -> Bool) -> Parser g s s Source # takeCharsWhile1 :: TextualMonoid s => (Char -> Bool) -> Parser g s s Source # concatMany :: Monoid a => Parser g s a -> Parser g s a Source # | |
Monad (Parser g s) Source # | |
Functor (Parser g s) Source # | |
Applicative (Parser g s) Source # | |
Defined in Text.Grampa.PEG.Backtrack | |
FactorialMonoid s => Alternative (Parser g s) Source # | |
FactorialMonoid s => MonadPlus (Parser g s) Source # | |
(Lexical g, LexicalConstraint Parser g s, Show s, TextualMonoid s) => TokenParsing (Parser g s) Source # | |
FactorialMonoid s => LookAheadParsing (Parser g s) Source # | |
Defined in Text.Grampa.PEG.Backtrack | |
(Show s, TextualMonoid s) => CharParsing (Parser g s) Source # | |
FactorialMonoid s => Parsing (Parser g s) Source # | |
Defined in Text.Grampa.PEG.Backtrack | |
Semigroup x => Semigroup (Parser g s x) Source # | |
Monoid x => Monoid (Parser g s x) Source # | |
type ResultFunctor Parser Source # | |
Defined in Text.Grampa.PEG.Backtrack | |
type GrammarConstraint Parser g Source # | |
Defined in Text.Grampa.PEG.Backtrack |