IntStream
BufferedTokenStream
, CommonTokenStream
, DebugTokenStream
, Interp.FilteringTokenStream
, LegacyCommonTokenStream
, TokenRewriteStream
, UnbufferedTokenStream
public interface TokenStream extends IntStream
Modifier and Type | Method | Description |
---|---|---|
Token |
get(int i) |
Get a token at an absolute index i; 0..n-1.
|
TokenSource |
getTokenSource() |
Where is this stream pulling tokens from? This is not the name, but
the object that provides Token objects.
|
Token |
LT(int k) |
Get Token at current input pointer + i ahead where i=1 is next Token.
|
int |
range() |
How far ahead has the stream been asked to look? The return
value is a valid index from 0..n-1.
|
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.
|
Token LT(int k)
int range()
Token get(int i)
TokenSource getTokenSource()
String toString(int start, int stop)
String toString(Token start, Token stop)
Copyright © 1992–2018 ANTLR. All rights reserved.