added start/stop methods.

[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9145]
This commit is contained in:
parrt 2011-10-12 15:09:14 -08:00
parent 3bbcfa5d25
commit 9eb19cf929
1 changed files with 12 additions and 1 deletions

View File

@ -82,10 +82,21 @@ public interface Token {
int getChannel();
/** An index from 0..n-1 of the token object in the input stream.
* This must be valid in order to use the ANTLRWorks debugger.
* This must be valid in order to print token streams,
* use TokenRewriteStream, and generally deal with ASTs.
*/
int getTokenIndex();
/** The starting character index of the token
* This method is optional; return -1 if not implemented.
*/
int getStartIndex();
/** The last character index of the token.
* This method is optional; return -1 if not implemented.
*/
int getStopIndex();
/** Where does this token come from? You can get the
* character input stream from the token source.
*/