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

DFA refactoring
author cin
date Wed, 24 Feb 2016 08:39:53 +0300
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Implab/Automaton/CharAlphabet.cs	Wed Feb 24 08:39:53 2016 +0300
@@ -0,0 +1,23 @@
+using Implab;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Implab.Automaton {
+    public class CharAlphabet: IndexedAlphabetBase<char> {
+
+        public CharAlphabet()
+            : base(char.MaxValue + 1) {
+        }
+
+        public override int GetSymbolIndex(char symbol) {
+            return symbol;
+        }
+
+        public override IEnumerable<char> InputSymbols {
+            get { return Enumerable.Range(char.MinValue, char.MaxValue).Select(x => (char)x); }
+        }
+    }
+}