src/lemon/lemon_reader.h
changeset 1427 14c75970840e
parent 1424 c3d754f5e631
child 1429 4283998fb2be
     1.1 --- a/src/lemon/lemon_reader.h	Wed May 18 09:39:06 2005 +0000
     1.2 +++ b/src/lemon/lemon_reader.h	Wed May 18 13:02:47 2005 +0000
     1.3 @@ -99,8 +99,8 @@
     1.4    /// header line of the section. Each next lines belong to this section
     1.5    /// while it does not starts with \c \@ character. This line can start a 
     1.6    /// new section or if it can close the file with the \c \@end line.
     1.7 -  /// The file format ignore the empty lines and it may contain comments
     1.8 -  /// started with a \c # character to the end of the line. 
     1.9 +  /// The file format ignore the empty and comment lines. The line is
    1.10 +  /// comment line if it starts with a \c # character. 
    1.11    ///
    1.12    /// The framework provides an abstract LemonReader::SectionReader class
    1.13    /// what defines the interface of a SectionReader. The SectionReader
    1.14 @@ -108,8 +108,8 @@
    1.15    /// decides if it want to process the next section. Several SectionReaders
    1.16    /// can be attached to an LemonReader and the first attached what can
    1.17    /// process the section will be used. Its \c read() member will called
    1.18 -  /// with a stream contains the section. From this stream the empty lines
    1.19 -  /// and comments are filtered out.
    1.20 +  /// with a stream contains the section. From this stream the empty and
    1.21 +  /// comment lines are filtered out.
    1.22    ///
    1.23    /// \relates GraphReader
    1.24    /// \relates NodeSetReader
    1.25 @@ -133,9 +133,8 @@
    1.26  
    1.27        enum skip_state_type {
    1.28  	no_skip,
    1.29 -	after_comment,
    1.30  	after_endl,
    1.31 -	empty_line
    1.32 +	comment_line
    1.33        };
    1.34  
    1.35        char_type small_buf[1];
    1.36 @@ -180,20 +179,9 @@
    1.37  	  case '\n': 
    1.38  	    skip_state = after_endl;
    1.39  	    return true;
    1.40 -	  case '#':
    1.41 -	    skip_state = after_comment;
    1.42 -	    return false;
    1.43  	  default:
    1.44  	    return true;
    1.45  	  }
    1.46 -	case after_comment:
    1.47 -	  switch (c) {
    1.48 -	  case '\n': 
    1.49 -	    skip_state = after_endl;
    1.50 -	    return true;
    1.51 -	  default:
    1.52 -	    return false;
    1.53 -	  }        
    1.54  	case after_endl:
    1.55  	  switch (c) {
    1.56  	  case '@':
    1.57 @@ -201,7 +189,7 @@
    1.58  	  case '\n': 
    1.59  	    return false;
    1.60  	  case '#':
    1.61 -	    skip_state = empty_line;
    1.62 +	    skip_state = comment_line;
    1.63  	    return false;
    1.64  	  default:
    1.65  	    if (!isspace(c)) {
    1.66 @@ -212,7 +200,7 @@
    1.67  	    }
    1.68  	  }
    1.69  	  break;
    1.70 -	case empty_line:
    1.71 +	case comment_line:
    1.72  	  switch (c) {
    1.73  	  case '\n': 
    1.74  	    skip_state = after_endl;