graphviz-2999.11.0.0: Graphviz bindings for Haskell.




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 Data.GraphViz.Types.DotRepr, you should use Data.GraphViz.Types.parseDotGraph rather than its ParseDot instance.


Re-exporting pertinent parts of Polyparse.

The ParseDot class.

type Parse a = Parser Char aSource

A ReadS-like type alias.

class ParseDot a whereSource


ParseDot Bool 
ParseDot Char 
ParseDot Double 
ParseDot Int 
ParseDot Word8 
ParseDot Word16 
ParseDot X11Color 
ParseDot Color 
ParseDot BrewerName 
ParseDot ColorScheme 
ParseDot CompassPoint 
ParseDot PortPos 
ParseDot PortName 
ParseDot HtmlScale 
ParseDot HtmlVAlign 
ParseDot HtmlAlign 
ParseDot HtmlAttribute 
ParseDot HtmlImg 
ParseDot HtmlCell 
ParseDot HtmlRow 
ParseDot HtmlTable 
ParseDot HtmlTextItem 
ParseDot HtmlLabel 
ParseDot Ratios 
ParseDot Justification 
ParseDot ScaleType 
ParseDot VerticalPlacement 
ParseDot FocusType 
ParseDot ViewPort 
ParseDot StyleName 
ParseDot StyleItem 
ParseDot STStyle 
ParseDot StartType 
ParseDot SmoothType 
ParseDot Shape 
ParseDot RankDir 
ParseDot RankType 
ParseDot Root 
ParseDot QuadType 
ParseDot Spline 
ParseDot PageDir 
ParseDot EdgeType 
ParseDot Pos 
ParseDot PackMode 
ParseDot Pack 
ParseDot OutputMode 
ParseDot LayerList 
ParseDot LayerID 
ParseDot LayerRange 
ParseDot Overlap 
ParseDot Point 
ParseDot RecordField 
ParseDot Label 
ParseDot Model 
ParseDot ModeType 
ParseDot DPoint 
ParseDot DEConstraints 
ParseDot DirType 
ParseDot ClusterMode 
ParseDot Rect 
ParseDot AspectType 
ParseDot ArrowSide 
ParseDot ArrowFill 
ParseDot ArrowModifier 
ParseDot ArrowShape 
ParseDot ArrowType 
ParseDot Attribute 
ParseDot GlobalAttributes 
ParseDot GraphID 
ParseDot a => ParseDot [a] 
ParseDot a => ParseDot (DotEdge a) 
ParseDot a => ParseDot (DotNode a) 
ParseDot a => ParseDot (DotSubGraph a) 
ParseDot a => ParseDot (DotStatements a) 
ParseDot a => ParseDot (DotGraph a) 
ParseDot a => ParseDot (GDotSubGraph a) 
ParseDot a => ParseDot (GDotStatement a) 
ParseDot a => ParseDot (GDotGraph a) 

parseIt :: ParseDot a => String -> (a, String)Source

Parse the required value, returning also the rest of the input String that hasn't been parsed (for debugging purposes).

parseIt' :: ParseDot a => String -> aSource

Parse the required value with the assumption that it will parse all of the input String.

runParser' :: Parse a -> String -> aSource

A variant of runParser where it is assumed that the provided parsing function consumes all of the String input (with the exception of whitespace at the end).

Convenience parsing combinators.

bracket :: Parse bra -> Parse ket -> Parse a -> Parse aSource

Parse a bracketed item, discarding the brackets.

The definition of bracket defined in Polyparse uses adjustErrBad and thus doesn't allow backtracking and trying the next possible parser. This is a version of bracket that does.

discard :: Parse a -> Parse b -> Parse aSource

x discard y parses both x and y, but discards the result of y.

The definition of discard defined in Polyparse is too strict and prevents backtracking. This should be fixed in the next release after 1.4.

onlyBool :: Parse BoolSource

Use this when you do not want numbers to be treated as Bool values.

quotelessString :: Parse StringSource

Parse a String that doesn't need to be quoted.

isNumString :: String -> BoolSource

Determine if this String represents a number.

quotedString :: Parse StringSource

Used when quotes are explicitly required;

parseEscaped :: Bool -> [Char] -> [Char] -> Parse StringSource

Parse a String where the provided Chars (as well as " and \) are escaped and the second list of Chars are those that are not permitted. Note: does not parse surrounding quotes. The Bool value indicates whether empty Strings are allowed or not.

parseStrictFloat :: Parse DoubleSource

Parse a floating point number that actually contains decimals.

noneOf :: Eq a => [a] -> Parser a aSource

wrapWhitespace :: Parse a -> Parse aSource

Parse and discard optional whitespace.

newline' :: Parse ()Source

Consume all whitespace and newlines until a line with non-whitespace is reached. The whitespace on that line is not consumed.

consumeLine :: Parse StringSource

Parses and returns all characters up till the end of the line, but does not touch the newline characters.

parseField :: ParseDot a => (a -> b) -> String -> Parse bSource

parseFields :: ParseDot a => (a -> b) -> [String] -> Parse bSource

parseFieldDef :: ParseDot a => (a -> b) -> a -> String -> Parse bSource

For Bool-like data structures where the presence of the field name without a value implies a default value.

parseFieldsDef :: ParseDot a => (a -> b) -> a -> [String] -> Parse bSource

commaSep' :: Parse a -> Parse b -> Parse (a, b)Source