1 package org.antlr.works.debugger.tree; 2 3 import org.antlr.runtime.Token; 4 import org.antlr.runtime.debug.RemoteDebugEventSocketListener.ProxyTree; 5 35 36 public class DBTreeToken implements Token { 37 public ProxyTree tree; 38 public int ID; 39 40 public DBTreeToken(ProxyTree tree) { 41 this.tree = tree; 42 this.ID = tree.ID; 43 } 44 45 public String getText() { 46 return tree.text; 47 } 48 49 public void setText(String text) { 50 tree.text = text; 51 } 52 53 public int getType() { 54 return tree.type; 55 } 56 57 public void setType(int ttype) { 58 tree.type = ttype; 59 } 60 61 public int getLine() { 62 return tree.line; 63 } 64 65 public void setLine(int line) { 66 tree.line = line; 67 } 68 69 public int getCharPositionInLine() { 70 return tree.charPos; 71 } 72 73 public void setCharPositionInLine(int pos) { 74 tree.charPos = pos; 75 } 76 77 public int getChannel() { 78 return 0; 79 } 80 81 public void setChannel(int channel) { 82 } 83 84 public int getTokenIndex() { 85 return tree.tokenIndex; 86 } 87 88 public void setTokenIndex(int index) { 89 tree.tokenIndex = index; 90 } 91 92 public String toString() { 93 String tokenIndexS = tree.tokenIndex>=0?(",@"+tree.tokenIndex):""; 94 String pos = tree.line>0?(","+tree.line+":"+tree.charPos):""; 95 return "["+tree.text+"/, <"+tree.type+">, "+tree.ID+pos+tokenIndexS+"]"; 96 } 97 } 98 | Popular Tags |