aboutsummaryrefslogtreecommitdiff
path: root/gdb/ada-exp.y
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2023-06-23 09:59:38 -0600
committerTom Tromey <tromey@adacore.com>2023-07-13 11:45:09 -0600
commit22f6f7979cbb2092db64896df33b02a146076ecb (patch)
treea8725581b0f9673ff29610a926f7d7287cf933af /gdb/ada-exp.y
parent1e5ae3d17f02bba07b07e1b6367563cf4d0eff99 (diff)
downloadgdb-22f6f7979cbb2092db64896df33b02a146076ecb.zip
gdb-22f6f7979cbb2092db64896df33b02a146076ecb.tar.gz
gdb-22f6f7979cbb2092db64896df33b02a146076ecb.tar.bz2
Implement 'Enum_Val and 'Enum_Rep
This patch implements the Ada 2022 attributes 'Enum_Val and 'Enum_Rep. Reviewed-By: Eli Zaretskii <eliz@gnu.org>
Diffstat (limited to 'gdb/ada-exp.y')
-rw-r--r--gdb/ada-exp.y14
1 files changed, 13 insertions, 1 deletions
diff --git a/gdb/ada-exp.y b/gdb/ada-exp.y
index 23aebf0..019ac85 100644
--- a/gdb/ada-exp.y
+++ b/gdb/ada-exp.y
@@ -474,7 +474,7 @@ make_tick_completer (struct stoken tok)
%right TICK_ACCESS TICK_ADDRESS TICK_FIRST TICK_LAST TICK_LENGTH
%right TICK_MAX TICK_MIN TICK_MODULUS
%right TICK_POS TICK_RANGE TICK_SIZE TICK_TAG TICK_VAL
-%right TICK_COMPLETE
+%right TICK_COMPLETE TICK_ENUM_REP TICK_ENUM_VAL
/* The following are right-associative only so that reductions at this
precedence have lower precedence than '.' and '('. The syntax still
forces a.b.c, e.g., to be LEFT-associated. */
@@ -864,6 +864,18 @@ primary : primary TICK_ACCESS
pstate->push_new<ada_atr_val_operation>
($1, std::move (arg));
}
+ | type_prefix TICK_ENUM_REP '(' exp ')'
+ {
+ operation_up arg = ada_pop (true, $1);
+ pstate->push_new<ada_atr_enum_rep_operation>
+ ($1, std::move (arg));
+ }
+ | type_prefix TICK_ENUM_VAL '(' exp ')'
+ {
+ operation_up arg = ada_pop (true, $1);
+ pstate->push_new<ada_atr_enum_val_operation>
+ ($1, std::move (arg));
+ }
| type_prefix TICK_MODULUS
{
struct type *type_arg = check_typedef ($1);