pangraph-0.2.1: A set of parsers for graph languages and conversions to graph libaries.

Safe HaskellSafe
LanguageHaskell2010

Pangraph.Gml.Ast

Description

AST for gml (Graph Modelling Language) files. The specification of the gml format can be found at: http://www.fim.uni-passau.de/fileadmin/files/lehrstuhl/brandenburg/projekte/gml/gml-technical-report.pdf.

Synopsis

Documentation

data Gml k Source #

Type of a AST node. k is the type that is used to represent strings.

Constructors

Integer Integer

Integer value

Float Double

Floating point value

String k

String value

Object [(k, Gml k)]

Object value. A gml object is a list of named values. The names of the values are not necessarily unique!

Instances
Eq k => Eq (Gml k) Source # 
Instance details

Defined in Pangraph.Gml.Ast

Methods

(==) :: Gml k -> Gml k -> Bool #

(/=) :: Gml k -> Gml k -> Bool #

Ord k => Ord (Gml k) Source # 
Instance details

Defined in Pangraph.Gml.Ast

Methods

compare :: Gml k -> Gml k -> Ordering #

(<) :: Gml k -> Gml k -> Bool #

(<=) :: Gml k -> Gml k -> Bool #

(>) :: Gml k -> Gml k -> Bool #

(>=) :: Gml k -> Gml k -> Bool #

max :: Gml k -> Gml k -> Gml k #

min :: Gml k -> Gml k -> Gml k #

Show k => Show (Gml k) Source # 
Instance details

Defined in Pangraph.Gml.Ast

Methods

showsPrec :: Int -> Gml k -> ShowS #

show :: Gml k -> String #

showList :: [Gml k] -> ShowS #

lookupValue :: Eq k => Gml k -> k -> Maybe (Gml k) Source #

Looks up a value in the given gml object. Produces Nothing when the given value is not a gml object or the object doesn't contain the a value with the given name. If a object contains multiple values with the same name one the values is returned.

integerValue :: Gml k -> Maybe Integer Source #

If the given gml value is a integer produces the integer value.

floatValue :: Gml k -> Maybe Double Source #

If the given gml value is a double value produces the float value.

stringValue :: Gml k -> Maybe k Source #

If the given gml value is a string produces the string value.

objectValues :: Gml k -> Maybe [(k, Gml k)] Source #

If the given gml value is an object produces the list of values that the object contains.

mapStrings :: (a -> b) -> Gml a -> Gml b Source #

Maps all strings in the gml ast.