public class Reader extends structure5.AbstractIterator<Token>
Token
s. By default, the stream is constructed
from a structure.ReadStream, but the Reader may also be constructed
to read from a List. This allows the recursive implementation of
procedures.Constructor and Description |
---|
Reader()
Constructs a Reader that reads from the default input stream.
|
Reader(structure5.List<Token> l)
Constructs a Reader that reads tokens from a List.
|
Reader(Token t)
Constructs a Reader that reads from a single Token.
|
Modifier and Type | Method and Description |
---|---|
Token |
get()
Not yet implemented.
|
boolean |
hasNext()
Check for more tokens on input stream.
|
static void |
main(java.lang.String[] args)
A sample method that reads tokens from a Reader and prints
their value to the console.
|
Token |
next()
If
hasNext() returns the next token from the input
stream. |
void |
reset()
If this is a list, resets the reader back to the beginning.
|
hasMoreElements, iterator, nextElement, remove, value
public Reader()
public Reader(structure5.List<Token> l)
l
- a List containing the tokens to be read.public Reader(Token t)
t
- the source of the token streampublic boolean hasNext()
public Token get()
get
in class structure5.AbstractIterator<Token>
public void reset()
reset
in class structure5.AbstractIterator<Token>
public static void main(java.lang.String[] args)