This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] merge objc-exp.y into c-exp.y
- From: Pedro Alves <palves at redhat dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 18 Jul 2012 18:08:53 +0100
- Subject: Re: [PATCH] merge objc-exp.y into c-exp.y
- References: <874np53t85.fsf@fleche.redhat.com>
On 07/18/2012 05:54 PM, Tom Tromey wrote:
> I'm curious about opinions on this patch. In the absence of comments
> I plan to check it in.
It all sounds good to me, FWIW.
> This patch removes objc-exp.y, merging it back into c-exp.y. This
> fixes some latent bugs in objc-exp.y -- basically, whatever we fixed
> in c-exp.y in the last several years. One such is in
> gdb.objc/print.exp, see the patch.
>
> This also reduces the amount of code we have to maintain and removes
> one of the more egregious examples of cut-and-paste from gdb.
>
> To make the resulting parser avoid Objective C constructs when in C or
> C++ modes, I made the lexer return a new OBJC_LBRAC token instead of
> '[' when parsing ObjC. Then I cloned a small number of (trivial)
> productions.
>
> This also fixes a bug in @selector parsing. The old code implemented
> a kind of bad, buggy miniature parser in the lexer, using 'strchr' to
> find the next paren. The new code uses the parser to do the parsing.
--
Pedro Alves