org.erights.e.elang.syntax
Class PrettyFeeder

java.lang.Object
  |
  +--org.erights.e.elang.syntax.PrettyFeeder
All Implemented Interfaces:
LineFeeder

public class PrettyFeeder
extends Object
implements LineFeeder

Safe: For prettifying source using indentation info.

Author:
Mark S. Miller

Field Summary
private  FlexList myBuf
           
private  TwineFeeder myWrapped
           
private static Twine SPACE
           
 
Constructor Summary
PrettyFeeder(Twine sourceCode)
          Enabled:
 
Method Summary
 Twine getPrettyCode()
          Enabled:
 Twine optNextLine(boolean atTop, boolean quoted, int indent, char closer, int closeIndent)
          Enabled:
static Twine pretty(Twine sourceCode)
          Enabled:
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myWrapped

private final TwineFeeder myWrapped

myBuf

private final FlexList myBuf

SPACE

private static final Twine SPACE
Constructor Detail

PrettyFeeder

public PrettyFeeder(Twine sourceCode)
Enabled:

Method Detail

pretty

public static Twine pretty(Twine sourceCode)
                    throws IOException
Enabled:

IOException

optNextLine

public Twine optNextLine(boolean atTop,
                         boolean quoted,
                         int indent,
                         char closer,
                         int closeIndent)
Enabled:

Specified by:
optNextLine in interface LineFeeder
Parameters:
atTop - Is this the beginning of a top-level unit (typically, a top-level expression)?
quoted - Will this next line be taken as literal text? If so, then it should not be trimmed or indented. 'quoted' is true between double quotes, or between quasi-quotes when not inside a $ or @ hole.
indent - The suggested indentation level for the next line, unless the next line begins with closer.
closer - The character that would close the most recent unclosed openner.
closeIndent - The suggested indentation level for the next line if it does begin (after trimming) with closer.

getPrettyCode

public Twine getPrettyCode()
Enabled:



comments?