1 package persistence.antlr; 2 3 8 9 public class CommonToken extends Token { 10 protected int line; 12 protected String text = null; 13 protected int col; 14 15 public CommonToken() { 16 } 17 18 public CommonToken(int t, String txt) { 19 type = t; 20 setText(txt); 21 } 22 23 public CommonToken(String s) { 24 text = s; 25 } 26 27 public int getLine() { 28 return line; 29 } 30 31 public String getText() { 32 return text; 33 } 34 35 public void setLine(int l) { 36 line = l; 37 } 38 39 public void setText(String s) { 40 text = s; 41 } 42 43 public String toString() { 44 return "[\"" + getText() + "\",<" + type + ">,line=" + line + ",col=" + col + "]"; 45 } 46 47 48 public int getColumn() { 49 return col; 50 } 51 52 public void setColumn(int c) { 53 col = c; 54 } 55 } 56 | Popular Tags |