org.quasiliteral.syntax
Class FileFeeder

java.lang.Object
  |
  +--org.quasiliteral.syntax.FileFeeder
All Implemented Interfaces:
LineFeeder

public class FileFeeder
extends Object
implements LineFeeder

Untamed: A FileFeeder reads its input from a Reader which it assumes starts at the beginning of line 1 in the text unit (file?) described by the Url.

Author:
Mark S. Miller

Field Summary
private  int myLineNum
           
private  TextWriter myOptOuts
           
private  BufferedReader myOptReader
           
private  String myUrl
           
 
Constructor Summary
FileFeeder(String url, BufferedReader optReader, TextWriter optOuts)
          Enabled:
 
Method Summary
 Twine optNextLine(boolean atTop, boolean quoted, int indent, char closer, int closeIndent)
          Enabled:
private  String prompt(boolean atTop, boolean quoted, int indent, char closer, int closeIndent)
           
 String toString()
          Suppressed:
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

myUrl

private final String myUrl

myLineNum

private int myLineNum

myOptReader

private BufferedReader myOptReader

myOptOuts

private final TextWriter myOptOuts
Constructor Detail

FileFeeder

public FileFeeder(String url,
                  BufferedReader optReader,
                  TextWriter optOuts)
Enabled:

Method Detail

toString

public String toString()
Suppressed:

Overrides:
toString in class Object
Returns:
a string representation of the object.

optNextLine

public Twine optNextLine(boolean atTop,
                         boolean quoted,
                         int indent,
                         char closer,
                         int closeIndent)
                  throws IOException
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.
IOException

prompt

private String prompt(boolean atTop,
                      boolean quoted,
                      int indent,
                      char closer,
                      int closeIndent)


comments?