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

Text.GrammarCombinators.Parser.Parsec

Description

Compatibility component for the Parsec library.

Synopsis

Documentation

parseParsec :: forall phi t r ix. Token t => ProcessingContextFreeGrammar phi t r -> phi ix -> SourceName -> [ConcreteToken t] -> Either ParseError (r ix)Source

Parse a given string according to a given grammar, starting from a given start non-terminal, using the Parsec parser library. Currently uses backtracking for every branch.

It is probably possible to automatically approximate branches where backtracking is required, which would be neat and really go beyond what is currently possible in Parsec. Help welcome!