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