YamlReference-0.9.2: YAML reference implementationContentsIndex
Text.Yaml.Reference
Portabilityportable
Stabilityalpha
Maintaineryaml-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
data Code
data Token
type Tokenizer = String -> ByteString -> Bool -> [Token]
yaml :: Tokenizer
data Context
data Chomp
tokenizer :: String -> (Maybe Tokenizer)
tokenizerWithN :: String -> Int -> Maybe Tokenizer
tokenizerWithC :: String -> Context -> Maybe Tokenizer
tokenizerWithT :: String -> Chomp -> Maybe Tokenizer
tokenizerWithNC :: String -> Int -> Context -> Maybe Tokenizer
tokenizerWithNT :: String -> Int -> Chomp -> Maybe Tokenizer
tokenizerNames :: [String]
showTokens :: [Token] -> String
Documentation
data Code
Token codes.
show/hide Instances
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.

show/hide 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.
show/hide 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.

show/hide 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