antlr

Class TokenWithIndex

Implemented Interfaces:
Cloneable

public class TokenWithIndex
extends CommonToken

This token knows what index 0..n-1 it is from beginning of stream. Designed to work with TokenStreamRewriteEngine.java

Field Summary

(package private) int
index
Index into token array indicating position in input stream

Fields inherited from class antlr.CommonToken

col, line, text

Fields inherited from class antlr.Token

EOF_TYPE, INVALID_TYPE, MIN_USER_TYPE, NULL_TREE_LOOKAHEAD, SKIP, badToken, type

Constructor Summary

TokenWithIndex()
TokenWithIndex(int i, String t)

Method Summary

int
getIndex()
void
setIndex(int i)
String
toString()

Methods inherited from class antlr.CommonToken

getColumn, getLine, getText, setColumn, setLine, setText, toString

Methods inherited from class antlr.Token

getColumn, getFilename, getLine, getText, getType, setColumn, setFilename, setLine, setText, setType, toString

Field Details

index

(package private)  int index
Index into token array indicating position in input stream

Constructor Details

TokenWithIndex

public TokenWithIndex()

TokenWithIndex

public TokenWithIndex(int i,
                      String t)

Method Details

getIndex

public int getIndex()

setIndex

public void setIndex(int i)

toString

public String toString()
Overrides:
toString in interface CommonToken