view Implab/Formats/ByteAlphabet.cs @ 165:e227e78d72e4 ref20160224

DFA refactoring
author cin
date Mon, 29 Feb 2016 02:02:17 +0300
parents ec35731ae299
children 92d5278d1b10
line wrap: on
line source

using System.Collections.Generic;
using System.Linq;
using Implab.Automaton;

namespace Implab.Formats {
    public class ByteAlphabet : IndexedAlphabetBase<byte> {
        public ByteAlphabet() : base(byte.MaxValue + 1){
        }

        #region implemented abstract members of IndexedAlphabetBase

        public override int GetSymbolIndex(byte symbol) {
            return (int)symbol;
        }

        public IEnumerable<byte> InputSymbols {
            get {
                return Enumerable.Range(byte.MinValue, byte.MaxValue).Cast<byte>();
            }
        }

        #endregion
    }
}