Package antlr
Class TokenBuffer
- java.lang.Object
-
- antlr.TokenBuffer
-
public class TokenBuffer extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected TokenStreaminput(package private) intmarkerOffset(package private) intnMarkers(package private) intnumToConsume(package private) TokenQueuequeue
-
Constructor Summary
Constructors Constructor Description TokenBuffer(TokenStream input_)Create a token buffer
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconsume()Mark another token for deferred consumptionTokenStreamgetInput()return the Tokenizer (needed by ParseView)intLA(int i)Get a lookahead token valueTokenLT(int i)Get a lookahead tokenintmark()Return an integer marker that can be used to rewind the buffer to its current state.voidreset()Reset the input buffer to empty statevoidrewind(int mark)Rewind the token buffer to a marker.
-
-
-
Field Detail
-
input
protected TokenStream input
-
nMarkers
int nMarkers
-
markerOffset
int markerOffset
-
numToConsume
int numToConsume
-
queue
TokenQueue queue
-
-
Constructor Detail
-
TokenBuffer
public TokenBuffer(TokenStream input_)
Create a token buffer
-
-
Method Detail
-
reset
public final void reset()
Reset the input buffer to empty state
-
consume
public final void consume()
Mark another token for deferred consumption
-
getInput
public TokenStream getInput()
return the Tokenizer (needed by ParseView)
-
LA
public final int LA(int i) throws TokenStreamExceptionGet a lookahead token value- Throws:
TokenStreamException
-
LT
public final Token LT(int i) throws TokenStreamException
Get a lookahead token- Throws:
TokenStreamException
-
mark
public final int mark()
Return an integer marker that can be used to rewind the buffer to its current state.
-
rewind
public final void rewind(int mark)
Rewind the token buffer to a marker.- Parameters:
mark- Marker returned previously from mark()
-
-