This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC 2/8] C language
- From: Tom Tromey <tromey at redhat dot com>
- To: Sergio Durigan Junior <sergiodj at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 16 Jan 2012 11:03:14 -0700
- Subject: Re: [RFC 2/8] C language
- References: <m3k44s7qej.fsf@gmail.com> <m362gc7pxq.fsf@gmail.com>
>>>>> "Sergio" == Sergio Durigan Junior <sergiodj@redhat.com> writes:
Sergio> Here and in all the .y files, I had to add an argument to the parser and
Sergio> the lexer functions, which is a `struct parser_state *ps'.
I think 'ps' is too short a name for something used all over the file.
Sergio> +%parse-param {struct parser_state *ps}
Sergio> +%lex-param {struct parser_state *ps}
This means we would require bison.
I don't really mind us requiring bison, but I think it is a bigger issue
and would need a separate patch - and at least configury changes.
Another approach would be to temporarily make a "local global" in the .y
file, then set this local global in the entry point to the parser.
This does not solve the whole problem, but it does make things somewhat
more modular, as a first step.
Sergio> - { write_exp_elt_opcode (BINOP_COMMA); }
Sergio> + { write_exp_elt_opcode (ps, BINOP_COMMA); }
All the mechanical changes are ok. Thanks for taking this on.
Tom