aboutsummaryrefslogtreecommitdiff
path: root/gdb/f-exp.y
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/f-exp.y')
-rw-r--r--gdb/f-exp.y18
1 files changed, 18 insertions, 0 deletions
diff --git a/gdb/f-exp.y b/gdb/f-exp.y
index 92a70b4..00f0df3 100644
--- a/gdb/f-exp.y
+++ b/gdb/f-exp.y
@@ -178,6 +178,7 @@ static int parse_number (struct parser_state *, const char *, int,
%token <opcode> ASSIGN_MODIFY
%token <opcode> UNOP_INTRINSIC BINOP_INTRINSIC
+%token <opcode> UNOP_OR_BINOP_INTRINSIC
%left ','
%left ABOVE_COMMA
@@ -246,6 +247,21 @@ exp : KIND '(' exp ')' %prec UNARY
{ write_exp_elt_opcode (pstate, UNOP_FORTRAN_KIND); }
;
+exp : UNOP_OR_BINOP_INTRINSIC '('
+ { pstate->start_arglist (); }
+ one_or_two_args ')'
+ { write_exp_elt_opcode (pstate, $1);
+ write_exp_elt_longcst (pstate, pstate->end_arglist ());
+ write_exp_elt_opcode (pstate, $1); }
+ ;
+
+one_or_two_args
+ : exp
+ { pstate->arglist_len = 1; }
+ | exp ',' exp
+ { pstate->arglist_len = 2; }
+ ;
+
/* No more explicit array operators, we treat everything in F77 as
a function call. The disambiguation as to whether we are
doing a subscript operation or a function call is done
@@ -1028,6 +1044,8 @@ static const struct token f77_keywords[] =
{ "ceiling", UNOP_INTRINSIC, UNOP_FORTRAN_CEILING, false },
{ "modulo", BINOP_INTRINSIC, BINOP_FORTRAN_MODULO, false },
{ "cmplx", BINOP_INTRINSIC, BINOP_FORTRAN_CMPLX, false },
+ { "lbound", UNOP_OR_BINOP_INTRINSIC, FORTRAN_LBOUND, false },
+ { "ubound", UNOP_OR_BINOP_INTRINSIC, FORTRAN_UBOUND, false },
};
/* Implementation of a dynamically expandable buffer for processing input