annotate Implab/Parsing/Alphabet.cs @ 89:ce0171cacec4 v2

improved performance of a chained map operation
author cin
date Wed, 08 Oct 2014 02:19:45 +0400
parents 21611344d366
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
55
c0bf853aa04f Added initial JSON support
cin
parents:
diff changeset
1 using Implab;
c0bf853aa04f Added initial JSON support
cin
parents:
diff changeset
2 using System;
c0bf853aa04f Added initial JSON support
cin
parents:
diff changeset
3 using System.Collections.Generic;
c0bf853aa04f Added initial JSON support
cin
parents:
diff changeset
4 using System.Linq;
c0bf853aa04f Added initial JSON support
cin
parents:
diff changeset
5 using System.Text;
c0bf853aa04f Added initial JSON support
cin
parents:
diff changeset
6 using System.Threading.Tasks;
c0bf853aa04f Added initial JSON support
cin
parents:
diff changeset
7
c0bf853aa04f Added initial JSON support
cin
parents:
diff changeset
8 namespace Implab.Parsing {
c0bf853aa04f Added initial JSON support
cin
parents:
diff changeset
9 public class Alphabet: AlphabetBase<char> {
c0bf853aa04f Added initial JSON support
cin
parents:
diff changeset
10
59
21611344d366 code cleanup
cin
parents: 55
diff changeset
11 public Alphabet()
21611344d366 code cleanup
cin
parents: 55
diff changeset
12 : base(char.MaxValue + 1) {
21611344d366 code cleanup
cin
parents: 55
diff changeset
13 }
21611344d366 code cleanup
cin
parents: 55
diff changeset
14
55
c0bf853aa04f Added initial JSON support
cin
parents:
diff changeset
15 public override int GetSymbolIndex(char symbol) {
c0bf853aa04f Added initial JSON support
cin
parents:
diff changeset
16 return symbol;
c0bf853aa04f Added initial JSON support
cin
parents:
diff changeset
17 }
c0bf853aa04f Added initial JSON support
cin
parents:
diff changeset
18
c0bf853aa04f Added initial JSON support
cin
parents:
diff changeset
19 public override IEnumerable<char> InputSymbols {
c0bf853aa04f Added initial JSON support
cin
parents:
diff changeset
20 get { return Enumerable.Range(char.MinValue, char.MaxValue).Select(x => (char)x); }
c0bf853aa04f Added initial JSON support
cin
parents:
diff changeset
21 }
c0bf853aa04f Added initial JSON support
cin
parents:
diff changeset
22 }
c0bf853aa04f Added initial JSON support
cin
parents:
diff changeset
23 }