sleep.parser

Class StringIterator


public class StringIterator
extends Object

Field Summary

protected int
begin
protected int
lineNo
protected LinkedList
mark1
protected LinkedList
mark2
protected int
position
protected char[]
text
protected String
texts

Constructor Summary

StringIterator(String text)
StringIterator(String _text, int _lineNo)

Method Summary

String
getEntireLine()
Token
getErrorToken()
int
getLineMarker()
int
getLineNumber()
boolean
hasNext()
check that there is another character out there for us to get
boolean
hasNext(int n)
check that there are at least n chars we can still get
boolean
isNextChar(char n)
boolean
isNextString(String n)
static void
main(args[] )
void
mark()
char
next()
moves the iterator forward one char
String
next(int n)
returns the string consisting of the next n characters.
char
peek()
String
reset()
void
skip(int n)
does a direct skip of n characters, use only when you know what the chars are..
String
toString()

Field Details

begin

protected int begin

lineNo

protected int lineNo

mark1

protected LinkedList mark1

mark2

protected LinkedList mark2

position

protected int position

text

protected char[] text

texts

protected String texts

Constructor Details

StringIterator

public StringIterator(String text)

StringIterator

public StringIterator(String _text,
                      int _lineNo)

Method Details

getEntireLine

public String getEntireLine()

getErrorToken

public Token getErrorToken()

getLineMarker

public int getLineMarker()

getLineNumber

public int getLineNumber()

hasNext

public boolean hasNext()
check that there is another character out there for us to get

hasNext

public boolean hasNext(int n)
check that there are at least n chars we can still get

isNextChar

public boolean isNextChar(char n)

isNextString

public boolean isNextString(String n)

main

public static void main(args[] )

mark

public void mark()

next

public char next()
moves the iterator forward one char

next

public String next(int n)
returns the string consisting of the next n characters.

peek

public char peek()

reset

public String reset()

skip

public void skip(int n)
does a direct skip of n characters, use only when you know what the chars are.. this will not increment the line number counter

toString

public String toString()