Safe Haskell | None |
---|---|
Language | GHC2021 |
DotParse.Examples.AST
Description
Example of Dot graph construction for the chart-svg class heirarchy.
Synopsis
- data SubComponents = SubComponents {}
- data ComponentEdge = ComponentEdge {}
- graphVs :: Monoid a => [SubComponents] -> Graph a (ByteString, ByteString)
- subs :: SubComponents -> [(ByteString, ByteString)]
- graphEs :: [ComponentEdge] -> Graph (Maybe ByteString) (ByteString, ByteString)
- graphAST :: [SubComponents] -> [ComponentEdge] -> Graph (Maybe ByteString) (ByteString, ByteString)
- fromCEs :: [ComponentEdge] -> [SubComponents]
- recordNodes :: Graph (Maybe ByteString) (ByteString, ByteString) -> [Statement]
- recordEdges :: Directed -> Graph (Maybe ByteString) (ByteString, ByteString) -> [Statement]
- toStatementsRecord :: Directed -> Graph (Maybe ByteString) (ByteString, ByteString) -> [Statement]
- toURL :: ByteString -> Maybe ByteString
- dotAST :: [SubComponents] -> [ComponentEdge] -> Graph
- data ItemModule = ItemModule {}
- itemModules :: [ItemModule]
- componentEdges :: [ComponentEdge]
- allSC :: [SubComponents]
Documentation
>>>
import DotParse
>>>
:set -XOverloadedStrings
data SubComponents Source #
A Haskell class and (informal) list of sub-components.
Constructors
SubComponents | |
Fields |
Instances
data ComponentEdge Source #
Relationship between a class, a sub-component and the class of the sub-component.
Constructors
ComponentEdge | |
Instances
Generic ComponentEdge Source # | |||||
Defined in DotParse.Examples.AST Associated Types
| |||||
Show ComponentEdge Source # | |||||
Defined in DotParse.Examples.AST Methods showsPrec :: Int -> ComponentEdge -> ShowS # show :: ComponentEdge -> String # showList :: [ComponentEdge] -> ShowS # | |||||
Eq ComponentEdge Source # | |||||
Defined in DotParse.Examples.AST Methods (==) :: ComponentEdge -> ComponentEdge -> Bool # (/=) :: ComponentEdge -> ComponentEdge -> Bool # | |||||
Ord ComponentEdge Source # | |||||
Defined in DotParse.Examples.AST Methods compare :: ComponentEdge -> ComponentEdge -> Ordering # (<) :: ComponentEdge -> ComponentEdge -> Bool # (<=) :: ComponentEdge -> ComponentEdge -> Bool # (>) :: ComponentEdge -> ComponentEdge -> Bool # (>=) :: ComponentEdge -> ComponentEdge -> Bool # max :: ComponentEdge -> ComponentEdge -> ComponentEdge # min :: ComponentEdge -> ComponentEdge -> ComponentEdge # | |||||
type Rep ComponentEdge Source # | |||||
Defined in DotParse.Examples.AST type Rep ComponentEdge = D1 ('MetaData "ComponentEdge" "DotParse.Examples.AST" "dotparse-0.1.2.2-4MUYXejHl8c8GMCrGHAjp6" 'False) (C1 ('MetaCons "ComponentEdge" 'PrefixI 'True) ((S1 ('MetaSel ('Just "edgeClassComponent") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString) :*: S1 ('MetaSel ('Just "edgeSubComponent") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString)) :*: (S1 ('MetaSel ('Just "subComponentClass") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString) :*: S1 ('MetaSel ('Just "edgeLabel") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ByteString))))) |
graphVs :: Monoid a => [SubComponents] -> Graph a (ByteString, ByteString) Source #
algebraic graph vertices
subs :: SubComponents -> [(ByteString, ByteString)] Source #
Convert sub-components to a list of class, subcomponent bytestring tuples.
graphEs :: [ComponentEdge] -> Graph (Maybe ByteString) (ByteString, ByteString) Source #
algebraic graph edges
graphAST :: [SubComponents] -> [ComponentEdge] -> Graph (Maybe ByteString) (ByteString, ByteString) Source #
algebraic graph
fromCEs :: [ComponentEdge] -> [SubComponents] Source #
Create a list of SubComponents
from a list of ComponentEdge
s
recordNodes :: Graph (Maybe ByteString) (ByteString, ByteString) -> [Statement] Source #
Convert an algebraic Graph into dot record nodes
recordEdges :: Directed -> Graph (Maybe ByteString) (ByteString, ByteString) -> [Statement] Source #
Convert an algebraic Graph into dot edges
toStatementsRecord :: Directed -> Graph (Maybe ByteString) (ByteString, ByteString) -> [Statement] Source #
create Statements from a (edge labelled) algebraic graph
https://graphviz.org/Gallery/directed/datastruct.html
toURL :: ByteString -> Maybe ByteString Source #
Convert a node ID to a label for chart-svg charts Doing this directly in dot doesn't quite work because the engines get the width of the link wrong.
dotAST :: [SubComponents] -> [ComponentEdge] -> Graph Source #
AST Graph
gAST = dotAST allSC componentEdges C.writeFile "other/ast.dot" $ dotPrint defaultDotConfig gAST bsSvg <- processDotWith Directed ["-Tsvg"] (dotPrint defaultDotConfig gAST) C.writeFile "other/ast.svg" bsSvg
data ItemModule Source #
Link values
Constructors
ItemModule | |
Fields
|
Instances
Generic ItemModule Source # | |||||
Defined in DotParse.Examples.AST Associated Types
| |||||
Show ItemModule Source # | |||||
Defined in DotParse.Examples.AST Methods showsPrec :: Int -> ItemModule -> ShowS # show :: ItemModule -> String # showList :: [ItemModule] -> ShowS # | |||||
Eq ItemModule Source # | |||||
Defined in DotParse.Examples.AST | |||||
type Rep ItemModule Source # | |||||
Defined in DotParse.Examples.AST type Rep ItemModule = D1 ('MetaData "ItemModule" "DotParse.Examples.AST" "dotparse-0.1.2.2-4MUYXejHl8c8GMCrGHAjp6" 'False) (C1 ('MetaCons "ItemModule" 'PrefixI 'True) (S1 ('MetaSel ('Just "item") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString) :*: (S1 ('MetaSel ('Just "itemModule") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString) :*: S1 ('MetaSel ('Just "itemPackage") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString)))) |
itemModules :: [ItemModule] Source #
List of link values
componentEdges :: [ComponentEdge] Source #
list of chart-svg component edges
allSC :: [SubComponents] Source #
list of chart-svg subcomponents