DFAStateDescriptor.cs
26 lines
| 750 B
| text/x-csharp
|
CSharpLexer
cin
|
r164 | namespace Implab.Automaton { | ||
cin
|
r165 | public struct DFAStateDescriptior { | ||
public readonly bool final; | ||||
public readonly int[] transitions; | ||||
public DFAStateDescriptior(int[] transitions, bool final) { | ||||
this.transitions = transitions; | ||||
this.final = final; | ||||
} | ||||
public DFAStateDescriptior(int[] transitions) : this(transitions, false) { | ||||
} | ||||
cin
|
r169 | |||
public DFAStateDescriptior(int size, bool final) { | ||||
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 | } | ||
} | ||||