Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

file_parser.hpp

Go to the documentation of this file.
00001 /*
00002  * Equation Cruncher
00003  * Copyright (C) 2004  Dhruv Matani(dhruvbird@yahoo.com)
00004  * 
00005  * 
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License as
00008  * published by the Free Software Foundation; either version 2 of the
00009  * License, or (at your option) any later version.
00010  * 
00011  * This program is distributed in the hope that it will be useful, but
00012  * WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * General Public License for more details.
00015  * 
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00019  * USA
00020  */
00021 
00022 
00023 #if !defined FILE_PARSER_HPP
00024 #define FILE_PARSER_HPP
00025 
00026 #include <map>
00027 #include <vector>
00028 #include <fstream>
00029 #include <stdexcept>
00030 #include <string>
00031 #include <cctype>
00032 #include <sstream>
00033 #include "udefs.hpp"
00034 
00076 namespace eqn_cruncher
00077 {
00084   struct file_error : std::runtime_error
00085   {
00086     file_error(std::string const& str = "file_error")
00087       : std::runtime_error(str)
00088     { }
00089   };
00090 
00091 
00099   struct parse_error : std::runtime_error
00100   {
00101     parse_error(std::string const& str = "parse_error")
00102       : std::runtime_error(str)
00103     { }
00104   };
00105 
00106 
00113   void
00114   eat_ws(std::istream& in);
00115 
00116 
00128   std::string
00129   suffix_from_number(unsigned int num);
00130 
00131 
00149   void
00150   parse_file(std::string const& file_name, 
00151              std::vector<std::string>& var_list, 
00152              matrix_t& mat, 
00153              std::vector<double>& rhs_list);
00154 }
00155 
00156 #endif // FILE_PARSER_HPP

Generated on Mon Oct 11 13:09:25 2004 for Equation Cruncher by doxygen1.2.18