private Task <LineProcessorResults> ProcessAsync(LineProcessor processor) { var observer = new LineEventHandler(); processor.Process(observer); return(observer.Task); }
public Dictionary <string, List <KVJ2D_Data> > ParseFromCollection(ICollection <string> lines, ContextInfo context) { LineProcessor helperClass = new LineProcessor(); bool isPartOfComment = false; foreach (var curLine in lines) { var trimmedLine = curLine.Trim(); if (trimmedLine.Length == 0) { continue; } if (StringStartsWithAny(trimmedLine, _singleComments)) { continue; } if (StringStartsWithAny(trimmedLine, _commentStart)) { isPartOfComment = true; continue; } if (StringEndsWithAny(trimmedLine, _commentEnd)) { isPartOfComment = false; continue; } if (isPartOfComment) { continue; } helperClass.Process(this, trimmedLine, context); } return(helperClass.KeyValues); }
static void Main(string[] args) { var processor = new LineProcessor(args); processor.Process(); }