comparison Implab/Parsing/EDFADefinition.cs @ 160:5802131432e4 v2

fixed regression: race condition in Promise DFA refactoring
author cin
date Thu, 18 Feb 2016 19:38:54 +0300
parents 130781364799
children
comparison
equal deleted inserted replaced
159:5558e43c79bb 160:5802131432e4
16 public void DefineTransition(int s1, int s2, T input) { 16 public void DefineTransition(int s1, int s2, T input) {
17 DefineTransition(s1, s2, m_alphabet.Translate(input)); 17 DefineTransition(s1, s2, m_alphabet.Translate(input));
18 } 18 }
19 19
20 public EDFADefinition<T> Optimize() { 20 public EDFADefinition<T> Optimize() {
21 var optimized = new EDFADefinition<T>(new EnumAlphabet<T>()); 21
22 Optimize(optimized, m_alphabet, optimized.Alphabet); 22 return (EDFADefinition<T>)Optimize(alphabet => new EDFADefinition<T>((EnumAlphabet<T>)alphabet), m_alphabet, new EnumAlphabet<T>());
23
24 return optimized;
25 } 23 }
26 24
27 public void PrintDFA() { 25 public void PrintDFA() {
28 PrintDFA(m_alphabet); 26 PrintDFA(m_alphabet);
29 } 27 }