source: trunk/yao/share/antlr-2.7.7/lib/csharp/antlr.runtime/antlr.debug/TraceEventArgs.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: 1011 bytes
Line 
1namespace antlr.debug
2{
3        using System;
4       
5        public class TraceEventArgs : GuessingEventArgs
6        {
7                public TraceEventArgs()
8                {
9                }
10                public TraceEventArgs(int type, int ruleNum, int guessing, int data)
11                {
12                        setValues(type, ruleNum, guessing, data);
13                }
14
15                public virtual int Data
16                {
17                        get     { return this.data_;    }
18                        set     { this.data_ = value;   }
19                }
20
21                public virtual int RuleNum
22                {
23                        get     { return this.ruleNum_;         }
24                        set     { this.ruleNum_ = value;        }
25                }
26
27                private int ruleNum_;
28                private int data_;
29
30                public static int ENTER = 0;
31                public static int EXIT = 1;
32                public static int DONE_PARSING = 2;
33               
34               
35                /// <summary>This should NOT be called from anyone other than ParserEventSupport!
36                /// </summary>
37                internal void  setValues(int type, int ruleNum, int guessing, int data)
38                {
39                        base.setValues(type, guessing);
40                        RuleNum = ruleNum;
41                        Data    = data;
42                }
43
44                public override string ToString()
45                {
46                        return "ParserTraceEvent [" + (Type == ENTER?"enter,":"exit,") + RuleNum + "," + Guessing + "]";
47                }
48        }
49}
Note: See TracBrowser for help on using the repository browser.