Mercurial > pub > ImplabNet
diff Implab/Automaton/DFAStateDescriptor.cs @ 169:54270c2f29f2 ref20160224
DFA refactoring
author | cin |
---|---|
date | Thu, 03 Mar 2016 08:41:02 +0300 |
parents | e227e78d72e4 |
children | 92d5278d1b10 |
line wrap: on
line diff
--- a/Implab/Automaton/DFAStateDescriptor.cs Wed Mar 02 19:59:16 2016 +0300 +++ b/Implab/Automaton/DFAStateDescriptor.cs Thu Mar 03 08:41:02 2016 +0300 @@ -11,5 +11,16 @@ public DFAStateDescriptior(int[] transitions) : this(transitions, false) { } + + 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; + } } }