aboutsummaryrefslogtreecommitdiff
path: root/gdb/f-exp.y
diff options
context:
space:
mode:
authorWu Zhou <woodzltc@cn.ibm.com>2006-02-24 07:26:10 +0000
committerWu Zhou <woodzltc@cn.ibm.com>2006-02-24 07:26:10 +0000
commit2a5e440cb420e37baa7e716febb0d48586e8f44b (patch)
treebf00c094d3a9129e7e15ff61bb9f12c03e67132a /gdb/f-exp.y
parent4e219700c3a6a15522ab94b42cc8f7160df9424d (diff)
* f-exp.y: Symbol '%' is not used as the modulus operator in
Fortran. Delete this from Fortran expression. It is now used by Fortran 90 and later to access the member of derived type. Add this into Fortran expression. * f-valprint.c (f_val_print): Add code to handle TYPE_CODE_STRUCT. Print each elements in the derived type. * f-typeprint.c (print_equivalent_f77_float_type): Add a parameter level into the function definition to do indented printing. And call fprintfi_filtered instead to do indented printing. (f_type_print_base): Replace fprintf_filtered with the indented version (fprintfi_filtered). (f_type_print_base): Call indented print_equivalent_f77_float_type. (f_type_print_base): Add code to handle TYPE_CODE_STRUCT. Print the definition of the derived type.
Diffstat (limited to 'gdb/f-exp.y')
-rw-r--r--gdb/f-exp.y20
1 files changed, 14 insertions, 6 deletions
diff --git a/gdb/f-exp.y b/gdb/f-exp.y
index f20a54f4bf..64ac9becf2 100644
--- a/gdb/f-exp.y
+++ b/gdb/f-exp.y
@@ -1,6 +1,6 @@
/* YACC parser for Fortran expressions, for GDB.
Copyright (C) 1986, 1989, 1990, 1991, 1993, 1994, 1995, 1996, 2000, 2001,
- 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+ 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
Contributed by Motorola. Adapted from the C parser by Farooq Butt
(fmbutt@engage.sps.mot.com).
@@ -178,6 +178,7 @@ static int parse_number (char *, int, int, YYSTYPE *);
%token <lval> BOOLEAN_LITERAL
%token <ssym> NAME
%token <tsym> TYPENAME
+%type <sval> name
%type <ssym> name_not_typename
/* A NAME_OR_INT is a symbol which is not known in the symbol table,
@@ -217,8 +218,9 @@ static int parse_number (char *, int, int, YYSTYPE *);
%left LSH RSH
%left '@'
%left '+' '-'
-%left '*' '/' '%'
+%left '*' '/'
%right STARSTAR
+%right '%'
%right UNARY
%right '('
@@ -332,6 +334,12 @@ exp : '(' type ')' exp %prec UNARY
write_exp_elt_opcode (UNOP_CAST); }
;
+exp : exp '%' name
+ { write_exp_elt_opcode (STRUCTOP_STRUCT);
+ write_exp_string ($3);
+ write_exp_elt_opcode (STRUCTOP_STRUCT); }
+ ;
+
/* Binary operators in order of decreasing precedence. */
exp : exp '@' exp
@@ -350,10 +358,6 @@ exp : exp '/' exp
{ write_exp_elt_opcode (BINOP_DIV); }
;
-exp : exp '%' exp
- { write_exp_elt_opcode (BINOP_REM); }
- ;
-
exp : exp '+' exp
{ write_exp_elt_opcode (BINOP_ADD); }
;
@@ -635,6 +639,10 @@ nonempty_typelist
}
;
+name : NAME
+ { $$ = $1.stoken; }
+ ;
+
name_not_typename : NAME
/* These would be useful if name_not_typename was useful, but it is just
a fake for "variable", so these cause reduce/reduce conflicts because