Maintainer | [email protected] |
---|
Data.GraphViz.Types.Parsing
Description
This module defines simple helper functions for use with Text.ParserCombinators.Poly.Lazy.
Note that the ParseDot
instances for Bool
, etc. match those
specified for use with GraphViz (e.g. non-zero integers are
equivalent to True
).
You should not be using this module; rather, it is here for
informative/documentative reasons. If you want to parse a
, you should use
Data.GraphViz.Types.DotGraph
rather than its Data.GraphViz.Types.parseDotGraph
ParseDot
instance.
- module Text.ParserCombinators.Poly.Lazy
- type Parse a = Parser Char a
- class ParseDot a where
- stringBlock :: Parse String
- numString :: Parse String
- quotedString :: Parse String
- parseAndSpace :: Parse a -> Parse a
- string :: String -> Parse String
- strings :: [String] -> Parse String
- hasString :: String -> Parse Bool
- character :: Char -> Parse Char
- noneOf :: Eq a => [a] -> Parser a a
- whitespace :: Parse String
- whitespace' :: Parse String
- optionalQuotedString :: String -> Parse String
- optionalQuoted :: Parse a -> Parse a
- quotedParse :: Parse a -> Parse a
- newline :: Parse String
- newline' :: Parse ()
- parseComma :: Parse Char
- tryParseList :: ParseDot a => Parse [a]
- tryParseList' :: Parse [a] -> Parse [a]
- skipToNewline :: Parse ()
- parseField :: ParseDot a => String -> Parse a
- parseFields :: ParseDot a => [String] -> Parse a
- parseFieldBool :: String -> Parse Bool
- parseFieldsBool :: [String] -> Parse Bool
- parseFieldDef :: ParseDot a => a -> String -> Parse a
- parseFieldsDef :: ParseDot a => a -> [String] -> Parse a
- commaSep :: (ParseDot a, ParseDot b) => Parse (a, b)
- commaSep' :: Parse a -> Parse b -> Parse (a, b)
- stringRep :: a -> String -> Parse a
Documentation
Methods
parseUnqtList :: Parse [a]Source
Instances
quotedString :: Parse StringSource
Used when quotes are explicitly required;
parseAndSpace :: Parse a -> Parse aSource
optionalQuoted :: Parse a -> Parse aSource
quotedParse :: Parse a -> Parse aSource
Consume all whitespace and newlines until a line with non-whitespace is reached. The whitespace on that line is not consumed.
tryParseList :: ParseDot a => Parse [a]Source
tryParseList' :: Parse [a] -> Parse [a]Source
parseField :: ParseDot a => String -> Parse aSource
parseFields :: ParseDot a => [String] -> Parse aSource
parseFieldBool :: String -> Parse BoolSource
parseFieldsBool :: [String] -> Parse BoolSource
parseFieldDef :: ParseDot a => a -> String -> Parse aSource
For Bool
-like data structures where the presence of the field
name without a value implies a default value.
parseFieldsDef :: ParseDot a => a -> [String] -> Parse aSource