polyglot.visit
Class StringPrettyPrinter

java.lang.Object
  extended by polyglot.visit.PrettyPrinter
      extended by polyglot.visit.StringPrettyPrinter

public class StringPrettyPrinter
extends PrettyPrinter

A PrettyPrinter generates output code from the processed AST. To use: new PrettyPrinter().printAst(node, new CodeWriter(out));


Nested Class Summary
static class StringPrettyPrinter.StringCodeWriter
           
 
Field Summary
 
Fields inherited from class polyglot.visit.PrettyPrinter
appendSemicolon, printType
 
Constructor Summary
StringPrettyPrinter(int maxdepth)
           
 
Method Summary
 void print(Node parent, Node child, CodeWriter w)
          Print an AST node using the given code writer.
 java.lang.String toString(Node ast)
           
 
Methods inherited from class polyglot.visit.PrettyPrinter
appendSemicolon, appendSemicolon, printAst, printType, printType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringPrettyPrinter

public StringPrettyPrinter(int maxdepth)
Method Detail

print

public void print(Node parent,
                  Node child,
                  CodeWriter w)
Description copied from class: PrettyPrinter
Print an AST node using the given code writer. The CodeWriter.flush() method must be called after this method to ensure code is output. Use printAst rather than this method to print the entire AST; this method should only be called by nodes to print their children.

Overrides:
print in class PrettyPrinter

toString

public java.lang.String toString(Node ast)