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