at.dms.kjc
Class StreamItDot

java.lang.Object
  extended by at.dms.kjc.StreamItDot
All Implemented Interfaces:
AttributeStreamVisitor
Direct Known Subclasses:
LinearDot, LinearDot, NumberDot, PartitionDot, SimpleDot, StatelessDot

public class StreamItDot
extends Object
implements AttributeStreamVisitor

This class does the front-end processing to turn a Kopi compilation unit into StreamIt classes, and then prints the class graph as a dot file.


Nested Class Summary
 class StreamItDot.NamePair
          Inner class to represent dot graph components.
 
Constructor Summary
StreamItDot(PrintStream outputStream)
           
 
Method Summary
 void compile(JCompilationUnit[] app)
          Prints out a dot graph for the program being compiled.
 String getClusterString(SIRStream self)
          Prints out the subgraph cluser line that is needed in to make clusters.
 String getName()
           
protected static String makeFilterLabel(SIRPhasedFilter self)
          Returns the rate information for a filter.
 String makeLabelledNode(String label)
           
 void print(String f)
           
static void printGraph(SIRStream str)
          Prints dot graph of
static void printGraph(SIRStream str, String filename)
          Prints dot graph of
 StreamItDot.NamePair processWorkFunction(JMethodDeclaration work)
           
 Object visitFeedbackLoop(SIRFeedbackLoop self, JFieldDeclaration[] fields, JMethodDeclaration[] methods, JMethodDeclaration init, JMethodDeclaration initPath)
           
 Object visitFilter(SIRFilter self, JFieldDeclaration[] fields, JMethodDeclaration[] methods, JMethodDeclaration init, JMethodDeclaration work, CType inputType, CType outputType)
           
 Object visitJoiner(SIRJoiner self, SIRJoinType type, JExpression[] expWeights)
           
 Object visitPhasedFilter(SIRPhasedFilter self, JFieldDeclaration[] fields, JMethodDeclaration[] methods, JMethodDeclaration init, JMethodDeclaration work, JMethodDeclaration[] initPhases, JMethodDeclaration[] phases, CType inputType, CType outputType)
           
 Object visitPipeline(SIRPipeline self, JFieldDeclaration[] fields, JMethodDeclaration[] methods, JMethodDeclaration init)
           
 Object visitSplitJoin(SIRSplitJoin self, JFieldDeclaration[] fields, JMethodDeclaration[] methods, JMethodDeclaration init, SIRSplitter splitter, SIRJoiner joiner)
           
 Object visitSplitter(SIRSplitter self, SIRSplitType type, JExpression[] expWeights)
           
 Object visitStructure(SIRStructure self, JFieldDeclaration[] fields)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamItDot

public StreamItDot(PrintStream outputStream)
Method Detail

compile

public void compile(JCompilationUnit[] app)
Prints out a dot graph for the program being compiled.


printGraph

public static void printGraph(SIRStream str)
Prints dot graph of
str
to System.out


printGraph

public static void printGraph(SIRStream str,
                              String filename)
Prints dot graph of
str
to
filename


print

public void print(String f)

makeLabelledNode

public String makeLabelledNode(String label)

getName

public String getName()

visitStructure

public Object visitStructure(SIRStructure self,
                             JFieldDeclaration[] fields)
Specified by:
visitStructure in interface AttributeStreamVisitor

makeFilterLabel

protected static String makeFilterLabel(SIRPhasedFilter self)
Returns the rate information for a filter.


visitFilter

public Object visitFilter(SIRFilter self,
                          JFieldDeclaration[] fields,
                          JMethodDeclaration[] methods,
                          JMethodDeclaration init,
                          JMethodDeclaration work,
                          CType inputType,
                          CType outputType)
Specified by:
visitFilter in interface AttributeStreamVisitor

visitPhasedFilter

public Object visitPhasedFilter(SIRPhasedFilter self,
                                JFieldDeclaration[] fields,
                                JMethodDeclaration[] methods,
                                JMethodDeclaration init,
                                JMethodDeclaration work,
                                JMethodDeclaration[] initPhases,
                                JMethodDeclaration[] phases,
                                CType inputType,
                                CType outputType)
Specified by:
visitPhasedFilter in interface AttributeStreamVisitor

visitSplitter

public Object visitSplitter(SIRSplitter self,
                            SIRSplitType type,
                            JExpression[] expWeights)
Specified by:
visitSplitter in interface AttributeStreamVisitor

visitJoiner

public Object visitJoiner(SIRJoiner self,
                          SIRJoinType type,
                          JExpression[] expWeights)
Specified by:
visitJoiner in interface AttributeStreamVisitor

processWorkFunction

public StreamItDot.NamePair processWorkFunction(JMethodDeclaration work)

visitPipeline

public Object visitPipeline(SIRPipeline self,
                            JFieldDeclaration[] fields,
                            JMethodDeclaration[] methods,
                            JMethodDeclaration init)
Specified by:
visitPipeline in interface AttributeStreamVisitor

visitSplitJoin

public Object visitSplitJoin(SIRSplitJoin self,
                             JFieldDeclaration[] fields,
                             JMethodDeclaration[] methods,
                             JMethodDeclaration init,
                             SIRSplitter splitter,
                             SIRJoiner joiner)
Specified by:
visitSplitJoin in interface AttributeStreamVisitor

visitFeedbackLoop

public Object visitFeedbackLoop(SIRFeedbackLoop self,
                                JFieldDeclaration[] fields,
                                JMethodDeclaration[] methods,
                                JMethodDeclaration init,
                                JMethodDeclaration initPath)
Specified by:
visitFeedbackLoop in interface AttributeStreamVisitor

getClusterString

public String getClusterString(SIRStream self)
Prints out the subgraph cluser line that is needed in to make clusters. This method is overridden to make colored pipelines and splitjoins in LinearDot.