annotate Implab/Formats/StringScanner.cs @ 209:a867536c68fc v2

Bound promise to CancellationToken Added new states to ExecutionSate enum. Added Safe.Guard() method to handle cleanup of the result of the promise
author cin
date Wed, 16 Nov 2016 03:06:08 +0300
parents 76e8f2ba12b8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
176
0c3c69fe225b rewritten the text scanner
cin
parents:
diff changeset
1 using System;
0c3c69fe225b rewritten the text scanner
cin
parents:
diff changeset
2
0c3c69fe225b rewritten the text scanner
cin
parents:
diff changeset
3 namespace Implab.Formats {
0c3c69fe225b rewritten the text scanner
cin
parents:
diff changeset
4 public class StringScanner: TextScanner {
0c3c69fe225b rewritten the text scanner
cin
parents:
diff changeset
5 const int CHUNK_SIZE = 1024;
0c3c69fe225b rewritten the text scanner
cin
parents:
diff changeset
6
182
76e8f2ba12b8 pretty print DFA, the minimization is still buggy
cin
parents: 176
diff changeset
7 public StringScanner(string text) : base(null) {
76e8f2ba12b8 pretty print DFA, the minimization is still buggy
cin
parents: 176
diff changeset
8 Safe.ArgumentNotNull(text, "text");
76e8f2ba12b8 pretty print DFA, the minimization is still buggy
cin
parents: 176
diff changeset
9 var data = text.ToCharArray();
76e8f2ba12b8 pretty print DFA, the minimization is still buggy
cin
parents: 176
diff changeset
10 Feed(data, 0, data.Length);
176
0c3c69fe225b rewritten the text scanner
cin
parents:
diff changeset
11 }
0c3c69fe225b rewritten the text scanner
cin
parents:
diff changeset
12
0c3c69fe225b rewritten the text scanner
cin
parents:
diff changeset
13 protected override int Read(char[] buffer, int offset, int size) {
182
76e8f2ba12b8 pretty print DFA, the minimization is still buggy
cin
parents: 176
diff changeset
14 return 0;
176
0c3c69fe225b rewritten the text scanner
cin
parents:
diff changeset
15 }
0c3c69fe225b rewritten the text scanner
cin
parents:
diff changeset
16 }
0c3c69fe225b rewritten the text scanner
cin
parents:
diff changeset
17 }
0c3c69fe225b rewritten the text scanner
cin
parents:
diff changeset
18