org.anarres.cpp
Class SourceIterator

java.lang.Object
  extended by org.anarres.cpp.SourceIterator
All Implemented Interfaces:
Iterator<Token>

public class SourceIterator
extends Object
implements Iterator<Token>

An Iterator for Sources, returning Tokens.


Constructor Summary
SourceIterator(Source s)
           
 
Method Summary
 boolean hasNext()
          Returns true if the enclosed Source has more tokens.
 Token next()
          Returns the next token from the enclosed Source.
 void remove()
          Not supported.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SourceIterator

public SourceIterator(Source s)
Method Detail

hasNext

public boolean hasNext()
Returns true if the enclosed Source has more tokens. The EOF token is never returned by the iterator.

Specified by:
hasNext in interface Iterator<Token>
Throws:
IllegalStateException - if the Source throws a LexerException or IOException

next

public Token next()
Returns the next token from the enclosed Source. The EOF token is never returned by the iterator.

Specified by:
next in interface Iterator<Token>
Throws:
IllegalStateException - if the Source throws a LexerException or IOException

remove

public void remove()
Not supported.

Specified by:
remove in interface Iterator<Token>
Throws:
UnsupportedOperationException.


Copyright © 2007 Shevek, Anarres. All Rights Reserved.