From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6935 invoked by alias); 21 Oct 2002 19:08:49 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 6714 invoked from network); 21 Oct 2002 19:08:44 -0000 Received: from unknown (HELO touchme.toronto.redhat.com) (216.138.202.10) by sources.redhat.com with SMTP; 21 Oct 2002 19:08:44 -0000 Received: from localhost.redhat.com (to-dhcp51.toronto.redhat.com [172.16.14.151]) by touchme.toronto.redhat.com (Postfix) with ESMTP id DC43D8000F3 for ; Mon, 21 Oct 2002 15:08:42 -0400 (EDT) Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 9307A3E14; Mon, 21 Oct 2002 12:35:05 -0400 (EDT) Message-ID: <3DB42CB9.50601@redhat.com> Date: Mon, 21 Oct 2002 12:08:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.0) Gecko/20020824 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Klee Dienes , Adam Fedor Cc: gdb-patches@sources.redhat.com Subject: Re: Add rules for ObjC files References: <3239ADC4-D77B-11D6-A34B-00039396EEB8@mit.edu> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-10/txt/msg00343.txt.bz2 > Klee Dienes wrote: > > I'm not sure if this is something you want to hassle with at the moment, or if you'd prefer to let it wait as a modification once a working version of the Objective-C patches are successfully committed. > > But just as a heads-up, I should mention that in more recent versions of our GDB, we've folded in all of the Objective-C support directly into c-exp.y, and removed objc-exp.y as a file entirely. Most of objc-exp.y was always just an out-of-date copy of c-exp.y, anyway; moving the (rather small) changes into c-exp.y directly not only allowed us to track changes to the C parser much more smoothly, it should also allow for much better Objective-C++ support. > > You'll probably want to look at the most recent version of our GDB tree (http://www.opensource.apple.com/projects/darwin/6.0/source/other/gdb- 20020918.tar.gz; no registration or anything similar required), and check out our changes to c-exp.y; I've attached them for your convenience. > > One downside to having the changes directly in c-exp.y is that I don't know of any good way to conditionalize them; though I am by no means a bison guru. > > ObjC is supposed to be a strict superset of C, so at least in theory, > extensions don't need to be conditionalized at all, or they can be > disallowed after parsing, if you wanted to have a "strict C mode" > (although I note that the little array@45 extension is always available, > even though it's not valid C). (time passes) (array@45 is documented as a GDB CLI extension). Keeping the objective C .y separate from the C .y, I think, is a better long term strategy. While it will mean that someone needs to keep the two files in sync, it also means that the objective C, C and C++ parsers are guarenteed to not stomp on each others toes. Andrew