org.quasiliteral.syntax
Class TwineFeeder
java.lang.Object
|
+--org.quasiliteral.syntax.TwineFeeder
- All Implemented Interfaces:
- LineFeeder
- public class TwineFeeder
- extends Object
- implements LineFeeder
Untamed: For feeding in one line of Twine at a time taken from a dynamically
provided Twine source.
- Author:
- Mark S. Miller
mySource
private final Twine mySource
myPos
private int myPos
TwineFeeder
public TwineFeeder(Twine sourceCode)
- Enabled:
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)
- 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.
comments?