1 package persistence.antlr; 2 3 7 8 11 public class TokenWithIndex extends CommonToken { 12 13 int index; 14 15 public TokenWithIndex() { 16 super(); 17 } 18 19 public TokenWithIndex(int i, String t) { 20 super(i,t); 21 } 22 23 public void setIndex(int i) { 24 index = i; 25 } 26 27 public int getIndex() { 28 return index; 29 } 30 31 public String toString() { 32 return "["+index+":\"" + getText() + "\",<" + getType() + ">,line=" + line + ",col=" + 33 col + "]\n"; 34 } 35 } 36 | Popular Tags |