source: trunk/yao/share/antlr-2.7.7/antlr/debug/TraceEvent.java @ 1

Last change on this file since 1 was 1, checked in by lnalod, 15 years ago

Initial import of YAO sources

File size: 990 bytes
Line 
1package antlr.debug;
2
3public 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 source) {
12                super(source);
13        }
14        public TraceEvent(Object 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 toString() {
37                return "ParserTraceEvent [" + 
38                       (getType()==ENTER?"enter,":"exit,") +
39                       getRuleNum() + "," + getGuessing() +"]";
40        }
41}
Note: See TracBrowser for help on using the repository browser.