|
| Text.Yaml.Reference | | Portability | portable | | Stability | alpha | | Maintainer | yaml-oren@ben-kiki.org |
|
|
|
| Description |
Implementation of the YAML syntax as defined in http://www.yaml.org.
Actually this file contains the parsing framework and includes (using CPP)
the actual productions from Reference.bnf.
The parsing framework is fully streaming (generates output tokens
"immediately"). The memory leak that existed in previous version has been
plugged.
|
|
| Synopsis |
|
|
|
| Documentation |
|
| data Code |
|
|
| data Token |
show code converts a Code to the one-character YEAST token code char.
The list of byte codes is also documented in the yaml2yeast program.
Parsed token.
| Instances | |
|
|
| type Tokenizer = String -> ByteString -> Bool -> [Token] |
| Tokenizer converts a (named) input text into a list of Token. Errors
are reported as tokens with the Error Code, and the unparsed text
following an error may be attached as a final token.
|
|
| yaml :: Tokenizer |
| yaml name input converts the Unicode input (called name in error
messages) to a list of Token according to the YAML spec. This is it!
|
|
| data Context |
| Production context.
| Instances | |
|
|
| data Chomp |
show context converts a Context to a String.
read context converts a String to a Context. We trust our callers to
convert any - characters into _ to allow the built-in lex function to
handle the names as single identifiers.
Chomp method.
| Instances | |
|
|
| tokenizer :: String -> (Maybe Tokenizer) |
| tokenizer name converts the production with the specified name to a
simple Tokenizer, or Nothing if it isn't known.
|
|
| tokenizerWithN :: String -> Int -> Maybe Tokenizer |
| tokenizerWithN name n converts the production (that requires an n
argument) with the specified name to a simple Tokenizer, or Nothing if
it isn't known.
|
|
| tokenizerWithC :: String -> Context -> Maybe Tokenizer |
| tokenizerWithC name c converts the production (that requires a c
argument) with the specified name to a simple Tokenizer, or Nothing if
it isn't known.
|
|
| tokenizerWithT :: String -> Chomp -> Maybe Tokenizer |
| tokenizerWithT name t converts the production (that requires an t
argument) with the specified name to a simple Tokenizer, or Nothing if
it isn't known.
|
|
| tokenizerWithNC :: String -> Int -> Context -> Maybe Tokenizer |
| tokenizerWithNC name n c converts the production (that requires n and
c arguments) with the specified name to a simple Tokenizer, or
Nothing if it isn't known.
|
|
| tokenizerWithNT :: String -> Int -> Chomp -> Maybe Tokenizer |
| tokenizerWithNT name n t converts the production (that requires n and
t arguments) with the specified name to a simple Tokenizer, or
Nothing if it isn't known.
|
|
| tokenizerNames :: [String] |
| tokenizerNames returns the list of all productions (tokenizers).
|
|
| showTokens :: [Token] -> String |
| showTokens tokens converts a list of tokens to a multi-line YEAST
text.
|
|
| Produced by Haddock version 2.1.0 |