antlr
Class TokenBuffer

java.lang.Object
  extended by antlr.TokenBuffer

public class TokenBuffer
extends Object


Field Summary
protected  TokenStream input
           
(package private)  int markerOffset
           
(package private)  int nMarkers
           
(package private)  int numToConsume
           
(package private)  TokenQueue queue
           
 
Constructor Summary
TokenBuffer(TokenStream input_)
          Create a token buffer
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 TokenStreamException
Get 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()