shivers-cfg-0.1.1: Implementation of Shivers' Control-Flow Analysis

Safe HaskellNone
LanguageHaskell98

CFGraph

Description

Generates a visual representation of a control flow graph, by overlaying a pretty-printed syntax output with a graphviz-generated graph.

This code uses the command line tools "neato", "pdf2ps" and "pdftk".

Synopsis

Documentation

font :: PDFFont Source

The font that is used to generate the code listings.

theCharWidth :: PDFFloat Source

Assuming a mono-spaced font, this is the width of a character.

theCharHeight :: PDFFloat Source

The height of a character.

renderCodeToFile :: FilePath -> String -> IO () Source

Creates a PDF file containing the given text, without any padding or borders, using the font specified by font

createDotFromGraph Source

Arguments

:: Integer

number of lines

-> Integer

number of columns

-> [Label Label]

the list of edges to draw

-> (Label :⇀ (Integer, Integer))

the position of the nodes, in characters

-> Graph 

Creates a Graph

createDotFromCode :: (Prog -> [Label Label]) -> Prog -> Graph Source

Creates a Graph given a program and a function generating the required graph

createCodeWithGraph Source

Arguments

:: (Prog -> [Label Label])

Generating a graph from a program

-> FilePath

Wanted filename

-> Prog

Program to draw

-> IO () 

The main function of this module. Writes out a PDF file containing both code and control flow graph