abnf-0.3.0.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 HaskellNone
LanguageHaskell2010

Text.ABNF.ABNF

Contents

Description

 

Synopsis

ABNF types

Re-exported from Text.ABNF.ABNF.Types

data Rule Source

A Rule represents a single entry in your ABNF. It could, for example, look like this:

CRLF = %x0D.0A

Constructors

Rule Text DefinedAs SumSpec 

Parsing ABNF Rules

Re-exported from Text.ABNF.ABNF.Parser

rulelist :: Parser [Rule] Source

The main parser, which parses a list of Rules.

parseABNF :: String -> Text -> Either (ParseError Char Dec) [Rule] Source

Convencience function to directly parse a list of rules. This is equivalent to

parse rulelist

Canonicalizing ABNF Rules

canonicalizeRules Source

Arguments

:: Text

The main, or top-level, Rule

-> [Rule]

List of Rules to canonicalize

-> Maybe Rule

The operation may fail for a number of reasons, for example, because the main Rule does not exist

Canonicalize a list of Rules, leaving only a single Rule.