lemon/lgf_reader.h
changeset 174 2ec3c1bbc687
parent 173 b026e9779b28
parent 172 c94a80f38d7f
child 179 289266783a0b
equal deleted inserted replaced
9:b043958089d3 10:6172a468e27d
  1137       bool attributes_done = false;
  1137       bool attributes_done = false;
  1138       std::set<std::string> extra_sections;
  1138       std::set<std::string> extra_sections;
  1139 
  1139 
  1140       line_num = 0;      
  1140       line_num = 0;      
  1141       readLine();
  1141       readLine();
       
  1142       skipSection();
  1142 
  1143 
  1143       while (readSuccess()) {
  1144       while (readSuccess()) {
  1144 	skipSection();
       
  1145 	try {
  1145 	try {
  1146 	  char c;
  1146 	  char c;
  1147 	  std::string section, caption;
  1147 	  std::string section, caption;
  1148 	  line >> c;
  1148 	  line >> c;
  1149 	  _reader_bits::readToken(line, section);
  1149 	  _reader_bits::readToken(line, section);
  1176 	    }
  1176 	    }
  1177 	    Sections::iterator it = _sections.find(section);
  1177 	    Sections::iterator it = _sections.find(section);
  1178 	    if (it != _sections.end()) {
  1178 	    if (it != _sections.end()) {
  1179 	      extra_sections.insert(section);
  1179 	      extra_sections.insert(section);
  1180 	      it->second->process(*_is, line_num);
  1180 	      it->second->process(*_is, line_num);
  1181 	      readLine();
       
  1182 	    } else {
       
  1183 	      readLine();
       
  1184 	      skipSection();
       
  1185 	    }
  1181 	    }
       
  1182 	    readLine();
       
  1183 	    skipSection();
  1186 	  }
  1184 	  }
  1187 	} catch (DataFormatError& error) {
  1185 	} catch (DataFormatError& error) {
  1188 	  error.line(line_num);
  1186 	  error.line(line_num);
  1189 	  throw;
  1187 	  throw;
  1190 	}	
  1188 	}	
  1979       bool attributes_done = false;
  1977       bool attributes_done = false;
  1980       std::set<std::string> extra_sections;
  1978       std::set<std::string> extra_sections;
  1981 
  1979 
  1982       line_num = 0;      
  1980       line_num = 0;      
  1983       readLine();
  1981       readLine();
       
  1982       skipSection();
  1984 
  1983 
  1985       while (readSuccess()) {
  1984       while (readSuccess()) {
  1986 	skipSection();
       
  1987 	try {
  1985 	try {
  1988 	  char c;
  1986 	  char c;
  1989 	  std::string section, caption;
  1987 	  std::string section, caption;
  1990 	  line >> c;
  1988 	  line >> c;
  1991 	  _reader_bits::readToken(line, section);
  1989 	  _reader_bits::readToken(line, section);
  2018 	    }
  2016 	    }
  2019 	    Sections::iterator it = _sections.find(section);
  2017 	    Sections::iterator it = _sections.find(section);
  2020 	    if (it != _sections.end()) {
  2018 	    if (it != _sections.end()) {
  2021 	      extra_sections.insert(section);
  2019 	      extra_sections.insert(section);
  2022 	      it->second->process(*_is, line_num);
  2020 	      it->second->process(*_is, line_num);
  2023 	      readLine();
       
  2024 	    } else {
       
  2025 	      readLine();
       
  2026 	      skipSection();
       
  2027 	    }
  2021 	    }
       
  2022 	    readLine();
       
  2023 	    skipSection();
  2028 	  }
  2024 	  }
  2029 	} catch (DataFormatError& error) {
  2025 	} catch (DataFormatError& error) {
  2030 	  error.line(line_num);
  2026 	  error.line(line_num);
  2031 	  throw;
  2027 	  throw;
  2032 	}	
  2028 	}