This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Centralize yacc interface names remapping (yyparse, yylex, yyerror, etc)
- From: Pedro Alves <palves at redhat dot com>
- To: Simon Marchi <simon dot marchi at ericsson dot com>, gdb-patches at sourceware dot org
- Date: Fri, 22 Apr 2016 16:44:51 +0100
- Subject: Re: [PATCH] Centralize yacc interface names remapping (yyparse, yylex, yyerror, etc)
- Authentication-results: sourceware.org; auth=none
- References: <1460766513-15104-1-git-send-email-palves at redhat dot com> <5714EAF3 dot 4010706 at ericsson dot com> <571520DD dot 5070509 at redhat dot com>
On 04/18/2016 07:01 PM, Pedro Alves wrote:
> On 04/18/2016 03:10 PM, Simon Marchi wrote:
>> On 16-04-15 08:28 PM, Pedro Alves wrote:
>>> This factors out all the yy-variables remapping to a single file,
>>> instead of each parser having to do the same, with different prefixes.
>>>
>>> With this, a parser just needs to define the prefix they want and
>>> include yy-remap.h, which does the dirty job.
>>>
>>> Note this renames the c_error, ada_error, etc. functions. Writting
>>
>> "Writing"
>
> Thanks.
>
>
>> Wow, it makes look really clean! I now almost looks like it's not a hack :).
>
> :-)
>
>>
>>> +/* Define GDB_YY_REMAP_PREFIX to the desired remapping prefix before
>>> + including this file. */
>>
>> What about adding an #ifndef/#error for GDB_YY_REMAP_PREFIX? The error would be
>> clearer than what we get otherwise if a file omits defining GDB_YY_REMAP_PREFIX:
>
> Good idea.
>
> )
>>> +#define yystacksize GDB_YY_REMAP(yystacksize)
>>> +#define yyvs GDB_YY_REMAP(yyvs)
>>> +#define yyvsp GDB_YY_REMAP(yyvsp)
>>
>> Mininit: I think these could be vertically aligned a bit better.
>
> Eh, I was sure I had aligned them. But I see now that I must
> have done that with emacs's whitespace-mode enabled, which adds
> extra chars and throws things off...
>
> I also missed a bunch of spaces before parens. :-P
>
>> Otherwise, looks very good!
>
> Here's the updated patch.
I've pushed this in now.
Thanks,
Pedro Alves