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