-
Notifications
You must be signed in to change notification settings - Fork 0
/
DTrans.cs
43 lines (39 loc) · 1.06 KB
/
DTrans.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
namespace Lex
{
/*
* Class: DTrans
*/
public class DTrans
{
/*
* Member Variables
*/
int[] dtrans;
Accept accept;
int anchor;
int label;
public int GetLabel() { return label; }
public void SetLabel(int i) { label = i; }
public int GetAnchor() { return anchor; }
public void SetAnchor(int i) { anchor = i; }
public Accept GetAccept() { return accept; }
public void SetAccept(Accept a) { accept = a; }
public void SetDTrans(int dest, int index) { dtrans[dest] = index; }
public int GetDTrans(int i) { return dtrans[i]; }
public int GetDTransLength() { return dtrans.Length; }
/*
* Constants
*/
public const int F = -1;
/*
* Function: DTrans
*/
public DTrans(Spec s, Dfa dfa)
{
dtrans = new int[s.dtrans_ncols];
label = s.dtrans_list.Count;
accept = dfa.GetAccept();
anchor = dfa.GetAnchor();
}
}
}