01: package antlr.debug;
02:
03: public class ParserTokenEvent extends Event {
04: private int value;
05: private int amount;
06: public static int LA = 0;
07: public static int CONSUME = 1;
08:
09: public ParserTokenEvent(Object source) {
10: super (source);
11: }
12:
13: public ParserTokenEvent(Object source, int type, int amount,
14: int value) {
15: super (source);
16: setValues(type, amount, value);
17: }
18:
19: public int getAmount() {
20: return amount;
21: }
22:
23: public int getValue() {
24: return value;
25: }
26:
27: void setAmount(int amount) {
28: this .amount = amount;
29: }
30:
31: void setValue(int value) {
32: this .value = value;
33: }
34:
35: /** This should NOT be called from anyone other than ParserEventSupport! */
36: void setValues(int type, int amount, int value) {
37: super .setValues(type);
38: setAmount(amount);
39: setValue(value);
40: }
41:
42: public String toString() {
43: if (getType() == LA)
44: return "ParserTokenEvent [LA," + getAmount() + ","
45: + getValue() + "]";
46: else
47: return "ParserTokenEvent [consume,1," + getValue() + "]";
48: }
49: }
|