public class UnbufferedTokenStream extends LookaheadStream<Token> implements TokenStream
BufferedTokenStream,
CommonTokenStream| Modifier and Type | Field and Description |
|---|---|
protected int |
channel
Skip tokens on any channel but this one; this is how we skip whitespace...
|
protected int |
tokenIndex |
protected TokenSource |
tokenSource |
currentElementIndex, eof, lastMarker, markDepth, prevElement, UNINITIALIZED_EOF_ELEMENT_INDEX| Constructor and Description |
|---|
UnbufferedTokenStream(TokenSource tokenSource) |
| Modifier and Type | Method and Description |
|---|---|
Token |
get(int i)
Get a token at an absolute index i; 0..n-1.
|
String |
getSourceName()
Where are you getting symbols from? Normally, implementations will
pass the buck all the way to the lexer who can ask its input stream
for the file name or whatever.
|
TokenSource |
getTokenSource()
Where is this stream pulling tokens from? This is not the name, but
the object that provides Token objects.
|
boolean |
isEOF(Token o) |
int |
LA(int i)
Get int at current input pointer + i ahead where i=1 is next int.
|
Token |
nextElement()
Implement nextElement to supply a stream of elements to this
lookahead buffer.
|
String |
toString(int start,
int stop)
Return the text of all tokens from start to stop, inclusive.
|
String |
toString(Token start,
Token stop)
Because the user is not required to use a token with an index stored
in it, we must provide a means for two token objects themselves to
indicate the start/end location.
|
consume, fill, index, LB, LT, mark, release, remove, reset, rewind, rewind, seek, size, syncAheadadd, clear, elementAt, head, range, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitLT, rangeprotected TokenSource tokenSource
protected int tokenIndex
protected int channel
public UnbufferedTokenStream(TokenSource tokenSource)
public Token nextElement()
LookaheadStreamnextElement in class LookaheadStream<Token>LookaheadStream.isEOF(T)public boolean isEOF(Token o)
isEOF in class LookaheadStream<Token>public TokenSource getTokenSource()
TokenStreamgetTokenSource in interface TokenStreampublic String toString(int start, int stop)
TokenStreamtoString in interface TokenStreampublic String toString(Token start, Token stop)
TokenStreamtoString in interface TokenStreampublic int LA(int i)
IntStreampublic Token get(int i)
TokenStreamget in interface TokenStreampublic String getSourceName()
IntStreamgetSourceName in interface IntStreamCopyright © 1992-2013 ANTLR. All Rights Reserved.