{
int i;
fprintf(f, "#line 0 \"gen_reduce\"\n");
- fprintf(f, "static int do_reduce(int prod, int depth, void **body,\n");
- fprintf(f, " void *ret)\n");
+ fprintf(f, "static int do_reduce(int prod, void **body, void *ret)\n");
fprintf(f, "{\n");
fprintf(f, "\tint ret_size = 0;\n");
###### parser
void *parser_run(struct token_state *tokens,
const struct state states[],
- int (*do_reduce)(int, int, void**, void*),
+ int (*do_reduce)(int, void**, void*),
void (*do_free)(short, void*),
FILE *trace, const char *non_term[], int knowns)
{
body = p.asn_stack +
(p.tos - states[p.state].reduce_size);
- bufsize = do_reduce(prod, p.tos, body,
- buf);
+ bufsize = do_reduce(prod, body, buf);
pop(&p, size, do_free);
shift(&p, sym, memdup(buf, bufsize), states);
###### exported functions
void *parser_run(struct token_state *tokens,
const struct state states[],
- int (*do_reduce)(int, int, void**, void*),
+ int (*do_reduce)(int, void**, void*),
void (*do_free)(short, void*),
FILE *trace, const char *non_term[], int knowns);