164
|
1 namespace Implab.Automaton {
|
172
|
2 public struct DFAStateDescriptor {
|
165
|
3 public readonly bool final;
|
|
4 public readonly int[] transitions;
|
|
5
|
|
6
|
172
|
7 public DFAStateDescriptor(int[] transitions, bool final) {
|
165
|
8 this.transitions = transitions;
|
|
9 this.final = final;
|
|
10 }
|
|
11
|
172
|
12 public DFAStateDescriptor(int[] transitions) : this(transitions, false) {
|
165
|
13 }
|
169
|
14
|
172
|
15 public DFAStateDescriptor(int size, bool final) {
|
169
|
16 Safe.ArgumentInRange(size, 0, int.MaxValue, "size");
|
|
17
|
|
18 this.final = final;
|
|
19
|
|
20 transitions = new int[size];
|
|
21
|
|
22 for (int i = 0; i < size; i++)
|
|
23 transitions[i] = DFAConst.UNREACHABLE_STATE;
|
|
24 }
|
162
|
25 }
|
|
26 }
|