OLD | NEW |
(Empty) | |
| 1 #line 8370 "../../doc/bison.texinfo" |
| 2 #include "calc++-driver.hh" |
| 3 #include "calc++-parser.hh" |
| 4 |
| 5 calcxx_driver::calcxx_driver () |
| 6 : trace_scanning (false), trace_parsing (false) |
| 7 { |
| 8 variables["one"] = 1; |
| 9 variables["two"] = 2; |
| 10 } |
| 11 |
| 12 calcxx_driver::~calcxx_driver () |
| 13 { |
| 14 } |
| 15 |
| 16 int |
| 17 calcxx_driver::parse (const std::string &f) |
| 18 { |
| 19 file = f; |
| 20 scan_begin (); |
| 21 yy::calcxx_parser parser (*this); |
| 22 parser.set_debug_level (trace_parsing); |
| 23 int res = parser.parse (); |
| 24 scan_end (); |
| 25 return res; |
| 26 } |
| 27 |
| 28 void |
| 29 calcxx_driver::error (const yy::location& l, const std::string& m) |
| 30 { |
| 31 std::cerr << l << ": " << m << std::endl; |
| 32 } |
| 33 |
| 34 void |
| 35 calcxx_driver::error (const std::string& m) |
| 36 { |
| 37 std::cerr << m << std::endl; |
| 38 } |
OLD | NEW |