sleep.parser

Class StringIterator

public class StringIterator extends Object

Field Summary
protected intbegin
protected intlineNo
protected LinkedListmark1
protected LinkedListmark2
protected intposition
protected char[]text
protected Stringtexts
Constructor Summary
StringIterator(String text)
StringIterator(String _text, int _lineNo)
Method Summary
StringgetEntireLine()
TokengetErrorToken()
intgetLineMarker()
intgetLineNumber()
booleanhasNext()
check that there is another character out there for us to get
booleanhasNext(int n)
check that there are at least n chars we can still get
booleanisNextChar(char n)
booleanisNextString(String n)
static voidmain(String[] args)
voidmark()
Stringnext(int n)
returns the string consisting of the next n characters.
charnext()
moves the iterator forward one char
charpeek()
Stringreset()
voidskip(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
StringtoString()

Field Detail

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 Detail

StringIterator

public StringIterator(String text)

StringIterator

public StringIterator(String _text, int _lineNo)

Method Detail

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(String[] args)

mark

public void mark()

next

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

next

public char next()
moves the iterator forward one char

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()