KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > antlr > debug > ParserTokenEvent


1 package antlr.debug;
2
3 public class ParserTokenEvent extends Event {
4     private int value;
5     private int amount;
6     public static int LA=0;
7     public static int CONSUME=1;
8
9
10     public ParserTokenEvent(Object JavaDoc source) {
11         super(source);
12     }
13     public ParserTokenEvent(Object JavaDoc source, int type,
14                             int amount, int value) {
15         super(source);
16         setValues(type,amount,value);
17     }
18     public int getAmount() {
19         return amount;
20     }
21     public int getValue() {
22         return value;
23     }
24     void setAmount(int amount) {
25         this.amount = amount;
26     }
27     void setValue(int value) {
28         this.value = value;
29     }
30     /** This should NOT be called from anyone other than ParserEventSupport! */
31     void setValues(int type, int amount, int value) {
32         super.setValues(type);
33         setAmount(amount);
34         setValue(value);
35     }
36     public String JavaDoc toString() {
37         if (getType()==LA)
38             return "ParserTokenEvent [LA," + getAmount() + "," +
39                    getValue() + "]";
40         else
41             return "ParserTokenEvent [consume,1," +
42                    getValue() + "]";
43     }
44 }
Popular Tags