Mercurial > pub > ImplabNet
diff Implab/Formats/StringScanner.cs @ 182:76e8f2ba12b8 ref20160224
pretty print DFA, the minimization is still buggy
author | cin |
---|---|
date | Thu, 24 Mar 2016 18:52:10 +0300 |
parents | 0c3c69fe225b |
children |
line wrap: on
line diff
--- a/Implab/Formats/StringScanner.cs Thu Mar 24 03:54:46 2016 +0300 +++ b/Implab/Formats/StringScanner.cs Thu Mar 24 18:52:10 2016 +0300 @@ -4,22 +4,14 @@ public class StringScanner: TextScanner { const int CHUNK_SIZE = 1024; - readonly string m_text; - int m_pos; - - public StringScanner(string text) : base(text.Length, text.Length < CHUNK_SIZE ? text.Length : CHUNK_SIZE) { - m_text = text; - Feed(); + public StringScanner(string text) : base(null) { + Safe.ArgumentNotNull(text, "text"); + var data = text.ToCharArray(); + Feed(data, 0, data.Length); } protected override int Read(char[] buffer, int offset, int size) { - var actual = size + m_pos > m_text.Length ? m_text.Length - m_pos : size; - - m_text.CopyTo(m_pos,buffer,offset, actual); - - m_pos += actual; - - return actual; + return 0; } } }