antlr

Class TokenQueue

class TokenQueue extends Object

A private circular buffer object used by the token buffer
Field Summary
protected intnbrEntries
number of tokens in the queue
Constructor Summary
TokenQueue(int minSize)
Method Summary
voidappend(Token tok)
Add token to end of the queue
TokenelementAt(int idx)
Fetch a token from the queue by index
voidremoveFirst()
Remove token from front of queue
voidreset()
Clear the queue.

Field Detail

nbrEntries

protected int nbrEntries
number of tokens in the queue

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

removeFirst

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

reset

public final void reset()
Clear the queue. Leaving the previous buffer alone.