public static void Parse(CharStream stream) { if (!stream.SkipIfPossible('/') || !(stream.SkipIfPossible('*'))) { throw stream.CreateException( "a comment has to be opened with '/*'"); } char c; string content = ""; while (stream.ReadNext(out c)) { if (c == '*' && stream.SkipIfPossible('/')) { return; } content += c; } throw new ParseException( "a comment entry was opened, but not closed", stream.CreateEOFException()); }