1 #include "mra-driver.hh" 2 #include "mra-parser.hh" 3 mra_driver()4mra_driver::mra_driver () 5 : scopedepth(0) 6 , tmpvarcnt(0) 7 , use_k_default(true) 8 , use_eps_default(true) 9 , trace_scanning (false) 10 , trace_parsing (false) 11 { 12 insert_sym("built in", new Exp("pi",Exp::REAL)); 13 } 14 ~mra_driver()15mra_driver::~mra_driver () 16 { 17 } 18 19 int parse(const std::string & f)20mra_driver::parse (const std::string &f) 21 { 22 file = f; 23 scan_begin (); 24 yy::mra_parser parser (*this); 25 parser.set_debug_level (trace_parsing); 26 int res = parser.parse (); 27 scan_end (); 28 return res; 29 } 30 31 void error(const yy::location & l,const std::string & m)32mra_driver::error (const yy::location& l, const std::string& m) 33 { 34 std::cerr << l << ": " << m << std::endl; 35 } 36 37 void error(const std::string & m)38mra_driver::error (const std::string& m) 39 { 40 std::cerr << m << std::endl; 41 } 42