KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > persistence > antlr > debug > InputBufferEvent


1 package persistence.antlr.debug;
2
3 public class InputBufferEvent extends Event {
4     char c;
5     int lookaheadAmount; // amount of lookahead
6
public static final int CONSUME = 0;
7     public static final int LA = 1;
8     public static final int MARK = 2;
9     public static final int REWIND = 3;
10
11
12 /**
13  * CharBufferEvent constructor comment.
14  * @param source java.lang.Object
15  */

16 public InputBufferEvent(Object JavaDoc source) {
17     super(source);
18 }
19 /**
20  * CharBufferEvent constructor comment.
21  * @param source java.lang.Object
22  */

23 public InputBufferEvent(Object JavaDoc source, int type, char c, int lookaheadAmount) {
24     super(source);
25     setValues(type, c, lookaheadAmount);
26 }
27     public char getChar() {
28         return c;
29     }
30     public int getLookaheadAmount() {
31         return lookaheadAmount;
32     }
33     void setChar(char c) {
34         this.c = c;
35     }
36     void setLookaheadAmount(int la) {
37         this.lookaheadAmount = la;
38     }
39     /** This should NOT be called from anyone other than ParserEventSupport! */
40     void setValues(int type, char c, int la) {
41         super.setValues(type);
42         setChar(c);
43         setLookaheadAmount(la);
44     }
45     public String JavaDoc toString() {
46         return "CharBufferEvent [" +
47             (getType()==CONSUME?"CONSUME, ":"LA, ")+
48         getChar() + "," + getLookaheadAmount() + "]";
49     }
50 }
51
Popular Tags