Class CFGUtil.DotFileGenerator
java.lang.Object
com.pnfsoftware.jeb.core.units.code.CFGUtil.DotFileGenerator
- Enclosing class:
CFGUtil
GraphViz generator for CFG objects. The edge labels are customizable via protected methods.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongenerate()Generate the dot file contents.protected StringgenerateEdgeLabel(IBasicBlock<? extends IInstruction> src, int outEdgeIndex) Generate a regular edge label.protected StringgenerateIrregularEdgeLabel(IBasicBlock<? extends IInstruction> src, int outEdgeIndex) Generate an irregular edge label.protected StringgenerateNodeBackgroundColor(IBasicBlock<? extends IInstruction> blk) Generate a node background color.protected StringgenerateNodeTextColor(IBasicBlock<? extends IInstruction> blk) Generate a node text color.voidsetBlockHeaders(Map<Long, String> blockHeaders) Set optional block headers.voidsetGenerateBlockIndices(int nodeIndexingStartValue) Set the first generated block index.voidsetLineLimit(int lineLimit) Set the line limit.voidSet the graph title.
-
Constructor Details
-
DotFileGenerator
Create a dot file generator.- Parameters:
cfg- control flow graph
-
-
Method Details
-
setTitle
Set the graph title.- Parameters:
title- graph title
-
setBlockHeaders
Set optional block headers.- Parameters:
blockHeaders- block headers
-
setLineLimit
public void setLineLimit(int lineLimit) Set the line limit.- Parameters:
lineLimit- line limit
-
setGenerateBlockIndices
public void setGenerateBlockIndices(int nodeIndexingStartValue) Set the first generated block index.- Parameters:
nodeIndexingStartValue- first block index
-
generate
Generate the dot file contents.- Returns:
- dot file contents
-
generateEdgeLabel
Generate a regular edge label.- Parameters:
src- source blockoutEdgeIndex- output edge index- Returns:
- edge label, or null
-
generateIrregularEdgeLabel
protected String generateIrregularEdgeLabel(IBasicBlock<? extends IInstruction> src, int outEdgeIndex) Generate an irregular edge label.- Parameters:
src- source blockoutEdgeIndex- output edge index- Returns:
- edge label, or null
-
generateNodeBackgroundColor
Generate a node background color.- Parameters:
blk- basic block- Returns:
- background color, or null
-
generateNodeTextColor
Generate a node text color.- Parameters:
blk- basic block- Returns:
- text color, or null
-