[PATCH] merge objc-exp.y into c-exp.y

Pedro Alves palves@redhat.com
Wed Jul 18 17:09:00 GMT 2012


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



More information about the Gdb-patches mailing list