antlr
Class TokenQueue

java.lang.Object
  |
  +--antlr.TokenQueue

class TokenQueue
extends Object

A private circular buffer object used by the token buffer


Field Summary
private  Token[] buffer
           
protected  int nbrEntries
           
private  int offset
           
private  int sizeLessOne
           
 
Constructor Summary
TokenQueue(int minSize)
           
 
Method Summary
 void append(Token tok)
          Add token to end of the queue
 Token elementAt(int idx)
          Fetch a token from the queue by index
private  void expand()
          Expand the token buffer by doubling its capacity
private  void init(int size)
          Initialize the queue.
 void removeFirst()
          Remove token from front of queue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

buffer

private Token[] buffer

sizeLessOne

private int sizeLessOne

offset

private int offset

nbrEntries

protected int nbrEntries
Constructor Detail

TokenQueue

public TokenQueue(int minSize)
Method Detail

append

public final void append(Token tok)
Add token to end of the queue

Parameters:
tok - The token to add

elementAt

public final Token elementAt(int idx)
Fetch a token from the queue by index

Parameters:
idx - The index of the token to fetch, where zero is the token at the front of the queue

expand

private final void expand()
Expand the token buffer by doubling its capacity


init

private final void init(int size)
Initialize the queue.

Parameters:
size - The initial size of the queue

removeFirst

public final void removeFirst()
Remove token from front of queue



comments?