annotate Implab/Parsing/CharAlphabet.cs @ 158:130781364799 v2

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