comparison Implab/Automaton/RegularExpressions/RegularDFA.cs @ 181:b2b6a6640aa3 ref20160224

minor fixes and debug
author cin
date Thu, 24 Mar 2016 03:54:46 +0300
parents c32688129f14
children 76e8f2ba12b8
comparison
equal deleted inserted replaced
180:c32688129f14 181:b2b6a6640aa3
61 // mark tags in the new DFA 61 // mark tags in the new DFA
62 foreach (var g in m_tags.Where(x => x.Key < StateCount).GroupBy(x => stateMap[x.Key], x => x.Value )) 62 foreach (var g in m_tags.Where(x => x.Key < StateCount).GroupBy(x => stateMap[x.Key], x => x.Value ))
63 dfa.SetStateTag(g.Key, g.SelectMany(x => x).ToArray()); 63 dfa.SetStateTag(g.Key, g.SelectMany(x => x).ToArray());
64 64
65 // make the alphabet for the new DFA 65 // make the alphabet for the new DFA
66 foreach (var pair in alphaMap) 66 // skip all unclassified symbols
67 foreach (var pair in alphaMap.Where(x => x.Value != 0))
67 alphabet.DefineClass(m_alphabet.GetSymbols(pair.Key), pair.Value); 68 alphabet.DefineClass(m_alphabet.GetSymbols(pair.Key), pair.Value);
68 69
69 return dfa; 70 return dfa;
70 } 71 }
71 72