abnf-0.4.1.0: Parse ABNF and generate parsers for the specified document

Copyright(c) Martin Zeller, 2016
LicenseBSD2
MaintainerMartin Zeller <mz.bremerhaven@gmail.com>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellSafe
LanguageHaskell2010

Text.ABNF.Document.Parser

Description

This module takes a canonicalized rule to parse a document described by it. You use the function generateParser to generate an attoparsec parser.

Synopsis

Documentation

parseDocument Source #

Arguments

:: Rule

Rule to parse against

-> Text

Text to parse

-> Either String (Document Text)

Return a String describing the error or the successfully parsed Document.

The format of the String is as returned by attoparsec.

Convenience function to directly parse a Document

generateParser :: Rule -> Parser (Document Text) Source #

Generate an attoparsec parser

parseRule :: Rule -> Parser (Document Text) Source #

parseSumSpec :: SumSpec -> Parser [Document Text] Source #

parseElem :: Element -> Parser [Document Text] Source #

parseLiteral :: Literal -> Parser [Document Text] Source #

parseNumLit :: NumLit -> Parser Text Source #

toList :: a -> [a] Source #

oneOf :: String -> Parser Char Source #