158
|
1 namespace Implab.Parsing {
|
|
2 public class CDFADefinition : DFADefinition {
|
|
3 readonly CharAlphabet m_alphabet;
|
55
|
4
|
158
|
5 public CharAlphabet Alphabet {
|
55
|
6 get { return m_alphabet; }
|
|
7 }
|
|
8
|
158
|
9 public CDFADefinition(CharAlphabet alphabet): base(alphabet.Count) {
|
55
|
10 m_alphabet = alphabet;
|
|
11 }
|
|
12
|
|
13 public CDFADefinition Optimize() {
|
158
|
14 var optimized = new CDFADefinition(new CharAlphabet());
|
55
|
15
|
|
16 Optimize(optimized, m_alphabet, optimized.Alphabet);
|
|
17 return optimized;
|
|
18 }
|
|
19
|
|
20 public void PrintDFA() {
|
|
21 PrintDFA(m_alphabet);
|
|
22 }
|
|
23 }
|
|
24 }
|