Mercurial > pub > ImplabNet
diff Implab/Formats/JSON/JSONScanner.cs @ 165:e227e78d72e4 ref20160224
DFA refactoring
author | cin |
---|---|
date | Mon, 29 Feb 2016 02:02:17 +0300 |
parents | 419aa51b04fd |
children | 0c3c69fe225b |
line wrap: on
line diff
--- a/Implab/Formats/JSON/JSONScanner.cs Thu Feb 25 02:11:13 2016 +0300 +++ b/Implab/Formats/JSON/JSONScanner.cs Mon Feb 29 02:02:17 2016 +0300 @@ -1,25 +1,21 @@ -using Implab.Parsing; -using System; -using System.Collections.Generic; +using System; using System.Globalization; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Implab.Automaton; -namespace Implab.JSON { +namespace Implab.Formats.JSON { /// <summary> /// Сканнер (лексер), разбивающий поток символов на токены JSON. /// </summary> - public class JSONScanner : Scanner { + public class JSONScanner : Scanner<object> { char[] m_stringBuffer; - DFAStateDescriptior[] m_stringDFA; + DFAStateDescriptior<>[] m_stringDFA; int[] m_stringAlphabet; /// <summary> /// Создает новый экземпляр сканнера /// </summary> public JSONScanner() - : base(JSONGrammar.Instance.JsonDFA.States, JSONGrammar.Instance.JsonDFA.Alphabet.GetTranslationMap()) { + : base(JSONGrammar.Instance.JsonDFA.GetTransitionTable(), JSONGrammar.Instance.JsonDFA.Alphabet.GetTranslationMap()) { m_stringBuffer = new char[1024]; var dfa = JSONGrammar.Instance.JsonStringDFA; m_stringAlphabet = dfa.Alphabet.GetTranslationMap();