Copyright | (c) Martin Zeller, 2016 |
---|---|
License | BSD2 |
Maintainer | Martin Zeller <mz.bremerhaven@gmail.com> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | Safe |
Language | Haskell2010 |
This module takes a canonicalized rule to parse a document described by it.
You use the function generateParser
to generate an attoparsec parser.
- parseDocument :: Rule -> Text -> Either String (Document Text)
- generateParser :: Rule -> Parser (Document Text)
- parseRule :: Rule -> Parser (Document Text)
- parseSumSpec :: SumSpec -> Parser [Document Text]
- parseProdSpec :: ProductSpec -> Parser [Document Text]
- parseRepetition :: Repetition -> Parser [Document Text]
- parseElem :: Element -> Parser [Document Text]
- parseLiteral :: Literal -> Parser [Document Text]
- parseNumLit :: NumLit -> Parser Text
- toList :: a -> [a]
- oneOf :: String -> Parser Char
Documentation
:: Rule |
|
-> Text |
|
-> Either String (Document Text) | Return a The format of the |
Convenience function to directly parse a Document
generateParser :: Rule -> Parser (Document Text) Source #
Generate an attoparsec parser
parseSumSpec :: SumSpec -> Parser [Document Text] Source #
parseProdSpec :: ProductSpec -> Parser [Document Text] Source #
parseRepetition :: Repetition -> Parser [Document Text] Source #
parseLiteral :: Literal -> Parser [Document Text] Source #
parseNumLit :: NumLit -> Parser Text Source #