1 /* Definitions for Fortran expressions
3 Copyright (C) 2020 Free Software Foundation, Inc.
5 This file is part of GDB.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
25 extern struct value
*eval_op_f_abs (struct type
*expect_type
,
26 struct expression
*exp
,
28 enum exp_opcode opcode
,
30 extern struct value
*eval_op_f_mod (struct type
*expect_type
,
31 struct expression
*exp
,
33 enum exp_opcode opcode
,
34 struct value
*arg1
, struct value
*arg2
);
35 extern struct value
*eval_op_f_ceil (struct type
*expect_type
,
36 struct expression
*exp
,
38 enum exp_opcode opcode
,
40 extern struct value
*eval_op_f_floor (struct type
*expect_type
,
41 struct expression
*exp
,
43 enum exp_opcode opcode
,
45 extern struct value
*eval_op_f_modulo (struct type
*expect_type
,
46 struct expression
*exp
,
48 enum exp_opcode opcode
,
49 struct value
*arg1
, struct value
*arg2
);
50 extern struct value
*eval_op_f_cmplx (struct type
*expect_type
,
51 struct expression
*exp
,
53 enum exp_opcode opcode
,
54 struct value
*arg1
, struct value
*arg2
);
55 extern struct value
*eval_op_f_kind (struct type
*expect_type
,
56 struct expression
*exp
,
58 enum exp_opcode opcode
,
64 using fortran_abs_operation
= unop_operation
<UNOP_ABS
, eval_op_f_abs
>;
65 using fortran_ceil_operation
= unop_operation
<UNOP_FORTRAN_CEILING
,
67 using fortran_floor_operation
= unop_operation
<UNOP_FORTRAN_FLOOR
,
69 using fortran_kind_operation
= unop_operation
<UNOP_FORTRAN_KIND
,
72 using fortran_mod_operation
= binop_operation
<BINOP_MOD
, eval_op_f_mod
>;
73 using fortran_modulo_operation
= binop_operation
<BINOP_FORTRAN_MODULO
,
76 /* The Fortran "complex" operation. */
77 class fortran_cmplx_operation
78 : public tuple_holding_operation
<operation_up
, operation_up
>
82 using tuple_holding_operation::tuple_holding_operation
;
84 value
*evaluate (struct type
*expect_type
,
85 struct expression
*exp
,
86 enum noside noside
) override
88 value
*arg1
= std::get
<0> (m_storage
)->evaluate (nullptr, exp
, noside
);
89 value
*arg2
= std::get
<1> (m_storage
)->evaluate (value_type (arg1
),
91 return eval_op_f_cmplx (expect_type
, exp
, noside
, BINOP_FORTRAN_CMPLX
,
95 enum exp_opcode
opcode () const override
96 { return BINOP_FORTRAN_CMPLX
; }
99 } /* namespace expr */
101 #endif /* FORTRAN_EXP_H */
This page took 0.032586 seconds and 5 git commands to generate.