Mercurial > pub > ImplabNet
annotate Implab/Parsing/CDFADefinition.cs @ 156:97fbbf816844 v2
Promises: SignalXXX methods merged into SignalHandler method.
Components: RunnableComponent In progress
author | cin |
---|---|
date | Mon, 15 Feb 2016 04:22:15 +0300 |
parents | c0bf853aa04f |
children | 130781364799 |
rev | line source |
---|---|
55 | 1 using Implab; |
2 using System; | |
3 using System.Collections.Generic; | |
4 using System.Linq; | |
5 using System.Text; | |
6 using System.Threading.Tasks; | |
7 | |
8 namespace Implab.Parsing { | |
9 public class CDFADefinition : DFADefinitionBase { | |
156
97fbbf816844
Promises: SignalXXX methods merged into SignalHandler method.
cin
parents:
55
diff
changeset
|
10 readonly Alphabet m_alphabet; |
55 | 11 |
12 public Alphabet Alphabet { | |
13 get { return m_alphabet; } | |
14 } | |
15 | |
16 public override int AlphabetSize { | |
17 get { return m_alphabet.Count; } | |
18 } | |
19 | |
20 public CDFADefinition(Alphabet alphabet): base() { | |
21 Safe.ArgumentNotNull(alphabet, "alphabet"); | |
22 m_alphabet = alphabet; | |
23 } | |
24 | |
25 public CDFADefinition Optimize() { | |
26 var optimized = new CDFADefinition(new Alphabet()); | |
27 | |
28 Optimize(optimized, m_alphabet, optimized.Alphabet); | |
29 return optimized; | |
30 } | |
31 | |
32 public void PrintDFA() { | |
33 PrintDFA(m_alphabet); | |
34 } | |
35 } | |
36 } |