Пример #1
0
        public IBatch Parse(IGetter <string> source, string description = null)
        {
            SBD.Clear(); SINS.Clear(); CUR = new ins_variant();

            var src = source.Get();

            if (string.IsNullOrEmpty(src))
            {
                goto finalize;
            }

            // This will store a filepath in order to prevent multiple calls for once-only files
            if (source is GetterTextFile)
            {
                FilesUsed.Add(((GetterTextFile)source).Filepath);
            }

            char c;
            var  echr = src.AsEnumerable().GetEnumerator();

            while (echr.MoveNext())
            {
                c = echr.Current;
                this.append(c);
            }
            this.append('\r'); // this closes the current value-parsers and any other processing

finalize:
            var ainp = SINS.Select(x => new Input(ref x)).ToArray(SINS.Count);
            var abab = ainp.Select(x => this.parse(x)).ToArrayR(ainp.Length);

            var bch = new BatchSequential()
            {
                Text = description
            };

            return(bch.Append(abab));
        }
Пример #2
0
 public enumerator(BatchSequential parent)
 {
     ITM = parent ?? throw new ArgumentNullException("Parent-batch unset");
     SSN = parent.SSN;
 }