annotate Implab/Automaton/CharAlphabet.cs @ 162:0526412bbb26 ref20160224

DFA refactoring
author cin
date Wed, 24 Feb 2016 08:39:53 +0300
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
162
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
1 using Implab;
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
2 using System;
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
3 using System.Collections.Generic;
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
4 using System.Linq;
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
5 using System.Text;
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
6 using System.Threading.Tasks;
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
7
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
8 namespace Implab.Automaton {
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
9 public class CharAlphabet: IndexedAlphabetBase<char> {
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
10
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
11 public CharAlphabet()
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
12 : base(char.MaxValue + 1) {
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
13 }
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
14
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
15 public override int GetSymbolIndex(char symbol) {
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
16 return symbol;
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
17 }
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
18
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
19 public override IEnumerable<char> InputSymbols {
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
20 get { return Enumerable.Range(char.MinValue, char.MaxValue).Select(x => (char)x); }
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
21 }
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
22 }
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
23 }