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 | |
| protected TokenSource |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Token | |
| public String | getSourceName()
Implements org. |
| public TokenSource | getTokenSource()
Implements org. |
| public boolean | |
| public int | LA(int i)
Implements org. |
| public Token | nextElement()
Implements abstract org. |
| public String | toString(int start, int stop)
Implements org. |
| public String | toString(Token start, Token stop)
Implements org. |
| channel | back to summary |
|---|---|
| protected int channel Skip tokens on any channel but this one; this is how we skip whitespace... | |
| tokenIndex | back to summary |
|---|---|
| protected int tokenIndex | |
| tokenSource | back to summary |
|---|---|
| protected TokenSource tokenSource | |
| UnbufferedTokenStream | back to summary |
|---|---|
| public UnbufferedTokenStream(TokenSource tokenSource) | |
| get | back to summary |
|---|---|
| public Token get(int i) Implements org. Doc from org. Get a token at an absolute index i; 0..n-1. This is really only needed for profiling and debugging and token stream rewriting. If you don't want to buffer up tokens, then this method makes no sense for you. Naturally you can't use the rewrite stream feature. I believe DebugTokenStream can easily be altered to not use this method, removing the dependency.
| |
| getSourceName | back to summary |
|---|---|
| public String getSourceName() Implements org. Doc from org. 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.
| |
| getTokenSource | back to summary |
|---|---|
| public TokenSource getTokenSource() Implements org. Doc from org. Where is this stream pulling tokens from? This is not the name, but the object that provides Token objects.
| |
| isEOF | back to summary |
|---|---|
| public boolean isEOF(Token o) Implements abstract org.
| |
| LA | back to summary |
|---|---|
| public int LA(int i) Implements org. Doc from org. Get int at current input pointer + i ahead where i=1 is next int. Negative indexes are allowed. LA(-1) is previous token (token just matched). LA(-i) where i is before first token should yield -1, invalid char / EOF.
| |
| nextElement | back to summary |
|---|---|
| public Token nextElement() Implements abstract org. Doc from org. Implement nextElement to supply a stream of elements to this lookahead buffer. Return EOF upon end of the stream we're pulling from.
| |
| toString | back to summary |
|---|---|
| public String toString(int start, int stop) Implements org. Doc from org. Return the text of all tokens from start to stop, inclusive. If the stream does not buffer all the tokens then it can just return "" or null; Users should not access $ruleLabel.text in an action of course in that case.
| |
| toString | back to summary |
|---|---|
| public String toString(Token start, Token stop) Implements org. Doc from org. 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. Most often this will just delegate to the other toString(int,int). This is also parallel with the TreeNodeStream.toString(Object,Object).
| |