This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC]: Patch to support Fortran derived type - Revised


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  <woodzltc@cn.ibm.com>
> 
> 	* 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]