| 1 | /* Ada language operator definitions for GDB, the GNU debugger. |
| 2 | |
| 3 | Copyright (C) 1992, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, |
| 4 | 2007, 2008, 2009 Free Software Foundation, Inc. |
| 5 | |
| 6 | This file is part of GDB. |
| 7 | |
| 8 | This program is free software; you can redistribute it and/or modify |
| 9 | it under the terms of the GNU General Public License as published by |
| 10 | the Free Software Foundation; either version 3 of the License, or |
| 11 | (at your option) any later version. |
| 12 | |
| 13 | This program is distributed in the hope that it will be useful, |
| 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | GNU General Public License for more details. |
| 17 | |
| 18 | You should have received a copy of the GNU General Public License |
| 19 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
| 20 | |
| 21 | /* X IN A'RANGE(N). N is an immediate operand, surrounded by |
| 22 | BINOP_IN_BOUNDS before and after. A is an array, X an index |
| 23 | value. Evaluates to true iff X is within range of the Nth |
| 24 | dimension (1-based) of A. (A multi-dimensional array |
| 25 | type is represented as array of array of ...) */ |
| 26 | BINOP_IN_BOUNDS = OP_EXTENDED0, |
| 27 | |
| 28 | /* X IN L .. U. True iff L <= X <= U. */ |
| 29 | TERNOP_IN_RANGE, |
| 30 | |
| 31 | /* Ada attributes ('Foo). */ |
| 32 | OP_ATR_FIRST, |
| 33 | OP_ATR_LAST, |
| 34 | OP_ATR_LENGTH, |
| 35 | OP_ATR_IMAGE, |
| 36 | OP_ATR_MAX, |
| 37 | OP_ATR_MIN, |
| 38 | OP_ATR_MODULUS, |
| 39 | OP_ATR_POS, |
| 40 | OP_ATR_SIZE, |
| 41 | OP_ATR_TAG, |
| 42 | OP_ATR_VAL, |
| 43 | |
| 44 | /* Ada type qualification. It is encoded as for UNOP_CAST, above, |
| 45 | and denotes the TYPE'(EXPR) construct. */ |
| 46 | UNOP_QUAL, |
| 47 | |
| 48 | /* X IN TYPE. The `TYPE' argument is immediate, with |
| 49 | UNOP_IN_RANGE before and after it. True iff X is a member of |
| 50 | type TYPE (typically a subrange). */ |
| 51 | UNOP_IN_RANGE, |
| 52 | |
| 53 | /* An aggregate. A single immediate operand, N>0, gives |
| 54 | the number of component specifications that follow. The |
| 55 | immediate operand is followed by a second OP_AGGREGATE. |
| 56 | Next come N component specifications. A component |
| 57 | specification is either an OP_OTHERS (others=>...), an |
| 58 | OP_CHOICES (for named associations), or other expression (for |
| 59 | positional aggregates only). Aggregates currently |
| 60 | occur only as the right sides of assignments. */ |
| 61 | OP_AGGREGATE, |
| 62 | |
| 63 | /* An others clause. Followed by a single expression. */ |
| 64 | OP_OTHERS, |
| 65 | |
| 66 | /* An aggregate component association. A single immediate operand, N, |
| 67 | gives the number of choices that follow. This is followed by a second |
| 68 | OP_CHOICES operator. Next come N operands, each of which is an |
| 69 | expression, an OP_DISCRETE_RANGE, or an OP_NAME---the latter |
| 70 | for a simple name that must be a record component name and does |
| 71 | not correspond to a single existing symbol. After the N choice |
| 72 | indicators comes an expression giving the value. |
| 73 | |
| 74 | In an aggregate such as (X => E1, ...), where X is a simple |
| 75 | name, X could syntactically be either a component_selector_name |
| 76 | or an expression used as a discrete_choice, depending on the |
| 77 | aggregate's type context. Since this is not known at parsing |
| 78 | time, we don't attempt to disambiguate X if it has multiple |
| 79 | definitions, but instead supply an OP_NAME. If X has a single |
| 80 | definition, we represent it with an OP_VAR_VALUE, even though |
| 81 | it may turn out to be within a record aggregate. Aggregate |
| 82 | evaluation can use either OP_NAMEs or OP_VAR_VALUEs to get a |
| 83 | record field name, and can evaluate OP_VAR_VALUE normally to |
| 84 | get its value as an expression. Unfortunately, we lose out in |
| 85 | cases where X has multiple meanings and is part of an array |
| 86 | aggregate. I hope these are not common enough to annoy users, |
| 87 | who can work around the problem in any case by putting |
| 88 | parentheses around X. */ |
| 89 | OP_CHOICES, |
| 90 | |
| 91 | /* A positional aggregate component association. The operator is |
| 92 | followed by a single integer indicating the position in the |
| 93 | aggregate (0-based), followed by a second OP_POSITIONAL. Next |
| 94 | follows a single expression giving the component value. */ |
| 95 | OP_POSITIONAL, |
| 96 | |
| 97 | /* A range of values. Followed by two expressions giving the |
| 98 | upper and lower bounds of the range. */ |
| 99 | OP_DISCRETE_RANGE, |
| 100 | |
| 101 | /* End marker */ |
| 102 | OP_ADA_LAST, |