polyglot.util
Class CodeWriter

java.lang.Object
  extended by polyglot.util.CodeWriter
Direct Known Subclasses:
StringPrettyPrinter.StringCodeWriter

public class CodeWriter
extends java.lang.Object


Field Summary
protected  polyglot.util.BlockItem current
           
static boolean debug
           
protected static int format_calls
           
protected  polyglot.util.BlockItem input
           
protected  java.io.PrintWriter output
           
static boolean precompute
           
static boolean showInput
           
protected static polyglot.util.Item top
           
protected  int trace_indent
           
static boolean visualize
           
protected  int width
           
 
Constructor Summary
CodeWriter(java.io.OutputStream o, int width_)
           
CodeWriter(java.io.PrintWriter o, int width_)
           
CodeWriter(java.io.Writer o, int width_)
           
 
Method Summary
 void allowBreak(int n)
           
 void allowBreak(int n, int level, java.lang.String alt, int altlen)
           
 void allowBreak(int n, java.lang.String alt)
           
 void begin(int n)
           
 void close()
           
 void end()
           
 boolean flush()
           
 boolean flush(boolean format)
           
 void newline()
           
 void newline(int n)
           
 void newline(int n, int level)
           
 java.lang.String toString()
           
 void unifiedBreak(int n, int level, java.lang.String alt, int altlen)
           
 void write(java.lang.String s)
           
 void write(java.lang.String s, int length)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

input

protected polyglot.util.BlockItem input

current

protected polyglot.util.BlockItem current

top

protected static polyglot.util.Item top

output

protected java.io.PrintWriter output

width

protected int width

format_calls

protected static int format_calls

debug

public static final boolean debug
See Also:
Constant Field Values

showInput

public static final boolean showInput
See Also:
Constant Field Values

visualize

public static final boolean visualize
See Also:
Constant Field Values

precompute

public static final boolean precompute
See Also:
Constant Field Values

trace_indent

protected int trace_indent
Constructor Detail

CodeWriter

public CodeWriter(java.io.OutputStream o,
                  int width_)

CodeWriter

public CodeWriter(java.io.PrintWriter o,
                  int width_)

CodeWriter

public CodeWriter(java.io.Writer o,
                  int width_)
Method Detail

write

public void write(java.lang.String s)

write

public void write(java.lang.String s,
                  int length)

begin

public void begin(int n)

end

public void end()

allowBreak

public void allowBreak(int n)

allowBreak

public void allowBreak(int n,
                       java.lang.String alt)

allowBreak

public void allowBreak(int n,
                       int level,
                       java.lang.String alt,
                       int altlen)

unifiedBreak

public void unifiedBreak(int n,
                         int level,
                         java.lang.String alt,
                         int altlen)

newline

public void newline()

newline

public void newline(int n,
                    int level)

newline

public void newline(int n)

flush

public boolean flush()
              throws java.io.IOException
Throws:
java.io.IOException

flush

public boolean flush(boolean format)
              throws java.io.IOException
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Throws:
java.io.IOException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object