view Implab/Parsing/CDFADefinition.cs @ 158:130781364799 v2

refactoring, code cleanup
author cin
date Thu, 18 Feb 2016 14:34:02 +0300
parents 97fbbf816844
children 5802131432e4
line wrap: on
line source

namespace Implab.Parsing {
    public class CDFADefinition : DFADefinition {
        readonly CharAlphabet m_alphabet;

        public CharAlphabet Alphabet {
            get { return m_alphabet; }
        }

        public CDFADefinition(CharAlphabet alphabet): base(alphabet.Count) {
            m_alphabet = alphabet;
        }

        public CDFADefinition Optimize() {
            var optimized = new CDFADefinition(new CharAlphabet());

            Optimize(optimized, m_alphabet, optimized.Alphabet);
            return optimized;
        }

        public void PrintDFA() {
            PrintDFA(m_alphabet);
        }
    }
}