Introduce ada_string_operation
[deliverable/binutils-gdb.git] / gdb / ada-exp.h
1 /* Definitions for Ada expressions
2
3 Copyright (C) 2020 Free Software Foundation, Inc.
4
5 This file is part of GDB.
6
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.
11
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.
16
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/>. */
19
20 #ifndef ADA_EXP_H
21 #define ADA_EXP_H
22
23 #include "expop.h"
24
25 namespace expr
26 {
27
28 /* In Ada, some generic operations must be wrapped with a handler that
29 handles some Ada-specific type conversions. */
30 class ada_wrapped_operation
31 : public tuple_holding_operation<operation_up>
32 {
33 public:
34
35 using tuple_holding_operation::tuple_holding_operation;
36
37 value *evaluate (struct type *expect_type,
38 struct expression *exp,
39 enum noside noside) override;
40
41 enum exp_opcode opcode () const override
42 { return std::get<0> (m_storage)->opcode (); }
43 };
44
45 /* An Ada string constant. */
46 class ada_string_operation
47 : public string_operation
48 {
49 public:
50
51 using string_operation::string_operation;
52
53 value *evaluate (struct type *expect_type,
54 struct expression *exp,
55 enum noside noside) override;
56 };
57
58 } /* namespace expr */
59
60 #endif /* ADA_EXP_H */
This page took 0.033116 seconds and 5 git commands to generate.