public class TokenBuffer extends Object
Modifier and Type | Field and Description |
---|---|
protected TokenStream |
input |
(package private) int |
markerOffset |
(package private) int |
nMarkers |
(package private) int |
numToConsume |
(package private) TokenQueue |
queue |
Constructor and Description |
---|
TokenBuffer(TokenStream input_)
Create a token buffer
|
Modifier and Type | Method and Description |
---|---|
void |
consume()
Mark another token for deferred consumption
|
TokenStream |
getInput()
return the Tokenizer (needed by ParseView)
|
int |
LA(int i)
Get a lookahead token value
|
Token |
LT(int i)
Get a lookahead token
|
int |
mark()
Return an integer marker that can be used to rewind the buffer to
its current state.
|
void |
reset()
Reset the input buffer to empty state
|
void |
rewind(int mark)
Rewind the token buffer to a marker.
|
protected TokenStream input
int nMarkers
int markerOffset
int numToConsume
TokenQueue queue
public TokenBuffer(TokenStream input_)
public final void reset()
public final void consume()
public TokenStream getInput()
public final int LA(int i) throws TokenStreamException
TokenStreamException
public final Token LT(int i) throws TokenStreamException
TokenStreamException
public final int mark()
public final void rewind(int mark)
mark
- Marker returned previously from mark()