4 using ArrayList
= System
.Collections
.ArrayList
;
6 public class DebuggingInputBuffer
: InputBuffer
8 public virtual ArrayList InputBufferListeners
10 get { return inputBufferEventSupport.InputBufferListeners; }
12 public virtual bool DebugMode
14 set { debugMode = value; }
17 private InputBuffer buffer
;
18 private InputBufferEventSupport inputBufferEventSupport
;
19 private bool debugMode
= true;
22 public DebuggingInputBuffer(InputBuffer buffer
)
25 inputBufferEventSupport
= new InputBufferEventSupport(this);
27 public virtual void addInputBufferListener(InputBufferListener l
)
29 inputBufferEventSupport
.addInputBufferListener(l
);
31 public override char consume()
38 catch (CharStreamException
)
43 inputBufferEventSupport
.fireConsume(la
);
46 public override void fill(int a
)
50 public virtual bool isDebugMode()
54 public override bool isMarked()
56 return buffer
.isMarked();
58 public override char LA(int i
)
60 char la
= buffer
.LA(i
);
62 inputBufferEventSupport
.fireLA(la
, i
);
65 public override int mark()
67 int m
= buffer
.mark();
68 inputBufferEventSupport
.fireMark(m
);
71 public virtual void removeInputBufferListener(InputBufferListener l
)
73 if (inputBufferEventSupport
!= null)
74 inputBufferEventSupport
.removeInputBufferListener(l
);
76 public override void rewind(int mark
)
79 inputBufferEventSupport
.fireRewind(mark
);