edu.cornell.cs.cs4120.util
Class CodeWriterTreePrinter

java.lang.Object
  extended by edu.cornell.cs.cs4120.util.CodeWriterTreePrinter
All Implemented Interfaces:
TreePrinter

public class CodeWriterTreePrinter
extends Object
implements TreePrinter

An TreePrinter implementation designed to print ASTs through a provided CodeWriter.


Constructor Summary
CodeWriterTreePrinter(CodeWriter writer)
          Constructs a new TreePrinter instance that prints programs using the given CodeWriter.
CodeWriterTreePrinter(OutputStream o)
          Constructs a new TreePrinter instance that prints programs using to the given stream.
 
Method Summary
 void print(VisualizableTreeNode node)
          Prints a tree.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CodeWriterTreePrinter

public CodeWriterTreePrinter(CodeWriter writer)
Constructs a new TreePrinter instance that prints programs using the given CodeWriter.

Parameters:
writer - the CodeWriter to print to

CodeWriterTreePrinter

public CodeWriterTreePrinter(OutputStream o)
Constructs a new TreePrinter instance that prints programs using to the given stream. Output is kept to 80 columns.

Parameters:
o - the output stream to print to
Method Detail

print

public void print(VisualizableTreeNode node)
Description copied from interface: TreePrinter
Prints a tree.

Specified by:
print in interface TreePrinter