public class Lookahead2Iterator<E>
extends java.lang.Object
Constructor and Description |
---|
Lookahead2Iterator()
Default constructor.
|
Lookahead2Iterator(java.util.Iterator<E> input)
Decerator constructor around an iterator
|
Lookahead2Iterator(java.util.List<E> input)
Constructor when the list of tokens is known beforehand.
|
Modifier and Type | Method and Description |
---|---|
void |
consume()
Eat one token.
|
E |
nextnext() |
E |
peekNext() |
E |
prev()
Return the token just consumed.
|
void |
setInputIterator(java.util.Iterator<E> input)
Should be called if the default constructor is used.
|
java.lang.String |
toString() |
public Lookahead2Iterator()
setInputIterator(Iterator)
method should be called.public Lookahead2Iterator(java.util.List<E> input)
input
- the list of tokenspublic Lookahead2Iterator(java.util.Iterator<E> input)
input
- the input itteratorpublic void setInputIterator(java.util.Iterator<E> input)
input
- the new input itteratorpublic E peekNext()
public E nextnext()
public E prev()
public void consume()
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2018 Singular Systems http://www.singularsys.com/jep