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 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 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 } | Popular Tags |