view Implab/Parsing/CDFADefinition.cs @ 159:5558e43c79bb v2

minor fix
author cin
date Thu, 18 Feb 2016 16:06:14 +0300
parents 130781364799
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);
        }
    }
}