|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object fmrisc.Communication.PrettyPrinter
public final class PrettyPrinter
Printing abstract syntax trees with appropriate line breaks.
Field Summary | |
---|---|
static int |
WIDTH
The pretty printer depends on the current printing mode (LINE or BLOCK) and the current indentation level LEVEL. |
Constructor Summary | |
---|---|
PrettyPrinter(int width,
java.io.PrintWriter out)
Create pretty printer to print abstract syntax trees. |
|
PrettyPrinter(java.io.PrintWriter out)
Create pretty printer for default width WIDTH. |
Method Summary | |
---|---|
void |
changeLevel(boolean increase)
Change indentation level. |
void |
newLine()
Start new (non-overflow)line and indent it appropriately. |
void |
print(Declaration decl)
Pretty-print declaration. |
void |
print(Expression exp)
Pretty-print expression. |
void |
print(java.lang.String text)
Print text. |
void |
print(Type type)
Pretty-print type. |
void |
space()
Insert a space (or a newline at the end of the line). |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int WIDTH
Constructor Detail |
---|
public PrettyPrinter(int width, java.io.PrintWriter out)
width
- the line width (suggestion, not a hard bound).out
- the stream to print on.public PrettyPrinter(java.io.PrintWriter out)
out
- the stream to print on.Method Detail |
---|
public void print(Declaration decl)
decl
- a declaration.public void print(Expression exp)
exp
- an expression.public void print(Type type)
type
- a typepublic void print(java.lang.String text)
text
- the text to be printed.public void changeLevel(boolean increase)
increase
- true if level is increased (decreased otherwise)public void newLine()
public void space()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |