DFAStateDescriptor.cs
26 lines
| 746 B
| text/x-csharp
|
CSharpLexer
cin
|
r164 | namespace Implab.Automaton { | ||
cin
|
r172 | public struct DFAStateDescriptor { | ||
cin
|
r165 | public readonly bool final; | ||
public readonly int[] transitions; | ||||
cin
|
r172 | public DFAStateDescriptor(int[] transitions, bool final) { | ||
cin
|
r165 | this.transitions = transitions; | ||
this.final = final; | ||||
} | ||||
cin
|
r172 | public DFAStateDescriptor(int[] transitions) : this(transitions, false) { | ||
cin
|
r165 | } | ||
cin
|
r169 | |||
cin
|
r172 | public DFAStateDescriptor(int size, bool final) { | ||
cin
|
r169 | Safe.ArgumentInRange(size, 0, int.MaxValue, "size"); | ||
this.final = final; | ||||
transitions = new int[size]; | ||||
for (int i = 0; i < size; i++) | ||||
transitions[i] = DFAConst.UNREACHABLE_STATE; | ||||
} | ||||
cin
|
r162 | } | ||
} | ||||