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