KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > antlr > debug > TraceEvent


1 package antlr.debug;
2
3 public class TraceEvent extends GuessingEvent {
4     private int ruleNum;
5     private int data;
6     public static int ENTER=0;
7     public static int EXIT=1;
8     public static int DONE_PARSING=2;
9
10
11     public TraceEvent(Object JavaDoc source) {
12         super(source);
13     }
14     public TraceEvent(Object JavaDoc source, int type, int ruleNum, int guessing, int data) {
15         super(source);
16         setValues(type, ruleNum, guessing, data);
17     }
18     public int getData() {
19         return data;
20     }
21     public int getRuleNum() {
22         return ruleNum;
23     }
24     void setData(int data) {
25         this.data = data;
26     }
27     void setRuleNum(int ruleNum) {
28         this.ruleNum = ruleNum;
29     }
30     /** This should NOT be called from anyone other than ParserEventSupport! */
31      void setValues(int type, int ruleNum, int guessing, int data) {
32         super.setValues(type, guessing);
33         setRuleNum(ruleNum);
34         setData(data);
35     }
36     public String JavaDoc toString() {
37         return "ParserTraceEvent [" +
38                (getType()==ENTER?"enter,":"exit,") +
39                getRuleNum() + "," + getGuessing() +"]";
40     }
41 }
Popular Tags