grammar-combinators-0.2.7: A parsing library of context-free grammar combinators.

Safe HaskellNone

Text.GrammarCombinators.Parser.Packrat

Synopsis

Documentation

data Result phi r t v Source

Constructors

Parsed v (Derivs phi r t) 
NoParse 

Instances

Functor (Result phi r t) 
Show v => Show (Result phi r t v) 

data Derivs phi r t Source

parsePackrat :: forall phi r ix t. (Token t, MemoFam phi) => ProcessingContextFreeGrammar phi t r -> phi ix -> [ConcreteToken t] -> Result phi r t (r ix)Source

Parse a given string according to a given grammar, starting from a given start non-terminal, with a backtracking Packrat parser algorithm (like backtracking recursive descent, but with linear performance in the length of the input).