miSim

misim.editor
Interface TokenIterator

All Known Implementing Classes:
Line

public interface TokenIterator

The TokenIterator interface provides a way to request tokens in sequence from a file or line.


Method Summary
 Token getLastToken()
          Return the last token before this one, or null if at the start of the line.
 Token getNextToken()
          Return the next token, and advance the pointer to the next token.
 void previousToken()
          move to the previous token.
 void resetTokenIndex()
          Reset the token iterator index
 

Method Detail

resetTokenIndex

public void resetTokenIndex()
Reset the token iterator index

getNextToken

public Token getNextToken()
Return the next token, and advance the pointer to the next token. If the pointer is beyond the end of the list of tokens, return null.
Returns:
The next token, or null if there are no more tokens

getLastToken

public Token getLastToken()
Return the last token before this one, or null if at the start of the line.
Returns:
The last token returned by getNextToken()

previousToken

public void previousToken()
                   throws EditorException
move to the previous token. If the pointer is at the start of the file, throw an exception.

miSim