From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1139 invoked by alias); 7 Dec 2005 23:25:47 -0000 Received: (qmail 1130 invoked by uid 22791); 7 Dec 2005 23:25:46 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Wed, 07 Dec 2005 23:25:45 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1Ek8fN-0002Oi-DW; Wed, 07 Dec 2005 18:25:41 -0500 Date: Thu, 08 Dec 2005 10:33:00 -0000 From: Daniel Jacobowitz To: Wu Zhou Cc: gdb-patches@sources.redhat.com, Thomas.Koenig@online.de Subject: Re: [RFC]: Patch to support Fortran derived type - Revised Message-ID: <20051207232541.GB7483@nevyn.them.org> Mail-Followup-To: Wu Zhou , gdb-patches@sources.redhat.com, Thomas.Koenig@online.de References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.8i X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2005-12/txt/msg00142.txt.bz2 On Wed, Nov 16, 2005 at 03:20:18PM +0800, Wu Zhou wrote: > Hello all, > > I revised the patch to add derived type support. Now it can print > the nested type such like this: > > Type foo > int4 :: a > Type bar > real :: b > End Type bar :: x > End Type foo > > It could also handle the member access like q%x%b. So I think it is > better than before. Any more place is needed to be improved, please let > me know. Here is the patch: Hi Wu, sorry about the delay. Just a couple of small comments. First of all, I'd prefer not to approve this without documentation and a testcase. > 2005-11-16 Wu Zhou > > * f-exp.y: Symbol '%' is not used as modular operator in Fortran. > Delete this from Fortran expression. > It is now used by Fortran 95 to access the member of derived type. > Add this into Fortran expression. You want "is not used as the modulus operator" here, I believe. There's a "modular operator" also, which seems to be something complicated in operator theory - completely different. > +name : NAME > + { $$ = $1.stoken; } > + ; > + Why not just use name_not_typename instead of adding "name"? Also, the comments in name_not_typename don't apply here; you could also handle exp : exp % NAME_OR_INT as a name. But, I don't think that adds much value. The whole NAME_OR_INT thing seems like overkill. > + /* Starting from Fortran 90 standard, Fortran language began to support > + derived type. The type code is TYPE_CODE_STRUCT. */ /* Starting from the Fortran 90 standard, Fortran supports derived types. */ Two periods after period, please :-) I think you can skip mentioning TYPE_CODE_STRUCT, since it's the case label. > +print_equivalent_f77_float_type (int level, struct type *type, struct ui_file *stream) Needs to be wrapped. The rest looks fine. -- Daniel Jacobowitz CodeSourcery, LLC