dk.brics.string.flow
Class FlowGraph

java.lang.Object
  extended by dk.brics.string.flow.FlowGraph

public class FlowGraph
extends Object

Flow graph. Nodes represent definitions (variables or expressions). Edges represent data flow.

Author:
Anders Møller <amoeller@cs.au.dk>, Aske Simon Christensen <aske@cs.au.dk>

Constructor Summary
FlowGraph()
          Constructs new empty flow graph.
 
Method Summary
 AssignmentNode addAssignmentNode()
          Adds new assignment node to this flow graph.
 BinaryNode addBinaryNode(BinaryOperation op)
          Adds new binary operation node to this flow graph.
 ConcatenationNode addConcatenationNode()
          Adds new concatenation node to this flow graph.
 InitializationNode addInitializationNode(Automaton reg)
          Adds new initialization node to this flow graph.
 UnaryNode addUnaryNode(UnaryOperation op)
          Adds new unary operation node to this flow graph.
 List<Node> getNodes()
          Returns the (unmodifiable) collection of nodes in this graph.
 int getNumberOfEdges()
          Returns number of edges in this graph.
 int getNumberOfNodes()
          Returns number of nodes in this graph.
 void normalize()
          See Simplifier.normalize(FlowGraph).
 void removeNodes(Set<Node> removed)
          Removes the given nodes from this graph.
 Map<Node,Node> simplify()
          See Simplifier.simplify(FlowGraph).
 String toDot()
          See FlowGraph2Dot.toDot(FlowGraph).
 String toDot(Collection<Node> hotspots)
          See FlowGraph2Dot.toDot(FlowGraph,Collection).
 void visitNodes(NodeVisitor v)
          Visits all nodes with the given visitor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FlowGraph

public FlowGraph()
Constructs new empty flow graph.

Method Detail

addAssignmentNode

public AssignmentNode addAssignmentNode()
Adds new assignment node to this flow graph.

Returns:
new node

addBinaryNode

public BinaryNode addBinaryNode(BinaryOperation op)
Adds new binary operation node to this flow graph.

Parameters:
op - binary operation
Returns:
new node

addConcatenationNode

public ConcatenationNode addConcatenationNode()
Adds new concatenation node to this flow graph.

Returns:
new node

addInitializationNode

public InitializationNode addInitializationNode(Automaton reg)
Adds new initialization node to this flow graph.

Parameters:
reg - regular language representing initialization values
Returns:
new node

addUnaryNode

public UnaryNode addUnaryNode(UnaryOperation op)
Adds new unary operation node to this flow graph.

Parameters:
op - unary operation
Returns:
new node

getNodes

public List<Node> getNodes()
Returns the (unmodifiable) collection of nodes in this graph.


getNumberOfEdges

public int getNumberOfEdges()
Returns number of edges in this graph.


getNumberOfNodes

public int getNumberOfNodes()
Returns number of nodes in this graph.


normalize

public void normalize()
See Simplifier.normalize(FlowGraph).


removeNodes

public void removeNodes(Set<Node> removed)
Removes the given nodes from this graph.


simplify

public Map<Node,Node> simplify()
See Simplifier.simplify(FlowGraph).


toDot

public String toDot()
See FlowGraph2Dot.toDot(FlowGraph).


toDot

public String toDot(Collection<Node> hotspots)
See FlowGraph2Dot.toDot(FlowGraph,Collection).


visitNodes

public void visitNodes(NodeVisitor v)
Visits all nodes with the given visitor.



Copyright © 2003-2009 Anders Møller, Aske Simon Christensen, Asger Feldthaus.