ESC/Java2
© 2003,2004,2005 David Cok and Joseph Kiniry
© 2005 UCD Dublin
© 2003,2004 Radboud University Nijmegen
© 1999,2000 Compaq Computer Corporation
© 1997,1998,1999 Digital Equipment Corporation
All Rights Reserved

javafe.ast
Class StandardPrettyPrint

java.lang.Object
  extended byjavafe.ast.PrettyPrint
      extended byjavafe.ast.StandardPrettyPrint
Direct Known Subclasses:
PrintSpec.PrintSpecPrettyPrint

public class StandardPrettyPrint
extends PrettyPrint


Field Summary
 
Fields inherited from class javafe.ast.PrettyPrint
displayInferred, INDENT, inst, self
 
Constructor Summary
StandardPrettyPrint()
           
StandardPrettyPrint(PrettyPrint self)
           
 
Method Summary
(package private)  void displayBody(java.io.OutputStream o, int ind, BlockStmt body, boolean showBody, boolean specOnly, java.lang.String kind)
           
 void print(java.io.OutputStream o, CompilationUnit cu)
          Print a compilation onto to a stream.
 void print(java.io.OutputStream o, GenericVarDecl d)
           
 void print(java.io.OutputStream o, int ind, ExprVec es)
           
 void print(java.io.OutputStream o, int ind, FieldDecl d, boolean showBody)
           
 void print(java.io.OutputStream o, int ind, FormalParaDeclVec fps)
           
 void print(java.io.OutputStream o, int ind, LocalVarDecl d, boolean showBody)
           
 void print(java.io.OutputStream o, int ind, ModifierPragma mp)
          Print a member or static initializer of a type declaration.
 void print(java.io.OutputStream o, int ind, ObjectDesignator od)
           
 void print(java.io.OutputStream o, int ind, Stmt s)
          Print a statement.
 void print(java.io.OutputStream o, int ind, StmtPragma sp)
           
 void print(java.io.OutputStream o, int ind, TypeDeclElem d, Identifier classId, boolean showBody)
          Print a member or static initializer of a type declaration.
 void print(java.io.OutputStream o, int ind, TypeDeclElemPragma tp)
           
 void print(java.io.OutputStream o, int ind, TypeModifierPragma tp)
           
 void print(java.io.OutputStream o, int ind, TypeModifierPragmaVec t)
           
 void print(java.io.OutputStream o, int ind, VarInit e)
           
 void print(java.io.OutputStream o, LexicalPragma lp)
          Print a lexical pragma.
 void print(java.io.OutputStream o, Name n)
           
 void print(java.io.OutputStream o, Type t)
           
 void print(java.io.OutputStream o, TypeNameVec tns)
           
static void println(VarInit e)
           
 void printnoln(java.io.OutputStream o, int ind, TypeDecl d)
          Print a type declaration onto to a stream, without a final newline.
static java.lang.String toCanonicalString(int tag, java.lang.Object val)
          Requires that tag is one of constants on the left of this table: TagConstants.BOOLEANLIT Boolean TagConstants.CHARLIT Integer TagConstants.DOUBLELIT Double TagConstants.FLOATLIT Float TagConstants.INTLIT Integer TagConstants.LONGLIT Long TagConstants.STRINGLIT String and that val is an instance of the corresponding type on the right.
 java.lang.String unknownTag(ASTNode n)
          Generate text to describe a ASTNote with an unknown tag
 java.lang.String unknownTagMsg(int tag)
          Generate text to describe a given unknown tag
 
Methods inherited from class javafe.ast.PrettyPrint
print, println, println, println, spaces, toString, toString, toString, toString, toString, toString, toString, toString, toString, toString, toString, write, write, writeln, writeln
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StandardPrettyPrint

public StandardPrettyPrint()

StandardPrettyPrint

public StandardPrettyPrint(PrettyPrint self)
Method Detail

print

public void print(java.io.OutputStream o,
                  CompilationUnit cu)
Description copied from class: PrettyPrint
Print a compilation onto to a stream. Works best when o is positioned at the start of a new line.

Specified by:
print in class PrettyPrint

printnoln

public void printnoln(java.io.OutputStream o,
                      int ind,
                      TypeDecl d)
Description copied from class: PrettyPrint
Print a type declaration onto to a stream, without a final newline.

Specified by:
printnoln in class PrettyPrint

print

public void print(java.io.OutputStream o,
                  int ind,
                  Stmt s)
Description copied from class: PrettyPrint
Print a statement. Assumes that s should be printed starting at the current position of o. It does not print a new-line at the end of the statement. However, if the statement needs to span multiple lines (for example, because it has embedded statements), then these lines are indented by ind spaces.

Specified by:
print in class PrettyPrint

print

public void print(java.io.OutputStream o,
                  int ind,
                  TypeDeclElem d,
                  Identifier classId,
                  boolean showBody)
Description copied from class: PrettyPrint
Print a member or static initializer of a type declaration. Assumes that s should be printed starting at the current position of o. If the declaration needs to span multiple lines (for example, to print the statements in the body of a method), then these lines are indented by ind spaces. It should leave o at the start of a new-line.

Specified by:
print in class PrettyPrint

displayBody

void displayBody(java.io.OutputStream o,
                 int ind,
                 BlockStmt body,
                 boolean showBody,
                 boolean specOnly,
                 java.lang.String kind)

print

public void print(java.io.OutputStream o,
                  TypeNameVec tns)
Specified by:
print in class PrettyPrint

print

public void print(java.io.OutputStream o,
                  int ind,
                  FormalParaDeclVec fps)
Specified by:
print in class PrettyPrint

print

public void print(java.io.OutputStream o,
                  int ind,
                  ExprVec es)
Specified by:
print in class PrettyPrint

print

public void print(java.io.OutputStream o,
                  GenericVarDecl d)
Specified by:
print in class PrettyPrint

print

public void print(java.io.OutputStream o,
                  int ind,
                  LocalVarDecl d,
                  boolean showBody)
Specified by:
print in class PrettyPrint

print

public void print(java.io.OutputStream o,
                  int ind,
                  FieldDecl d,
                  boolean showBody)
Specified by:
print in class PrettyPrint

print

public void print(java.io.OutputStream o,
                  Type t)
Specified by:
print in class PrettyPrint

print

public void print(java.io.OutputStream o,
                  Name n)
Specified by:
print in class PrettyPrint

println

public static void println(VarInit e)

print

public void print(java.io.OutputStream o,
                  int ind,
                  VarInit e)
Specified by:
print in class PrettyPrint

print

public void print(java.io.OutputStream o,
                  int ind,
                  ObjectDesignator od)
Specified by:
print in class PrettyPrint

toCanonicalString

public static java.lang.String toCanonicalString(int tag,
                                                 java.lang.Object val)
Requires that tag is one of constants on the left of this table:
TagConstants.BOOLEANLIT Boolean
TagConstants.CHARLIT Integer
TagConstants.DOUBLELIT Double
TagConstants.FLOATLIT Float
TagConstants.INTLIT Integer
TagConstants.LONGLIT Long
TagConstants.STRINGLIT String
and that val is an instance of the corresponding type on the right.

Returns:
a canonical text representation for literal values.

print

public void print(java.io.OutputStream o,
                  LexicalPragma lp)
Description copied from class: PrettyPrint
Print a lexical pragma. Assumes o is at the start of the line; should leave o at the start of a new line.

Specified by:
print in class PrettyPrint

print

public void print(java.io.OutputStream o,
                  int ind,
                  TypeDeclElemPragma tp)
Specified by:
print in class PrettyPrint

print

public void print(java.io.OutputStream o,
                  int ind,
                  ModifierPragma mp)
Description copied from class: PrettyPrint
Print a member or static initializer of a type declaration. Assumes that s should be printed starting at the current position of o. If the declaration needs to span multiple lines (for example, to print the statements in the body of a method), then these lines are indented by ind spaces. It should leave o at the start of a new-line.

Specified by:
print in class PrettyPrint

print

public void print(java.io.OutputStream o,
                  int ind,
                  StmtPragma sp)
Specified by:
print in class PrettyPrint

print

public void print(java.io.OutputStream o,
                  int ind,
                  TypeModifierPragma tp)
Specified by:
print in class PrettyPrint

print

public void print(java.io.OutputStream o,
                  int ind,
                  TypeModifierPragmaVec t)

unknownTag

public java.lang.String unknownTag(ASTNode n)
Generate text to describe a ASTNote with an unknown tag


unknownTagMsg

public java.lang.String unknownTagMsg(int tag)
Generate text to describe a given unknown tag


ESC/Java2
© 2003,2004,2005 David Cok and Joseph Kiniry
© 2005 UCD Dublin
© 2003,2004 Radboud University Nijmegen
© 1999,2000 Compaq Computer Corporation
© 1997,1998,1999 Digital Equipment Corporation
All Rights Reserved

The ESC/Java2 Project Homepage