public void Process(StreamReader reader) { bool sequenceStarted = false; while (!reader.EndOfStream) { int token = reader.Peek(); switch (token) { case 10: //end of line reader.ReadLine(); break; case 32: //space reader.Read(); break; case 59 when sequenceStarted: case 62 when sequenceStarted: return; //sequence is done case 59: //';' case 62: //'<' _comment.Process(reader); break; default: _letters.Process(reader); sequenceStarted = true; break; } } }