Mercurial > pub > ImplabNet
comparison Implab/Formats/CharAlphabet.cs @ 176:0c3c69fe225b ref20160224
rewritten the text scanner
author | cin |
---|---|
date | Tue, 22 Mar 2016 18:58:40 +0300 |
parents | 92d5278d1b10 |
children | a0ff6a0e9c44 |
comparison
equal
deleted
inserted
replaced
175:96a89dcb4060 | 176:0c3c69fe225b |
---|---|
3 using Implab.Automaton; | 3 using Implab.Automaton; |
4 | 4 |
5 namespace Implab.Formats { | 5 namespace Implab.Formats { |
6 public class CharAlphabet: IndexedAlphabetBase<char> { | 6 public class CharAlphabet: IndexedAlphabetBase<char> { |
7 | 7 |
8 public CharAlphabet() | 8 public CharAlphabet() { |
9 : base(char.MaxValue + 1) { | |
10 } | 9 } |
11 | 10 |
12 public override int GetSymbolIndex(char symbol) { | 11 public override int GetSymbolIndex(char symbol) { |
13 return symbol; | 12 return symbol; |
14 } | 13 } |
15 | 14 |
16 public override char GetSymbolByIndex(int index) { | 15 public IEnumerable<char> InputSymbols { |
17 return (char)index; | |
18 } | |
19 | |
20 public override IEnumerable<char> InputSymbols { | |
21 get { return Enumerable.Range(char.MinValue, char.MaxValue).Cast<char>(); } | 16 get { return Enumerable.Range(char.MinValue, char.MaxValue).Cast<char>(); } |
22 } | 17 } |
23 } | 18 } |
24 } | 19 } |