01: package persistence.antlr.debug;
02:
03: public class InputBufferEvent extends Event {
04: char c;
05: int lookaheadAmount; // amount of lookahead
06: public static final int CONSUME = 0;
07: public static final int LA = 1;
08: public static final int MARK = 2;
09: public static final int REWIND = 3;
10:
11: /**
12: * CharBufferEvent constructor comment.
13: * @param source java.lang.Object
14: */
15: public InputBufferEvent(Object source) {
16: super (source);
17: }
18:
19: /**
20: * CharBufferEvent constructor comment.
21: * @param source java.lang.Object
22: */
23: public InputBufferEvent(Object source, int type, char c,
24: int lookaheadAmount) {
25: super (source);
26: setValues(type, c, lookaheadAmount);
27: }
28:
29: public char getChar() {
30: return c;
31: }
32:
33: public int getLookaheadAmount() {
34: return lookaheadAmount;
35: }
36:
37: void setChar(char c) {
38: this .c = c;
39: }
40:
41: void setLookaheadAmount(int la) {
42: this .lookaheadAmount = la;
43: }
44:
45: /** This should NOT be called from anyone other than ParserEventSupport! */
46: void setValues(int type, char c, int la) {
47: super .setValues(type);
48: setChar(c);
49: setLookaheadAmount(la);
50: }
51:
52: public String toString() {
53: return "CharBufferEvent ["
54: + (getType() == CONSUME ? "CONSUME, " : "LA, ")
55: + getChar() + "," + getLookaheadAmount() + "]";
56: }
57: }
|