/* YACC parser for Ada expressions, for GDB.
- Copyright (C) 1986-2021 Free Software Foundation, Inc.
+ Copyright (C) 1986-2022 Free Software Foundation, Inc.
This file is part of GDB.
static struct parser_state *pstate = NULL;
-/* If expression is in the context of TYPE'(...), then TYPE, else
- * NULL. */
-static struct type *type_qualifier;
-
int yyparse (void);
static int yylex (void);
%type <bval> block
%type <lval> arglist tick_arglist
-%type <tval> save_qualifier
-
%token DOT_ALL
/* Special type cases, put in to allow the parser to distinguish different
}
;
-primary : var_or_type '\'' save_qualifier { type_qualifier = $1; }
- '(' exp ')'
+primary : var_or_type '\'' '(' exp ')'
{
if ($1 == NULL)
error (_("Type required for qualification"));
check_typedef ($1));
pstate->push_new<ada_qual_operation>
(std::move (arg), $1);
- type_qualifier = $3;
}
;
-save_qualifier : { $$ = type_qualifier; }
- ;
-
primary :
primary '(' simple_exp DOTDOT simple_exp ')'
{ ada_wrap3<ada_ternop_slice_operation> (); }
pstate = par_state;
lexer_init (yyin); /* (Re-)initialize lexer. */
- type_qualifier = NULL;
obstack_free (&temp_parse_space, NULL);
obstack_init (&temp_parse_space);
components.clear ();
}
/* Emit expression corresponding to the renamed object named
- * designated by RENAMED_ENTITY[0 .. RENAMED_ENTITY_LEN-1] in the
- * context of ORIG_LEFT_CONTEXT, to which is applied the operations
- * encoded by RENAMING_EXPR. MAX_DEPTH is the maximum number of
- * cascaded renamings to allow. If ORIG_LEFT_CONTEXT is null, it
- * defaults to the currently selected block. ORIG_SYMBOL is the
- * symbol that originally encoded the renaming. It is needed only
- * because its prefix also qualifies any index variables used to index
- * or slice an array. It should not be necessary once we go to the
- * new encoding entirely (FIXME pnh 7/20/2007). */
+ designated by RENAMED_ENTITY[0 .. RENAMED_ENTITY_LEN-1] in the
+ context of ORIG_LEFT_CONTEXT, to which is applied the operations
+ encoded by RENAMING_EXPR. MAX_DEPTH is the maximum number of
+ cascaded renamings to allow. If ORIG_LEFT_CONTEXT is null, it
+ defaults to the currently selected block. ORIG_SYMBOL is the
+ symbol that originally encoded the renaming. It is needed only
+ because its prefix also qualifies any index variables used to index
+ or slice an array. It should not be necessary once we go to the
+ new encoding entirely (FIXME pnh 7/20/2007). */
static void
write_object_renaming (struct parser_state *par_state,