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