| 1281 | } |
| 1282 | |
| 1283 | static char *insert_arg_rule(char *arg, char *tag) |
| 1284 | { |
| 1285 | int lineno = rescan_lineno; |
| 1286 | char *code = compile_arg(&arg, tag); |
| 1287 | int rule = lookup_arg_cache(code); |
| 1288 | FILE *f = action_file; |
| 1289 | |
| 1290 | if (rule<0) { |
| 1291 | rule = nrules; |
| 1292 | insert_arg_cache(code, rule); |
| 1293 | fprintf(f, "case %d:\n", rule - 2); |
| 1294 | if (!lflag) |
| 1295 | fprintf(f, line_format, lineno, (inc_file?inc_file_name:input_file_name)); |
| 1296 | fprintf(f, "%s;\n", code); |
| 1297 | fprintf(f, "break;\n"); |
| 1298 | insert_empty_rule(); |
| 1299 | plhs[rule]->tag = tag; |
| 1300 | plhs[rule]->class = ARGUMENT; } |
| 1301 | else { |
| 1302 | if (++nitems > maxitems) |
| 1303 | expand_items(); |
| 1304 | pitem[nitems-1] = plhs[rule]; |
| 1305 | free(code); } |
| 1306 | return arg+1; |
| 1307 | } |
| 1308 | |
| 1309 | void add_symbol() |
| 1310 | { |
no test coverage detected