Maintainer | [email protected] |
---|
Data.GraphViz.Types.Parsing
Contents
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
- parseIt :: ParseDot a => String -> (a, String)
- onlyBool :: Parse Bool
- stringBlock :: Parse String
- numString :: Parse String
- isNumString :: String -> Bool
- isIntString :: String -> Bool
- quotedString :: Parse String
- parseAndSpace :: Parse a -> Parse a
- string :: String -> Parse String
- strings :: [String] -> Parse String
- hasString :: String -> Parse Bool
- character :: Char -> Parse Char
- parseStrictFloat :: Parse Double
- 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
- orQuote :: Parse Char -> Parse Char
- quoteChar :: Char
- newline :: Parse String
- newline' :: Parse ()
- parseComma :: Parse Char
- tryParseList :: ParseDot a => Parse [a]
- tryParseList' :: Parse [a] -> Parse [a]
- skipToNewline :: Parse String
- 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)
- commaSepUnqt :: (ParseDot a, ParseDot b) => Parse (a, b)
- commaSep' :: Parse a -> Parse b -> Parse (a, b)
- stringRep :: a -> String -> Parse a
- stringReps :: a -> [String] -> Parse a
- preProcess :: String -> String
Re-exporting pertinent parts of Polyparse.
The ParseDot class.
Methods
parseUnqtList :: Parse [a]Source
Instances
parseIt :: ParseDot a => String -> (a, String)Source
Parse the required value, returning also the rest of the input
String
that hasn't been parsed.
Convenience parsing combinators.
isNumString :: String -> BoolSource
Determine if this String represents a number.
isIntString :: String -> BoolSource
quotedString :: Parse StringSource
Used when quotes are explicitly required;
parseAndSpace :: Parse a -> Parse aSource
parseStrictFloat :: Parse DoubleSource
Parse a floating point number that actually contains decimals.
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
skipToNewline :: Parse StringSource
Parses and returns all characters up till the end of the line, then skips to the beginning of the next line.
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
commaSepUnqt :: (ParseDot a, ParseDot b) => Parse (a, b)Source
stringReps :: a -> [String] -> Parse aSource
Pre-processing of Dot code to remove comments, etc.
preProcess :: String -> StringSource
Remove unparseable features of Dot, such as comments and multi-line strings (which are converted to single-line strings).