v4: TokenStream extends ObjectStream<Token> (specified Token as the type parameter)

[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9327]
This commit is contained in:
sharwell 2011-11-17 15:52:21 -08:00
parent 29ec107b24
commit ddf4cadf06
1 changed files with 3 additions and 1 deletions

View File

@ -30,13 +30,14 @@
package org.antlr.v4.runtime;
/** A stream of tokens accessing tokens from a TokenSource */
public interface TokenStream extends ObjectStream {
public interface TokenStream extends ObjectStream<Token> {
/** Get Token at current input pointer + i ahead where i=1 is next Token.
* i<0 indicates tokens in the past. So -1 is previous token and -2 is
* two tokens ago. LT(0) is undefined. For i>=n, return Token.EOFToken.
* Return null for LT(0) and any index that results in an absolute address
* that is negative.
*/
@Override
public Token LT(int k);
/** How far ahead has the stream been asked to look? The return
@ -51,6 +52,7 @@ public interface TokenStream extends ObjectStream {
* I believe DebugTokenStream can easily be altered to not use
* this method, removing the dependency.
*/
@Override
public Token get(int i);
/** Where is this stream pulling tokens from? This is not the name, but