org.duelengine.duel.parsing
Class DuelLexer

java.lang.Object
  extended by org.duelengine.duel.parsing.DuelLexer
All Implemented Interfaces:
Iterator<DuelToken>

public class DuelLexer
extends Object
implements Iterator<DuelToken>

Processes source text into a token sequence


Constructor Summary
DuelLexer(Reader reader)
          Ctor
DuelLexer(String text)
          Ctor
 
Method Summary
 void clearLastError()
          Clears the last error
 int getColumn()
          Gets the current column within the input
 int getIndex()
          Gets the current index within the input
 Throwable getLastError()
          Returns the last exception encountered
 int getLine()
          Gets the current line within the input
 boolean hasNext()
          Determines if any more tokens are available
 DuelToken next()
          Returns the next token in the input
 void remove()
          Altering the input is not supported
 ArrayList<DuelToken> toList()
          Produces a list of the remaining tokens
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DuelLexer

public DuelLexer(String text)
Ctor

Parameters:
text -

DuelLexer

public DuelLexer(Reader reader)
Ctor

Parameters:
reader -
Method Detail

getLine

public int getLine()
Gets the current line within the input

Returns:

getColumn

public int getColumn()
Gets the current column within the input

Returns:

getIndex

public int getIndex()
Gets the current index within the input

Returns:

getLastError

public Throwable getLastError()
Returns the last exception encountered


clearLastError

public void clearLastError()
Clears the last error


hasNext

public boolean hasNext()
Determines if any more tokens are available

Specified by:
hasNext in interface Iterator<DuelToken>

next

public DuelToken next()
Returns the next token in the input

Specified by:
next in interface Iterator<DuelToken>

remove

public void remove()
            throws UnsupportedOperationException
Altering the input is not supported

Specified by:
remove in interface Iterator<DuelToken>
Throws:
UnsupportedOperationException

toList

public ArrayList<DuelToken> toList()
Produces a list of the remaining tokens

Returns:


Copyright © 2012. All Rights Reserved.