UMinho Haskell Libraries (1.0)ContentsIndex
Language.Java.PackageGraph
Portability portable
Stability experimental
Maintainer joost.visser@di.uminho.pt
Contents
Representation
Package graph generation
Functions for Graphviz format generation.
Description
Synopsis
type PackageGraph = (Rel PGNode PGNode, Rel PGNode PGNode, Rel PGNode PGNode, Rel PGNode PGNode)
type PGNode = String
emptyPG :: PackageGraph
appendPG :: PackageGraph -> PackageGraph -> PackageGraph
addImport :: PGNode -> PGNode -> PackageGraph -> PackageGraph
addNesting :: PGNode -> PGNode -> PackageGraph -> PackageGraph
addInherit :: PGNode -> PGNode -> PackageGraph -> PackageGraph
addImplement :: PGNode -> PGNode -> PackageGraph -> PackageGraph
legendPG :: PackageGraph
pgAsRel :: PackageGraph -> Rel Identifier Identifier
projectPG' :: Rel PGNode PGNode -> PackageGraph -> PackageGraph
java2pcg :: MonadPlus m => [CompilationUnit] -> m String
java2pcg' :: (Term x, MonadPlus m) => (Identifier -> Identifier) -> PGNode -> x -> m PackageGraph
collectDeclaredTypes :: (MonadPlus m, Term t) => t -> m [Identifier]
collectNames :: Term x => x -> [Name]
pg2dot :: String -> PackageGraph -> String
Representation
type PackageGraph = (Rel PGNode PGNode, Rel PGNode PGNode, Rel PGNode PGNode, Rel PGNode PGNode)
The type of package graphs is a 4-tuple of four relations: import, nesting, inherit, and implement.
type PGNode = String
The type of package graph nodes.
emptyPG :: PackageGraph
Empty package graph.
appendPG :: PackageGraph -> PackageGraph -> PackageGraph
Appending two package graphs.
addImport :: PGNode -> PGNode -> PackageGraph -> PackageGraph
Adding edges to the package graph.
addNesting :: PGNode -> PGNode -> PackageGraph -> PackageGraph
addInherit :: PGNode -> PGNode -> PackageGraph -> PackageGraph
addImplement :: PGNode -> PGNode -> PackageGraph -> PackageGraph
legendPG :: PackageGraph
A package graph that can serve as legend.
pgAsRel :: PackageGraph -> Rel Identifier Identifier
Create a single relation out of a package graph.
projectPG' :: Rel PGNode PGNode -> PackageGraph -> PackageGraph
Given a relation, compute the sub graph of a package graph that holds only edges that occur in the relation.
Package graph generation
java2pcg :: MonadPlus m => [CompilationUnit] -> m String
Generate a package graph from a list of compilation units and print it. in the GraphViz format.
java2pcg'
:: (Term x, MonadPlus m)
=> (Identifier -> Identifier)Name resolver
-> PGNodeCurrent parent.
-> xJava fragment.
-> m PackageGraph
Generate a package graph from a Java fragment.
collectDeclaredTypes :: (MonadPlus m, Term t) => t -> m [Identifier]
Collect all types declared in a Java fragment.
collectNames :: Term x => x -> [Name]
Collect all names from a Java fragment.
Functions for Graphviz format generation.
pg2dot
:: StringGraph name
-> PackageGraphGraph
-> StringGraphviz format.
Print a Package Graph in dot format.
Produced by Haddock version 0.6