CharAlphabet.cs
24 lines
| 634 B
| text/x-csharp
|
CSharpLexer
cin
|
r165 | using System.Collections.Generic; | ||
cin
|
r164 | using System.Linq; | ||
cin
|
r165 | using Implab.Automaton; | ||
cin
|
r164 | |||
cin
|
r165 | namespace Implab.Formats { | ||
cin
|
r164 | public class CharAlphabet: IndexedAlphabetBase<char> { | ||
public CharAlphabet() | ||||
: base(char.MaxValue + 1) { | ||||
} | ||||
public override int GetSymbolIndex(char symbol) { | ||||
return symbol; | ||||
} | ||||
cin
|
r172 | public override char GetSymbolByIndex(int index) { | ||
return (char)index; | ||||
} | ||||
cin
|
r164 | public override IEnumerable<char> InputSymbols { | ||
get { return Enumerable.Range(char.MinValue, char.MaxValue).Cast<char>(); } | ||||
} | ||||
} | ||||
} | ||||