예제 #1
0
        private Task <LineProcessorResults> ProcessAsync(LineProcessor processor)
        {
            var observer = new LineEventHandler();

            processor.Process(observer);
            return(observer.Task);
        }
예제 #2
0
        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);
        }
예제 #3
0
 static void Main(string[] args)
 {
     var processor = new LineProcessor(args);
     processor.Process();
 }