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 source) {
11 super(source);
12 }
13 public ParserTokenEvent(Object 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
31 void setValues(int type, int amount, int value) {
32 super.setValues(type);
33 setAmount(amount);
34 setValue(value);
35 }
36 public String toString() {
37 if (getType()==LA)
38 return "ParserTokenEvent [LA," + getAmount() + "," +
39 getValue() + "]";
40 else
41 return "ParserTokenEvent [consume,1," +
42 getValue() + "]";
43 }
44 }
45