ByteAlphabet.cs
29 lines
| 711 B
| text/x-csharp
|
CSharpLexer
|
|
r165 | using System.Collections.Generic; | ||
|
|
r164 | using System.Linq; | ||
|
|
r165 | using Implab.Automaton; | ||
|
|
r164 | |||
|
|
r165 | namespace Implab.Formats { | ||
|
|
r164 | 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; | ||||
| } | ||||
|
|
r172 | public override byte GetSymbolByIndex(int index) { | ||
| return (byte)index; | ||||
| } | ||||
|
|
r164 | public IEnumerable<byte> InputSymbols { | ||
| get { | ||||
| return Enumerable.Range(byte.MinValue, byte.MaxValue).Cast<byte>(); | ||||
| } | ||||
| } | ||||
| #endregion | ||||
| } | ||||
| } | ||||
