KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > JavaSymbol


1
2 public class JavaSymbol extends java_cup.runtime.Symbol {
3   private int line;
4   private int column;
5
6   public JavaSymbol(int type, int line, int column) {
7     this(type, line, column, -1, -1, null);
8   }
9
10   public JavaSymbol(int type, int line, int column, Object JavaDoc value) {
11     this(type, line, column, -1, -1, value);
12   }
13
14   public JavaSymbol(int type, int line, int column, int left, int right, Object JavaDoc value) {
15     super(type, left, right, value);
16     this.line = line;
17     this.column = column;
18   }
19
20   public int getLine() {
21     return line;
22   }
23
24   public int getColumn() {
25     return column;
26   }
27
28   public String JavaDoc toString() {
29     return "line "+line+", column "+column+", sym: "+sym+(value == null ? "" : (", value: '"+value+"'"));
30   }
31 }
32
Popular Tags