Tidy dwarf1 cached section contents
[binutils-gdb.git] / gdb / ada-exp.h
1 /* Definitions for Ada expressions
2
3 Copyright (C) 2020-2023 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 extern struct value *ada_unop_neg (struct type *expect_type,
26 struct expression *exp,
27 enum noside noside, enum exp_opcode op,
28 struct value *arg1);
29 extern struct value *ada_atr_tag (struct type *expect_type,
30 struct expression *exp,
31 enum noside noside, enum exp_opcode op,
32 struct value *arg1);
33 extern struct value *ada_atr_size (struct type *expect_type,
34 struct expression *exp,
35 enum noside noside, enum exp_opcode op,
36 struct value *arg1);
37 extern struct value *ada_abs (struct type *expect_type,
38 struct expression *exp,
39 enum noside noside, enum exp_opcode op,
40 struct value *arg1);
41 extern struct value *ada_unop_in_range (struct type *expect_type,
42 struct expression *exp,
43 enum noside noside, enum exp_opcode op,
44 struct value *arg1, struct type *type);
45 extern struct value *ada_mult_binop (struct type *expect_type,
46 struct expression *exp,
47 enum noside noside, enum exp_opcode op,
48 struct value *arg1, struct value *arg2);
49 extern struct value *ada_equal_binop (struct type *expect_type,
50 struct expression *exp,
51 enum noside noside, enum exp_opcode op,
52 struct value *arg1, struct value *arg2);
53 extern struct value *ada_ternop_slice (struct expression *exp,
54 enum noside noside,
55 struct value *array,
56 struct value *low_bound_val,
57 struct value *high_bound_val);
58 extern struct value *ada_binop_in_bounds (struct expression *exp,
59 enum noside noside,
60 struct value *arg1,
61 struct value *arg2,
62 int n);
63 extern struct value *ada_binop_minmax (struct type *expect_type,
64 struct expression *exp,
65 enum noside noside, enum exp_opcode op,
66 struct value *arg1,
67 struct value *arg2);
68 extern struct value *ada_pos_atr (struct type *expect_type,
69 struct expression *exp,
70 enum noside noside, enum exp_opcode op,
71 struct value *arg);
72 extern struct value *ada_val_atr (enum noside noside, struct type *type,
73 struct value *arg);
74 extern struct value *ada_binop_exp (struct type *expect_type,
75 struct expression *exp,
76 enum noside noside, enum exp_opcode op,
77 struct value *arg1, struct value *arg2);
78
79 namespace expr
80 {
81
82 /* The base class for Ada type resolution. Ada operations that want
83 to participate in resolution implement this interface. */
84 struct ada_resolvable
85 {
86 /* Resolve this object. EXP is the expression being resolved.
87 DEPROCEDURE_P is true if a symbol that refers to a zero-argument
88 function may be turned into a function call. PARSE_COMPLETION
89 and TRACKER are passed in from the parser context. CONTEXT_TYPE
90 is the expected type of the expression, or nullptr if none is
91 known. This method should return true if the operation should be
92 replaced by a function call with this object as the callee. */
93 virtual bool resolve (struct expression *exp,
94 bool deprocedure_p,
95 bool parse_completion,
96 innermost_block_tracker *tracker,
97 struct type *context_type) = 0;
98
99 /* Possibly replace this object with some other expression object.
100 This is like 'resolve', but can return a replacement.
101
102 The default implementation calls 'resolve' and wraps this object
103 in a function call if that call returns true. OWNER is a
104 reference to the unique pointer that owns the 'this'; it can be
105 'move'd from to construct the replacement.
106
107 This should either return a new object, or OWNER -- never
108 nullptr. */
109
110 virtual operation_up replace (operation_up &&owner,
111 struct expression *exp,
112 bool deprocedure_p,
113 bool parse_completion,
114 innermost_block_tracker *tracker,
115 struct type *context_type);
116 };
117
118 /* In Ada, some generic operations must be wrapped with a handler that
119 handles some Ada-specific type conversions. */
120 class ada_wrapped_operation
121 : public tuple_holding_operation<operation_up>
122 {
123 public:
124
125 using tuple_holding_operation::tuple_holding_operation;
126
127 value *evaluate (struct type *expect_type,
128 struct expression *exp,
129 enum noside noside) override;
130
131 enum exp_opcode opcode () const override
132 { return std::get<0> (m_storage)->opcode (); }
133
134 protected:
135
136 void do_generate_ax (struct expression *exp,
137 struct agent_expr *ax,
138 struct axs_value *value,
139 struct type *cast_type)
140 override;
141 };
142
143 /* An Ada string constant. */
144 class ada_string_operation
145 : public string_operation
146 {
147 public:
148
149 using string_operation::string_operation;
150
151 /* Return the underlying string. */
152 const char *get_name () const
153 {
154 return std::get<0> (m_storage).c_str ();
155 }
156
157 value *evaluate (struct type *expect_type,
158 struct expression *exp,
159 enum noside noside) override;
160 };
161
162 /* The Ada TYPE'(EXP) construct. */
163 class ada_qual_operation
164 : public tuple_holding_operation<operation_up, struct type *>
165 {
166 public:
167
168 using tuple_holding_operation::tuple_holding_operation;
169
170 value *evaluate (struct type *expect_type,
171 struct expression *exp,
172 enum noside noside) override;
173
174 enum exp_opcode opcode () const override
175 { return UNOP_QUAL; }
176 };
177
178 /* Ternary in-range operator. */
179 class ada_ternop_range_operation
180 : public tuple_holding_operation<operation_up, operation_up, operation_up>
181 {
182 public:
183
184 using tuple_holding_operation::tuple_holding_operation;
185
186 value *evaluate (struct type *expect_type,
187 struct expression *exp,
188 enum noside noside) override;
189
190 enum exp_opcode opcode () const override
191 { return TERNOP_IN_RANGE; }
192 };
193
194 using ada_neg_operation = unop_operation<UNOP_NEG, ada_unop_neg>;
195 using ada_atr_tag_operation = unop_operation<OP_ATR_TAG, ada_atr_tag>;
196 using ada_atr_size_operation = unop_operation<OP_ATR_SIZE, ada_atr_size>;
197 using ada_abs_operation = unop_operation<UNOP_ABS, ada_abs>;
198 using ada_pos_operation = unop_operation<OP_ATR_POS, ada_pos_atr>;
199
200 /* The in-range operation, given a type. */
201 class ada_unop_range_operation
202 : public tuple_holding_operation<operation_up, struct type *>
203 {
204 public:
205
206 using tuple_holding_operation::tuple_holding_operation;
207
208 value *evaluate (struct type *expect_type,
209 struct expression *exp,
210 enum noside noside) override
211 {
212 value *val = std::get<0> (m_storage)->evaluate (nullptr, exp, noside);
213 return ada_unop_in_range (expect_type, exp, noside, UNOP_IN_RANGE,
214 val, std::get<1> (m_storage));
215 }
216
217 enum exp_opcode opcode () const override
218 { return UNOP_IN_RANGE; }
219 };
220
221 /* The Ada + and - operators. */
222 class ada_binop_addsub_operation
223 : public tuple_holding_operation<enum exp_opcode, operation_up, operation_up>
224 {
225 public:
226
227 using tuple_holding_operation::tuple_holding_operation;
228
229 value *evaluate (struct type *expect_type,
230 struct expression *exp,
231 enum noside noside) override;
232
233 enum exp_opcode opcode () const override
234 { return std::get<0> (m_storage); }
235 };
236
237 using ada_binop_mul_operation = binop_operation<BINOP_MUL, ada_mult_binop>;
238 using ada_binop_div_operation = binop_operation<BINOP_DIV, ada_mult_binop>;
239 using ada_binop_rem_operation = binop_operation<BINOP_REM, ada_mult_binop>;
240 using ada_binop_mod_operation = binop_operation<BINOP_MOD, ada_mult_binop>;
241
242 using ada_binop_min_operation = binop_operation<BINOP_MIN, ada_binop_minmax>;
243 using ada_binop_max_operation = binop_operation<BINOP_MAX, ada_binop_minmax>;
244
245 using ada_binop_exp_operation = binop_operation<BINOP_EXP, ada_binop_exp>;
246
247 /* Implement the equal and not-equal operations for Ada. */
248 class ada_binop_equal_operation
249 : public tuple_holding_operation<enum exp_opcode, operation_up, operation_up>
250 {
251 public:
252
253 using tuple_holding_operation::tuple_holding_operation;
254
255 value *evaluate (struct type *expect_type,
256 struct expression *exp,
257 enum noside noside) override
258 {
259 value *arg1 = std::get<1> (m_storage)->evaluate (nullptr, exp, noside);
260 value *arg2 = std::get<2> (m_storage)->evaluate (arg1->type (),
261 exp, noside);
262 return ada_equal_binop (expect_type, exp, noside, std::get<0> (m_storage),
263 arg1, arg2);
264 }
265
266 void do_generate_ax (struct expression *exp,
267 struct agent_expr *ax,
268 struct axs_value *value,
269 struct type *cast_type)
270 override
271 {
272 gen_expr_binop (exp, opcode (),
273 std::get<1> (this->m_storage).get (),
274 std::get<2> (this->m_storage).get (),
275 ax, value);
276 }
277
278 enum exp_opcode opcode () const override
279 { return std::get<0> (m_storage); }
280 };
281
282 /* Bitwise operators for Ada. */
283 template<enum exp_opcode OP>
284 class ada_bitwise_operation
285 : public maybe_constant_operation<operation_up, operation_up>
286 {
287 public:
288
289 using maybe_constant_operation::maybe_constant_operation;
290
291 value *evaluate (struct type *expect_type,
292 struct expression *exp,
293 enum noside noside) override
294 {
295 value *lhs = std::get<0> (m_storage)->evaluate (nullptr, exp, noside);
296 value *rhs = std::get<1> (m_storage)->evaluate (nullptr, exp, noside);
297 value *result = eval_op_binary (expect_type, exp, noside, OP, lhs, rhs);
298 return value_cast (lhs->type (), result);
299 }
300
301 enum exp_opcode opcode () const override
302 { return OP; }
303 };
304
305 using ada_bitwise_and_operation = ada_bitwise_operation<BINOP_BITWISE_AND>;
306 using ada_bitwise_ior_operation = ada_bitwise_operation<BINOP_BITWISE_IOR>;
307 using ada_bitwise_xor_operation = ada_bitwise_operation<BINOP_BITWISE_XOR>;
308
309 /* Ada array- or string-slice operation. */
310 class ada_ternop_slice_operation
311 : public maybe_constant_operation<operation_up, operation_up, operation_up>,
312 public ada_resolvable
313 {
314 public:
315
316 using maybe_constant_operation::maybe_constant_operation;
317
318 value *evaluate (struct type *expect_type,
319 struct expression *exp,
320 enum noside noside) override
321 {
322 value *array = std::get<0> (m_storage)->evaluate (nullptr, exp, noside);
323 value *low = std::get<1> (m_storage)->evaluate (nullptr, exp, noside);
324 value *high = std::get<2> (m_storage)->evaluate (nullptr, exp, noside);
325 return ada_ternop_slice (exp, noside, array, low, high);
326 }
327
328 enum exp_opcode opcode () const override
329 { return TERNOP_SLICE; }
330
331 bool resolve (struct expression *exp,
332 bool deprocedure_p,
333 bool parse_completion,
334 innermost_block_tracker *tracker,
335 struct type *context_type) override;
336 };
337
338 /* Implement BINOP_IN_BOUNDS for Ada. */
339 class ada_binop_in_bounds_operation
340 : public maybe_constant_operation<operation_up, operation_up, int>
341 {
342 public:
343
344 using maybe_constant_operation::maybe_constant_operation;
345
346 value *evaluate (struct type *expect_type,
347 struct expression *exp,
348 enum noside noside) override
349 {
350 value *arg1 = std::get<0> (m_storage)->evaluate (nullptr, exp, noside);
351 value *arg2 = std::get<1> (m_storage)->evaluate (nullptr, exp, noside);
352 return ada_binop_in_bounds (exp, noside, arg1, arg2,
353 std::get<2> (m_storage));
354 }
355
356 enum exp_opcode opcode () const override
357 { return BINOP_IN_BOUNDS; }
358 };
359
360 /* Implement several unary Ada OP_ATR_* operations. */
361 class ada_unop_atr_operation
362 : public maybe_constant_operation<operation_up, enum exp_opcode, int>
363 {
364 public:
365
366 using maybe_constant_operation::maybe_constant_operation;
367
368 value *evaluate (struct type *expect_type,
369 struct expression *exp,
370 enum noside noside) override;
371
372 enum exp_opcode opcode () const override
373 { return std::get<1> (m_storage); }
374 };
375
376 /* Variant of var_value_operation for Ada. */
377 class ada_var_value_operation
378 : public var_value_operation, public ada_resolvable
379 {
380 public:
381
382 using var_value_operation::var_value_operation;
383
384 value *evaluate (struct type *expect_type,
385 struct expression *exp,
386 enum noside noside) override;
387
388 value *evaluate_for_cast (struct type *expect_type,
389 struct expression *exp,
390 enum noside noside) override;
391
392 const block *get_block () const
393 { return std::get<0> (m_storage).block; }
394
395 bool resolve (struct expression *exp,
396 bool deprocedure_p,
397 bool parse_completion,
398 innermost_block_tracker *tracker,
399 struct type *context_type) override;
400
401 protected:
402
403 void do_generate_ax (struct expression *exp,
404 struct agent_expr *ax,
405 struct axs_value *value,
406 struct type *cast_type)
407 override;
408 };
409
410 /* Variant of var_msym_value_operation for Ada. */
411 class ada_var_msym_value_operation
412 : public var_msym_value_operation
413 {
414 public:
415
416 using var_msym_value_operation::var_msym_value_operation;
417
418 value *evaluate_for_cast (struct type *expect_type,
419 struct expression *exp,
420 enum noside noside) override;
421
422 protected:
423
424 using operation::do_generate_ax;
425 };
426
427 /* Implement the Ada 'val attribute. */
428 class ada_atr_val_operation
429 : public tuple_holding_operation<struct type *, operation_up>
430 {
431 public:
432
433 using tuple_holding_operation::tuple_holding_operation;
434
435 value *evaluate (struct type *expect_type,
436 struct expression *exp,
437 enum noside noside) override;
438
439 enum exp_opcode opcode () const override
440 { return OP_ATR_VAL; }
441 };
442
443 /* The indirection operator for Ada. */
444 class ada_unop_ind_operation
445 : public unop_ind_base_operation
446 {
447 public:
448
449 using unop_ind_base_operation::unop_ind_base_operation;
450
451 value *evaluate (struct type *expect_type,
452 struct expression *exp,
453 enum noside noside) override;
454 };
455
456 /* Implement STRUCTOP_STRUCT for Ada. */
457 class ada_structop_operation
458 : public structop_base_operation
459 {
460 public:
461
462 using structop_base_operation::structop_base_operation;
463
464 value *evaluate (struct type *expect_type,
465 struct expression *exp,
466 enum noside noside) override;
467
468 enum exp_opcode opcode () const override
469 { return STRUCTOP_STRUCT; }
470
471 /* Set the completion prefix. */
472 void set_prefix (std::string &&prefix)
473 {
474 m_prefix = std::move (prefix);
475 }
476
477 bool complete (struct expression *exp, completion_tracker &tracker) override
478 {
479 return structop_base_operation::complete (exp, tracker, m_prefix.c_str ());
480 }
481
482 void dump (struct ui_file *stream, int depth) const override
483 {
484 structop_base_operation::dump (stream, depth);
485 dump_for_expression (stream, depth + 1, m_prefix);
486 }
487
488 private:
489
490 /* We may need to provide a prefix to field name completion. See
491 ada-exp.y:find_completion_bounds for details. */
492 std::string m_prefix;
493 };
494
495 /* Function calls for Ada. */
496 class ada_funcall_operation
497 : public tuple_holding_operation<operation_up, std::vector<operation_up>>,
498 public ada_resolvable
499 {
500 public:
501
502 using tuple_holding_operation::tuple_holding_operation;
503
504 value *evaluate (struct type *expect_type,
505 struct expression *exp,
506 enum noside noside) override;
507
508 bool resolve (struct expression *exp,
509 bool deprocedure_p,
510 bool parse_completion,
511 innermost_block_tracker *tracker,
512 struct type *context_type) override;
513
514 enum exp_opcode opcode () const override
515 { return OP_FUNCALL; }
516 };
517
518 /* An Ada assignment operation. */
519 class ada_assign_operation
520 : public assign_operation
521 {
522 public:
523
524 using assign_operation::assign_operation;
525
526 value *evaluate (struct type *expect_type,
527 struct expression *exp,
528 enum noside noside) override;
529
530 enum exp_opcode opcode () const override
531 { return BINOP_ASSIGN; }
532 };
533
534 /* This abstract class represents a single component in an Ada
535 aggregate assignment. */
536 class ada_component
537 {
538 public:
539
540 /* Assign to LHS, which is part of CONTAINER. EXP is the expression
541 being evaluated. INDICES, LOW, and HIGH indicate which
542 sub-components have already been assigned; INDICES should be
543 updated by this call. */
544 virtual void assign (struct value *container,
545 struct value *lhs, struct expression *exp,
546 std::vector<LONGEST> &indices,
547 LONGEST low, LONGEST high) = 0;
548
549 /* Same as operation::uses_objfile. */
550 virtual bool uses_objfile (struct objfile *objfile) = 0;
551
552 /* Same as operation::dump. */
553 virtual void dump (ui_file *stream, int depth) = 0;
554
555 virtual ~ada_component () = default;
556
557 protected:
558
559 ada_component () = default;
560 DISABLE_COPY_AND_ASSIGN (ada_component);
561 };
562
563 /* Unique pointer specialization for Ada assignment components. */
564 typedef std::unique_ptr<ada_component> ada_component_up;
565
566 /* An operation that holds a single component. */
567 class ada_aggregate_operation
568 : public tuple_holding_operation<ada_component_up>
569 {
570 public:
571
572 using tuple_holding_operation::tuple_holding_operation;
573
574 /* Assuming that LHS represents an lvalue having a record or array
575 type, evaluate an assignment of this aggregate's value to LHS.
576 CONTAINER is an lvalue containing LHS (possibly LHS itself).
577 Does not modify the inferior's memory, nor does it modify the
578 contents of LHS (unless == CONTAINER). Returns the modified
579 CONTAINER. */
580
581 value *assign_aggregate (struct value *container,
582 struct value *lhs,
583 struct expression *exp);
584
585 value *evaluate (struct type *expect_type,
586 struct expression *exp,
587 enum noside noside) override
588 {
589 error (_("Aggregates only allowed on the right of an assignment"));
590 }
591
592 enum exp_opcode opcode () const override
593 { return OP_AGGREGATE; }
594 };
595
596 /* A component holding a vector of other components to assign. */
597 class ada_aggregate_component : public ada_component
598 {
599 public:
600
601 explicit ada_aggregate_component (std::vector<ada_component_up> &&components)
602 : m_components (std::move (components))
603 {
604 }
605
606 void assign (struct value *container,
607 struct value *lhs, struct expression *exp,
608 std::vector<LONGEST> &indices,
609 LONGEST low, LONGEST high) override;
610
611 bool uses_objfile (struct objfile *objfile) override;
612
613 void dump (ui_file *stream, int depth) override;
614
615 private:
616
617 std::vector<ada_component_up> m_components;
618 };
619
620 /* A component that assigns according to a provided index (which is
621 relative to the "low" value). */
622 class ada_positional_component : public ada_component
623 {
624 public:
625
626 ada_positional_component (int index, operation_up &&op)
627 : m_index (index),
628 m_op (std::move (op))
629 {
630 }
631
632 void assign (struct value *container,
633 struct value *lhs, struct expression *exp,
634 std::vector<LONGEST> &indices,
635 LONGEST low, LONGEST high) override;
636
637 bool uses_objfile (struct objfile *objfile) override;
638
639 void dump (ui_file *stream, int depth) override;
640
641 private:
642
643 int m_index;
644 operation_up m_op;
645 };
646
647 /* A component which handles an "others" clause. */
648 class ada_others_component : public ada_component
649 {
650 public:
651
652 explicit ada_others_component (operation_up &&op)
653 : m_op (std::move (op))
654 {
655 }
656
657 void assign (struct value *container,
658 struct value *lhs, struct expression *exp,
659 std::vector<LONGEST> &indices,
660 LONGEST low, LONGEST high) override;
661
662 bool uses_objfile (struct objfile *objfile) override;
663
664 void dump (ui_file *stream, int depth) override;
665
666 private:
667
668 operation_up m_op;
669 };
670
671 /* An interface that represents an association that is used in
672 aggregate assignment. */
673 class ada_association
674 {
675 public:
676
677 /* Like ada_component::assign, but takes an operation as a
678 parameter. The operation is evaluated and then assigned into LHS
679 according to the rules of the concrete implementation. */
680 virtual void assign (struct value *container,
681 struct value *lhs,
682 struct expression *exp,
683 std::vector<LONGEST> &indices,
684 LONGEST low, LONGEST high,
685 operation_up &op) = 0;
686
687 /* Same as operation::uses_objfile. */
688 virtual bool uses_objfile (struct objfile *objfile) = 0;
689
690 /* Same as operation::dump. */
691 virtual void dump (ui_file *stream, int depth) = 0;
692
693 virtual ~ada_association () = default;
694
695 protected:
696
697 ada_association () = default;
698 DISABLE_COPY_AND_ASSIGN (ada_association);
699 };
700
701 /* Unique pointer specialization for Ada assignment associations. */
702 typedef std::unique_ptr<ada_association> ada_association_up;
703
704 /* A component that holds a vector of associations and an operation.
705 The operation is re-evaluated for each choice. */
706 class ada_choices_component : public ada_component
707 {
708 public:
709
710 explicit ada_choices_component (operation_up &&op)
711 : m_op (std::move (op))
712 {
713 }
714
715 /* Set the vector of associations. This is done separately from the
716 constructor because it was simpler for the implementation of the
717 parser. */
718 void set_associations (std::vector<ada_association_up> &&assoc)
719 {
720 m_assocs = std::move (assoc);
721 }
722
723 void assign (struct value *container,
724 struct value *lhs, struct expression *exp,
725 std::vector<LONGEST> &indices,
726 LONGEST low, LONGEST high) override;
727
728 bool uses_objfile (struct objfile *objfile) override;
729
730 void dump (ui_file *stream, int depth) override;
731
732 private:
733
734 std::vector<ada_association_up> m_assocs;
735 operation_up m_op;
736 };
737
738 /* An association that uses a discrete range. */
739 class ada_discrete_range_association : public ada_association
740 {
741 public:
742
743 ada_discrete_range_association (operation_up &&low, operation_up &&high)
744 : m_low (std::move (low)),
745 m_high (std::move (high))
746 {
747 }
748
749 void assign (struct value *container,
750 struct value *lhs, struct expression *exp,
751 std::vector<LONGEST> &indices,
752 LONGEST low, LONGEST high,
753 operation_up &op) override;
754
755 bool uses_objfile (struct objfile *objfile) override;
756
757 void dump (ui_file *stream, int depth) override;
758
759 private:
760
761 operation_up m_low;
762 operation_up m_high;
763 };
764
765 /* An association that uses a name. The name may be an expression
766 that evaluates to an integer (for arrays), or an Ada string or
767 variable value operation. */
768 class ada_name_association : public ada_association
769 {
770 public:
771
772 explicit ada_name_association (operation_up val)
773 : m_val (std::move (val))
774 {
775 }
776
777 void assign (struct value *container,
778 struct value *lhs, struct expression *exp,
779 std::vector<LONGEST> &indices,
780 LONGEST low, LONGEST high,
781 operation_up &op) override;
782
783 bool uses_objfile (struct objfile *objfile) override;
784
785 void dump (ui_file *stream, int depth) override;
786
787 private:
788
789 operation_up m_val;
790 };
791
792 /* A character constant expression. This is a separate operation so
793 that it can participate in resolution, so that TYPE'(CST) can
794 work correctly for enums with character enumerators. */
795 class ada_char_operation : public long_const_operation,
796 public ada_resolvable
797 {
798 public:
799
800 using long_const_operation::long_const_operation;
801
802 bool resolve (struct expression *exp,
803 bool deprocedure_p,
804 bool parse_completion,
805 innermost_block_tracker *tracker,
806 struct type *context_type) override
807 {
808 /* This should never be called, because this class also implements
809 'replace'. */
810 gdb_assert_not_reached ("unexpected call");
811 }
812
813 operation_up replace (operation_up &&owner,
814 struct expression *exp,
815 bool deprocedure_p,
816 bool parse_completion,
817 innermost_block_tracker *tracker,
818 struct type *context_type) override;
819
820 value *evaluate (struct type *expect_type,
821 struct expression *exp,
822 enum noside noside) override;
823 };
824
825 class ada_concat_operation : public concat_operation
826 {
827 public:
828
829 using concat_operation::concat_operation;
830
831 value *evaluate (struct type *expect_type,
832 struct expression *exp,
833 enum noside noside) override;
834 };
835
836 } /* namespace expr */
837
838 #endif /* ADA_EXP_H */