From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30933 invoked by alias); 18 Jul 2012 17:09:14 -0000 Received: (qmail 30912 invoked by uid 22791); 18 Jul 2012 17:09:11 -0000 X-SWARE-Spam-Status: No, hits=-7.5 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,TW_BJ,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 18 Jul 2012 17:08:55 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6IH8s31021542 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 18 Jul 2012 13:08:55 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q6IH8rOR026163; Wed, 18 Jul 2012 13:08:54 -0400 Message-ID: <5006EDA5.2080107@redhat.com> Date: Wed, 18 Jul 2012 17:09:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1 MIME-Version: 1.0 To: Tom Tromey CC: gdb-patches@sourceware.org Subject: Re: [PATCH] merge objc-exp.y into c-exp.y References: <874np53t85.fsf@fleche.redhat.com> In-Reply-To: <874np53t85.fsf@fleche.redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-07/txt/msg00282.txt.bz2 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