##// END OF EJS Templates
container configuration docs
container configuration docs

File last commit:

r236:302ca905c19e v2
r276:b4e0f81c7425 v3
Show More
CharAlphabet.cs
36 lines | 1.0 KiB | text/x-csharp | CSharpLexer
cin
DFA refactoring
r165 using System.Collections.Generic;
cin
Almost complete DFA refactoring
r164 using System.Linq;
cin
DFA refactoring
r165 using Implab.Automaton;
cin
Rewritten JsonScanner, JsonParser, fixed naming style
r228 using System;
cin
Almost complete DFA refactoring
r164
cin
DFA refactoring
r165 namespace Implab.Formats {
cin
JsonReader optimizations
r236 public class CharAlphabet : IndexedAlphabetBase<char> {
cin
Almost complete DFA refactoring
r164
public override int GetSymbolIndex(char symbol) {
return symbol;
}
cin
rewritten the text scanner
r176 public IEnumerable<char> InputSymbols {
cin
Almost complete DFA refactoring
r164 get { return Enumerable.Range(char.MinValue, char.MaxValue).Cast<char>(); }
}
cin
Rewritten JsonScanner, JsonParser, fixed naming style
r228
public CharMap CreateCharMap() {
var map = new Dictionary<int, int>();
int max = 0, min = char.MaxValue;
foreach (var p in Mappings) {
var index = GetSymbolIndex(p.Key);
max = Math.Max(max, index);
min = Math.Min(min, index);
map[index] = p.Value;
}
var result = new int[max - min + 1];
for (int i = 0; i < result.Length; i++)
map.TryGetValue(min + i, out result[i]);
return new CharMap((char)min, result);
}
cin
Almost complete DFA refactoring
r164 }
}