|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpolyglot.util.CodeWriter
polyglot.visit.StringPrettyPrinter.StringCodeWriter
Field Summary |
Fields inherited from class polyglot.util.CodeWriter |
debug, precompute |
Constructor Summary | |
StringPrettyPrinter.StringCodeWriter(java.io.CharArrayWriter w)
|
Method Summary | |
void |
allowBreak(int n)
Allow a newline. |
void |
allowBreak(int n,
java.lang.String alt)
Allow a newline. |
void |
begin(int n)
Start a new block with a relative indentation of n
characters. |
void |
newline(int n)
Force a newline. |
java.lang.String |
toString()
Return a readable representation of all the structured input given to the CodeWriter since the last flush. |
void |
write(java.lang.String s)
Print the string s verbatim on the output stream. |
Methods inherited from class polyglot.util.CodeWriter |
end, flush, newline |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public StringPrettyPrinter.StringCodeWriter(java.io.CharArrayWriter w)
Method Detail |
public void write(java.lang.String s)
CodeWriter
s
verbatim on the output stream.
write
in class CodeWriter
public void newline(int n)
CodeWriter
allowBreak
is
preferable because forcing a newline also causes all breaks
in containing blocks to be broken.
newline
in class CodeWriter
public void allowBreak(int n)
CodeWriter
allowBreak
in class CodeWriter
n
- the amount of increase in indentation if
the newline is inserted.
public void allowBreak(int n, java.lang.String alt)
CodeWriter
allowBreak
in class CodeWriter
n
- the amount of increase in indentation if
the newline is inserted.alt
- if no newline is inserted, the string alt
is
output instead.
public void begin(int n)
CodeWriter
n
characters.
newline
item in the block.allowBreak
will cause a line change, the first line
is printed at the current cursor position pos
,
all the following lines are printed at the position
pos+n
.
begin
in class CodeWriter
n
- the number of characters increased on indentation (relative
to the current position) for all lines in the block.
public java.lang.String toString()
CodeWriter
toString
in class CodeWriter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |