01: package persistence.antlr;
02:
03: /* ANTLR Translator Generator
04: * Project led by Terence Parr at http://www.jGuru.com
05: * Software rights: http://www.antlr.org/license.html
06: *
07: */
08:
09: public class CommonToken extends Token {
10: // most tokens will want line and text information
11: 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
45: + ",col=" + col + "]";
46: }
47:
48: /** Return token's start column */
49: public int getColumn() {
50: return col;
51: }
52:
53: public void setColumn(int c) {
54: col = c;
55: }
56: }
|