| 272 | } |
| 273 | |
| 274 | parse_state parse(const char * src) { |
| 275 | try { |
| 276 | parse_state state; |
| 277 | const char * pos = parse_space(src, true); |
| 278 | while (*pos) { |
| 279 | pos = parse_rule(state, pos); |
| 280 | } |
| 281 | return state; |
| 282 | } catch (const std::exception & err) { |
| 283 | fprintf(stderr, "%s: error parsing grammar: %s\n", __func__, err.what()); |
| 284 | return parse_state(); |
| 285 | } |
| 286 | } |
| 287 | |
| 288 | static void print_grammar_char(FILE * file, uint32_t c) { |
| 289 | if (0x20 <= c && c <= 0x7f) { |
no test coverage detected