|
mjc | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.multijava.mjc.ParsingController.IndexedTokenBuffer
This inner class buffers tokens of a nested language and allows selection and discarding of a subset of these buffered tokens based on a reference to an index token of the surrounding language.
| Field Summary | |
private LinkedList |
indexTokens
A list of buffers containing index tokens of the surrounding language. |
private boolean |
isBlocked
Indicates whether this is a blocked token buffer, to which new tokens or indices cannot be added. |
private boolean |
startNewBuffer
Indicates whether a new buffer is required to store the next buffered token. |
private LinkedList |
tokenBuffers
A list of token buffers. |
| Constructor Summary | |
ParsingController.IndexedTokenBuffer()
Creates a new empty token buffer. |
|
ParsingController.IndexedTokenBuffer(LinkedList tokenBuffers)
Creates a blocked token buffer from the given list of token buffers. |
|
| Method Summary | |
private void |
addEOF()
Adds an end-of-file token to the end of the token buffer. |
void |
bufferToken(antlr.Token tok)
Adds the given token of the nested language to the buffer. |
private int |
findIndexToken(antlr.Token index)
Returns the position in tokenBuffers of the last contiguous block of buffered tokens that comes before the given index token. |
boolean |
flushTokensBefore(antlr.Token index)
Discards all buffered tokens before the given index token. |
boolean |
hasNext()
Returns true if this buffer has additional tokens. |
boolean |
isBlocked()
Indicates whether this token buffer is blocked from accepting additinal tokens or indices. |
antlr.Token |
next()
Returns the next token from the buffer. |
void |
recordIndexToken(antlr.Token index)
Records the given index token. |
ParsingController.FilteredTokenStream |
streamForTokensBefore(antlr.Token index)
Returns a token stream that includes just the buffered tokens that came before the given index token. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private boolean isBlocked
private boolean startNewBuffer
private LinkedList tokenBuffers
private LinkedList indexTokens
| Constructor Detail |
public ParsingController.IndexedTokenBuffer()
public ParsingController.IndexedTokenBuffer(LinkedList tokenBuffers)
| Method Detail |
public void bufferToken(antlr.Token tok)
throws antlr.TokenStreamException
antlr.TokenStreamException - if buffer is blocked
public void recordIndexToken(antlr.Token index)
throws antlr.TokenStreamException
antlr.TokenStreamException - if buffer is blocked
public ParsingController.FilteredTokenStream streamForTokensBefore(antlr.Token index)
throws antlr.TokenStreamException
antlr.TokenStreamException - if buffer is blocked
public boolean flushTokensBefore(antlr.Token index)
throws antlr.TokenStreamException
antlr.TokenStreamException - if buffer is blockedpublic boolean isBlocked()
public antlr.Token next()
public boolean hasNext()
private int findIndexToken(antlr.Token index)
-1 if the index token is not
recorded in this.
private void addEOF()
|
mjc | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||