comparison Implab/Formats/JSON/JSONParser.cs @ 172:92d5278d1b10 ref20160224

Working on text scanner
author cin
date Mon, 14 Mar 2016 01:19:38 +0300
parents e227e78d72e4
children d5c5db0335ee
comparison
equal deleted inserted replaced
171:0f70905b4652 172:92d5278d1b10
84 84
85 static Token<object> Token(params JsonTokenType[] input) { 85 static Token<object> Token(params JsonTokenType[] input) {
86 return Token<object>.New(input.Select(t => _alphabet.Translate(t)).ToArray()); 86 return Token<object>.New(input.Select(t => _alphabet.Translate(t)).ToArray());
87 } 87 }
88 88
89 static RegularDFADefinition<JsonTokenType,object> CreateDFA(Token<object> expr) { 89 static RegularDFA<JsonTokenType,object> CreateDFA(Token<object> expr) {
90 var builder = new RegularDFABuilder<object>(); 90 var builder = new RegularExpressionVisitor<object>();
91 var dfa = new RegularDFADefinition<JsonTokenType,object>(_alphabet); 91 var dfa = new RegularDFA<JsonTokenType,object>(_alphabet);
92 92
93 expr.Accept(builder); 93 expr.Accept(builder);
94 94
95 builder.BuildDFA(dfa); 95 builder.BuildDFA(dfa);
96 return dfa; 96 return dfa;