This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Centralize yacc interface names remapping (yyparse, yylex, yyerror, etc)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]