|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--antlr.InputBuffer
Untamed: A Stream of characters fed to the lexer from a InputStream that can be rewound via mark()/rewind() methods.
A dynamic array is used to buffer up all the input characters. Normally, "k" characters are stored in the buffer. More characters may be stored during guess mode (testing syntactic predicate), or when LT(i>k) is referenced. Consumption of characters is deferred. In other words, reading the next character is not done by conume(), but deferred until needed by LA or LT.
antlr.CharQueue
Field Summary | |
protected int |
markerOffset
|
protected int |
nMarkers
|
protected int |
numToConsume
|
protected CharQueue |
queue
|
Constructor Summary | |
InputBuffer()
Enabled: Create an input buffer |
Method Summary | |
void |
commit()
Enabled: This method updates the state of the input buffer so that the text matched since the most recent mark() is no longer held by the buffer. |
void |
consume()
Enabled: Mark another character for deferred consumption |
abstract void |
fill(int amount)
Enabled: Ensure that the input buffer is sufficiently full |
String |
getLAChars()
Enabled: |
String |
getMarkedChars()
Enabled: |
boolean |
isMarked()
Enabled: |
char |
LA(int i)
Enabled: Get a lookahead character |
int |
mark()
Enabled: Return an integer marker that can be used to rewind the buffer to its current state. |
void |
rewind(int mark)
Enabled: Rewind the character buffer to a marker. |
protected void |
syncConsume()
Sync up deferred consumption |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected int nMarkers
protected int markerOffset
protected int numToConsume
protected CharQueue queue
Constructor Detail |
public InputBuffer()
Method Detail |
public void commit()
public void consume()
public abstract void fill(int amount) throws CharStreamException
CharStreamException
public String getLAChars()
public String getMarkedChars()
public boolean isMarked()
public char LA(int i) throws CharStreamException
CharStreamException
public int mark()
public void rewind(int mark)
mark
- Marker returned previously from mark()protected void syncConsume()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |