| 277 | } |
| 278 | |
| 279 | std::string file_slurp(std::ifstream & ifs) |
| 280 | { |
| 281 | std::string retval; |
| 282 | while (ifs) { |
| 283 | char const c = ifs.get(); |
| 284 | retval += c; |
| 285 | } |
| 286 | if (!retval.empty() && retval.back() == -1) |
| 287 | retval.pop_back(); |
| 288 | return retval; |
| 289 | } |
| 290 | |
| 291 | // This is our callbacks-struct. It has a callback for each of the kinds of |
| 292 | // callback rules in our parser. If one were missing, you'd get a pretty |