1 package antlr; 2 3 9 10 13 public class Token implements Cloneable { 14 public static final int MIN_USER_TYPE = 4; 16 public static final int NULL_TREE_LOOKAHEAD = 3; 17 public static final int INVALID_TYPE = 0; 18 public static final int EOF_TYPE = 1; 19 public static final int SKIP = -1; 20 21 int type = INVALID_TYPE; 23 24 public static Token badToken = new Token(INVALID_TYPE, "<no text>"); 26 27 public Token() { 28 } 29 30 public Token(int t) { 31 type = t; 32 } 33 34 public Token(int t, String txt) { 35 type = t; 36 setText(txt); 37 } 38 39 public int getColumn() { 40 return 0; 41 } 42 43 public int getLine() { 44 return 0; 45 } 46 47 public String getText() { 48 return "<no text>"; 49 } 50 51 public int getType() { 52 return type; 53 } 54 55 public void setColumn(int c) { 56 } 57 58 public void setLine(int l) { 59 } 60 61 public void setText(String t) { 62 } 63 64 public void setType(int t) { 65 type = t; 66 } 67 68 public String toString() { 69 return "[\"" + getText() + "\",<" + type + ">]"; 70 } 71 } 72 | Popular Tags |