GDB (xrefs)
Loading...
Searching...
No Matches
ada-exp.c
Go to the documentation of this file.
1/* A Bison parser, made by GNU Bison 3.8.2. */
2
3/* Bison implementation for Yacc-like parsers in C
4
5 Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
6 Inc.
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 <https://www.gnu.org/licenses/>. */
20
21/* As a special exception, you may create a larger work that contains
22 part or all of the Bison parser skeleton and distribute that work
23 under terms of your choice, so long as that work isn't itself a
24 parser generator using the skeleton or a modified version thereof
25 as a parser skeleton. Alternatively, if you modify or redistribute
26 the parser skeleton itself, you may (at your option) remove this
27 special exception, which will cause the skeleton and the resulting
28 Bison output files to be licensed under the GNU General Public
29 License without this special exception.
30
31 This special exception was added by the Free Software Foundation in
32 version 2.2 of Bison. */
33
34/* C LALR(1) parser skeleton written by Richard Stallman, by
35 simplifying the original so-called "semantic" parser. */
36
37/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
38 especially those whose name start with YY_ or yy_. They are
39 private implementation details that can be changed or removed. */
40
41/* All symbols defined below should begin with yy or YY, to avoid
42 infringing on user name space. This should be done even for local
43 variables, as they might otherwise be expanded by user macros.
44 There are some unavoidable exceptions within include files to
45 define necessary library symbols; they are noted "INFRINGES ON
46 USER NAME SPACE" below. */
47
48/* Identify Bison output, and Bison version. */
49#define YYBISON 30802
50
51/* Bison version string. */
52#define YYBISON_VERSION "3.8.2"
53
54/* Skeleton name. */
55#define YYSKELETON_NAME "yacc.c"
56
57/* Pure parsers. */
58#define YYPURE 0
59
60/* Push parsers. */
61#define YYPUSH 0
62
63/* Pull parsers. */
64#define YYPULL 1
65
66
67
68
69/* First part of user prologue. */
70#line 36 "ada-exp.y"
71
72
73#include "defs.h"
74#include <ctype.h>
75#include "expression.h"
76#include "value.h"
77#include "parser-defs.h"
78#include "language.h"
79#include "ada-lang.h"
80#include "frame.h"
81#include "block.h"
82#include "ada-exp.h"
83
84#define parse_type(ps) builtin_type (ps->gdbarch ())
85
86/* Remap normal yacc parser interface names (yyparse, yylex, yyerror,
87 etc). */
88#define GDB_YY_REMAP_PREFIX ada_
89#include "yy-remap.h"
90
91struct name_info {
92 struct symbol *sym;
94 const struct block *block;
95 struct stoken stoken;
96};
97
98/* The state of the parser, used internally when we are parsing the
99 expression. */
100
101static struct parser_state *pstate = NULL;
102
103/* The original expression string. */
104static const char *original_expr;
105
106/* We don't have a good way to manage non-POD data in Yacc, so store
107 values here. The storage here is only valid for the duration of
108 the parse. */
109static std::vector<std::unique_ptr<gdb_mpz>> int_storage;
110
111int yyparse (void);
112
113static int yylex (void);
114
115static void yyerror (const char *);
116
117static void write_int (struct parser_state *, LONGEST, struct type *);
118
119static void write_object_renaming (struct parser_state *,
120 const struct block *, const char *, int,
121 const char *, int);
122
123static struct type* write_var_or_type (struct parser_state *,
124 const struct block *, struct stoken);
125static struct type *write_var_or_type_completion (struct parser_state *,
126 const struct block *,
127 struct stoken);
128
129static void write_name_assoc (struct parser_state *, struct stoken);
130
131static const struct block *block_lookup (const struct block *, const char *);
132
133static void write_ambiguous_var (struct parser_state *,
134 const struct block *, const char *, int);
135
136static struct type *type_for_char (struct parser_state *, ULONGEST);
137
138static struct type *type_system_address (struct parser_state *);
139
140static std::string find_completion_bounds (struct parser_state *);
141
142using namespace expr;
143
144/* Handle Ada type resolution for OP. DEPROCEDURE_P and CONTEXT_TYPE
145 are passed to the resolve method, if called. */
146static operation_up
147resolve (operation_up &&op, bool deprocedure_p, struct type *context_type)
148{
149 operation_up result = std::move (op);
150 ada_resolvable *res = dynamic_cast<ada_resolvable *> (result.get ());
151 if (res != nullptr)
152 return res->replace (std::move (result),
153 pstate->expout.get (),
154 deprocedure_p,
157 context_type);
158 return result;
159}
160
161/* Like parser_state::pop, but handles Ada type resolution.
162 DEPROCEDURE_P and CONTEXT_TYPE are passed to the resolve method, if
163 called. */
164static operation_up
165ada_pop (bool deprocedure_p = true, struct type *context_type = nullptr)
166{
167 /* Of course it's ok to call parser_state::pop here... */
168 return resolve (pstate->pop (), deprocedure_p, context_type);
169}
170
171/* Like parser_state::wrap, but use ada_pop to pop the value. */
172template<typename T>
173void
175{
176 operation_up arg = ada_pop ();
177 pstate->push_new<T> (std::move (arg));
178}
179
180/* Create and push an address-of operation, as appropriate for Ada.
181 If TYPE is not NULL, the resulting operation will be wrapped in a
182 cast to TYPE. */
183static void
184ada_addrof (struct type *type = nullptr)
185{
186 operation_up arg = ada_pop (false);
187 operation_up addr = make_operation<unop_addr_operation> (std::move (arg));
188 operation_up wrapped
189 = make_operation<ada_wrapped_operation> (std::move (addr));
190 if (type != nullptr)
191 wrapped = make_operation<unop_cast_operation> (std::move (wrapped), type);
192 pstate->push (std::move (wrapped));
193}
194
195/* Handle operator overloading. Either returns a function all
196 operation wrapping the arguments, or it returns null, leaving the
197 caller to construct the appropriate operation. If RHS is null, a
198 unary operator is assumed. */
199static operation_up
201{
202 struct value *args[2];
203
204 int nargs = 1;
205 args[0] = lhs->evaluate (nullptr, pstate->expout.get (),
207 if (rhs == nullptr)
208 args[1] = nullptr;
209 else
210 {
211 args[1] = rhs->evaluate (nullptr, pstate->expout.get (),
213 ++nargs;
214 }
215
217 nargs, args);
218 if (fn.symbol == nullptr)
219 return {};
220
223 operation_up callee = make_operation<ada_var_value_operation> (fn);
224
225 std::vector<operation_up> argvec;
226 argvec.push_back (std::move (lhs));
227 if (rhs != nullptr)
228 argvec.push_back (std::move (rhs));
229 return make_operation<ada_funcall_operation> (std::move (callee),
230 std::move (argvec));
231}
232
233/* Like parser_state::wrap, but use ada_pop to pop the value, and
234 handle unary overloading. */
235template<typename T>
236void
238{
239 operation_up arg = ada_pop ();
240 operation_up empty;
241
242 operation_up call = maybe_overload (op, arg, empty);
243 if (call == nullptr)
244 call = make_operation<T> (std::move (arg));
245 pstate->push (std::move (call));
246}
247
248/* A variant of parser_state::wrap2 that uses ada_pop to pop both
249 operands, and then pushes a new Ada-wrapped operation of the
250 template type T. */
251template<typename T>
252void
254{
255 operation_up rhs = ada_pop ();
256 operation_up lhs = ada_pop ();
257
258 operation_up wrapped = maybe_overload (op, lhs, rhs);
259 if (wrapped == nullptr)
260 {
261 wrapped = make_operation<T> (std::move (lhs), std::move (rhs));
262 wrapped = make_operation<ada_wrapped_operation> (std::move (wrapped));
263 }
264 pstate->push (std::move (wrapped));
265}
266
267/* A variant of parser_state::wrap2 that uses ada_pop to pop both
268 operands. Unlike ada_un_wrap2, ada_wrapped_operation is not
269 used. */
270template<typename T>
271void
273{
274 operation_up rhs = ada_pop ();
275 operation_up lhs = ada_pop ();
276 operation_up call = maybe_overload (op, lhs, rhs);
277 if (call == nullptr)
278 call = make_operation<T> (std::move (lhs), std::move (rhs));
279 pstate->push (std::move (call));
280}
281
282/* A variant of parser_state::wrap2 that uses ada_pop to pop both
283 operands. OP is also passed to the constructor of the new binary
284 operation. */
285template<typename T>
286void
288{
289 operation_up rhs = ada_pop ();
290 operation_up lhs = ada_pop ();
291 operation_up call = maybe_overload (op, lhs, rhs);
292 if (call == nullptr)
293 call = make_operation<T> (op, std::move (lhs), std::move (rhs));
294 pstate->push (std::move (call));
295}
296
297/* Pop three operands using ada_pop, then construct a new ternary
298 operation of type T and push it. */
299template<typename T>
300void
302{
303 operation_up rhs = ada_pop ();
304 operation_up mid = ada_pop ();
305 operation_up lhs = ada_pop ();
306 pstate->push_new<T> (std::move (lhs), std::move (mid), std::move (rhs));
307}
308
309/* Pop NARGS operands, then a callee operand, and use these to
310 construct and push a new Ada function call operation. */
311static void
312ada_funcall (int nargs)
313{
314 /* We use the ordinary pop here, because we're going to do
315 resolution in a separate step, in order to handle array
316 indices. */
317 std::vector<operation_up> args = pstate->pop_vector (nargs);
318 /* Call parser_state::pop here, because we don't want to
319 function-convert the callee slot of a call we're already
320 constructing. */
321 operation_up callee = pstate->pop ();
322
324 = dynamic_cast<ada_var_value_operation *> (callee.get ());
325 int array_arity = 0;
326 struct type *callee_t = nullptr;
327 if (vvo == nullptr
328 || vvo->get_symbol ()->domain () != UNDEF_DOMAIN)
329 {
330 struct value *callee_v = callee->evaluate (nullptr,
331 pstate->expout.get (),
333 callee_t = ada_check_typedef (callee_v->type ());
334 array_arity = ada_array_arity (callee_t);
335 }
336
337 for (int i = 0; i < nargs; ++i)
338 {
339 struct type *subtype = nullptr;
340 if (i < array_arity)
341 subtype = ada_index_type (callee_t, i + 1, "array type");
342 args[i] = resolve (std::move (args[i]), true, subtype);
343 }
344
345 std::unique_ptr<ada_funcall_operation> funcall
346 (new ada_funcall_operation (std::move (callee), std::move (args)));
347 funcall->resolve (pstate->expout.get (), true, pstate->parse_completion,
348 pstate->block_tracker, nullptr);
349 pstate->push (std::move (funcall));
350}
351
352/* The components being constructed during this parse. */
353static std::vector<ada_component_up> components;
354
355/* Create a new ada_component_up of the indicated type and arguments,
356 and push it on the global 'components' vector. */
357template<typename T, typename... Arg>
358void
359push_component (Arg... args)
360{
361 components.emplace_back (new T (std::forward<Arg> (args)...));
362}
363
364/* Examine the final element of the 'components' vector, and return it
365 as a pointer to an ada_choices_component. The caller is
366 responsible for ensuring that the final element is in fact an
367 ada_choices_component. */
370{
371 ada_component *last = components.back ().get ();
372 return gdb::checked_static_cast<ada_choices_component *> (last);
373}
374
375/* Pop the most recent component from the global stack, and return
376 it. */
377static ada_component_up
379{
380 ada_component_up result = std::move (components.back ());
381 components.pop_back ();
382 return result;
383}
384
385/* Pop the N most recent components from the global stack, and return
386 them in a vector. */
387static std::vector<ada_component_up>
389{
390 std::vector<ada_component_up> result (n);
391 for (int i = 1; i <= n; ++i)
392 result[n - i] = pop_component ();
393 return result;
394}
395
396/* The associations being constructed during this parse. */
397static std::vector<ada_association_up> associations;
398
399/* Create a new ada_association_up of the indicated type and
400 arguments, and push it on the global 'associations' vector. */
401template<typename T, typename... Arg>
402void
403push_association (Arg... args)
404{
405 associations.emplace_back (new T (std::forward<Arg> (args)...));
406}
407
408/* Pop the most recent association from the global stack, and return
409 it. */
412{
413 ada_association_up result = std::move (associations.back ());
414 associations.pop_back ();
415 return result;
416}
417
418/* Pop the N most recent associations from the global stack, and
419 return them in a vector. */
420static std::vector<ada_association_up>
422{
423 std::vector<ada_association_up> result (n);
424 for (int i = 1; i <= n; ++i)
425 result[n - i] = pop_association ();
426 return result;
427}
428
429/* Expression completer for attributes. */
431{
432 explicit ada_tick_completer (std::string &&name)
433 : m_name (std::move (name))
434 {
435 }
436
437 bool complete (struct expression *exp,
438 completion_tracker &tracker) override;
439
440private:
441
442 std::string m_name;
443};
444
445/* Make a new ada_tick_completer and wrap it in a unique pointer. */
446static std::unique_ptr<expr_completion_base>
448{
449 return (std::unique_ptr<expr_completion_base>
450 (new ada_tick_completer (std::string (tok.ptr, tok.length))));
451}
452
453/* A convenience typedef. */
454typedef std::unique_ptr<ada_assign_operation> ada_assign_up;
455
456/* The stack of currently active assignment expressions. This is used
457 to implement '@', the target name symbol. */
458static std::vector<ada_assign_up> assignments;
459
460
461#line 462 "ada-exp.c.tmp"
462
463# ifndef YY_CAST
464# ifdef __cplusplus
465# define YY_CAST(Type, Val) static_cast<Type> (Val)
466# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
467# else
468# define YY_CAST(Type, Val) ((Type) (Val))
469# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
470# endif
471# endif
472# ifndef YY_NULLPTRPTR
473# if defined __cplusplus
474# if 201103L <= __cplusplus
475# define YY_NULLPTRPTR nullptr
476# else
477# define YY_NULLPTRPTR 0
478# endif
479# else
480# define YY_NULLPTRPTR ((void*)0)
481# endif
482# endif
483
484
485/* Debug traces. */
486#ifndef YYDEBUG
487# define YYDEBUG 0
488#endif
489#if YYDEBUG
490extern int yydebug;
491#endif
492
493/* Token kinds. */
494#ifndef YYTOKENTYPE
495# define YYTOKENTYPE
497 {
499 YYEOF = 0, /* "end of file" */
500 YYerror = 256, /* error */
501 YYUNDEF = 257, /* "invalid token" */
502 INT = 258, /* INT */
503 NULL_PTR = 259, /* NULL_PTR */
504 CHARLIT = 260, /* CHARLIT */
505 FLOAT = 261, /* FLOAT */
506 TRUEKEYWORD = 262, /* TRUEKEYWORD */
507 FALSEKEYWORD = 263, /* FALSEKEYWORD */
508 COLONCOLON = 264, /* COLONCOLON */
509 STRING = 265, /* STRING */
510 NAME = 266, /* NAME */
511 DOT_ID = 267, /* DOT_ID */
512 TICK_COMPLETE = 268, /* TICK_COMPLETE */
513 DOT_COMPLETE = 269, /* DOT_COMPLETE */
514 NAME_COMPLETE = 270, /* NAME_COMPLETE */
515 DOLLAR_VARIABLE = 271, /* DOLLAR_VARIABLE */
516 ASSIGN = 272, /* ASSIGN */
517 _AND_ = 273, /* _AND_ */
518 OR = 274, /* OR */
519 XOR = 275, /* XOR */
520 THEN = 276, /* THEN */
521 ELSE = 277, /* ELSE */
522 NOTEQUAL = 278, /* NOTEQUAL */
523 LEQ = 279, /* LEQ */
524 GEQ = 280, /* GEQ */
525 IN = 281, /* IN */
526 DOTDOT = 282, /* DOTDOT */
527 UNARY = 283, /* UNARY */
528 MOD = 284, /* MOD */
529 REM = 285, /* REM */
530 STARSTAR = 286, /* STARSTAR */
531 ABS = 287, /* ABS */
532 NOT = 288, /* NOT */
533 VAR = 289, /* VAR */
534 ARROW = 290, /* ARROW */
535 TICK_ACCESS = 291, /* TICK_ACCESS */
536 TICK_ADDRESS = 292, /* TICK_ADDRESS */
537 TICK_FIRST = 293, /* TICK_FIRST */
538 TICK_LAST = 294, /* TICK_LAST */
539 TICK_LENGTH = 295, /* TICK_LENGTH */
540 TICK_MAX = 296, /* TICK_MAX */
541 TICK_MIN = 297, /* TICK_MIN */
542 TICK_MODULUS = 298, /* TICK_MODULUS */
543 TICK_POS = 299, /* TICK_POS */
544 TICK_RANGE = 300, /* TICK_RANGE */
545 TICK_SIZE = 301, /* TICK_SIZE */
546 TICK_TAG = 302, /* TICK_TAG */
547 TICK_VAL = 303, /* TICK_VAL */
548 TICK_ENUM_REP = 304, /* TICK_ENUM_REP */
549 TICK_ENUM_VAL = 305, /* TICK_ENUM_VAL */
550 NEW = 306, /* NEW */
551 OTHERS = 307 /* OTHERS */
552 };
554#endif
555/* Token kinds. */
556#define YYEMPTY -2
557#define YYEOF 0
558#define YYerror 256
559#define YYUNDEF 257
560#define INT 258
561#define NULL_PTR 259
562#define CHARLIT 260
563#define FLOAT 261
564#define TRUEKEYWORD 262
565#define FALSEKEYWORD 263
566#define COLONCOLON 264
567#define STRING 265
568#define NAME 266
569#define DOT_ID 267
570#define TICK_COMPLETE 268
571#define DOT_COMPLETE 269
572#define NAME_COMPLETE 270
573#define DOLLAR_VARIABLE 271
574#define ASSIGN 272
575#define _AND_ 273
576#define OR 274
577#define XOR 275
578#define THEN 276
579#define ELSE 277
580#define NOTEQUAL 278
581#define LEQ 279
582#define GEQ 280
583#define IN 281
584#define DOTDOT 282
585#define UNARY 283
586#define MOD 284
587#define REM 285
588#define STARSTAR 286
589#define ABS 287
590#define NOT 288
591#define VAR 289
592#define ARROW 290
593#define TICK_ACCESS 291
594#define TICK_ADDRESS 292
595#define TICK_FIRST 293
596#define TICK_LAST 294
597#define TICK_LENGTH 295
598#define TICK_MAX 296
599#define TICK_MIN 297
600#define TICK_MODULUS 298
601#define TICK_POS 299
602#define TICK_RANGE 300
603#define TICK_SIZE 301
604#define TICK_TAG 302
605#define TICK_VAL 303
606#define TICK_ENUM_REP 304
607#define TICK_ENUM_VAL 305
608#define NEW 306
609#define OTHERS 307
610
611/* Value type. */
612#if ! defined ada_exp_YYSTYPE && ! defined ada_exp_YYSTYPE_IS_DECLARED
614{
615#line 428 "ada-exp.y"
616
617 LONGEST lval;
618 struct {
619 const gdb_mpz *val;
620 struct type *type;
622 struct {
623 LONGEST val;
624 struct type *type;
626 struct {
627 gdb_byte val[16];
628 struct type *type;
630 struct type *tval;
631 struct stoken sval;
632 const struct block *bval;
634
635
636#line 637 "ada-exp.c.tmp"
637
638};
640# define ada_exp_YYSTYPE_IS_TRIVIAL 1
641# define ada_exp_YYSTYPE_IS_DECLARED 1
642#endif
643
644
646
647
648int yyparse (void);
649
650
651
652/* Symbol kind. */
654{
656 YYSYMBOL_YYEOF = 0, /* "end of file" */
657 YYSYMBOL_YYerror = 1, /* error */
658 YYSYMBOL_YYUNDEF = 2, /* "invalid token" */
659 YYSYMBOL_INT = 3, /* INT */
660 YYSYMBOL_NULL_PTR = 4, /* NULL_PTR */
661 YYSYMBOL_CHARLIT = 5, /* CHARLIT */
662 YYSYMBOL_FLOAT = 6, /* FLOAT */
663 YYSYMBOL_TRUEKEYWORD = 7, /* TRUEKEYWORD */
664 YYSYMBOL_FALSEKEYWORD = 8, /* FALSEKEYWORD */
665 YYSYMBOL_COLONCOLON = 9, /* COLONCOLON */
666 YYSYMBOL_STRING = 10, /* STRING */
667 YYSYMBOL_NAME = 11, /* NAME */
668 YYSYMBOL_DOT_ID = 12, /* DOT_ID */
669 YYSYMBOL_TICK_COMPLETE = 13, /* TICK_COMPLETE */
670 YYSYMBOL_DOT_COMPLETE = 14, /* DOT_COMPLETE */
671 YYSYMBOL_NAME_COMPLETE = 15, /* NAME_COMPLETE */
672 YYSYMBOL_DOLLAR_VARIABLE = 16, /* DOLLAR_VARIABLE */
673 YYSYMBOL_ASSIGN = 17, /* ASSIGN */
674 YYSYMBOL__AND_ = 18, /* _AND_ */
675 YYSYMBOL_OR = 19, /* OR */
676 YYSYMBOL_XOR = 20, /* XOR */
677 YYSYMBOL_THEN = 21, /* THEN */
678 YYSYMBOL_ELSE = 22, /* ELSE */
679 YYSYMBOL_23_ = 23, /* '=' */
680 YYSYMBOL_NOTEQUAL = 24, /* NOTEQUAL */
681 YYSYMBOL_25_ = 25, /* '<' */
682 YYSYMBOL_26_ = 26, /* '>' */
683 YYSYMBOL_LEQ = 27, /* LEQ */
684 YYSYMBOL_GEQ = 28, /* GEQ */
685 YYSYMBOL_IN = 29, /* IN */
686 YYSYMBOL_DOTDOT = 30, /* DOTDOT */
687 YYSYMBOL_31_ = 31, /* '@' */
688 YYSYMBOL_32_ = 32, /* '+' */
689 YYSYMBOL_33_ = 33, /* '-' */
690 YYSYMBOL_34_ = 34, /* '&' */
691 YYSYMBOL_UNARY = 35, /* UNARY */
692 YYSYMBOL_36_ = 36, /* '*' */
693 YYSYMBOL_37_ = 37, /* '/' */
694 YYSYMBOL_MOD = 38, /* MOD */
695 YYSYMBOL_REM = 39, /* REM */
696 YYSYMBOL_STARSTAR = 40, /* STARSTAR */
697 YYSYMBOL_ABS = 41, /* ABS */
698 YYSYMBOL_NOT = 42, /* NOT */
699 YYSYMBOL_VAR = 43, /* VAR */
700 YYSYMBOL_ARROW = 44, /* ARROW */
701 YYSYMBOL_45_ = 45, /* '|' */
702 YYSYMBOL_TICK_ACCESS = 46, /* TICK_ACCESS */
703 YYSYMBOL_TICK_ADDRESS = 47, /* TICK_ADDRESS */
704 YYSYMBOL_TICK_FIRST = 48, /* TICK_FIRST */
705 YYSYMBOL_TICK_LAST = 49, /* TICK_LAST */
706 YYSYMBOL_TICK_LENGTH = 50, /* TICK_LENGTH */
707 YYSYMBOL_TICK_MAX = 51, /* TICK_MAX */
708 YYSYMBOL_TICK_MIN = 52, /* TICK_MIN */
709 YYSYMBOL_TICK_MODULUS = 53, /* TICK_MODULUS */
710 YYSYMBOL_TICK_POS = 54, /* TICK_POS */
711 YYSYMBOL_TICK_RANGE = 55, /* TICK_RANGE */
712 YYSYMBOL_TICK_SIZE = 56, /* TICK_SIZE */
713 YYSYMBOL_TICK_TAG = 57, /* TICK_TAG */
714 YYSYMBOL_TICK_VAL = 58, /* TICK_VAL */
715 YYSYMBOL_TICK_ENUM_REP = 59, /* TICK_ENUM_REP */
716 YYSYMBOL_TICK_ENUM_VAL = 60, /* TICK_ENUM_VAL */
717 YYSYMBOL_61_ = 61, /* '.' */
718 YYSYMBOL_62_ = 62, /* '(' */
719 YYSYMBOL_63_ = 63, /* '[' */
720 YYSYMBOL_NEW = 64, /* NEW */
721 YYSYMBOL_OTHERS = 65, /* OTHERS */
722 YYSYMBOL_66_ = 66, /* ';' */
723 YYSYMBOL_67_ = 67, /* ')' */
724 YYSYMBOL_68_ = 68, /* '\'' */
725 YYSYMBOL_69_ = 69, /* ',' */
726 YYSYMBOL_70_ = 70, /* '{' */
727 YYSYMBOL_71_ = 71, /* '}' */
728 YYSYMBOL_72_ = 72, /* ']' */
729 YYSYMBOL_YYACCEPT = 73, /* $accept */
730 YYSYMBOL_start = 74, /* start */
731 YYSYMBOL_exp1 = 75, /* exp1 */
732 YYSYMBOL_76_1 = 76, /* $@1 */
733 YYSYMBOL_primary = 77, /* primary */
734 YYSYMBOL_simple_exp = 78, /* simple_exp */
735 YYSYMBOL_arglist = 79, /* arglist */
736 YYSYMBOL_relation = 80, /* relation */
737 YYSYMBOL_exp = 81, /* exp */
738 YYSYMBOL_and_exp = 82, /* and_exp */
739 YYSYMBOL_and_then_exp = 83, /* and_then_exp */
740 YYSYMBOL_or_exp = 84, /* or_exp */
741 YYSYMBOL_or_else_exp = 85, /* or_else_exp */
742 YYSYMBOL_xor_exp = 86, /* xor_exp */
743 YYSYMBOL_tick_arglist = 87, /* tick_arglist */
744 YYSYMBOL_type_prefix = 88, /* type_prefix */
745 YYSYMBOL_opt_type_prefix = 89, /* opt_type_prefix */
746 YYSYMBOL_var_or_type = 90, /* var_or_type */
747 YYSYMBOL_block = 91, /* block */
748 YYSYMBOL_aggregate = 92, /* aggregate */
749 YYSYMBOL_aggregate_component_list = 93, /* aggregate_component_list */
750 YYSYMBOL_positional_list = 94, /* positional_list */
751 YYSYMBOL_component_groups = 95, /* component_groups */
752 YYSYMBOL_others = 96, /* others */
753 YYSYMBOL_component_group = 97, /* component_group */
754 YYSYMBOL_component_associations = 98 /* component_associations */
757
758
759
760
761#ifdef short
762# undef short
763#endif
764
765/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
766 <limits.h> and (if available) <stdint.h> are included
767 so that the code can choose integer types of a good width. */
768
769#ifndef __PTRDIFF_MAX__
770# include <limits.h> /* INFRINGES ON USER NAME SPACE */
771# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
772# include <stdint.h> /* INFRINGES ON USER NAME SPACE */
773# define YY_STDINT_H
774# endif
775#endif
776
777/* Narrow types that promote to a signed type and that can represent a
778 signed or unsigned integer of at least N bits. In tables they can
779 save space and decrease cache pressure. Promoting to a signed type
780 helps avoid bugs in integer arithmetic. */
781
782#ifdef __INT_LEAST8_MAX__
783typedef __INT_LEAST8_TYPE__ yytype_int8;
784#elif defined YY_STDINT_H
785typedef int_least8_t yytype_int8;
786#else
787typedef signed char yytype_int8;
788#endif
789
790#ifdef __INT_LEAST16_MAX__
791typedef __INT_LEAST16_TYPE__ yytype_int16;
792#elif defined YY_STDINT_H
793typedef int_least16_t yytype_int16;
794#else
795typedef short yytype_int16;
796#endif
797
798/* Work around bug in HP-UX 11.23, which defines these macros
799 incorrectly for preprocessor constants. This workaround can likely
800 be removed in 2023, as HPE has promised support for HP-UX 11.23
801 (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
802 <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */
803#ifdef __hpux
804# undef UINT_LEAST8_MAX
805# undef UINT_LEAST16_MAX
806# define UINT_LEAST8_MAX 255
807# define UINT_LEAST16_MAX 65535
808#endif
809
810#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
811typedef __UINT_LEAST8_TYPE__ yytype_uint8;
812#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
813 && UINT_LEAST8_MAX <= INT_MAX)
814typedef uint_least8_t yytype_uint8;
815#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
816typedef unsigned char yytype_uint8;
817#else
818typedef short yytype_uint8;
819#endif
820
821#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
822typedef __UINT_LEAST16_TYPE__ yytype_uint16;
823#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
824 && UINT_LEAST16_MAX <= INT_MAX)
825typedef uint_least16_t yytype_uint16;
826#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
827typedef unsigned short yytype_uint16;
828#else
829typedef int yytype_uint16;
830#endif
831
832#ifndef YYPTRDIFF_T
833# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
834# define YYPTRDIFF_T __PTRDIFF_TYPE__
835# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
836# elif defined PTRDIFF_MAX
837# ifndef ptrdiff_t
838# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
839# endif
840# define YYPTRDIFF_T ptrdiff_t
841# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
842# else
843# define YYPTRDIFF_T long
844# define YYPTRDIFF_MAXIMUM LONG_MAX
845# endif
846#endif
847
848#ifndef YYSIZE_T
849# ifdef __SIZE_TYPE__
850# define YYSIZE_T __SIZE_TYPE__
851# elif defined size_t
852# define YYSIZE_T size_t
853# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
854# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
855# define YYSIZE_T size_t
856# else
857# define YYSIZE_T unsigned
858# endif
859#endif
860
861#define YYSIZE_MAXIMUM \
862 YY_CAST (YYPTRDIFF_T, \
863 (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
864 ? YYPTRDIFF_MAXIMUM \
865 : YY_CAST (YYSIZE_T, -1)))
866
867#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
868
869
870/* Stored state numbers (used for stacks). */
872
873/* State numbers in computations. */
874typedef int yy_state_fast_t;
875
876#ifndef YY_
877# if defined YYENABLE_NLS && YYENABLE_NLS
878# if ENABLE_NLS
879# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
880# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
881# endif
882# endif
883# ifndef YY_
884# define YY_(Msgid) Msgid
885# endif
886#endif
887
888
889#ifndef YY_ATTRIBUTE_PURE
890# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
891# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
892# else
893# define YY_ATTRIBUTE_PURE
894# endif
895#endif
896
897#ifndef YY_ATTRIBUTE_UNUSED
898# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
899# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
900# else
901# define YY_ATTRIBUTE_UNUSED
902# endif
903#endif
904
905/* Suppress unused-variable warnings by "using" E. */
906#if ! defined lint || defined __GNUC__
907# define YY_USE(E) ((void) (E))
908#else
909# define YY_USE(E) /* empty */
910#endif
911
912/* Suppress an incorrect diagnostic about yylval being uninitialized. */
913#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
914# if __GNUC__ * 100 + __GNUC_MINOR__ < 407
915# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
916 _Pragma ("GCC diagnostic push") \
917 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
918# else
919# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
920 _Pragma ("GCC diagnostic push") \
921 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
922 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
923# endif
924# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
925 _Pragma ("GCC diagnostic pop")
926#else
927# define YY_INITIAL_VALUE(Value) Value
928#endif
929#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
930# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
931# define YY_IGNORE_MAYBE_UNINITIALIZED_END
932#endif
933#ifndef YY_INITIAL_VALUE
934# define YY_INITIAL_VALUE(Value) /* Nothing. */
935#endif
936
937#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
938# define YY_IGNORE_USELESS_CAST_BEGIN \
939 _Pragma ("GCC diagnostic push") \
940 _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
941# define YY_IGNORE_USELESS_CAST_END \
942 _Pragma ("GCC diagnostic pop")
943#endif
944#ifndef YY_IGNORE_USELESS_CAST_BEGIN
945# define YY_IGNORE_USELESS_CAST_BEGIN
946# define YY_IGNORE_USELESS_CAST_END
947#endif
948
949
950#define YY_ASSERT(E) ((void) (0 && (E)))
951
952#if !defined yyoverflow
953
954/* The parser invokes alloca or xmalloc; define the necessary symbols. */
955
956# ifdef YYSTACK_USE_ALLOCA
957# if YYSTACK_USE_ALLOCA
958# ifdef __GNUC__
959# define YYSTACK_ALLOC __builtin_alloca
960# elif defined __BUILTIN_VA_ARG_INCR
961# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
962# elif defined _AIX
963# define YYSTACK_ALLOC __alloca
964# elif defined _MSC_VER
965# define alloca _alloca
966# else
967# define YYSTACK_ALLOC alloca
968# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
969# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
970 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
971# ifndef EXIT_SUCCESS
972# define EXIT_SUCCESS 0
973# endif
974# endif
975# endif
976# endif
977# endif
978
979# ifdef YYSTACK_ALLOC
980 /* Pacify GCC's 'empty if-body' warning. */
981# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
982# ifndef YYSTACK_ALLOC_MAXIMUM
983 /* The OS might guarantee only one guard page at the bottom of the stack,
984 and a page size can be as small as 4096 bytes. So we cannot safely
985 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
986 to allow for a few compiler-allocated temporary stack slots. */
987# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
988# endif
989# else
990# define YYSTACK_ALLOC YYMALLOC
991# define YYSTACK_FREE YYFREE
992# ifndef YYSTACK_ALLOC_MAXIMUM
993# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
994# endif
995# if (defined __cplusplus && ! defined EXIT_SUCCESS \
996 && ! ((defined YYMALLOC || defined xmalloc) \
997 && (defined YYFREE || defined xfree)))
998# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
999# ifndef EXIT_SUCCESS
1000# define EXIT_SUCCESS 0
1001# endif
1002# endif
1003# ifndef YYMALLOC
1004# define YYMALLOC xmalloc
1005# if ! defined xmalloc && ! defined EXIT_SUCCESS
1006void *xmalloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
1007# endif
1008# endif
1009# ifndef YYFREE
1010# define YYFREE xfree
1011# if ! defined xfree && ! defined EXIT_SUCCESS
1012void xfree (void *); /* INFRINGES ON USER NAME SPACE */
1013# endif
1014# endif
1015# endif
1016#endif /* !defined yyoverflow */
1017
1018#if (! defined yyoverflow \
1019 && (! defined __cplusplus \
1020 || (defined ada_exp_YYSTYPE_IS_TRIVIAL && ada_exp_YYSTYPE_IS_TRIVIAL)))
1021
1022/* A type that is properly aligned for any stack member. */
1028
1029/* The size of the maximum gap between one aligned stack and the next. */
1030# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union ada_exp_yyalloc) - 1)
1031
1032/* The size of an array large to enough to hold all stacks, each with
1033 N elements. */
1034# define YYSTACK_BYTES(N) \
1035 ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (ada_exp_YYSTYPE)) \
1036 + YYSTACK_GAP_MAXIMUM)
1037
1038# define YYCOPY_NEEDED 1
1039
1040/* Relocate STACK from its old location to the new one. The
1041 local variables YYSIZE and YYSTACKSIZE give the old and new number of
1042 elements in the stack, and YYPTR gives the new location of the
1043 stack. Advance YYPTR to a properly aligned location for the next
1044 stack. */
1045# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
1046 do \
1047 { \
1048 YYPTRDIFF_T yynewbytes; \
1049 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
1050 Stack = &yyptr->Stack_alloc; \
1051 yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
1052 yyptr += yynewbytes / YYSIZEOF (*yyptr); \
1053 } \
1054 while (0)
1055
1056#endif
1057
1058#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
1059/* Copy COUNT objects from SRC to DST. The source and destination do
1060 not overlap. */
1061# ifndef YYCOPY
1062# if defined __GNUC__ && 1 < __GNUC__
1063# define YYCOPY(Dst, Src, Count) \
1064 __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
1065# else
1066# define YYCOPY(Dst, Src, Count) \
1067 do \
1068 { \
1069 YYPTRDIFF_T yyi; \
1070 for (yyi = 0; yyi < (Count); yyi++) \
1071 (Dst)[yyi] = (Src)[yyi]; \
1072 } \
1073 while (0)
1074# endif
1075# endif
1076#endif /* !YYCOPY_NEEDED */
1077
1078/* YYFINAL -- State number of the termination state. */
1079#define YYFINAL 59
1080/* YYLAST -- Last index in YYTABLE. */
1081#define YYLAST 798
1082
1083/* YYNTOKENS -- Number of terminals. */
1084#define YYNTOKENS 73
1085/* YYNNTS -- Number of nonterminals. */
1086#define YYNNTS 26
1087/* YYNRULES -- Number of rules. */
1088#define YYNRULES 123
1089/* YYNSTATES -- Number of states. */
1090#define YYNSTATES 240
1091
1092/* YYMAXUTOK -- Last valid token kind. */
1093#define YYMAXUTOK 307
1094
1095
1096/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
1097 as returned by yylex, with out-of-bounds checking. */
1098#define YYTRANSLATE(YYX) \
1099 (0 <= (YYX) && (YYX) <= YYMAXUTOK \
1100 ? YY_CAST (ada_exp_yysymbol_kind_t, yytranslate[YYX]) \
1101 : YYSYMBOL_YYUNDEF)
1102
1103/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
1104 as returned by yylex. */
1105static const yytype_int8 yytranslate[] =
1106{
1107 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1108 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1109 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1110 2, 2, 2, 2, 2, 2, 2, 2, 34, 68,
1111 62, 67, 36, 32, 69, 33, 61, 37, 2, 2,
1112 2, 2, 2, 2, 2, 2, 2, 2, 2, 66,
1113 25, 23, 26, 2, 31, 2, 2, 2, 2, 2,
1114 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1115 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1116 2, 63, 2, 72, 2, 2, 2, 2, 2, 2,
1117 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1118 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1119 2, 2, 2, 70, 45, 71, 2, 2, 2, 2,
1120 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1121 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1122 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1123 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1124 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1125 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1126 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1127 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1128 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1129 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1130 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1131 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1132 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
1133 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
1134 15, 16, 17, 18, 19, 20, 21, 22, 24, 27,
1135 28, 29, 30, 35, 38, 39, 40, 41, 42, 43,
1136 44, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1137 55, 56, 57, 58, 59, 60, 64, 65
1138};
1139
1140#if YYDEBUG
1141/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
1142static const yytype_int16 yyrline[] =
1143{
1144 0, 495, 495, 499, 500, 503, 502, 526, 539, 553,
1145 555, 570, 582, 584, 592, 603, 609, 613, 620, 631,
1146 634, 638, 654, 661, 665, 668, 670, 672, 674, 678,
1147 691, 695, 699, 703, 707, 711, 715, 719, 723, 727,
1148 730, 734, 738, 742, 744, 751, 759, 762, 770, 781,
1149 785, 789, 793, 794, 795, 796, 797, 798, 802, 805,
1150 811, 814, 820, 823, 829, 831, 835, 838, 851, 853,
1151 855, 859, 865, 871, 877, 879, 881, 883, 885, 887,
1152 893, 899, 905, 915, 917, 922, 931, 934, 938, 945,
1153 951, 962, 970, 977, 982, 989, 993, 995, 1001, 1003,
1154 1009, 1017, 1028, 1030, 1035, 1046, 1047, 1053, 1058, 1064,
1155 1073, 1074, 1075, 1079, 1086, 1099, 1105, 1111, 1120, 1125,
1156 1130, 1144, 1146, 1148
1157};
1158#endif
1159
1161#define YY_ACCESSING_SYMBOL(State) YY_CAST (ada_exp_yysymbol_kind_t, yystos[State])
1162
1163#if YYDEBUG || 0
1164/* The user-facing name of the symbol whose (internal) number is
1165 YYSYMBOL. No bounds checking. */
1166static const char *yysymbol_name (ada_exp_yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
1167
1168/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1169 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
1170static const char *const yytname[] =
1171{
1172 "\"end of file\"", "error", "\"invalid token\"", "INT", "NULL_PTR",
1173 "CHARLIT", "FLOAT", "TRUEKEYWORD", "FALSEKEYWORD", "COLONCOLON",
1174 "STRING", "NAME", "DOT_ID", "TICK_COMPLETE", "DOT_COMPLETE",
1175 "NAME_COMPLETE", "DOLLAR_VARIABLE", "ASSIGN", "_AND_", "OR", "XOR",
1176 "THEN", "ELSE", "'='", "NOTEQUAL", "'<'", "'>'", "LEQ", "GEQ", "IN",
1177 "DOTDOT", "'@'", "'+'", "'-'", "'&'", "UNARY", "'*'", "'/'", "MOD",
1178 "REM", "STARSTAR", "ABS", "NOT", "VAR", "ARROW", "'|'", "TICK_ACCESS",
1179 "TICK_ADDRESS", "TICK_FIRST", "TICK_LAST", "TICK_LENGTH", "TICK_MAX",
1180 "TICK_MIN", "TICK_MODULUS", "TICK_POS", "TICK_RANGE", "TICK_SIZE",
1181 "TICK_TAG", "TICK_VAL", "TICK_ENUM_REP", "TICK_ENUM_VAL", "'.'", "'('",
1182 "'['", "NEW", "OTHERS", "';'", "')'", "'\\''", "','", "'{'", "'}'",
1183 "']'", "$accept", "start", "exp1", "$@1", "primary", "simple_exp",
1184 "arglist", "relation", "exp", "and_exp", "and_then_exp", "or_exp",
1185 "or_else_exp", "xor_exp", "tick_arglist", "type_prefix",
1186 "opt_type_prefix", "var_or_type", "block", "aggregate",
1187 "aggregate_component_list", "positional_list", "component_groups",
1188 "others", "component_group", "component_associations", YY_NULLPTRPTR
1189};
1190
1191static const char *
1193{
1194 return yytname[yysymbol];
1195}
1196#endif
1197
1198#define YYPACT_NINF (-108)
1199
1200#define yypact_value_is_default(Yyn) \
1201 ((Yyn) == YYPACT_NINF)
1202
1203#define YYTABLE_NINF (-86)
1204
1205#define yytable_value_is_error(Yyn) \
1206 0
1207
1208/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1209 STATE-NUM. */
1210static const yytype_int16 yypact[] =
1211{
1212 443, -108, -108, -108, -108, -108, -108, -108, -1, -108,
1213 -108, -108, 443, 443, 563, 563, 443, 443, 294, 5,
1214 -5, 12, -26, 128, 710, 35, -108, -7, 28, 43,
1215 50, 52, 49, 65, 410, 90, -108, -108, -108, 606,
1216 167, 167, 14, 14, 167, 167, 21, 31, -45, 647,
1217 30, 44, 294, -108, -108, 45, -108, -108, 51, -108,
1218 443, -108, -108, -108, -108, -108, -108, 58, 58, 58,
1219 -108, -108, 280, 443, 443, 443, 443, 443, 443, 443,
1220 443, 443, 443, 443, 443, 443, 443, 443, 443, 443,
1221 97, 362, 403, 443, 443, 106, 443, 121, 443, -108,
1222 82, 84, 96, 108, 110, 111, 280, 118, 25, -108,
1223 443, 483, 443, -108, 443, 443, 483, -108, -108, 91,
1224 -108, 294, 563, -108, 443, 176, -108, -108, -108, -2,
1225 670, -40, -108, 109, 98, 98, 98, 98, 98, 98,
1226 1, 738, 182, 758, 167, 167, 167, 143, 143, 143,
1227 143, 143, 443, 443, -108, 443, -108, -108, -108, 443,
1228 -108, 443, -108, 443, 443, 443, 443, 443, 443, 690,
1229 11, 443, -108, -108, -108, 117, -108, -108, 722, -108,
1230 -108, -108, -108, 14, -108, 120, 443, 443, -108, 523,
1231 -108, 58, 443, 588, 749, 210, -108, -108, -108, -108,
1232 125, 126, 129, 119, 139, 130, 443, -108, 131, 443,
1233 483, -108, -108, 348, 24, -108, -108, 98, 58, 443,
1234 -108, -108, -108, 443, 443, -108, 572, -108, -108, -108,
1235 -108, 443, -108, 98, 144, 145, -108, -108, -108, -108
1236};
1237
1238/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
1239 Performed when YYTABLE does not specify something else to do. Zero
1240 means the default is an error. */
1241static const yytype_int8 yydefact[] =
1242{
1243 87, 88, 91, 89, 90, 93, 94, 92, 96, 97,
1244 16, 18, 87, 87, 87, 87, 87, 87, 87, 0,
1245 0, 0, 2, 19, 39, 52, 3, 53, 54, 55,
1246 56, 57, 86, 0, 15, 0, 17, 102, 100, 19,
1247 21, 20, 122, 121, 23, 22, 96, 0, 0, 39,
1248 3, 0, 87, 105, 110, 111, 114, 95, 0, 1,
1249 87, 7, 70, 8, 5, 68, 69, 83, 83, 83,
1250 74, 75, 87, 87, 87, 87, 87, 87, 87, 87,
1251 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
1252 0, 87, 87, 87, 87, 0, 87, 0, 87, 82,
1253 0, 0, 0, 0, 0, 0, 87, 0, 98, 99,
1254 87, 87, 87, 14, 87, 87, 87, 108, 104, 106,
1255 107, 87, 87, 4, 87, 0, 71, 72, 73, 96,
1256 39, 0, 25, 0, 40, 41, 50, 51, 42, 49,
1257 19, 0, 15, 35, 36, 38, 37, 31, 32, 34,
1258 33, 30, 87, 87, 58, 87, 62, 66, 59, 87,
1259 63, 87, 67, 87, 87, 87, 87, 87, 87, 39,
1260 0, 87, 103, 101, 115, 0, 118, 113, 0, 116,
1261 119, 109, 112, 29, 6, 0, 87, 87, 9, 87,
1262 123, 83, 87, 19, 0, 15, 60, 64, 61, 65,
1263 0, 0, 0, 0, 0, 0, 87, 10, 0, 87,
1264 87, 84, 26, 0, 96, 27, 44, 43, 83, 87,
1265 79, 80, 81, 87, 87, 78, 0, 11, 117, 120,
1266 12, 87, 47, 46, 0, 0, 13, 28, 77, 76
1267};
1268
1269/* YYPGOTO[NTERM-NUM]. */
1270static const yytype_int16 yypgoto[] =
1271{
1272 -108, -108, 177, -108, 17, 7, 112, -55, 0, -108,
1273 -108, -108, -108, -108, -66, -108, -108, -19, -108, -108,
1274 -108, -108, -47, -108, -108, -107
1275};
1276
1277/* YYDEFGOTO[NTERM-NUM]. */
1278static const yytype_uint8 yydefgoto[] =
1279{
1280 0, 21, 22, 124, 39, 24, 131, 25, 132, 27,
1281 28, 29, 30, 31, 126, 32, 33, 34, 35, 36,
1282 51, 52, 53, 54, 55, 56
1283};
1284
1285/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
1286 positive, shift that token. If negative, reduce the rule whose
1287 number is the opposite. If YYTABLE_NINF, syntax error. */
1288static const yytype_int16 yytable[] =
1289{
1290 26, 58, 127, 128, 176, 120, 8, 37, 37, 180,
1291 9, 94, 59, 61, 62, 63, 57, 23, 50, 40,
1292 41, 60, 113, 44, 45, 49, 61, 188, 63, 189,
1293 37, 42, 43, 37, 172, 23, 154, 156, 157, 158,
1294 60, 160, 186, 162, 38, 38, 95, 65, 66, 67,
1295 68, 69, 119, 91, 92, 93, 191, 70, 71, 49,
1296 123, 142, 96, 72, 73, 110, 111, 38, 231, 97,
1297 38, 173, 98, 133, 182, 112, 72, 73, 207, 130,
1298 189, 134, 135, 136, 137, 138, 139, 141, 143, 144,
1299 145, 146, 147, 148, 149, 150, 151, 140, 196, 117,
1300 197, 108, 99, 229, 198, 109, 199, 100, 101, 102,
1301 174, 118, 177, 169, 121, 179, 103, 104, 175, 105,
1302 125, 178, 122, 175, 184, 216, 152, 159, 175, 81,
1303 82, 83, 84, 195, 85, 86, 87, 88, 89, 183,
1304 61, 62, 63, 161, 163, 64, 164, 114, 81, 82,
1305 83, 84, 232, 85, 86, 87, 88, 89, 165, 194,
1306 181, 115, 116, 200, 201, 202, 203, 204, 205, 193,
1307 166, 208, 167, 168, 65, 66, 67, 68, 69, 185,
1308 171, 190, -45, 89, 70, 71, 212, 211, 223, 215,
1309 72, 73, 220, 221, 213, 48, 222, 225, 227, 217,
1310 -45, -45, -45, 85, 86, 87, 88, 89, 224, 228,
1311 -48, 238, 239, 226, 0, 0, 0, 175, 170, 0,
1312 0, 0, 0, 234, 235, 0, 233, 0, -48, -48,
1313 -48, 237, 0, -85, -85, -85, -85, 0, 0, 0,
1314 -85, -85, -85, 0, 106, 0, 0, 0, -45, -45,
1315 107, -45, 0, 0, -45, 0, 0, 0, 0, 0,
1316 0, -85, -85, -85, -85, 0, 0, 0, -85, -85,
1317 -85, 0, 106, 0, 0, 0, -48, -48, 107, -48,
1318 0, 0, -48, 1, 2, 3, 4, 5, 6, 0,
1319 7, 129, 0, 0, 0, 9, 10, 1, 2, 3,
1320 4, 5, 6, 0, 7, 46, 0, 0, 0, 9,
1321 10, 11, 12, 13, 14, 0, 15, 0, 0, 0,
1322 0, 16, 17, 0, 0, 11, 12, 13, 14, 0,
1323 15, 0, 0, 0, 0, 16, 17, 0, 0, 0,
1324 0, 0, 18, 0, 19, 0, 0, -24, 0, -24,
1325 20, 0, 0, 0, 0, 0, 18, 0, 19, 47,
1326 0, 0, 0, 0, 20, 1, 2, 3, 4, 5,
1327 6, 0, 7, 8, 0, 0, 0, 9, 10, 81,
1328 82, 83, 84, 153, 85, 86, 87, 88, 89, 0,
1329 0, 0, 0, 11, 12, 13, 14, 0, 15, 0,
1330 0, 0, 0, 16, 17, 0, 1, 2, 3, 4,
1331 5, 6, 0, 7, 8, 230, 0, 0, 9, 10,
1332 0, 0, 0, 0, 18, 155, 19, 0, 0, 0,
1333 0, 0, 20, 0, 11, 12, 13, 14, 0, 15,
1334 0, 0, 0, 0, 16, 17, 1, 2, 3, 4,
1335 5, 6, 0, 7, 8, 0, 0, 0, 9, 10,
1336 0, -85, -85, -85, -85, 18, 0, 19, -85, -85,
1337 -85, 0, 106, 20, 11, 12, 13, 14, 107, 15,
1338 0, 0, 0, 0, 16, 17, 1, 2, 3, 4,
1339 5, 6, 0, 7, 46, 0, 0, 0, 9, 10,
1340 0, 0, 0, 0, 0, 18, 0, 19, 0, 0,
1341 0, 0, 0, 20, 11, 12, 13, 14, 0, 15,
1342 0, 0, 0, 0, 16, 17, 1, 2, 3, 4,
1343 5, 6, 0, 7, 214, 0, 0, 0, 9, 10,
1344 0, 0, 0, 0, 0, 18, 0, 19, 0, 0,
1345 0, 0, 0, 20, 11, 12, 13, 14, 0, 15,
1346 0, 0, 0, 0, 16, 17, 1, 2, 3, 4,
1347 5, 6, 0, 7, 8, 0, 0, 0, 9, 10,
1348 0, 0, 0, 0, 0, 18, 0, 19, 0, 0,
1349 0, 0, 0, 20, 11, 0, 0, 14, 0, 15,
1350 61, 62, 63, 81, 82, 83, 84, 0, 85, 86,
1351 87, 88, 89, 0, 0, 0, 0, 0, 61, 62,
1352 63, 0, 0, 0, 0, 18, 0, 19, 0, 0,
1353 0, 0, 0, 20, 65, 66, 67, 68, 69, 236,
1354 0, 0, 0, 218, 70, 71, 0, 0, 0, 0,
1355 72, 73, 65, 66, 67, 68, 69, 0, 0, 0,
1356 0, 0, 70, 71, 0, 0, 0, 0, 72, 73,
1357 74, 75, 76, 77, 78, 79, 80, 114, 81, 82,
1358 83, 84, 0, 85, 86, 87, 88, 89, 0, 90,
1359 0, 115, 116, 74, 75, 76, 77, 78, 79, 80,
1360 187, 81, 82, 83, 84, 0, 85, 86, 87, 88,
1361 89, 0, 90, 74, 75, 76, 77, 78, 79, 80,
1362 206, 81, 82, 83, 84, 0, 85, 86, 87, 88,
1363 89, 0, 90, 74, 75, 76, 77, 78, 79, 80,
1364 0, 81, 82, 83, 84, 0, 85, 86, 87, 88,
1365 89, 0, 90, 81, 82, 83, 84, 0, 85, 86,
1366 87, 88, 89, 0, 0, 0, 209, 210, 192, 81,
1367 82, 83, 84, 0, 85, 86, 87, 88, 89, 219,
1368 81, 82, 83, 84, 0, 85, 86, 87, 88, 89,
1369 82, 83, 84, 0, 85, 86, 87, 88, 89
1370};
1371
1372static const yytype_int16 yycheck[] =
1373{
1374 0, 20, 68, 69, 111, 52, 11, 9, 9, 116,
1375 15, 18, 0, 12, 13, 14, 11, 0, 18, 12,
1376 13, 66, 67, 16, 17, 18, 12, 67, 14, 69,
1377 9, 14, 15, 9, 9, 18, 91, 92, 93, 94,
1378 66, 96, 44, 98, 46, 46, 18, 46, 47, 48,
1379 49, 50, 52, 18, 19, 20, 55, 56, 57, 52,
1380 60, 80, 19, 62, 63, 44, 45, 46, 44, 19,
1381 46, 46, 20, 73, 121, 44, 62, 63, 67, 72,
1382 69, 74, 75, 76, 77, 78, 79, 80, 81, 82,
1383 83, 84, 85, 86, 87, 88, 89, 80, 153, 69,
1384 155, 11, 53, 210, 159, 15, 161, 58, 59, 60,
1385 110, 67, 112, 106, 69, 115, 51, 52, 111, 54,
1386 62, 114, 71, 116, 124, 191, 29, 21, 121, 31,
1387 32, 33, 34, 152, 36, 37, 38, 39, 40, 122,
1388 12, 13, 14, 22, 62, 17, 62, 30, 31, 32,
1389 33, 34, 218, 36, 37, 38, 39, 40, 62, 152,
1390 69, 44, 45, 163, 164, 165, 166, 167, 168, 152,
1391 62, 171, 62, 62, 46, 47, 48, 49, 50, 3,
1392 62, 72, 0, 40, 56, 57, 186, 67, 69, 189,
1393 62, 63, 67, 67, 187, 18, 67, 67, 67, 192,
1394 18, 19, 20, 36, 37, 38, 39, 40, 69, 209,
1395 0, 67, 67, 206, -1, -1, -1, 210, 106, -1,
1396 -1, -1, -1, 223, 224, -1, 219, -1, 18, 19,
1397 20, 231, -1, 51, 52, 53, 54, -1, -1, -1,
1398 58, 59, 60, -1, 62, -1, -1, -1, 66, 67,
1399 68, 69, -1, -1, 72, -1, -1, -1, -1, -1,
1400 -1, 51, 52, 53, 54, -1, -1, -1, 58, 59,
1401 60, -1, 62, -1, -1, -1, 66, 67, 68, 69,
1402 -1, -1, 72, 3, 4, 5, 6, 7, 8, -1,
1403 10, 11, -1, -1, -1, 15, 16, 3, 4, 5,
1404 6, 7, 8, -1, 10, 11, -1, -1, -1, 15,
1405 16, 31, 32, 33, 34, -1, 36, -1, -1, -1,
1406 -1, 41, 42, -1, -1, 31, 32, 33, 34, -1,
1407 36, -1, -1, -1, -1, 41, 42, -1, -1, -1,
1408 -1, -1, 62, -1, 64, -1, -1, 67, -1, 69,
1409 70, -1, -1, -1, -1, -1, 62, -1, 64, 65,
1410 -1, -1, -1, -1, 70, 3, 4, 5, 6, 7,
1411 8, -1, 10, 11, -1, -1, -1, 15, 16, 31,
1412 32, 33, 34, 21, 36, 37, 38, 39, 40, -1,
1413 -1, -1, -1, 31, 32, 33, 34, -1, 36, -1,
1414 -1, -1, -1, 41, 42, -1, 3, 4, 5, 6,
1415 7, 8, -1, 10, 11, 67, -1, -1, 15, 16,
1416 -1, -1, -1, -1, 62, 22, 64, -1, -1, -1,
1417 -1, -1, 70, -1, 31, 32, 33, 34, -1, 36,
1418 -1, -1, -1, -1, 41, 42, 3, 4, 5, 6,
1419 7, 8, -1, 10, 11, -1, -1, -1, 15, 16,
1420 -1, 51, 52, 53, 54, 62, -1, 64, 58, 59,
1421 60, -1, 62, 70, 31, 32, 33, 34, 68, 36,
1422 -1, -1, -1, -1, 41, 42, 3, 4, 5, 6,
1423 7, 8, -1, 10, 11, -1, -1, -1, 15, 16,
1424 -1, -1, -1, -1, -1, 62, -1, 64, -1, -1,
1425 -1, -1, -1, 70, 31, 32, 33, 34, -1, 36,
1426 -1, -1, -1, -1, 41, 42, 3, 4, 5, 6,
1427 7, 8, -1, 10, 11, -1, -1, -1, 15, 16,
1428 -1, -1, -1, -1, -1, 62, -1, 64, -1, -1,
1429 -1, -1, -1, 70, 31, 32, 33, 34, -1, 36,
1430 -1, -1, -1, -1, 41, 42, 3, 4, 5, 6,
1431 7, 8, -1, 10, 11, -1, -1, -1, 15, 16,
1432 -1, -1, -1, -1, -1, 62, -1, 64, -1, -1,
1433 -1, -1, -1, 70, 31, -1, -1, 34, -1, 36,
1434 12, 13, 14, 31, 32, 33, 34, -1, 36, 37,
1435 38, 39, 40, -1, -1, -1, -1, -1, 12, 13,
1436 14, -1, -1, -1, -1, 62, -1, 64, -1, -1,
1437 -1, -1, -1, 70, 46, 47, 48, 49, 50, 67,
1438 -1, -1, -1, 55, 56, 57, -1, -1, -1, -1,
1439 62, 63, 46, 47, 48, 49, 50, -1, -1, -1,
1440 -1, -1, 56, 57, -1, -1, -1, -1, 62, 63,
1441 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
1442 33, 34, -1, 36, 37, 38, 39, 40, -1, 42,
1443 -1, 44, 45, 23, 24, 25, 26, 27, 28, 29,
1444 30, 31, 32, 33, 34, -1, 36, 37, 38, 39,
1445 40, -1, 42, 23, 24, 25, 26, 27, 28, 29,
1446 30, 31, 32, 33, 34, -1, 36, 37, 38, 39,
1447 40, -1, 42, 23, 24, 25, 26, 27, 28, 29,
1448 -1, 31, 32, 33, 34, -1, 36, 37, 38, 39,
1449 40, -1, 42, 31, 32, 33, 34, -1, 36, 37,
1450 38, 39, 40, -1, -1, -1, 44, 45, 30, 31,
1451 32, 33, 34, -1, 36, 37, 38, 39, 40, 30,
1452 31, 32, 33, 34, -1, 36, 37, 38, 39, 40,
1453 32, 33, 34, -1, 36, 37, 38, 39, 40
1454};
1455
1456/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
1457 state STATE-NUM. */
1458static const yytype_int8 yystos[] =
1459{
1460 0, 3, 4, 5, 6, 7, 8, 10, 11, 15,
1461 16, 31, 32, 33, 34, 36, 41, 42, 62, 64,
1462 70, 74, 75, 77, 78, 80, 81, 82, 83, 84,
1463 85, 86, 88, 89, 90, 91, 92, 9, 46, 77,
1464 78, 78, 77, 77, 78, 78, 11, 65, 75, 78,
1465 81, 93, 94, 95, 96, 97, 98, 11, 90, 0,
1466 66, 12, 13, 14, 17, 46, 47, 48, 49, 50,
1467 56, 57, 62, 63, 23, 24, 25, 26, 27, 28,
1468 29, 31, 32, 33, 34, 36, 37, 38, 39, 40,
1469 42, 18, 19, 20, 18, 18, 19, 19, 20, 53,
1470 58, 59, 60, 51, 52, 54, 62, 68, 11, 15,
1471 44, 45, 44, 67, 30, 44, 45, 69, 67, 81,
1472 95, 69, 71, 81, 76, 62, 87, 87, 87, 11,
1473 78, 79, 81, 81, 78, 78, 78, 78, 78, 78,
1474 77, 78, 90, 78, 78, 78, 78, 78, 78, 78,
1475 78, 78, 29, 21, 80, 22, 80, 80, 80, 21,
1476 80, 22, 80, 62, 62, 62, 62, 62, 62, 78,
1477 79, 62, 9, 46, 81, 78, 98, 81, 78, 81,
1478 98, 69, 95, 77, 81, 3, 44, 30, 67, 69,
1479 72, 55, 30, 77, 78, 90, 80, 80, 80, 80,
1480 81, 81, 81, 81, 81, 81, 30, 67, 81, 44,
1481 45, 67, 81, 78, 11, 81, 87, 78, 55, 30,
1482 67, 67, 67, 69, 69, 67, 78, 67, 81, 98,
1483 67, 44, 87, 78, 81, 81, 67, 81, 67, 67
1484};
1485
1486/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */
1487static const yytype_int8 yyr1[] =
1488{
1489 0, 73, 74, 75, 75, 76, 75, 77, 77, 77,
1490 77, 77, 77, 77, 77, 77, 77, 77, 77, 78,
1491 78, 78, 78, 78, 79, 79, 79, 79, 79, 77,
1492 78, 78, 78, 78, 78, 78, 78, 78, 78, 80,
1493 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
1494 80, 80, 81, 81, 81, 81, 81, 81, 82, 82,
1495 83, 83, 84, 84, 85, 85, 86, 86, 77, 77,
1496 77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
1497 77, 77, 77, 87, 87, 88, 89, 89, 77, 77,
1498 77, 77, 77, 77, 77, 77, 90, 90, 90, 90,
1499 90, 90, 91, 91, 92, 93, 93, 93, 94, 94,
1500 95, 95, 95, 96, 97, 98, 98, 98, 98, 98,
1501 98, 77, 77, 77
1502};
1503
1504/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */
1505static const yytype_int8 yyr2[] =
1506{
1507 0, 2, 1, 1, 3, 0, 4, 2, 2, 4,
1508 4, 5, 6, 6, 3, 1, 1, 1, 1, 1,
1509 2, 2, 2, 2, 0, 1, 3, 3, 5, 4,
1510 3, 3, 3, 3, 3, 3, 3, 3, 3, 1,
1511 3, 3, 3, 5, 5, 3, 6, 6, 4, 3,
1512 3, 3, 1, 1, 1, 1, 1, 1, 3, 3,
1513 4, 4, 3, 3, 4, 4, 3, 3, 2, 2,
1514 2, 3, 3, 3, 2, 2, 7, 7, 5, 5,
1515 5, 5, 2, 0, 3, 1, 1, 0, 1, 1,
1516 1, 1, 1, 1, 1, 2, 1, 1, 2, 2,
1517 2, 3, 2, 3, 3, 1, 2, 2, 2, 3,
1518 1, 1, 3, 3, 1, 3, 3, 5, 3, 3,
1519 5, 2, 2, 4
1520};
1521
1522
1523enum { YYENOMEM = -2 };
1524
1525#define yyerrok (yyerrstatus = 0)
1526#define yyclearin (yychar = YYEMPTY)
1527
1528#define YYACCEPT goto yyacceptlab
1529#define YYABORT goto yyabortlab
1530#define YYERROR goto yyerrorlab
1531#define YYNOMEM goto yyexhaustedlab
1532
1533
1534#define YYRECOVERING() (!!yyerrstatus)
1535
1536#define YYBACKUP(Token, Value) \
1537 do \
1538 if (yychar == YYEMPTY) \
1539 { \
1540 yychar = (Token); \
1541 yylval = (Value); \
1542 YYPOPSTACK (yylen); \
1543 yystate = *yyssp; \
1544 goto yybackup; \
1545 } \
1546 else \
1547 { \
1548 yyerror (YY_("syntax error: cannot back up")); \
1549 YYERROR; \
1550 } \
1551 while (0)
1552
1553/* Backward compatibility with an undocumented macro.
1554 Use YYerror or YYUNDEF. */
1555#define YYERRCODE YYUNDEF
1556
1557
1558/* Enable debugging if requested. */
1559#if YYDEBUG
1560
1561# ifndef YYFPRINTF
1562# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1563# define YYFPRINTF fprintf
1564# endif
1565
1566# define YYDPRINTF(Args) \
1567do { \
1568 if (yydebug) \
1569 YYFPRINTF Args; \
1570} while (0)
1571
1572
1573
1574
1575# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
1576do { \
1577 if (yydebug) \
1578 { \
1579 YYFPRINTF (stderr, "%s ", Title); \
1580 yy_symbol_print (stderr, \
1581 Kind, Value); \
1582 YYFPRINTF (stderr, "\n"); \
1583 } \
1584} while (0)
1585
1586
1587/*-----------------------------------.
1588| Print this symbol's value on YYO. |
1589`-----------------------------------*/
1590
1591static void
1593 ada_exp_yysymbol_kind_t yykind, ada_exp_YYSTYPE const * const yyvaluep)
1594{
1595 FILE *yyoutput = yyo;
1596 YY_USE (yyoutput);
1597 if (!yyvaluep)
1598 return;
1600 YY_USE (yykind);
1602}
1603
1604
1605/*---------------------------.
1606| Print this symbol on YYO. |
1607`---------------------------*/
1608
1609static void
1611 ada_exp_yysymbol_kind_t yykind, ada_exp_YYSTYPE const * const yyvaluep)
1612{
1613 YYFPRINTF (yyo, "%s %s (",
1614 yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
1615
1616 yy_symbol_value_print (yyo, yykind, yyvaluep);
1617 YYFPRINTF (yyo, ")");
1618}
1619
1620/*------------------------------------------------------------------.
1621| yy_stack_print -- Print the state stack from its BOTTOM up to its |
1622| TOP (included). |
1623`------------------------------------------------------------------*/
1624
1625static void
1627{
1628 YYFPRINTF (stderr, "Stack now");
1629 for (; yybottom <= yytop; yybottom++)
1630 {
1631 int yybot = *yybottom;
1632 YYFPRINTF (stderr, " %d", yybot);
1633 }
1634 YYFPRINTF (stderr, "\n");
1635}
1636
1637# define YY_STACK_PRINT(Bottom, Top) \
1638do { \
1639 if (yydebug) \
1640 yy_stack_print ((Bottom), (Top)); \
1641} while (0)
1642
1643
1644/*------------------------------------------------.
1645| Report that the YYRULE is going to be reduced. |
1646`------------------------------------------------*/
1647
1648static void
1650 int yyrule)
1651{
1652 int yylno = yyrline[yyrule];
1653 int yynrhs = yyr2[yyrule];
1654 int yyi;
1655 YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
1656 yyrule - 1, yylno);
1657 /* The symbols being reduced. */
1658 for (yyi = 0; yyi < yynrhs; yyi++)
1659 {
1660 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1661 yy_symbol_print (stderr,
1662 YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
1663 &yyvsp[(yyi + 1) - (yynrhs)]);
1664 YYFPRINTF (stderr, "\n");
1665 }
1666}
1667
1668# define YY_REDUCE_PRINT(Rule) \
1669do { \
1670 if (yydebug) \
1671 yy_reduce_print (yyssp, yyvsp, Rule); \
1672} while (0)
1673
1674/* Nonzero means print parse trace. It is left uninitialized so that
1675 multiple parsers can coexist. */
1677#else /* !YYDEBUG */
1678# define YYDPRINTF(Args) ((void) 0)
1679# define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
1680# define YY_STACK_PRINT(Bottom, Top)
1681# define YY_REDUCE_PRINT(Rule)
1682#endif /* !YYDEBUG */
1683
1684
1685/* YYINITDEPTH -- initial size of the parser's stacks. */
1686#ifndef YYINITDEPTH
1687# define YYINITDEPTH 200
1688#endif
1689
1690/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1691 if the built-in stack extension method is used).
1692
1693 Do not make this value too large; the results are undefined if
1694 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1695 evaluated with infinite-precision integer arithmetic. */
1696
1697#ifndef YYMAXDEPTH
1698# define YYMAXDEPTH 10000
1699#endif
1700
1701
1702
1703
1704
1705
1706/*-----------------------------------------------.
1707| Release the memory associated to this symbol. |
1708`-----------------------------------------------*/
1709
1710static void
1711yydestruct (const char *yymsg,
1712 ada_exp_yysymbol_kind_t yykind, ada_exp_YYSTYPE *yyvaluep)
1713{
1714 YY_USE (yyvaluep);
1715 if (!yymsg)
1716 yymsg = "Deleting";
1717 YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
1718
1720 YY_USE (yykind);
1722}
1723
1724
1725/* Lookahead token kind. */
1727
1728/* The semantic value of the lookahead symbol. */
1730/* Number of syntax errors so far. */
1732
1733
1734
1735
1736/*----------.
1737| yyparse. |
1738`----------*/
1739
1740int
1742{
1744 /* Number of tokens to shift before error messages enabled. */
1745 int yyerrstatus = 0;
1746
1747 /* Refer to the stacks through separate pointers, to allow yyoverflow
1748 to xreallocate them elsewhere. */
1749
1750 /* Their size. */
1752
1753 /* The state stack: array, bottom, top. */
1754 yy_state_t yyssa[YYINITDEPTH];
1755 yy_state_t *yyss = yyssa;
1757
1758 /* The semantic value stack: array, bottom, top. */
1760 ada_exp_YYSTYPE *yyvs = yyvsa;
1762
1763 int yyn;
1764 /* The return value of yyparse. */
1765 int yyresult;
1766 /* Lookahead symbol kind. */
1768 /* The variables used to return semantic value and location from the
1769 action routines. */
1771
1772
1773
1774#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1775
1776 /* The number of symbols on the RHS of the reduced rule.
1777 Keep to zero when no symbol should be popped. */
1778 int yylen = 0;
1779
1780 YYDPRINTF ((stderr, "Starting parse\n"));
1781
1782 yychar = YYEMPTY; /* Cause a token to be read. */
1783
1784 goto yysetstate;
1785
1786
1787/*------------------------------------------------------------.
1788| yynewstate -- push a new state, which is found in yystate. |
1789`------------------------------------------------------------*/
1790yynewstate:
1791 /* In all cases, when you get here, the value and location stacks
1792 have just been pushed. So pushing a state here evens the stacks. */
1793 yyssp++;
1794
1795
1796/*--------------------------------------------------------------------.
1797| yysetstate -- set current state (the top of the stack) to yystate. |
1798`--------------------------------------------------------------------*/
1799yysetstate:
1800 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1801 YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1806
1807 if (yyss + yystacksize - 1 <= yyssp)
1808#if !defined yyoverflow && !defined YYSTACK_RELOCATE
1809 YYNOMEM;
1810#else
1811 {
1812 /* Get the current used size of the three stacks, in elements. */
1813 YYPTRDIFF_T yysize = yyssp - yyss + 1;
1814
1815# if defined yyoverflow
1816 {
1817 /* Give user a chance to xreallocate the stack. Use copies of
1818 these so that the &'s don't force the real ones into
1819 memory. */
1820 yy_state_t *yyss1 = yyss;
1821 ada_exp_YYSTYPE *yyvs1 = yyvs;
1822
1823 /* Each stack pointer address is followed by the size of the
1824 data in use in that stack, in bytes. This used to be a
1825 conditional around just the two extra args, but that might
1826 be undefined if yyoverflow is a macro. */
1827 yyoverflow (YY_("memory exhausted"),
1828 &yyss1, yysize * YYSIZEOF (*yyssp),
1829 &yyvs1, yysize * YYSIZEOF (*yyvsp),
1830 &yystacksize);
1831 yyss = yyss1;
1832 yyvs = yyvs1;
1833 }
1834# else /* defined YYSTACK_RELOCATE */
1835 /* Extend the stack our own way. */
1836 if (YYMAXDEPTH <= yystacksize)
1837 YYNOMEM;
1838 yystacksize *= 2;
1839 if (YYMAXDEPTH < yystacksize)
1841
1842 {
1843 yy_state_t *yyss1 = yyss;
1844 union ada_exp_yyalloc *yyptr =
1845 YY_CAST (union ada_exp_yyalloc *,
1847 if (! yyptr)
1848 YYNOMEM;
1851# undef YYSTACK_RELOCATE
1852 if (yyss1 != yyssa)
1853 YYSTACK_FREE (yyss1);
1854 }
1855# endif
1856
1857 yyssp = yyss + yysize - 1;
1858 yyvsp = yyvs + yysize - 1;
1859
1861 YYDPRINTF ((stderr, "Stack size increased to %ld\n",
1862 YY_CAST (long, yystacksize)));
1864
1865 if (yyss + yystacksize - 1 <= yyssp)
1866 YYABORT;
1867 }
1868#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1869
1870
1871 if (yystate == YYFINAL)
1872 YYACCEPT;
1873
1874 goto yybackup;
1875
1876
1877/*-----------.
1878| yybackup. |
1879`-----------*/
1880yybackup:
1881 /* Do appropriate processing given the current state. Read a
1882 lookahead token if we need one and don't already have one. */
1883
1884 /* First try to decide what to do without reference to lookahead token. */
1885 yyn = yypact[yystate];
1886 if (yypact_value_is_default (yyn))
1887 goto yydefault;
1888
1889 /* Not known => get a lookahead token if don't already have one. */
1890
1891 /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
1892 if (yychar == YYEMPTY)
1893 {
1894 YYDPRINTF ((stderr, "Reading a token\n"));
1895 yychar = yylex ();
1896 }
1897
1898 if (yychar <= YYEOF)
1899 {
1900 yychar = YYEOF;
1901 yytoken = YYSYMBOL_YYEOF;
1902 YYDPRINTF ((stderr, "Now at end of input.\n"));
1903 }
1904 else if (yychar == YYerror)
1905 {
1906 /* The scanner already issued an error message, process directly
1907 to error recovery. But do not keep the error token as
1908 lookahead, it is too special and may lead us to an endless
1909 loop in error recovery. */
1910 yychar = YYUNDEF;
1911 yytoken = YYSYMBOL_YYerror;
1912 goto yyerrlab1;
1913 }
1914 else
1915 {
1916 yytoken = YYTRANSLATE (yychar);
1917 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1918 }
1919
1920 /* If the proper action on seeing token YYTOKEN is to reduce or to
1921 detect an error, take that action. */
1922 yyn += yytoken;
1923 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1924 goto yydefault;
1925 yyn = yytable[yyn];
1926 if (yyn <= 0)
1927 {
1928 if (yytable_value_is_error (yyn))
1929 goto yyerrlab;
1930 yyn = -yyn;
1931 goto yyreduce;
1932 }
1933
1934 /* Count tokens shifted since error; after three, turn off error
1935 status. */
1936 if (yyerrstatus)
1937 yyerrstatus--;
1938
1939 /* Shift the lookahead token. */
1940 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1941 yystate = yyn;
1943 *++yyvsp = yylval;
1945
1946 /* Discard the shifted token. */
1947 yychar = YYEMPTY;
1948 goto yynewstate;
1949
1950
1951/*-----------------------------------------------------------.
1952| yydefault -- do the default action for the current state. |
1953`-----------------------------------------------------------*/
1954yydefault:
1955 yyn = yydefact[yystate];
1956 if (yyn == 0)
1957 goto yyerrlab;
1958 goto yyreduce;
1959
1960
1961/*-----------------------------.
1962| yyreduce -- do a reduction. |
1963`-----------------------------*/
1964yyreduce:
1965 /* yyn is the number of a rule to reduce with. */
1966 yylen = yyr2[yyn];
1967
1968 /* If YYLEN is nonzero, implement the default value of the action:
1969 '$$ = $1'.
1970
1971 Otherwise, the following line sets YYVAL to garbage.
1972 This behavior is undocumented and Bison
1973 users should not rely upon it. Assigning to YYVAL
1974 unconditionally makes the parser a bit smaller, and it avoids a
1975 GCC warning that YYVAL may be used uninitialized. */
1976 yyval = yyvsp[1-yylen];
1977
1978
1979 YY_REDUCE_PRINT (yyn);
1980 switch (yyn)
1981 {
1982 case 4: /* exp1: exp1 ';' exp */
1983#line 501 "ada-exp.y"
1984 { ada_wrap2<comma_operation> (BINOP_COMMA); }
1985#line 1987 "ada-exp.c.tmp"
1986 break;
1987
1988 case 5: /* $@1: %empty */
1989#line 503 "ada-exp.y"
1990 {
1991 assignments.emplace_back
1992 (new ada_assign_operation (ada_pop (), nullptr));
1993 }
1994#line 1996 "ada-exp.c.tmp"
1995 break;
1996
1997 case 6: /* exp1: primary ASSIGN $@1 exp */
1998#line 508 "ada-exp.y"
1999 {
2000 ada_assign_up assign
2001 = std::move (assignments.back ());
2002 assignments.pop_back ();
2003 value *lhs_val = (assign->eval_for_resolution
2004 (pstate->expout.get ()));
2005
2006 operation_up rhs = pstate->pop ();
2007 rhs = resolve (std::move (rhs), true,
2008 lhs_val->type ());
2009
2010 assign->set_rhs (std::move (rhs));
2011 pstate->push (std::move (assign));
2012 }
2013#line 2015 "ada-exp.c.tmp"
2014 break;
2015
2016 case 7: /* primary: primary DOT_ID */
2017#line 527 "ada-exp.y"
2018 {
2019 if (strcmp ((yyvsp[0].sval).ptr, "all") == 0)
2020 ada_wrap<ada_unop_ind_operation> ();
2021 else
2022 {
2023 operation_up arg = ada_pop ();
2025 (std::move (arg), copy_name ((yyvsp[0].sval)));
2026 }
2027 }
2028#line 2030 "ada-exp.c.tmp"
2029 break;
2030
2031 case 8: /* primary: primary DOT_COMPLETE */
2032#line 540 "ada-exp.y"
2033 {
2034 /* This is done even for ".all", because
2035 that might be a prefix. */
2036 operation_up arg = ada_pop ();
2039 (std::move (arg), copy_name ((yyvsp[0].sval))));
2041 pstate->push (operation_up (str_op));
2043 }
2044#line 2046 "ada-exp.c.tmp"
2045 break;
2046
2047 case 9: /* primary: primary '(' arglist ')' */
2048#line 554 "ada-exp.y"
2049 { ada_funcall ((yyvsp[-1].lval)); }
2050#line 2052 "ada-exp.c.tmp"
2051 break;
2052
2053 case 10: /* primary: var_or_type '(' arglist ')' */
2054#line 556 "ada-exp.y"
2055 {
2056 if ((yyvsp[-3].tval) != NULL)
2057 {
2058 if ((yyvsp[-1].lval) != 1)
2059 error (_("Invalid conversion"));
2060 operation_up arg = ada_pop ();
2062 (std::move (arg), (yyvsp[-3].tval));
2063 }
2064 else
2065 ada_funcall ((yyvsp[-1].lval));
2066 }
2067#line 2069 "ada-exp.c.tmp"
2068 break;
2069
2070 case 11: /* primary: var_or_type '\'' '(' exp ')' */
2071#line 571 "ada-exp.y"
2072 {
2073 if ((yyvsp[-4].tval) == NULL)
2074 error (_("Type required for qualification"));
2075 operation_up arg = ada_pop (true,
2076 check_typedef ((yyvsp[-4].tval)));
2078 (std::move (arg), (yyvsp[-4].tval));
2079 }
2080#line 2082 "ada-exp.c.tmp"
2081 break;
2082
2083 case 12: /* primary: primary '(' simple_exp DOTDOT simple_exp ')' */
2084#line 583 "ada-exp.y"
2085 { ada_wrap3<ada_ternop_slice_operation> (); }
2086#line 2088 "ada-exp.c.tmp"
2087 break;
2088
2089 case 13: /* primary: var_or_type '(' simple_exp DOTDOT simple_exp ')' */
2090#line 585 "ada-exp.y"
2091 { if ((yyvsp[-5].tval) == NULL)
2092 ada_wrap3<ada_ternop_slice_operation> ();
2093 else
2094 error (_("Cannot slice a type"));
2095 }
2096#line 2098 "ada-exp.c.tmp"
2097 break;
2098
2099 case 14: /* primary: '(' exp1 ')' */
2100#line 592 "ada-exp.y"
2101 { }
2102#line 2104 "ada-exp.c.tmp"
2103 break;
2104
2105 case 15: /* primary: var_or_type */
2106#line 604 "ada-exp.y"
2107 { if ((yyvsp[0].tval) != NULL)
2108 pstate->push_new<type_operation> ((yyvsp[0].tval));
2109 }
2110#line 2112 "ada-exp.c.tmp"
2111 break;
2112
2113 case 16: /* primary: DOLLAR_VARIABLE */
2114#line 610 "ada-exp.y"
2115 { pstate->push_dollar ((yyvsp[0].sval)); }
2116#line 2118 "ada-exp.c.tmp"
2117 break;
2118
2119 case 17: /* primary: aggregate */
2120#line 614 "ada-exp.y"
2121 {
2123 (pop_component ());
2124 }
2125#line 2127 "ada-exp.c.tmp"
2126 break;
2127
2128 case 18: /* primary: '@' */
2129#line 621 "ada-exp.y"
2130 {
2131 if (assignments.empty ())
2132 error (_("the target name symbol ('@') may only "
2133 "appear in an assignment context"));
2134 ada_assign_operation *current
2135 = assignments.back ().get ();
2137 }
2138#line 2140 "ada-exp.c.tmp"
2139 break;
2140
2141 case 20: /* simple_exp: '-' simple_exp */
2142#line 635 "ada-exp.y"
2143 { ada_wrap_overload<ada_neg_operation> (UNOP_NEG); }
2144#line 2146 "ada-exp.c.tmp"
2145 break;
2146
2147 case 21: /* simple_exp: '+' simple_exp */
2148#line 639 "ada-exp.y"
2149 {
2150 operation_up arg = ada_pop ();
2151 operation_up empty;
2152
2153 /* If an overloaded operator was found, use
2154 it. Otherwise, unary + has no effect and
2155 the argument can be pushed instead. */
2156 operation_up call = maybe_overload (UNOP_PLUS, arg,
2157 empty);
2158 if (call != nullptr)
2159 arg = std::move (call);
2160 pstate->push (std::move (arg));
2161 }
2162#line 2164 "ada-exp.c.tmp"
2163 break;
2164
2165 case 22: /* simple_exp: NOT simple_exp */
2166#line 655 "ada-exp.y"
2167 {
2168 ada_wrap_overload<unary_logical_not_operation>
2169 (UNOP_LOGICAL_NOT);
2170 }
2171#line 2173 "ada-exp.c.tmp"
2172 break;
2173
2174 case 23: /* simple_exp: ABS simple_exp */
2175#line 662 "ada-exp.y"
2176 { ada_wrap_overload<ada_abs_operation> (UNOP_ABS); }
2177#line 2179 "ada-exp.c.tmp"
2178 break;
2179
2180 case 24: /* arglist: %empty */
2181#line 665 "ada-exp.y"
2182 { (yyval.lval) = 0; }
2183#line 2185 "ada-exp.c.tmp"
2184 break;
2185
2186 case 25: /* arglist: exp */
2187#line 669 "ada-exp.y"
2188 { (yyval.lval) = 1; }
2189#line 2191 "ada-exp.c.tmp"
2190 break;
2191
2192 case 26: /* arglist: NAME ARROW exp */
2193#line 671 "ada-exp.y"
2194 { (yyval.lval) = 1; }
2195#line 2197 "ada-exp.c.tmp"
2196 break;
2197
2198 case 27: /* arglist: arglist ',' exp */
2199#line 673 "ada-exp.y"
2200 { (yyval.lval) = (yyvsp[-2].lval) + 1; }
2201#line 2203 "ada-exp.c.tmp"
2202 break;
2203
2204 case 28: /* arglist: arglist ',' NAME ARROW exp */
2205#line 675 "ada-exp.y"
2206 { (yyval.lval) = (yyvsp[-4].lval) + 1; }
2207#line 2209 "ada-exp.c.tmp"
2208 break;
2209
2210 case 29: /* primary: '{' var_or_type '}' primary */
2211#line 680 "ada-exp.y"
2212 {
2213 if ((yyvsp[-2].tval) == NULL)
2214 error (_("Type required within braces in coercion"));
2215 operation_up arg = ada_pop ();
2217 (std::move (arg), (yyvsp[-2].tval));
2218 }
2219#line 2221 "ada-exp.c.tmp"
2220 break;
2221
2222 case 30: /* simple_exp: simple_exp STARSTAR simple_exp */
2223#line 692 "ada-exp.y"
2224 { ada_wrap2<ada_binop_exp_operation> (BINOP_EXP); }
2225#line 2227 "ada-exp.c.tmp"
2226 break;
2227
2228 case 31: /* simple_exp: simple_exp '*' simple_exp */
2229#line 696 "ada-exp.y"
2230 { ada_wrap2<ada_binop_mul_operation> (BINOP_MUL); }
2231#line 2233 "ada-exp.c.tmp"
2232 break;
2233
2234 case 32: /* simple_exp: simple_exp '/' simple_exp */
2235#line 700 "ada-exp.y"
2236 { ada_wrap2<ada_binop_div_operation> (BINOP_DIV); }
2237#line 2239 "ada-exp.c.tmp"
2238 break;
2239
2240 case 33: /* simple_exp: simple_exp REM simple_exp */
2241#line 704 "ada-exp.y"
2242 { ada_wrap2<ada_binop_rem_operation> (BINOP_REM); }
2243#line 2245 "ada-exp.c.tmp"
2244 break;
2245
2246 case 34: /* simple_exp: simple_exp MOD simple_exp */
2247#line 708 "ada-exp.y"
2248 { ada_wrap2<ada_binop_mod_operation> (BINOP_MOD); }
2249#line 2251 "ada-exp.c.tmp"
2250 break;
2251
2252 case 35: /* simple_exp: simple_exp '@' simple_exp */
2253#line 712 "ada-exp.y"
2254 { ada_wrap2<repeat_operation> (BINOP_REPEAT); }
2255#line 2257 "ada-exp.c.tmp"
2256 break;
2257
2258 case 36: /* simple_exp: simple_exp '+' simple_exp */
2259#line 716 "ada-exp.y"
2260 { ada_wrap_op<ada_binop_addsub_operation> (BINOP_ADD); }
2261#line 2263 "ada-exp.c.tmp"
2262 break;
2263
2264 case 37: /* simple_exp: simple_exp '&' simple_exp */
2265#line 720 "ada-exp.y"
2266 { ada_wrap2<ada_concat_operation> (BINOP_CONCAT); }
2267#line 2269 "ada-exp.c.tmp"
2268 break;
2269
2270 case 38: /* simple_exp: simple_exp '-' simple_exp */
2271#line 724 "ada-exp.y"
2272 { ada_wrap_op<ada_binop_addsub_operation> (BINOP_SUB); }
2273#line 2275 "ada-exp.c.tmp"
2274 break;
2275
2276 case 40: /* relation: simple_exp '=' simple_exp */
2277#line 731 "ada-exp.y"
2278 { ada_wrap_op<ada_binop_equal_operation> (BINOP_EQUAL); }
2279#line 2281 "ada-exp.c.tmp"
2280 break;
2281
2282 case 41: /* relation: simple_exp NOTEQUAL simple_exp */
2283#line 735 "ada-exp.y"
2284 { ada_wrap_op<ada_binop_equal_operation> (BINOP_NOTEQUAL); }
2285#line 2287 "ada-exp.c.tmp"
2286 break;
2287
2288 case 42: /* relation: simple_exp LEQ simple_exp */
2289#line 739 "ada-exp.y"
2290 { ada_un_wrap2<leq_operation> (BINOP_LEQ); }
2291#line 2293 "ada-exp.c.tmp"
2292 break;
2293
2294 case 43: /* relation: simple_exp IN simple_exp DOTDOT simple_exp */
2295#line 743 "ada-exp.y"
2296 { ada_wrap3<ada_ternop_range_operation> (); }
2297#line 2299 "ada-exp.c.tmp"
2298 break;
2299
2300 case 44: /* relation: simple_exp IN primary TICK_RANGE tick_arglist */
2301#line 745 "ada-exp.y"
2302 {
2303 operation_up rhs = ada_pop ();
2304 operation_up lhs = ada_pop ();
2306 (std::move (lhs), std::move (rhs), (yyvsp[0].lval));
2307 }
2308#line 2310 "ada-exp.c.tmp"
2309 break;
2310
2311 case 45: /* relation: simple_exp IN var_or_type */
2312#line 752 "ada-exp.y"
2313 {
2314 if ((yyvsp[0].tval) == NULL)
2315 error (_("Right operand of 'in' must be type"));
2316 operation_up arg = ada_pop ();
2318 (std::move (arg), (yyvsp[0].tval));
2319 }
2320#line 2322 "ada-exp.c.tmp"
2321 break;
2322
2323 case 46: /* relation: simple_exp NOT IN simple_exp DOTDOT simple_exp */
2324#line 760 "ada-exp.y"
2325 { ada_wrap3<ada_ternop_range_operation> ();
2326 ada_wrap<unary_logical_not_operation> (); }
2327#line 2329 "ada-exp.c.tmp"
2328 break;
2329
2330 case 47: /* relation: simple_exp NOT IN primary TICK_RANGE tick_arglist */
2331#line 763 "ada-exp.y"
2332 {
2333 operation_up rhs = ada_pop ();
2334 operation_up lhs = ada_pop ();
2336 (std::move (lhs), std::move (rhs), (yyvsp[0].lval));
2337 ada_wrap<unary_logical_not_operation> ();
2338 }
2339#line 2341 "ada-exp.c.tmp"
2340 break;
2341
2342 case 48: /* relation: simple_exp NOT IN var_or_type */
2343#line 771 "ada-exp.y"
2344 {
2345 if ((yyvsp[0].tval) == NULL)
2346 error (_("Right operand of 'in' must be type"));
2347 operation_up arg = ada_pop ();
2349 (std::move (arg), (yyvsp[0].tval));
2350 ada_wrap<unary_logical_not_operation> ();
2351 }
2352#line 2354 "ada-exp.c.tmp"
2353 break;
2354
2355 case 49: /* relation: simple_exp GEQ simple_exp */
2356#line 782 "ada-exp.y"
2357 { ada_un_wrap2<geq_operation> (BINOP_GEQ); }
2358#line 2360 "ada-exp.c.tmp"
2359 break;
2360
2361 case 50: /* relation: simple_exp '<' simple_exp */
2362#line 786 "ada-exp.y"
2363 { ada_un_wrap2<less_operation> (BINOP_LESS); }
2364#line 2366 "ada-exp.c.tmp"
2365 break;
2366
2367 case 51: /* relation: simple_exp '>' simple_exp */
2368#line 790 "ada-exp.y"
2369 { ada_un_wrap2<gtr_operation> (BINOP_GTR); }
2370#line 2372 "ada-exp.c.tmp"
2371 break;
2372
2373 case 58: /* and_exp: relation _AND_ relation */
2374#line 803 "ada-exp.y"
2375 { ada_wrap2<ada_bitwise_and_operation>
2376 (BINOP_BITWISE_AND); }
2377#line 2379 "ada-exp.c.tmp"
2378 break;
2379
2380 case 59: /* and_exp: and_exp _AND_ relation */
2381#line 806 "ada-exp.y"
2382 { ada_wrap2<ada_bitwise_and_operation>
2383 (BINOP_BITWISE_AND); }
2384#line 2386 "ada-exp.c.tmp"
2385 break;
2386
2387 case 60: /* and_then_exp: relation _AND_ THEN relation */
2388#line 812 "ada-exp.y"
2389 { ada_wrap2<logical_and_operation>
2390 (BINOP_LOGICAL_AND); }
2391#line 2393 "ada-exp.c.tmp"
2392 break;
2393
2394 case 61: /* and_then_exp: and_then_exp _AND_ THEN relation */
2395#line 815 "ada-exp.y"
2396 { ada_wrap2<logical_and_operation>
2397 (BINOP_LOGICAL_AND); }
2398#line 2400 "ada-exp.c.tmp"
2399 break;
2400
2401 case 62: /* or_exp: relation OR relation */
2402#line 821 "ada-exp.y"
2403 { ada_wrap2<ada_bitwise_ior_operation>
2404 (BINOP_BITWISE_IOR); }
2405#line 2407 "ada-exp.c.tmp"
2406 break;
2407
2408 case 63: /* or_exp: or_exp OR relation */
2409#line 824 "ada-exp.y"
2410 { ada_wrap2<ada_bitwise_ior_operation>
2411 (BINOP_BITWISE_IOR); }
2412#line 2414 "ada-exp.c.tmp"
2413 break;
2414
2415 case 64: /* or_else_exp: relation OR ELSE relation */
2416#line 830 "ada-exp.y"
2417 { ada_wrap2<logical_or_operation> (BINOP_LOGICAL_OR); }
2418#line 2420 "ada-exp.c.tmp"
2419 break;
2420
2421 case 65: /* or_else_exp: or_else_exp OR ELSE relation */
2422#line 832 "ada-exp.y"
2423 { ada_wrap2<logical_or_operation> (BINOP_LOGICAL_OR); }
2424#line 2426 "ada-exp.c.tmp"
2425 break;
2426
2427 case 66: /* xor_exp: relation XOR relation */
2428#line 836 "ada-exp.y"
2429 { ada_wrap2<ada_bitwise_xor_operation>
2430 (BINOP_BITWISE_XOR); }
2431#line 2433 "ada-exp.c.tmp"
2432 break;
2433
2434 case 67: /* xor_exp: xor_exp XOR relation */
2435#line 839 "ada-exp.y"
2436 { ada_wrap2<ada_bitwise_xor_operation>
2437 (BINOP_BITWISE_XOR); }
2438#line 2440 "ada-exp.c.tmp"
2439 break;
2440
2441 case 68: /* primary: primary TICK_ACCESS */
2442#line 852 "ada-exp.y"
2443 { ada_addrof (); }
2444#line 2446 "ada-exp.c.tmp"
2445 break;
2446
2447 case 69: /* primary: primary TICK_ADDRESS */
2448#line 854 "ada-exp.y"
2450#line 2452 "ada-exp.c.tmp"
2451 break;
2452
2453 case 70: /* primary: primary TICK_COMPLETE */
2454#line 856 "ada-exp.y"
2455 {
2457 }
2458#line 2460 "ada-exp.c.tmp"
2459 break;
2460
2461 case 71: /* primary: primary TICK_FIRST tick_arglist */
2462#line 860 "ada-exp.y"
2463 {
2464 operation_up arg = ada_pop ();
2466 (std::move (arg), OP_ATR_FIRST, (yyvsp[0].lval));
2467 }
2468#line 2470 "ada-exp.c.tmp"
2469 break;
2470
2471 case 72: /* primary: primary TICK_LAST tick_arglist */
2472#line 866 "ada-exp.y"
2473 {
2474 operation_up arg = ada_pop ();
2476 (std::move (arg), OP_ATR_LAST, (yyvsp[0].lval));
2477 }
2478#line 2480 "ada-exp.c.tmp"
2479 break;
2480
2481 case 73: /* primary: primary TICK_LENGTH tick_arglist */
2482#line 872 "ada-exp.y"
2483 {
2484 operation_up arg = ada_pop ();
2486 (std::move (arg), OP_ATR_LENGTH, (yyvsp[0].lval));
2487 }
2488#line 2490 "ada-exp.c.tmp"
2489 break;
2490
2491 case 74: /* primary: primary TICK_SIZE */
2492#line 878 "ada-exp.y"
2493 { ada_wrap<ada_atr_size_operation> (); }
2494#line 2496 "ada-exp.c.tmp"
2495 break;
2496
2497 case 75: /* primary: primary TICK_TAG */
2498#line 880 "ada-exp.y"
2499 { ada_wrap<ada_atr_tag_operation> (); }
2500#line 2502 "ada-exp.c.tmp"
2501 break;
2502
2503 case 76: /* primary: opt_type_prefix TICK_MIN '(' exp ',' exp ')' */
2504#line 882 "ada-exp.y"
2505 { ada_wrap2<ada_binop_min_operation> (BINOP_MIN); }
2506#line 2508 "ada-exp.c.tmp"
2507 break;
2508
2509 case 77: /* primary: opt_type_prefix TICK_MAX '(' exp ',' exp ')' */
2510#line 884 "ada-exp.y"
2511 { ada_wrap2<ada_binop_max_operation> (BINOP_MAX); }
2512#line 2514 "ada-exp.c.tmp"
2513 break;
2514
2515 case 78: /* primary: opt_type_prefix TICK_POS '(' exp ')' */
2516#line 886 "ada-exp.y"
2517 { ada_wrap<ada_pos_operation> (); }
2518#line 2520 "ada-exp.c.tmp"
2519 break;
2520
2521 case 79: /* primary: type_prefix TICK_VAL '(' exp ')' */
2522#line 888 "ada-exp.y"
2523 {
2524 operation_up arg = ada_pop ();
2526 ((yyvsp[-4].tval), std::move (arg));
2527 }
2528#line 2530 "ada-exp.c.tmp"
2529 break;
2530
2531 case 80: /* primary: type_prefix TICK_ENUM_REP '(' exp ')' */
2532#line 894 "ada-exp.y"
2533 {
2534 operation_up arg = ada_pop (true, (yyvsp[-4].tval));
2536 ((yyvsp[-4].tval), std::move (arg));
2537 }
2538#line 2540 "ada-exp.c.tmp"
2539 break;
2540
2541 case 81: /* primary: type_prefix TICK_ENUM_VAL '(' exp ')' */
2542#line 900 "ada-exp.y"
2543 {
2544 operation_up arg = ada_pop (true, (yyvsp[-4].tval));
2546 ((yyvsp[-4].tval), std::move (arg));
2547 }
2548#line 2550 "ada-exp.c.tmp"
2549 break;
2550
2551 case 82: /* primary: type_prefix TICK_MODULUS */
2552#line 906 "ada-exp.y"
2553 {
2554 struct type *type_arg = check_typedef ((yyvsp[-1].tval));
2555 if (!ada_is_modular_type (type_arg))
2556 error (_("'modulus must be applied to modular type"));
2557 write_int (pstate, ada_modulus (type_arg),
2558 type_arg->target_type ());
2559 }
2560#line 2562 "ada-exp.c.tmp"
2561 break;
2562
2563 case 83: /* tick_arglist: %empty */
2564#line 916 "ada-exp.y"
2565 { (yyval.lval) = 1; }
2566#line 2568 "ada-exp.c.tmp"
2567 break;
2568
2569 case 84: /* tick_arglist: '(' INT ')' */
2570#line 918 "ada-exp.y"
2571 { (yyval.lval) = (yyvsp[-1].typed_val).val->as_integer<LONGEST> (); }
2572#line 2574 "ada-exp.c.tmp"
2573 break;
2574
2575 case 85: /* type_prefix: var_or_type */
2576#line 923 "ada-exp.y"
2577 {
2578 if ((yyvsp[0].tval) == NULL)
2579 error (_("Prefix must be type"));
2580 (yyval.tval) = (yyvsp[0].tval);
2581 }
2582#line 2584 "ada-exp.c.tmp"
2583 break;
2584
2585 case 86: /* opt_type_prefix: type_prefix */
2586#line 932 "ada-exp.y"
2587 { (yyval.tval) = (yyvsp[0].tval); }
2588#line 2590 "ada-exp.c.tmp"
2589 break;
2590
2591 case 87: /* opt_type_prefix: %empty */
2592#line 934 "ada-exp.y"
2593 { (yyval.tval) = parse_type (pstate)->builtin_void; }
2594#line 2596 "ada-exp.c.tmp"
2595 break;
2596
2597 case 88: /* primary: INT */
2598#line 939 "ada-exp.y"
2599 {
2600 pstate->push_new<long_const_operation> ((yyvsp[0].typed_val).type, *(yyvsp[0].typed_val).val);
2601 ada_wrap<ada_wrapped_operation> ();
2602 }
2603#line 2605 "ada-exp.c.tmp"
2604 break;
2605
2606 case 89: /* primary: CHARLIT */
2607#line 946 "ada-exp.y"
2608 {
2609 pstate->push_new<ada_char_operation> ((yyvsp[0].typed_char).type, (yyvsp[0].typed_char).val);
2610 }
2611#line 2613 "ada-exp.c.tmp"
2612 break;
2613
2614 case 90: /* primary: FLOAT */
2615#line 952 "ada-exp.y"
2616 {
2617 float_data data;
2618 std::copy (std::begin ((yyvsp[0].typed_val_float).val), std::end ((yyvsp[0].typed_val_float).val),
2619 std::begin (data));
2621 ((yyvsp[0].typed_val_float).type, data);
2622 ada_wrap<ada_wrapped_operation> ();
2623 }
2624#line 2626 "ada-exp.c.tmp"
2625 break;
2626
2627 case 91: /* primary: NULL_PTR */
2628#line 963 "ada-exp.y"
2629 {
2630 struct type *null_ptr_type
2631 = lookup_pointer_type (parse_type (pstate)->builtin_int0);
2632 write_int (pstate, 0, null_ptr_type);
2633 }
2634#line 2636 "ada-exp.c.tmp"
2635 break;
2636
2637 case 92: /* primary: STRING */
2638#line 971 "ada-exp.y"
2639 {
2641 (copy_name ((yyvsp[0].sval)));
2642 }
2643#line 2645 "ada-exp.c.tmp"
2644 break;
2645
2646 case 93: /* primary: TRUEKEYWORD */
2647#line 978 "ada-exp.y"
2648 {
2649 write_int (pstate, 1,
2650 parse_type (pstate)->builtin_bool);
2651 }
2652#line 2654 "ada-exp.c.tmp"
2653 break;
2654
2655 case 94: /* primary: FALSEKEYWORD */
2656#line 983 "ada-exp.y"
2657 {
2658 write_int (pstate, 0,
2659 parse_type (pstate)->builtin_bool);
2660 }
2661#line 2663 "ada-exp.c.tmp"
2662 break;
2663
2664 case 95: /* primary: NEW NAME */
2665#line 990 "ada-exp.y"
2666 { error (_("NEW not implemented.")); }
2667#line 2669 "ada-exp.c.tmp"
2668 break;
2669
2670 case 96: /* var_or_type: NAME */
2671#line 994 "ada-exp.y"
2672 { (yyval.tval) = write_var_or_type (pstate, NULL, (yyvsp[0].sval)); }
2673#line 2675 "ada-exp.c.tmp"
2674 break;
2675
2676 case 97: /* var_or_type: NAME_COMPLETE */
2677#line 996 "ada-exp.y"
2678 {
2680 NULL,
2681 (yyvsp[0].sval));
2682 }
2683#line 2685 "ada-exp.c.tmp"
2684 break;
2685
2686 case 98: /* var_or_type: block NAME */
2687#line 1002 "ada-exp.y"
2688 { (yyval.tval) = write_var_or_type (pstate, (yyvsp[-1].bval), (yyvsp[0].sval)); }
2689#line 2691 "ada-exp.c.tmp"
2690 break;
2691
2692 case 99: /* var_or_type: block NAME_COMPLETE */
2693#line 1004 "ada-exp.y"
2694 {
2696 (yyvsp[-1].bval),
2697 (yyvsp[0].sval));
2698 }
2699#line 2701 "ada-exp.c.tmp"
2700 break;
2701
2702 case 100: /* var_or_type: NAME TICK_ACCESS */
2703#line 1010 "ada-exp.y"
2704 {
2705 (yyval.tval) = write_var_or_type (pstate, NULL, (yyvsp[-1].sval));
2706 if ((yyval.tval) == NULL)
2707 ada_addrof ();
2708 else
2709 (yyval.tval) = lookup_pointer_type ((yyval.tval));
2710 }
2711#line 2713 "ada-exp.c.tmp"
2712 break;
2713
2714 case 101: /* var_or_type: block NAME TICK_ACCESS */
2715#line 1018 "ada-exp.y"
2716 {
2717 (yyval.tval) = write_var_or_type (pstate, (yyvsp[-2].bval), (yyvsp[-1].sval));
2718 if ((yyval.tval) == NULL)
2719 ada_addrof ();
2720 else
2721 (yyval.tval) = lookup_pointer_type ((yyval.tval));
2722 }
2723#line 2725 "ada-exp.c.tmp"
2724 break;
2725
2726 case 102: /* block: NAME COLONCOLON */
2727#line 1029 "ada-exp.y"
2728 { (yyval.bval) = block_lookup (NULL, (yyvsp[-1].sval).ptr); }
2729#line 2731 "ada-exp.c.tmp"
2730 break;
2731
2732 case 103: /* block: block NAME COLONCOLON */
2733#line 1031 "ada-exp.y"
2734 { (yyval.bval) = block_lookup ((yyvsp[-2].bval), (yyvsp[-1].sval).ptr); }
2735#line 2737 "ada-exp.c.tmp"
2736 break;
2737
2738 case 104: /* aggregate: '(' aggregate_component_list ')' */
2739#line 1036 "ada-exp.y"
2740 {
2741 std::vector<ada_component_up> components
2742 = pop_components ((yyvsp[-1].lval));
2743
2744 push_component<ada_aggregate_component>
2745 (std::move (components));
2746 }
2747#line 2749 "ada-exp.c.tmp"
2748 break;
2749
2750 case 105: /* aggregate_component_list: component_groups */
2751#line 1046 "ada-exp.y"
2752 { (yyval.lval) = (yyvsp[0].lval); }
2753#line 2755 "ada-exp.c.tmp"
2754 break;
2755
2756 case 106: /* aggregate_component_list: positional_list exp */
2757#line 1048 "ada-exp.y"
2758 {
2759 push_component<ada_positional_component>
2760 ((yyvsp[-1].lval), ada_pop ());
2761 (yyval.lval) = (yyvsp[-1].lval) + 1;
2762 }
2763#line 2765 "ada-exp.c.tmp"
2764 break;
2765
2766 case 107: /* aggregate_component_list: positional_list component_groups */
2767#line 1054 "ada-exp.y"
2768 { (yyval.lval) = (yyvsp[-1].lval) + (yyvsp[0].lval); }
2769#line 2771 "ada-exp.c.tmp"
2770 break;
2771
2772 case 108: /* positional_list: exp ',' */
2773#line 1059 "ada-exp.y"
2774 {
2775 push_component<ada_positional_component>
2776 (0, ada_pop ());
2777 (yyval.lval) = 1;
2778 }
2779#line 2781 "ada-exp.c.tmp"
2780 break;
2781
2782 case 109: /* positional_list: positional_list exp ',' */
2783#line 1065 "ada-exp.y"
2784 {
2785 push_component<ada_positional_component>
2786 ((yyvsp[-2].lval), ada_pop ());
2787 (yyval.lval) = (yyvsp[-2].lval) + 1;
2788 }
2789#line 2791 "ada-exp.c.tmp"
2790 break;
2791
2792 case 110: /* component_groups: others */
2793#line 1073 "ada-exp.y"
2794 { (yyval.lval) = 1; }
2795#line 2797 "ada-exp.c.tmp"
2796 break;
2797
2798 case 111: /* component_groups: component_group */
2799#line 1074 "ada-exp.y"
2800 { (yyval.lval) = 1; }
2801#line 2803 "ada-exp.c.tmp"
2802 break;
2803
2804 case 112: /* component_groups: component_group ',' component_groups */
2805#line 1076 "ada-exp.y"
2806 { (yyval.lval) = (yyvsp[0].lval) + 1; }
2807#line 2809 "ada-exp.c.tmp"
2808 break;
2809
2810 case 113: /* others: OTHERS ARROW exp */
2811#line 1080 "ada-exp.y"
2812 {
2813 push_component<ada_others_component> (ada_pop ());
2814 }
2815#line 2817 "ada-exp.c.tmp"
2816 break;
2817
2818 case 114: /* component_group: component_associations */
2819#line 1087 "ada-exp.y"
2820 {
2822 choices->set_associations (pop_associations ((yyvsp[0].lval)));
2823 }
2824#line 2826 "ada-exp.c.tmp"
2825 break;
2826
2827 case 115: /* component_associations: NAME ARROW exp */
2828#line 1100 "ada-exp.y"
2829 {
2830 push_component<ada_choices_component> (ada_pop ());
2831 write_name_assoc (pstate, (yyvsp[-2].sval));
2832 (yyval.lval) = 1;
2833 }
2834#line 2836 "ada-exp.c.tmp"
2835 break;
2836
2837 case 116: /* component_associations: simple_exp ARROW exp */
2838#line 1106 "ada-exp.y"
2839 {
2840 push_component<ada_choices_component> (ada_pop ());
2841 push_association<ada_name_association> (ada_pop ());
2842 (yyval.lval) = 1;
2843 }
2844#line 2846 "ada-exp.c.tmp"
2845 break;
2846
2847 case 117: /* component_associations: simple_exp DOTDOT simple_exp ARROW exp */
2848#line 1112 "ada-exp.y"
2849 {
2850 push_component<ada_choices_component> (ada_pop ());
2851 operation_up rhs = ada_pop ();
2852 operation_up lhs = ada_pop ();
2853 push_association<ada_discrete_range_association>
2854 (std::move (lhs), std::move (rhs));
2855 (yyval.lval) = 1;
2856 }
2857#line 2859 "ada-exp.c.tmp"
2858 break;
2859
2860 case 118: /* component_associations: NAME '|' component_associations */
2861#line 1121 "ada-exp.y"
2862 {
2863 write_name_assoc (pstate, (yyvsp[-2].sval));
2864 (yyval.lval) = (yyvsp[0].lval) + 1;
2865 }
2866#line 2868 "ada-exp.c.tmp"
2867 break;
2868
2869 case 119: /* component_associations: simple_exp '|' component_associations */
2870#line 1126 "ada-exp.y"
2871 {
2872 push_association<ada_name_association> (ada_pop ());
2873 (yyval.lval) = (yyvsp[0].lval) + 1;
2874 }
2875#line 2877 "ada-exp.c.tmp"
2876 break;
2877
2878 case 120: /* component_associations: simple_exp DOTDOT simple_exp '|' component_associations */
2879#line 1132 "ada-exp.y"
2880 {
2881 operation_up rhs = ada_pop ();
2882 operation_up lhs = ada_pop ();
2883 push_association<ada_discrete_range_association>
2884 (std::move (lhs), std::move (rhs));
2885 (yyval.lval) = (yyvsp[0].lval) + 1;
2886 }
2887#line 2889 "ada-exp.c.tmp"
2888 break;
2889
2890 case 121: /* primary: '*' primary */
2891#line 1145 "ada-exp.y"
2892 { ada_wrap<ada_unop_ind_operation> (); }
2893#line 2895 "ada-exp.c.tmp"
2894 break;
2895
2896 case 122: /* primary: '&' primary */
2897#line 1147 "ada-exp.y"
2898 { ada_addrof (); }
2899#line 2901 "ada-exp.c.tmp"
2900 break;
2901
2902 case 123: /* primary: primary '[' exp ']' */
2903#line 1149 "ada-exp.y"
2904 {
2905 ada_wrap2<subscript_operation> (BINOP_SUBSCRIPT);
2906 ada_wrap<ada_wrapped_operation> ();
2907 }
2908#line 2910 "ada-exp.c.tmp"
2909 break;
2910
2911
2912#line 2914 "ada-exp.c.tmp"
2913
2914 default: break;
2915 }
2916 /* User semantic actions sometimes alter yychar, and that requires
2917 that yytoken be updated with the new translation. We take the
2918 approach of translating immediately before every use of yytoken.
2919 One alternative is translating here after every semantic action,
2920 but that translation would be missed if the semantic action invokes
2921 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2922 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2923 incorrect destructor might then be invoked immediately. In the
2924 case of YYERROR or YYBACKUP, subsequent parser actions might lead
2925 to an incorrect destructor call or verbose syntax error message
2926 before the lookahead is translated. */
2927 YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (ada_exp_yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
2928
2929 YYPOPSTACK (yylen);
2930 yylen = 0;
2931
2932 *++yyvsp = yyval;
2933
2934 /* Now 'shift' the result of the reduction. Determine what state
2935 that goes to, based on the state we popped back to and the rule
2936 number reduced by. */
2937 {
2938 const int yylhs = yyr1[yyn] - YYNTOKENS;
2939 const int yyi = yypgoto[yylhs] + *yyssp;
2940 yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
2941 ? yytable[yyi]
2942 : yydefgoto[yylhs]);
2943 }
2944
2945 goto yynewstate;
2946
2947
2948/*--------------------------------------.
2949| yyerrlab -- here on detecting error. |
2950`--------------------------------------*/
2951yyerrlab:
2952 /* Make sure we have latest lookahead translation. See comments at
2953 user semantic actions for why this is necessary. */
2955 /* If not already recovering from an error, report this error. */
2956 if (!yyerrstatus)
2957 {
2958 ++yynerrs;
2959 yyerror (YY_("syntax error"));
2960 }
2961
2962 if (yyerrstatus == 3)
2963 {
2964 /* If just tried and failed to reuse lookahead token after an
2965 error, discard it. */
2966
2967 if (yychar <= YYEOF)
2968 {
2969 /* Return failure if at end of input. */
2970 if (yychar == YYEOF)
2971 YYABORT;
2972 }
2973 else
2974 {
2975 yydestruct ("Error: discarding",
2976 yytoken, &yylval);
2977 yychar = YYEMPTY;
2978 }
2979 }
2980
2981 /* Else will try to reuse lookahead token after shifting the error
2982 token. */
2983 goto yyerrlab1;
2984
2985
2986/*---------------------------------------------------.
2987| yyerrorlab -- error raised explicitly by YYERROR. |
2988`---------------------------------------------------*/
2989yyerrorlab:
2990 /* Pacify compilers when the user code never invokes YYERROR and the
2991 label yyerrorlab therefore never appears in user code. */
2992 if (0)
2993 YYERROR;
2994 ++yynerrs;
2995
2996 /* Do not reclaim the symbols of the rule whose action triggered
2997 this YYERROR. */
2998 YYPOPSTACK (yylen);
2999 yylen = 0;
3001 yystate = *yyssp;
3002 goto yyerrlab1;
3003
3004
3005/*-------------------------------------------------------------.
3006| yyerrlab1 -- common code for both syntax error and YYERROR. |
3007`-------------------------------------------------------------*/
3008yyerrlab1:
3009 yyerrstatus = 3; /* Each real token shifted decrements this. */
3010
3011 /* Pop stack until we find a state that shifts the error token. */
3012 for (;;)
3013 {
3014 yyn = yypact[yystate];
3015 if (!yypact_value_is_default (yyn))
3016 {
3017 yyn += YYSYMBOL_YYerror;
3018 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
3019 {
3020 yyn = yytable[yyn];
3021 if (0 < yyn)
3022 break;
3023 }
3024 }
3025
3026 /* Pop the current state because it cannot handle the error token. */
3027 if (yyssp == yyss)
3028 YYABORT;
3029
3030
3031 yydestruct ("Error: popping",
3033 YYPOPSTACK (1);
3034 yystate = *yyssp;
3036 }
3037
3039 *++yyvsp = yylval;
3041
3042
3043 /* Shift the error token. */
3044 YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
3045
3046 yystate = yyn;
3047 goto yynewstate;
3048
3049
3050/*-------------------------------------.
3051| yyacceptlab -- YYACCEPT comes here. |
3052`-------------------------------------*/
3053yyacceptlab:
3054 yyresult = 0;
3055 goto yyreturnlab;
3056
3057
3058/*-----------------------------------.
3059| yyabortlab -- YYABORT comes here. |
3060`-----------------------------------*/
3061yyabortlab:
3062 yyresult = 1;
3063 goto yyreturnlab;
3064
3065
3066/*-----------------------------------------------------------.
3067| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. |
3068`-----------------------------------------------------------*/
3069yyexhaustedlab:
3070 yyerror (YY_("memory exhausted"));
3071 yyresult = 2;
3072 goto yyreturnlab;
3073
3074
3075/*----------------------------------------------------------.
3076| yyreturnlab -- parsing is finished, clean up and return. |
3077`----------------------------------------------------------*/
3078yyreturnlab:
3079 if (yychar != YYEMPTY)
3080 {
3081 /* Make sure we have latest lookahead translation. See comments at
3082 user semantic actions for why this is necessary. */
3083 yytoken = YYTRANSLATE (yychar);
3084 yydestruct ("Cleanup: discarding lookahead",
3085 yytoken, &yylval);
3086 }
3087 /* Do not reclaim the symbols of the rule whose action triggered
3088 this YYABORT or YYACCEPT. */
3089 YYPOPSTACK (yylen);
3091 while (yyssp != yyss)
3092 {
3093 yydestruct ("Cleanup: popping",
3095 YYPOPSTACK (1);
3096 }
3097#ifndef yyoverflow
3098 if (yyss != yyssa)
3100#endif
3101
3102 return yyresult;
3103}
3104
3105#line 1155 "ada-exp.y"
3106
3107
3108/* yylex defined in ada-lex.c: Reads one token, getting characters */
3109/* through lexptr. */
3110
3111/* Remap normal flex interface names (yylex) as well as gratuitiously */
3112/* global symbol names, so we can have multiple flex-generated parsers */
3113/* in gdb. */
3114
3115/* (See note above on previous definitions for YACC.) */
3116
3117#define yy_create_buffer ada_yy_create_buffer
3118#define yy_delete_buffer ada_yy_delete_buffer
3119#define yy_init_buffer ada_yy_init_buffer
3120#define yy_load_buffer_state ada_yy_load_buffer_state
3121#define yy_switch_to_buffer ada_yy_switch_to_buffer
3122#define yyrestart ada_yyrestart
3123#define yytext ada_yytext
3124
3125static struct obstack temp_parse_space;
3126
3127/* The following kludge was found necessary to prevent conflicts between */
3128/* defs.h and non-standard stdlib.h files. */
3129#define qsort __qsort__dummy
3130#include "ada-lex.c"
3131
3132int
3133ada_parse (struct parser_state *par_state)
3134{
3135 /* Setting up the parser state. */
3136 scoped_restore pstate_restore = make_scoped_restore (&pstate);
3137 gdb_assert (par_state != NULL);
3138 pstate = par_state;
3139 original_expr = par_state->lexptr;
3140
3141 scoped_restore restore_yydebug = make_scoped_restore (&yydebug,
3142 par_state->debug);
3143
3144 lexer_init (yyin); /* (Re-)initialize lexer. */
3145 obstack_free (&temp_parse_space, NULL);
3146 obstack_init (&temp_parse_space);
3147 components.clear ();
3148 associations.clear ();
3149 int_storage.clear ();
3150 assignments.clear ();
3151
3152 int result = yyparse ();
3153 if (!result)
3154 {
3155 struct type *context_type = nullptr;
3156 if (par_state->void_context_p)
3157 context_type = parse_type (par_state)->builtin_void;
3158 pstate->set_operation (ada_pop (true, context_type));
3159 }
3160 return result;
3161}
3162
3163static void
3164yyerror (const char *msg)
3165{
3166 error (_("Error in expression, near `%s'."), pstate->lexptr);
3167}
3168
3169/* Emit expression to access an instance of SYM, in block BLOCK (if
3170 non-NULL). */
3171
3172static void
3174{
3177
3178 par_state->push_new<ada_var_value_operation> (sym);
3179}
3180
3181/* Write integer or boolean constant ARG of type TYPE. */
3182
3183static void
3184write_int (struct parser_state *par_state, LONGEST arg, struct type *type)
3185{
3187 ada_wrap<ada_wrapped_operation> ();
3188}
3189
3190/* Emit expression corresponding to the renamed object named
3191 designated by RENAMED_ENTITY[0 .. RENAMED_ENTITY_LEN-1] in the
3192 context of ORIG_LEFT_CONTEXT, to which is applied the operations
3193 encoded by RENAMING_EXPR. MAX_DEPTH is the maximum number of
3194 cascaded renamings to allow. If ORIG_LEFT_CONTEXT is null, it
3195 defaults to the currently selected block. ORIG_SYMBOL is the
3196 symbol that originally encoded the renaming. It is needed only
3197 because its prefix also qualifies any index variables used to index
3198 or slice an array. It should not be necessary once we go to the
3199 new encoding entirely (FIXME pnh 7/20/2007). */
3200
3201static void
3203 const struct block *orig_left_context,
3204 const char *renamed_entity, int renamed_entity_len,
3205 const char *renaming_expr, int max_depth)
3206{
3207 char *name;
3208 enum { SIMPLE_INDEX, LOWER_BOUND, UPPER_BOUND } slice_state;
3209 struct block_symbol sym_info;
3210
3211 if (max_depth <= 0)
3212 error (_("Could not find renamed symbol"));
3213
3214 if (orig_left_context == NULL)
3215 orig_left_context = get_selected_block (NULL);
3216
3217 name = obstack_strndup (&temp_parse_space, renamed_entity,
3218 renamed_entity_len);
3219 ada_lookup_encoded_symbol (name, orig_left_context, VAR_DOMAIN, &sym_info);
3220 if (sym_info.symbol == NULL)
3221 error (_("Could not find renamed variable: %s"), ada_decode (name).c_str ());
3222 else if (sym_info.symbol->aclass () == LOC_TYPEDEF)
3223 /* We have a renaming of an old-style renaming symbol. Don't
3224 trust the block information. */
3225 sym_info.block = orig_left_context;
3226
3227 {
3228 const char *inner_renamed_entity;
3229 int inner_renamed_entity_len;
3230 const char *inner_renaming_expr;
3231
3232 switch (ada_parse_renaming (sym_info.symbol, &inner_renamed_entity,
3233 &inner_renamed_entity_len,
3234 &inner_renaming_expr))
3235 {
3236 case ADA_NOT_RENAMING:
3237 write_var_from_sym (par_state, sym_info);
3238 break;
3240 write_object_renaming (par_state, sym_info.block,
3241 inner_renamed_entity, inner_renamed_entity_len,
3242 inner_renaming_expr, max_depth - 1);
3243 break;
3244 default:
3245 goto BadEncoding;
3246 }
3247 }
3248
3249 slice_state = SIMPLE_INDEX;
3250 while (*renaming_expr == 'X')
3251 {
3252 renaming_expr += 1;
3253
3254 switch (*renaming_expr) {
3255 case 'A':
3256 renaming_expr += 1;
3257 ada_wrap<ada_unop_ind_operation> ();
3258 break;
3259 case 'L':
3260 slice_state = LOWER_BOUND;
3261 /* FALLTHROUGH */
3262 case 'S':
3263 renaming_expr += 1;
3264 if (isdigit (*renaming_expr))
3265 {
3266 char *next;
3267 long val = strtol (renaming_expr, &next, 10);
3268 if (next == renaming_expr)
3269 goto BadEncoding;
3270 renaming_expr = next;
3271 write_int (par_state, val, parse_type (par_state)->builtin_int);
3272 }
3273 else
3274 {
3275 const char *end;
3276 char *index_name;
3277 struct block_symbol index_sym_info;
3278
3279 end = strchr (renaming_expr, 'X');
3280 if (end == NULL)
3281 end = renaming_expr + strlen (renaming_expr);
3282
3283 index_name = obstack_strndup (&temp_parse_space, renaming_expr,
3284 end - renaming_expr);
3285 renaming_expr = end;
3286
3287 ada_lookup_encoded_symbol (index_name, orig_left_context,
3288 VAR_DOMAIN, &index_sym_info);
3289 if (index_sym_info.symbol == NULL)
3290 error (_("Could not find %s"), index_name);
3291 else if (index_sym_info.symbol->aclass () == LOC_TYPEDEF)
3292 /* Index is an old-style renaming symbol. */
3293 index_sym_info.block = orig_left_context;
3294 write_var_from_sym (par_state, index_sym_info);
3295 }
3296 if (slice_state == SIMPLE_INDEX)
3297 ada_funcall (1);
3298 else if (slice_state == LOWER_BOUND)
3299 slice_state = UPPER_BOUND;
3300 else if (slice_state == UPPER_BOUND)
3301 {
3302 ada_wrap3<ada_ternop_slice_operation> ();
3303 slice_state = SIMPLE_INDEX;
3304 }
3305 break;
3306
3307 case 'R':
3308 {
3309 const char *end;
3310
3311 renaming_expr += 1;
3312
3313 if (slice_state != SIMPLE_INDEX)
3314 goto BadEncoding;
3315 end = strchr (renaming_expr, 'X');
3316 if (end == NULL)
3317 end = renaming_expr + strlen (renaming_expr);
3318
3319 operation_up arg = ada_pop ();
3321 (std::move (arg), std::string (renaming_expr,
3322 end - renaming_expr));
3323 renaming_expr = end;
3324 break;
3325 }
3326
3327 default:
3328 goto BadEncoding;
3329 }
3330 }
3331 if (slice_state == SIMPLE_INDEX)
3332 return;
3333
3334 BadEncoding:
3335 error (_("Internal error in encoding of renaming declaration"));
3336}
3337
3338static const struct block*
3339block_lookup (const struct block *context, const char *raw_name)
3340{
3341 const char *name;
3342 struct symtab *symtab;
3343 const struct block *result = NULL;
3344
3345 std::string name_storage;
3346 if (raw_name[0] == '\'')
3347 {
3348 raw_name += 1;
3349 name = raw_name;
3350 }
3351 else
3352 {
3353 name_storage = ada_encode (raw_name);
3354 name = name_storage.c_str ();
3355 }
3356
3357 std::vector<struct block_symbol> syms
3359
3360 if (context == NULL
3361 && (syms.empty () || syms[0].symbol->aclass () != LOC_BLOCK))
3363 else
3364 symtab = NULL;
3365
3366 if (symtab != NULL)
3367 result = symtab->compunit ()->blockvector ()->static_block ();
3368 else if (syms.empty () || syms[0].symbol->aclass () != LOC_BLOCK)
3369 {
3370 if (context == NULL)
3371 error (_("No file or function \"%s\"."), raw_name);
3372 else
3373 error (_("No function \"%s\" in specified context."), raw_name);
3374 }
3375 else
3376 {
3377 if (syms.size () > 1)
3378 warning (_("Function name \"%s\" ambiguous here"), raw_name);
3379 result = syms[0].symbol->value_block ();
3380 }
3381
3382 return result;
3383}
3384
3385static struct symbol*
3386select_possible_type_sym (const std::vector<struct block_symbol> &syms)
3387{
3388 int i;
3389 int preferred_index;
3390 struct type *preferred_type;
3391
3392 preferred_index = -1; preferred_type = NULL;
3393 for (i = 0; i < syms.size (); i += 1)
3394 switch (syms[i].symbol->aclass ())
3395 {
3396 case LOC_TYPEDEF:
3397 if (ada_prefer_type (syms[i].symbol->type (), preferred_type))
3398 {
3399 preferred_index = i;
3400 preferred_type = syms[i].symbol->type ();
3401 }
3402 break;
3403 case LOC_REGISTER:
3404 case LOC_ARG:
3405 case LOC_REF_ARG:
3406 case LOC_REGPARM_ADDR:
3407 case LOC_LOCAL:
3408 case LOC_COMPUTED:
3409 return NULL;
3410 default:
3411 break;
3412 }
3413 if (preferred_type == NULL)
3414 return NULL;
3415 return syms[preferred_index].symbol;
3416}
3417
3418static struct type*
3419find_primitive_type (struct parser_state *par_state, const char *name)
3420{
3421 struct type *type;
3423 par_state->gdbarch (),
3424 name);
3425 if (type == NULL && strcmp ("system__address", name) == 0)
3426 type = type_system_address (par_state);
3427
3428 if (type != NULL)
3429 {
3430 /* Check to see if we have a regular definition of this
3431 type that just didn't happen to have been read yet. */
3432 struct symbol *sym;
3433 char *expanded_name =
3434 (char *) alloca (strlen (name) + sizeof ("standard__"));
3435 strcpy (expanded_name, "standard__");
3436 strcat (expanded_name, name);
3437 sym = ada_lookup_symbol (expanded_name, NULL, VAR_DOMAIN).symbol;
3438 if (sym != NULL && sym->aclass () == LOC_TYPEDEF)
3439 type = sym->type ();
3440 }
3441
3442 return type;
3443}
3444
3445static int
3446chop_selector (const char *name, int end)
3447{
3448 int i;
3449 for (i = end - 1; i > 0; i -= 1)
3450 if (name[i] == '.' || (name[i] == '_' && name[i+1] == '_'))
3451 return i;
3452 return -1;
3453}
3454
3455/* If NAME is a string beginning with a separator (either '__', or
3456 '.'), chop this separator and return the result; else, return
3457 NAME. */
3458
3459static const char *
3461{
3462 if (*name == '.')
3463 return name + 1;
3464
3465 if (name[0] == '_' && name[1] == '_')
3466 return name + 2;
3467
3468 return name;
3469}
3470
3471/* Given that SELS is a string of the form (<sep><identifier>)*, where
3472 <sep> is '__' or '.', write the indicated sequence of
3473 STRUCTOP_STRUCT expression operators. Returns a pointer to the
3474 last operation that was pushed. */
3476write_selectors (struct parser_state *par_state, const char *sels)
3477{
3478 ada_structop_operation *result = nullptr;
3479 while (*sels != '\0')
3480 {
3481 const char *p = chop_separator (sels);
3482 sels = p;
3483 while (*sels != '\0' && *sels != '.'
3484 && (sels[0] != '_' || sels[1] != '_'))
3485 sels += 1;
3486 operation_up arg = ada_pop ();
3487 result = new ada_structop_operation (std::move (arg),
3488 std::string (p, sels - p));
3489 pstate->push (operation_up (result));
3490 }
3491 return result;
3492}
3493
3494/* Write a variable access (OP_VAR_VALUE) to ambiguous encoded name
3495 NAME[0..LEN-1], in block context BLOCK, to be resolved later. Writes
3496 a temporary symbol that is valid until the next call to ada_parse.
3497 */
3498static void
3500 const struct block *block, const char *name, int len)
3501{
3502 struct symbol *sym = new (&temp_parse_space) symbol ();
3503
3504 sym->set_domain (UNDEF_DOMAIN);
3505 sym->set_linkage_name (obstack_strndup (&temp_parse_space, name, len));
3506 sym->set_language (language_ada, nullptr);
3507
3508 block_symbol bsym { sym, block };
3509 par_state->push_new<ada_var_value_operation> (bsym);
3510}
3511
3512/* A convenient wrapper around ada_get_field_index that takes
3513 a non NUL-terminated FIELD_NAME0 and a FIELD_NAME_LEN instead
3514 of a NUL-terminated field name. */
3515
3516static int
3517ada_nget_field_index (const struct type *type, const char *field_name0,
3518 int field_name_len, int maybe_missing)
3519{
3520 char *field_name = (char *) alloca ((field_name_len + 1) * sizeof (char));
3521
3522 strncpy (field_name, field_name0, field_name_len);
3523 field_name[field_name_len] = '\0';
3524 return ada_get_field_index (type, field_name, maybe_missing);
3525}
3526
3527/* If encoded_field_name is the name of a field inside symbol SYM,
3528 then return the type of that field. Otherwise, return NULL.
3529
3530 This function is actually recursive, so if ENCODED_FIELD_NAME
3531 doesn't match one of the fields of our symbol, then try to see
3532 if ENCODED_FIELD_NAME could not be a succession of field names
3533 (in other words, the user entered an expression of the form
3534 TYPE_NAME.FIELD1.FIELD2.FIELD3), in which case we evaluate
3535 each field name sequentially to obtain the desired field type.
3536 In case of failure, we return NULL. */
3537
3538static struct type *
3539get_symbol_field_type (struct symbol *sym, const char *encoded_field_name)
3540{
3541 const char *field_name = encoded_field_name;
3542 const char *subfield_name;
3543 struct type *type = sym->type ();
3544 int fieldno;
3545
3546 if (type == NULL || field_name == NULL)
3547 return NULL;
3549
3550 while (field_name[0] != '\0')
3551 {
3553
3554 fieldno = ada_get_field_index (type, field_name, 1);
3555 if (fieldno >= 0)
3556 return type->field (fieldno).type ();
3557
3558 subfield_name = field_name;
3559 while (*subfield_name != '\0' && *subfield_name != '.'
3560 && (subfield_name[0] != '_' || subfield_name[1] != '_'))
3561 subfield_name += 1;
3562
3563 if (subfield_name[0] == '\0')
3564 return NULL;
3565
3567 subfield_name - field_name, 1);
3568 if (fieldno < 0)
3569 return NULL;
3570
3571 type = type->field (fieldno).type ();
3572 field_name = subfield_name;
3573 }
3574
3575 return NULL;
3576}
3577
3578/* Look up NAME0 (an unencoded identifier or dotted name) in BLOCK (or
3579 expression_block_context if NULL). If it denotes a type, return
3580 that type. Otherwise, write expression code to evaluate it as an
3581 object and return NULL. In this second case, NAME0 will, in general,
3582 have the form <name>(.<selector_name>)*, where <name> is an object
3583 or renaming encoded in the debugging data. Calls error if no
3584 prefix <name> matches a name in the debugging data (i.e., matches
3585 either a complete name or, as a wild-card match, the final
3586 identifier). */
3587
3588static struct type*
3590 const struct block *block, struct stoken name0)
3591{
3592 int depth;
3593 char *encoded_name;
3594 int name_len;
3595
3596 if (block == NULL)
3597 block = par_state->expression_context_block;
3598
3599 std::string name_storage = ada_encode (name0.ptr);
3600 name_len = name_storage.size ();
3601 encoded_name = obstack_strndup (&temp_parse_space, name_storage.c_str (),
3602 name_len);
3603 for (depth = 0; depth < MAX_RENAMING_CHAIN_LENGTH; depth += 1)
3604 {
3605 int tail_index;
3606
3607 tail_index = name_len;
3608 while (tail_index > 0)
3609 {
3610 struct symbol *type_sym;
3611 struct symbol *renaming_sym;
3612 const char* renaming;
3613 int renaming_len;
3614 const char* renaming_expr;
3615 int terminator = encoded_name[tail_index];
3616
3617 encoded_name[tail_index] = '\0';
3618 /* In order to avoid double-encoding, we want to only pass
3619 the decoded form to lookup functions. */
3620 std::string decoded_name = ada_decode (encoded_name);
3621 encoded_name[tail_index] = terminator;
3622
3623 std::vector<struct block_symbol> syms
3624 = ada_lookup_symbol_list (decoded_name.c_str (), block, VAR_DOMAIN);
3625
3626 type_sym = select_possible_type_sym (syms);
3627
3628 if (type_sym != NULL)
3629 renaming_sym = type_sym;
3630 else if (syms.size () == 1)
3631 renaming_sym = syms[0].symbol;
3632 else
3633 renaming_sym = NULL;
3634
3635 switch (ada_parse_renaming (renaming_sym, &renaming,
3636 &renaming_len, &renaming_expr))
3637 {
3638 case ADA_NOT_RENAMING:
3639 break;
3643 {
3644 int alloc_len = renaming_len + name_len - tail_index + 1;
3645 char *new_name
3646 = (char *) obstack_alloc (&temp_parse_space, alloc_len);
3647 strncpy (new_name, renaming, renaming_len);
3648 strcpy (new_name + renaming_len, encoded_name + tail_index);
3649 encoded_name = new_name;
3650 name_len = renaming_len + name_len - tail_index;
3651 goto TryAfterRenaming;
3652 }
3654 write_object_renaming (par_state, block, renaming, renaming_len,
3655 renaming_expr, MAX_RENAMING_CHAIN_LENGTH);
3656 write_selectors (par_state, encoded_name + tail_index);
3657 return NULL;
3658 default:
3659 internal_error (_("impossible value from ada_parse_renaming"));
3660 }
3661
3662 if (type_sym != NULL)
3663 {
3664 struct type *field_type;
3665
3666 if (tail_index == name_len)
3667 return type_sym->type ();
3668
3669 /* We have some extraneous characters after the type name.
3670 If this is an expression "TYPE_NAME.FIELD0.[...].FIELDN",
3671 then try to get the type of FIELDN. */
3672 field_type
3673 = get_symbol_field_type (type_sym, encoded_name + tail_index);
3674 if (field_type != NULL)
3675 return field_type;
3676 else
3677 error (_("Invalid attempt to select from type: \"%s\"."),
3678 name0.ptr);
3679 }
3680 else if (tail_index == name_len && syms.empty ())
3681 {
3682 struct type *type = find_primitive_type (par_state,
3683 encoded_name);
3684
3685 if (type != NULL)
3686 return type;
3687 }
3688
3689 if (syms.size () == 1)
3690 {
3691 write_var_from_sym (par_state, syms[0]);
3692 write_selectors (par_state, encoded_name + tail_index);
3693 return NULL;
3694 }
3695 else if (syms.empty ())
3696 {
3697 struct objfile *objfile = nullptr;
3698 if (block != nullptr)
3699 objfile = block->objfile ();
3700
3701 struct bound_minimal_symbol msym
3702 = ada_lookup_simple_minsym (decoded_name.c_str (), objfile);
3703 if (msym.minsym != NULL)
3704 {
3705 par_state->push_new<ada_var_msym_value_operation> (msym);
3706 /* Maybe cause error here rather than later? FIXME? */
3707 write_selectors (par_state, encoded_name + tail_index);
3708 return NULL;
3709 }
3710
3711 if (tail_index == name_len
3712 && strncmp (encoded_name, "standard__",
3713 sizeof ("standard__") - 1) == 0)
3714 error (_("No definition of \"%s\" found."), name0.ptr);
3715
3716 tail_index = chop_selector (encoded_name, tail_index);
3717 }
3718 else
3719 {
3720 write_ambiguous_var (par_state, block, encoded_name,
3721 tail_index);
3722 write_selectors (par_state, encoded_name + tail_index);
3723 return NULL;
3724 }
3725 }
3726
3727 if (!have_full_symbols () && !have_partial_symbols () && block == NULL)
3728 error (_("No symbol table is loaded. Use the \"file\" command."));
3729 if (block == par_state->expression_context_block)
3730 error (_("No definition of \"%s\" in current context."), name0.ptr);
3731 else
3732 error (_("No definition of \"%s\" in specified context."), name0.ptr);
3733
3734 TryAfterRenaming: ;
3735 }
3736
3737 error (_("Could not find renamed symbol \"%s\""), name0.ptr);
3738
3739}
3740
3741/* Because ada_completer_word_break_characters does not contain '.' --
3742 and it cannot easily be added, this breaks other completions -- we
3743 have to recreate the completion word-splitting here, so that we can
3744 provide a prefix that is then used when completing field names.
3745 Without this, an attempt like "complete print abc.d" will give a
3746 result like "print def" rather than "print abc.def". */
3747
3748static std::string
3750{
3751 const char *end = pstate->lexptr;
3752 /* First the end of the prefix. Here we stop at the token start or
3753 at '.' or space. */
3754 for (; end > original_expr && end[-1] != '.' && !isspace (end[-1]); --end)
3755 {
3756 /* Nothing. */
3757 }
3758 /* Now find the start of the prefix. */
3759 const char *ptr = end;
3760 /* Here we allow '.'. */
3761 for (;
3762 ptr > original_expr && (ptr[-1] == '.'
3763 || ptr[-1] == '_'
3764 || (ptr[-1] >= 'a' && ptr[-1] <= 'z')
3765 || (ptr[-1] >= 'A' && ptr[-1] <= 'Z')
3766 || (ptr[-1] & 0xff) >= 0x80);
3767 --ptr)
3768 {
3769 /* Nothing. */
3770 }
3771 /* ... except, skip leading spaces. */
3772 ptr = skip_spaces (ptr);
3773
3774 return std::string (ptr, end);
3775}
3776
3777/* A wrapper for write_var_or_type that is used specifically when
3778 completion is requested for the last of a sequence of
3779 identifiers. */
3780
3781static struct type *
3783 const struct block *block, struct stoken name0)
3784{
3785 int tail_index = chop_selector (name0.ptr, name0.length);
3786 /* If there's no separator, just defer to ordinary symbol
3787 completion. */
3788 if (tail_index == -1)
3789 return write_var_or_type (par_state, block, name0);
3790
3791 std::string copy (name0.ptr, tail_index);
3792 struct type *type = write_var_or_type (par_state, block,
3793 { copy.c_str (),
3794 (int) copy.length () });
3795 /* For completion purposes, it's enough that we return a type
3796 here. */
3797 if (type != nullptr)
3798 return type;
3799
3800 ada_structop_operation *op = write_selectors (par_state,
3801 name0.ptr + tail_index);
3802 op->set_prefix (find_completion_bounds (par_state));
3803 par_state->mark_struct_expression (op);
3804 return nullptr;
3805}
3806
3807/* Write a left side of a component association (e.g., NAME in NAME =>
3808 exp). If NAME has the form of a selected component, write it as an
3809 ordinary expression. If it is a simple variable that unambiguously
3810 corresponds to exactly one symbol that does not denote a type or an
3811 object renaming, also write it normally as an OP_VAR_VALUE.
3812 Otherwise, write it as an OP_NAME.
3813
3814 Unfortunately, we don't know at this point whether NAME is supposed
3815 to denote a record component name or the value of an array index.
3816 Therefore, it is not appropriate to disambiguate an ambiguous name
3817 as we normally would, nor to replace a renaming with its referent.
3818 As a result, in the (one hopes) rare case that one writes an
3819 aggregate such as (R => 42) where R renames an object or is an
3820 ambiguous name, one must write instead ((R) => 42). */
3821
3822static void
3823write_name_assoc (struct parser_state *par_state, struct stoken name)
3824{
3825 if (strchr (name.ptr, '.') == NULL)
3826 {
3827 std::vector<struct block_symbol> syms
3829 par_state->expression_context_block,
3830 VAR_DOMAIN);
3831
3832 if (syms.size () != 1 || syms[0].symbol->aclass () == LOC_TYPEDEF)
3834 else
3835 write_var_from_sym (par_state, syms[0]);
3836 }
3837 else
3838 if (write_var_or_type (par_state, NULL, name) != NULL)
3839 error (_("Invalid use of type."));
3840
3841 push_association<ada_name_association> (ada_pop ());
3842}
3843
3844static struct type *
3845type_for_char (struct parser_state *par_state, ULONGEST value)
3846{
3847 if (value <= 0xff)
3848 return language_string_char_type (par_state->language (),
3849 par_state->gdbarch ());
3850 else if (value <= 0xffff)
3851 return language_lookup_primitive_type (par_state->language (),
3852 par_state->gdbarch (),
3853 "wide_character");
3854 return language_lookup_primitive_type (par_state->language (),
3855 par_state->gdbarch (),
3856 "wide_wide_character");
3857}
3858
3859static struct type *
3861{
3862 struct type *type
3864 par_state->gdbarch (),
3865 "system__address");
3866 return type != NULL ? type : parse_type (par_state)->builtin_data_ptr;
3867}
3868
3869void _initialize_ada_exp ();
3870void
3872{
3873 obstack_init (&temp_parse_space);
3874}
const char *const name
#define TICK_VAL
Definition ada-exp.c:605
void ada_wrap_overload(enum exp_opcode op)
Definition ada-exp.c:237
#define LEQ
Definition ada-exp.c:581
#define DOLLAR_VARIABLE
Definition ada-exp.c:573
#define ELSE
Definition ada-exp.c:579
#define TRUEKEYWORD
Definition ada-exp.c:564
int yynerrs
Definition ada-exp.c:1731
#define STRING
Definition ada-exp.c:567
static ada_component_up pop_component()
Definition ada-exp.c:378
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Definition ada-exp.c:930
#define YYMAXDEPTH
Definition ada-exp.c:1698
#define NOTEQUAL
Definition ada-exp.c:580
yytokentype
Definition ada-exp.c:497
static std::string find_completion_bounds(struct parser_state *)
Definition ada-exp.c:3749
static void yy_symbol_value_print(FILE *yyo, ada_exp_yysymbol_kind_t yykind, ada_exp_YYSTYPE const *const yyvaluep)
Definition ada-exp.c:1592
static const char * yysymbol_name(ada_exp_yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED
Definition ada-exp.c:1192
#define YYSTACK_FREE
Definition ada-exp.c:991
static const yytype_int8 yytranslate[]
Definition ada-exp.c:1105
#define TICK_ADDRESS
Definition ada-exp.c:594
void ada_wrap_op(enum exp_opcode op)
Definition ada-exp.c:287
#define YY_ASSERT(E)
Definition ada-exp.c:950
#define YY_(Msgid)
Definition ada-exp.c:884
#define ABS
Definition ada-exp.c:589
#define YYNOMEM
Definition ada-exp.c:1531
#define TICK_COMPLETE
Definition ada-exp.c:570
std::unique_ptr< ada_assign_operation > ada_assign_up
Definition ada-exp.c:454
static struct type * write_var_or_type(struct parser_state *, const struct block *, struct stoken)
Definition ada-exp.c:3589
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
Definition ada-exp.c:931
static const yytype_int8 yydefact[]
Definition ada-exp.c:1241
static ada_structop_operation * write_selectors(struct parser_state *par_state, const char *sels)
Definition ada-exp.c:3476
#define YYNSTATES
Definition ada-exp.c:1090
#define TICK_ENUM_REP
Definition ada-exp.c:606
#define TICK_POS
Definition ada-exp.c:601
#define YY_IGNORE_USELESS_CAST_END
Definition ada-exp.c:946
short yytype_int16
Definition ada-exp.c:795
#define OR
Definition ada-exp.c:576
static const char * chop_separator(const char *name)
Definition ada-exp.c:3460
#define FALSEKEYWORD
Definition ada-exp.c:565
static int chop_selector(const char *name, int end)
Definition ada-exp.c:3446
ada_exp_YYSTYPE yylval
Definition ada-exp.c:1729
void * xmalloc(YYSIZE_T)
int ada_parse(struct parser_state *par_state)
Definition ada-exp.c:3133
static struct type * write_var_or_type_completion(struct parser_state *, const struct block *, struct stoken)
Definition ada-exp.c:3782
static struct type * type_system_address(struct parser_state *)
Definition ada-exp.c:3860
#define YYEOF
Definition ada-exp.c:557
#define YYABORT
Definition ada-exp.c:1529
void _initialize_ada_exp()
Definition ada-exp.c:3871
static const yytype_int16 yyrline[]
Definition ada-exp.c:1142
#define TICK_TAG
Definition ada-exp.c:604
#define YYSTACK_BYTES(N)
Definition ada-exp.c:1034
#define TICK_SIZE
Definition ada-exp.c:603
static void write_int(struct parser_state *, LONGEST, struct type *)
Definition ada-exp.c:3184
#define XOR
Definition ada-exp.c:577
yytype_uint8 yy_state_t
Definition ada-exp.c:871
#define NAME
Definition ada-exp.c:568
#define YY_REDUCE_PRINT(Rule)
Definition ada-exp.c:1668
#define YY_CAST(Type, Val)
Definition ada-exp.c:468
static const struct block * block_lookup(const struct block *, const char *)
Definition ada-exp.c:3339
#define REM
Definition ada-exp.c:587
static std::vector< ada_association_up > pop_associations(int n)
Definition ada-exp.c:421
#define ASSIGN
Definition ada-exp.c:574
#define TICK_RANGE
Definition ada-exp.c:602
static std::vector< ada_assign_up > assignments
Definition ada-exp.c:458
static struct parser_state * pstate
Definition ada-exp.c:101
static const yytype_int16 yypact[]
Definition ada-exp.c:1210
#define NULL_PTR
Definition ada-exp.c:561
static std::unique_ptr< expr_completion_base > make_tick_completer(struct stoken tok)
Definition ada-exp.c:447
static const yytype_uint8 yydefgoto[]
Definition ada-exp.c:1278
#define YYerror
Definition ada-exp.c:558
#define TICK_ENUM_VAL
Definition ada-exp.c:607
static struct type * type_for_char(struct parser_state *, ULONGEST)
Definition ada-exp.c:3845
#define YYUNDEF
Definition ada-exp.c:559
static struct obstack temp_parse_space
Definition ada-exp.c:3125
#define ARROW
Definition ada-exp.c:592
#define YYFINAL
Definition ada-exp.c:1079
static int yylex(void)
Definition ada-lex.l:120
#define YY_ACCESSING_SYMBOL(State)
Definition ada-exp.c:1161
#define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
Definition ada-exp.c:1575
void ada_un_wrap2(enum exp_opcode op)
Definition ada-exp.c:253
#define OTHERS
Definition ada-exp.c:609
static const yytype_int16 yypgoto[]
Definition ada-exp.c:1270
static void yydestruct(const char *yymsg, ada_exp_yysymbol_kind_t yykind, ada_exp_YYSTYPE *yyvaluep)
Definition ada-exp.c:1711
void push_component(Arg... args)
Definition ada-exp.c:359
static void yy_reduce_print(yy_state_t *yyssp, ada_exp_YYSTYPE *yyvsp, int yyrule)
Definition ada-exp.c:1649
static struct type * get_symbol_field_type(struct symbol *sym, const char *encoded_field_name)
Definition ada-exp.c:3539
#define DOT_COMPLETE
Definition ada-exp.c:571
#define YYNTOKENS
Definition ada-exp.c:1084
#define STARSTAR
Definition ada-exp.c:588
unsigned char yytype_uint8
Definition ada-exp.c:816
#define CHARLIT
Definition ada-exp.c:562
#define YY_STACK_PRINT(Bottom, Top)
Definition ada-exp.c:1637
#define YYSIZE_T
Definition ada-exp.c:857
static ada_choices_component * choice_component()
Definition ada-exp.c:369
#define DOTDOT
Definition ada-exp.c:584
static std::vector< ada_association_up > associations
Definition ada-exp.c:397
#define YY_IGNORE_USELESS_CAST_BEGIN
Definition ada-exp.c:945
#define parse_type(ps)
Definition ada-exp.c:84
static operation_up ada_pop(bool deprocedure_p=true, struct type *context_type=nullptr)
Definition ada-exp.c:165
int yyparse(void)
Definition ada-exp.c:1741
static operation_up maybe_overload(enum exp_opcode op, operation_up &lhs, operation_up &rhs)
Definition ada-exp.c:200
#define TICK_LENGTH
Definition ada-exp.c:597
#define TICK_MODULUS
Definition ada-exp.c:600
static const yytype_int8 yyr2[]
Definition ada-exp.c:1505
static ada_association_up pop_association()
Definition ada-exp.c:411
#define YYPTRDIFF_T
Definition ada-exp.c:843
#define NAME_COMPLETE
Definition ada-exp.c:572
static void yy_symbol_print(FILE *yyo, ada_exp_yysymbol_kind_t yykind, ada_exp_YYSTYPE const *const yyvaluep)
Definition ada-exp.c:1610
static struct symbol * select_possible_type_sym(const std::vector< struct block_symbol > &syms)
Definition ada-exp.c:3386
int yychar
Definition ada-exp.c:1726
void ada_wrap2(enum exp_opcode op)
Definition ada-exp.c:272
static const yytype_int16 yytable[]
Definition ada-exp.c:1288
#define GEQ
Definition ada-exp.c:582
#define YY_NULLPTRPTR
Definition ada-exp.c:480
#define YYACCEPT
Definition ada-exp.c:1528
#define yytable_value_is_error(Yyn)
Definition ada-exp.c:1205
static void ada_funcall(int nargs)
Definition ada-exp.c:312
#define COLONCOLON
Definition ada-exp.c:566
#define YYTRANSLATE(YYX)
Definition ada-exp.c:1098
static const yytype_int8 yystos[]
Definition ada-exp.c:1458
#define UNARY
Definition ada-exp.c:585
int yydebug
Definition ada-exp.c:1676
#define TICK_MIN
Definition ada-exp.c:599
void ada_wrap()
Definition ada-exp.c:174
#define YY_ATTRIBUTE_UNUSED
Definition ada-exp.c:901
#define NEW
Definition ada-exp.c:608
static void write_name_assoc(struct parser_state *, struct stoken)
Definition ada-exp.c:3823
static const char *const yytname[]
Definition ada-exp.c:1170
ada_exp_yysymbol_kind_t
Definition ada-exp.c:654
@ YYSYMBOL_exp1
Definition ada-exp.c:731
@ YYSYMBOL_68_
Definition ada-exp.c:724
@ YYSYMBOL_or_exp
Definition ada-exp.c:740
@ YYSYMBOL_aggregate
Definition ada-exp.c:748
@ YYSYMBOL_25_
Definition ada-exp.c:681
@ YYSYMBOL_STRING
Definition ada-exp.c:666
@ YYSYMBOL_YYUNDEF
Definition ada-exp.c:658
@ YYSYMBOL_type_prefix
Definition ada-exp.c:744
@ YYSYMBOL_71_
Definition ada-exp.c:727
@ YYSYMBOL_arglist
Definition ada-exp.c:735
@ YYSYMBOL_NULL_PTR
Definition ada-exp.c:660
@ YYSYMBOL_INT
Definition ada-exp.c:659
@ YYSYMBOL_76_1
Definition ada-exp.c:732
@ YYSYMBOL_and_then_exp
Definition ada-exp.c:739
@ YYSYMBOL_TICK_MIN
Definition ada-exp.c:708
@ YYSYMBOL_primary
Definition ada-exp.c:733
@ YYSYMBOL_or_else_exp
Definition ada-exp.c:741
@ YYSYMBOL_NOTEQUAL
Definition ada-exp.c:680
@ YYSYMBOL_26_
Definition ada-exp.c:682
@ YYSYMBOL_tick_arglist
Definition ada-exp.c:743
@ YYSYMBOL_positional_list
Definition ada-exp.c:750
@ YYSYMBOL_UNARY
Definition ada-exp.c:691
@ YYSYMBOL_LEQ
Definition ada-exp.c:683
@ YYSYMBOL_YYerror
Definition ada-exp.c:657
@ YYSYMBOL_GEQ
Definition ada-exp.c:684
@ YYSYMBOL__AND_
Definition ada-exp.c:674
@ YYSYMBOL_TICK_VAL
Definition ada-exp.c:714
@ YYSYMBOL_start
Definition ada-exp.c:730
@ YYSYMBOL_exp
Definition ada-exp.c:737
@ YYSYMBOL_REM
Definition ada-exp.c:695
@ YYSYMBOL_TICK_SIZE
Definition ada-exp.c:712
@ YYSYMBOL_var_or_type
Definition ada-exp.c:746
@ YYSYMBOL_TICK_ENUM_REP
Definition ada-exp.c:715
@ YYSYMBOL_STARSTAR
Definition ada-exp.c:696
@ YYSYMBOL_and_exp
Definition ada-exp.c:738
@ YYSYMBOL_63_
Definition ada-exp.c:719
@ YYSYMBOL_DOT_COMPLETE
Definition ada-exp.c:670
@ YYSYMBOL_ARROW
Definition ada-exp.c:700
@ YYSYMBOL_TICK_ENUM_VAL
Definition ada-exp.c:716
@ YYSYMBOL_TICK_ADDRESS
Definition ada-exp.c:703
@ YYSYMBOL_component_groups
Definition ada-exp.c:751
@ YYSYMBOL_MOD
Definition ada-exp.c:694
@ YYSYMBOL_67_
Definition ada-exp.c:723
@ YYSYMBOL_32_
Definition ada-exp.c:688
@ YYSYMBOL_ELSE
Definition ada-exp.c:678
@ YYSYMBOL_others
Definition ada-exp.c:752
@ YYSYMBOL_TICK_MODULUS
Definition ada-exp.c:709
@ YYSYMBOL_61_
Definition ada-exp.c:717
@ YYSYMBOL_DOTDOT
Definition ada-exp.c:686
@ YYSYMBOL_VAR
Definition ada-exp.c:699
@ YYSYMBOL_aggregate_component_list
Definition ada-exp.c:749
@ YYSYMBOL_DOT_ID
Definition ada-exp.c:668
@ YYSYMBOL_TICK_ACCESS
Definition ada-exp.c:702
@ YYSYMBOL_ABS
Definition ada-exp.c:697
@ YYSYMBOL_simple_exp
Definition ada-exp.c:734
@ YYSYMBOL_70_
Definition ada-exp.c:726
@ YYSYMBOL_TICK_COMPLETE
Definition ada-exp.c:669
@ YYSYMBOL_block
Definition ada-exp.c:747
@ YYSYMBOL_COLONCOLON
Definition ada-exp.c:665
@ YYSYMBOL_36_
Definition ada-exp.c:692
@ YYSYMBOL_YYACCEPT
Definition ada-exp.c:729
@ YYSYMBOL_TICK_RANGE
Definition ada-exp.c:711
@ YYSYMBOL_component_associations
Definition ada-exp.c:754
@ YYSYMBOL_OR
Definition ada-exp.c:675
@ YYSYMBOL_TICK_MAX
Definition ada-exp.c:707
@ YYSYMBOL_TICK_LENGTH
Definition ada-exp.c:706
@ YYSYMBOL_23_
Definition ada-exp.c:679
@ YYSYMBOL_component_group
Definition ada-exp.c:753
@ YYSYMBOL_TICK_LAST
Definition ada-exp.c:705
@ YYSYMBOL_TRUEKEYWORD
Definition ada-exp.c:663
@ YYSYMBOL_YYEOF
Definition ada-exp.c:656
@ YYSYMBOL_CHARLIT
Definition ada-exp.c:661
@ YYSYMBOL_62_
Definition ada-exp.c:718
@ YYSYMBOL_NAME_COMPLETE
Definition ada-exp.c:671
@ YYSYMBOL_THEN
Definition ada-exp.c:677
@ YYSYMBOL_DOLLAR_VARIABLE
Definition ada-exp.c:672
@ YYSYMBOL_TICK_TAG
Definition ada-exp.c:713
@ YYSYMBOL_33_
Definition ada-exp.c:689
@ YYSYMBOL_34_
Definition ada-exp.c:690
@ YYSYMBOL_IN
Definition ada-exp.c:685
@ YYSYMBOL_YYEMPTY
Definition ada-exp.c:655
@ YYSYMBOL_72_
Definition ada-exp.c:728
@ YYSYMBOL_TICK_POS
Definition ada-exp.c:710
@ YYSYMBOL_XOR
Definition ada-exp.c:676
@ YYSYMBOL_xor_exp
Definition ada-exp.c:742
@ YYSYMBOL_69_
Definition ada-exp.c:725
@ YYSYMBOL_37_
Definition ada-exp.c:693
@ YYSYMBOL_OTHERS
Definition ada-exp.c:721
@ YYSYMBOL_66_
Definition ada-exp.c:722
@ YYSYMBOL_FLOAT
Definition ada-exp.c:662
@ YYSYMBOL_FALSEKEYWORD
Definition ada-exp.c:664
@ YYSYMBOL_NAME
Definition ada-exp.c:667
@ YYSYMBOL_opt_type_prefix
Definition ada-exp.c:745
@ YYSYMBOL_ASSIGN
Definition ada-exp.c:673
@ YYSYMBOL_31_
Definition ada-exp.c:687
@ YYSYMBOL_relation
Definition ada-exp.c:736
@ YYSYMBOL_NOT
Definition ada-exp.c:698
@ YYSYMBOL_NEW
Definition ada-exp.c:720
@ YYSYMBOL_45_
Definition ada-exp.c:701
@ YYSYMBOL_TICK_FIRST
Definition ada-exp.c:704
static void write_var_from_sym(struct parser_state *par_state, block_symbol sym)
Definition ada-exp.c:3173
static int ada_nget_field_index(const struct type *type, const char *field_name0, int field_name_len, int maybe_missing)
Definition ada-exp.c:3517
#define VAR
Definition ada-exp.c:591
#define IN
Definition ada-exp.c:583
static const yytype_int8 yyr1[]
Definition ada-exp.c:1487
#define MOD
Definition ada-exp.c:586
static const char * original_expr
Definition ada-exp.c:104
enum yytokentype yytoken_kind_t
Definition ada-exp.c:553
#define DOT_ID
Definition ada-exp.c:569
#define _AND_
Definition ada-exp.c:575
#define YYPOPSTACK(N)
static std::vector< ada_component_up > components
Definition ada-exp.c:353
#define NOT
Definition ada-exp.c:590
#define TICK_MAX
Definition ada-exp.c:598
int yy_state_fast_t
Definition ada-exp.c:874
void push_association(Arg... args)
Definition ada-exp.c:403
#define THEN
Definition ada-exp.c:578
unsigned short yytype_uint16
Definition ada-exp.c:827
void ada_wrap3()
Definition ada-exp.c:301
#define TICK_LAST
Definition ada-exp.c:596
@ YYENOMEM
Definition ada-exp.c:1523
static void write_object_renaming(struct parser_state *, const struct block *, const char *, int, const char *, int)
Definition ada-exp.c:3202
#define YYEMPTY
Definition ada-exp.c:556
#define YYLAST
Definition ada-exp.c:1081
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
Definition ada-exp.c:1045
#define FLOAT
Definition ada-exp.c:563
#define yypact_value_is_default(Yyn)
Definition ada-exp.c:1200
#define YYINITDEPTH
Definition ada-exp.c:1687
static void write_ambiguous_var(struct parser_state *, const struct block *, const char *, int)
Definition ada-exp.c:3499
signed char yytype_int8
Definition ada-exp.c:787
static std::vector< ada_component_up > pop_components(int n)
Definition ada-exp.c:388
static void ada_addrof(struct type *type=nullptr)
Definition ada-exp.c:184
#define YYERROR
Definition ada-exp.c:1530
static void yy_stack_print(yy_state_t *yybottom, yy_state_t *yytop)
Definition ada-exp.c:1626
#define YYSIZEOF(X)
Definition ada-exp.c:867
#define TICK_FIRST
Definition ada-exp.c:595
static const yytype_int16 yycheck[]
Definition ada-exp.c:1372
#define YYSTACK_ALLOC
Definition ada-exp.c:990
#define YYDPRINTF(Args)
Definition ada-exp.c:1566
static struct type * find_primitive_type(struct parser_state *par_state, const char *name)
Definition ada-exp.c:3419
#define TICK_ACCESS
Definition ada-exp.c:593
void xfree(void *)
#define YY_USE(E)
Definition ada-exp.c:907
static std::vector< std::unique_ptr< gdb_mpz > > int_storage
Definition ada-exp.c:109
#define INT
Definition ada-exp.c:560
std::string ada_decode(const char *encoded, bool wrap, bool operators)
Definition ada-lang.c:1311
struct type * ada_index_type(struct type *type, int n, const char *name)
Definition ada-lang.c:3233
struct bound_minimal_symbol ada_lookup_simple_minsym(const char *name, struct objfile *objfile)
Definition ada-lang.c:4906
int ada_prefer_type(struct type *type0, struct type *type1)
Definition ada-lang.c:7545
std::string ada_encode(const char *decoded, bool fold)
Definition ada-lang.c:1155
ULONGEST ada_modulus(struct type *type)
Definition ada-lang.c:11540
int ada_is_modular_type(struct type *type)
Definition ada-lang.c:11528
block_symbol ada_find_operator_symbol(enum exp_opcode op, bool parse_completion, int nargs, value *argvec[])
Definition ada-lang.c:3747
enum ada_renaming_category ada_parse_renaming(struct symbol *sym, const char **renamed_entity, int *len, const char **renaming_expr)
Definition ada-lang.c:4301
void ada_lookup_encoded_symbol(const char *name, const struct block *block, domain_enum domain, struct block_symbol *info)
Definition ada-lang.c:5776
std::vector< struct block_symbol > ada_lookup_symbol_list(const char *name, const struct block *block, domain_enum domain)
Definition ada-lang.c:5759
struct type * ada_check_typedef(struct type *type)
Definition ada-lang.c:8704
struct block_symbol ada_lookup_symbol(const char *name, const struct block *block0, domain_enum domain)
Definition ada-lang.c:5798
int ada_get_field_index(const struct type *type, const char *field_name, int maybe_missing)
Definition ada-lang.c:501
int ada_array_arity(struct type *type)
Definition ada-lang.c:3158
@ ADA_EXCEPTION_RENAMING
Definition ada-lang.h:93
@ ADA_OBJECT_RENAMING
Definition ada-lang.h:89
@ ADA_NOT_RENAMING
Definition ada-lang.h:85
@ ADA_PACKAGE_RENAMING
Definition ada-lang.h:96
@ ADA_SUBPROGRAM_RENAMING
Definition ada-lang.h:100
#define MAX_RENAMING_CHAIN_LENGTH
Definition ada-lang.h:64
FILE * yyin
Definition ada-lex.c:330
static void lexer_init(FILE *inp)
Definition ada-lex.l:346
void set_associations(std::vector< ada_association_up > &&assoc)
Definition ada-exp.h:802
void set_prefix(std::string &&prefix)
Definition ada-exp.h:496
symbol * get_symbol() const
Definition expop.h:665
void update(const struct block *b, innermost_block_tracker_types t)
Definition parse.c:78
@ language_ada
Definition defs.h:225
exp_opcode
Definition expression.h:45
@ INNERMOST_BLOCK_FOR_SYMBOLS
Definition expression.h:36
@ EVAL_AVOID_SIDE_EFFECTS
Definition expression.h:58
int symbol_read_needs_frame(struct symbol *sym)
Definition findvar.c:388
const struct block * get_selected_block(CORE_ADDR *addr_in_block)
Definition stack.c:2570
struct type * lookup_pointer_type(struct type *type)
Definition gdbtypes.c:430
struct type * check_typedef(struct type *type)
Definition gdbtypes.c:2966
struct type * language_lookup_primitive_type(const struct language_defn *la, struct gdbarch *gdbarch, const char *name)
Definition language.c:1006
struct type * language_string_char_type(const struct language_defn *la, struct gdbarch *gdbarch)
Definition language.c:868
Definition ada-exp.h:87
std::unique_ptr< operation > operation_up
Definition expression.h:82
std::unique_ptr< ada_association > ada_association_up
Definition ada-exp.h:786
std::array< gdb_byte, 16 > float_data
Definition expop.h:556
std::unique_ptr< ada_component > ada_component_up
Definition ada-exp.h:648
Definition aarch64.h:67
int have_partial_symbols(void)
Definition objfiles.c:763
int have_full_symbols(void)
Definition objfiles.c:778
std::string copy_name(struct stoken token)
Definition parse.c:319
static gdbpy_ref field_name(struct type *type, int field)
Definition py-type.c:234
enum var_types type
Definition scm-param.c:142
#define resolve(X)
Definition 1.cc:26
std::string m_name
Definition ada-exp.c:442
bool complete(struct expression *exp, completion_tracker &tracker) override
Definition ada-lex.c:2999
ada_tick_completer(std::string &&name)
Definition ada-exp.c:432
const struct block * block
Definition symtab.h:1537
struct symbol * symbol
Definition symtab.h:1533
Definition block.h:109
struct objfile * objfile() const
Definition block.c:43
struct block * static_block()
Definition block.h:405
struct minimal_symbol * minsym
Definition minsyms.h:49
struct blockvector * blockvector()
Definition symtab.h:1847
virtual operation_up replace(operation_up &&owner, struct expression *exp, bool deprocedure_p, bool parse_completion, innermost_block_tracker *tracker, struct type *context_type)
Definition ada-lang.c:10486
void set_operation(expr::operation_up &&op)
Definition parser-defs.h:73
const struct language_defn * language()
Definition parser-defs.h:66
struct gdbarch * gdbarch()
Definition parser-defs.h:59
expression_up expout
Definition parser-defs.h:80
struct type * type() const
Definition gdbtypes.h:547
void set_language(enum language language, struct obstack *obstack)
Definition symtab.c:803
void set_linkage_name(const char *linkage_name)
Definition symtab.h:494
struct minimal_symbol * msym
Definition ada-exp.c:93
const struct block * block
Definition ada-exp.c:94
struct symbol * sym
Definition ada-exp.c:92
void push_new(Arg... args)
const struct block *const expression_context_block
std::vector< expr::operation_up > pop_vector(int n)
bool parse_completion
void push_dollar(struct stoken str)
Definition parse.c:162
void mark_completion(std::unique_ptr< expr_completion_base > completer)
innermost_block_tracker * block_tracker
expr::operation_up pop()
void push(expr::operation_up &&op)
const char * lexptr
bool void_context_p
void mark_struct_expression(expr::structop_base_operation *op)
Definition parse.c:101
int length
const char * ptr
address_class aclass() const
Definition symtab.h:1274
struct type * type() const
Definition symtab.h:1331
domain_enum domain() const
Definition symtab.h:1286
void set_domain(domain_enum domain)
Definition symtab.h:1291
struct compunit_symtab * compunit() const
Definition symtab.h:1677
struct type * target_type() const
Definition gdbtypes.h:1037
struct field & field(int idx) const
Definition gdbtypes.h:1012
Definition value.h:130
struct type * type() const
Definition value.h:180
struct symtab * lookup_symtab(const char *name)
Definition symtab.c:675
@ LOC_BLOCK
Definition symtab.h:1028
@ LOC_REGISTER
Definition symtab.h:993
@ LOC_REF_ARG
Definition symtab.h:1001
@ LOC_LOCAL
Definition symtab.h:1013
@ LOC_TYPEDEF
Definition symtab.h:1018
@ LOC_REGPARM_ADDR
Definition symtab.h:1009
@ LOC_COMPUTED
Definition symtab.h:1066
@ LOC_ARG
Definition symtab.h:997
@ VAR_DOMAIN
Definition symtab.h:910
@ UNDEF_DOMAIN
Definition symtab.h:905
const struct block * bval
Definition ada-exp.c:632
struct ada_exp_YYSTYPE::@4 typed_val_float
struct type * tval
Definition ada-exp.c:630
struct ada_exp_YYSTYPE::@2 typed_val
struct internalvar * ivar
Definition ada-exp.c:633
struct type * type
Definition ada-exp.c:620
LONGEST lval
Definition ada-exp.c:617
struct stoken sval
Definition ada-exp.c:631
LONGEST val
Definition ada-exp.c:623
const gdb_mpz * val
Definition ada-exp.c:619
struct ada_exp_YYSTYPE::@3 typed_char
ada_exp_YYSTYPE yyvs_alloc
Definition ada-exp.c:1026
yy_state_t yyss_alloc
Definition ada-exp.c:1025
#define yylloc
Definition yy-remap.h:68
#define yyss
Definition yy-remap.h:82
#define yyval
Definition yy-remap.h:67
#define yyrule
Definition yy-remap.h:72
#define yylhs
Definition yy-remap.h:73
#define yyvsp
Definition yy-remap.h:87
#define yylen
Definition yy-remap.h:74
#define yyssp
Definition yy-remap.h:84
#define yystacksize
Definition yy-remap.h:85
#define yyvs
Definition yy-remap.h:86
#define yystate
Definition yy-remap.h:63
#define YYFPRINTF
Definition yy-remap.h:97
#define yyerror
Definition yy-remap.h:45