source: trunk/yao/share/antlr-2.7.7/lib/csharp/antlr.runtime/antlr.debug/InputBufferEventArgs.cs @ 1

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

Initial import of YAO sources

File size: 1.0 KB
Line 
1namespace antlr.debug
2{
3        using System;
4       
5        public class InputBufferEventArgs : ANTLREventArgs
6        {
7                public InputBufferEventArgs()
8                {
9                }
10
11                public InputBufferEventArgs(int type, char c, int lookaheadAmount)
12                {
13                        setValues(type, c, lookaheadAmount);
14                }
15       
16                public virtual char Char
17                {
18                        get     { return this.c_;       }
19                        set     { this.c_ = value;      }
20                }
21                public virtual int LookaheadAmount
22                {
23                        get     { return this.lookaheadAmount_;         }
24                        set     { this.lookaheadAmount_ = value;        }
25                }
26
27                internal char c_;
28                internal int lookaheadAmount_; // amount of lookahead
29
30                public const int CONSUME = 0;
31                public const int LA = 1;
32                public const int MARK = 2;
33                public const int REWIND = 3;
34               
35               
36                /// <summary>This should NOT be called from anyone other than ParserEventSupport!
37                /// </summary>
38                internal void  setValues(int type, char c, int la)
39                {
40                        setValues(type);
41                        this.Char       = c;
42                        this.LookaheadAmount = la;
43                }
44
45                public override string ToString()
46                {
47                        return "CharBufferEvent [" + (Type == CONSUME?"CONSUME, ":"LA, ") + Char + "," + LookaheadAmount + "]";
48                }
49        }
50}
Note: See TracBrowser for help on using the repository browser.