Copyright | (c) 2013 Peter Simons |
---|---|
License | BSD3 |
Maintainer | simons@cryp.to |
Stability | provisional |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell2010 |
This module provides parsers for the grammar defined in
RFC2234, "Augmented BNF for Syntax Specifications:
ABNF", http://www.faqs.org/rfcs/rfc2234.html. The
terminal called char
in the RFC is called character
here to avoid conflicts with Parsec's char
function.
- caseChar :: Stream s m Char => Char -> ParsecT s u m Char
- caseString :: Stream s m Char => String -> ParsecT s u m ()
- manyN :: Int -> ParsecT s u m a -> ParsecT s u m [a]
- manyNtoM :: Int -> Int -> ParsecT s u m a -> ParsecT s u m [a]
- parsec2read :: Parser a -> String -> [(a, String)]
- alpha :: Stream s m Char => ParsecT s u m Char
- bit :: Stream s m Char => ParsecT s u m Char
- character :: Stream s m Char => ParsecT s u m Char
- cr :: Stream s m Char => ParsecT s u m Char
- lf :: Stream s m Char => ParsecT s u m Char
- crlf :: Stream s m Char => ParsecT s u m String
- ctl :: Stream s m Char => ParsecT s u m Char
- dquote :: Stream s m Char => ParsecT s u m Char
- hexdig :: Stream s m Char => ParsecT s u m Char
- htab :: Stream s m Char => ParsecT s u m Char
- lwsp :: Stream s m Char => ParsecT s u m String
- octet :: Stream s m Char => ParsecT s u m Char
- sp :: Stream s m Char => ParsecT s u m Char
- vchar :: Stream s m Char => ParsecT s u m Char
- wsp :: Stream s m Char => ParsecT s u m Char
- quoted_pair :: Stream s m Char => ParsecT s u m String
- quoted_string :: Stream s m Char => ParsecT s u m String
Parser Combinators
caseChar :: Stream s m Char => Char -> ParsecT s u m Char Source #
Case-insensitive variant of Parsec's char
function.
caseString :: Stream s m Char => String -> ParsecT s u m () Source #
Case-insensitive variant of Parsec's string
function.
manyNtoM :: Int -> Int -> ParsecT s u m a -> ParsecT s u m [a] Source #
Match a parser at least n
times, but no more than m
times.
parsec2read :: Parser a -> String -> [(a, String)] Source #
Helper function to generate Parser
-based instances for
the Read
class.
Primitive Parsers
character :: Stream s m Char => ParsecT s u m Char Source #
Match any 7-bit US-ASCII character except for NUL (ASCII value 0, that is).
ctl :: Stream s m Char => ParsecT s u m Char Source #
Match any US-ASCII control character. That is any character with a decimal value in the range of [0..31,127].
hexdig :: Stream s m Char => ParsecT s u m Char Source #
Match any character that is valid in a hexadecimal number; ['0'..'9'] and ['A'..'F','a'..'f'] that is.
vchar :: Stream s m Char => ParsecT s u m Char Source #
Match any printable ASCII character. (The "v" stands for "visible".) That is any character in the decimal range of [33..126].