source: trunk/yao/share/antlr-2.7.7/lib/csharp/antlr.runtime/antlr.debug/ParserTokenEventArgs.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: 965 bytes
Line 
1namespace antlr.debug
2{
3        using System;
4       
5        public class TokenEventArgs : ANTLREventArgs
6        {
7                public TokenEventArgs()
8                {
9                }
10                public TokenEventArgs(int type, int amount, int val)
11                {
12                        setValues(type, amount, val);
13                }
14
15                public virtual int Amount
16                {
17                        get     { return amount;        }
18                        set     { this.amount = value;  }
19                }
20
21                public virtual int Value
22                {
23                        get     { return this.value_;   }
24                        set { this.value_ = value;      }
25                }
26
27                private int value_;
28                private int amount;
29
30                public static int LA = 0;
31                public static int CONSUME = 1;
32               
33               
34                /// <summary>This should NOT be called from anyone other than ParserEventSupport!
35                /// </summary>
36                internal void  setValues(int type, int amount, int val)
37                {
38                        base.setValues(type);
39                        this.Amount = amount;
40                        this.Value  = val;
41                }
42
43                public override string ToString()
44                {
45                        if (Type == LA)
46                                return "ParserTokenEvent [LA," + Amount + "," + Value + "]";
47                        else
48                                return "ParserTokenEvent [consume,1," + Value + "]";
49                }
50        }
51}
Note: See TracBrowser for help on using the repository browser.