GDB (xrefs)
/tmp/gdb-8.1/gdb/ada-exp.c
Go to the documentation of this file.
1 /* A Bison parser, made by GNU Bison 3.0.4. */
2 
3 /* Bison implementation for Yacc-like parsers in C
4 
5  Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
6 
7  This program is free software: you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation, either version 3 of the License, or
10  (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program. If not, see <http://www.gnu.org/licenses/>. */
19 
20 /* As a special exception, you may create a larger work that contains
21  part or all of the Bison parser skeleton and distribute that work
22  under terms of your choice, so long as that work isn't itself a
23  parser generator using the skeleton or a modified version thereof
24  as a parser skeleton. Alternatively, if you modify or redistribute
25  the parser skeleton itself, you may (at your option) remove this
26  special exception, which will cause the skeleton and the resulting
27  Bison output files to be licensed under the GNU General Public
28  License without this special exception.
29 
30  This special exception was added by the Free Software Foundation in
31  version 2.2 of Bison. */
32 
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34  simplifying the original so-called "semantic" parser. */
35 
36 /* All symbols defined below should begin with yy or YY, to avoid
37  infringing on user name space. This should be done even for local
38  variables, as they might otherwise be expanded by user macros.
39  There are some unavoidable exceptions within include files to
40  define necessary library symbols; they are noted "INFRINGES ON
41  USER NAME SPACE" below. */
42 
43 /* Identify Bison output. */
44 #define YYBISON 1
45 
46 /* Bison version. */
47 #define YYBISON_VERSION "3.0.4"
48 
49 /* Skeleton name. */
50 #define YYSKELETON_NAME "yacc.c"
51 
52 /* Pure parsers. */
53 #define YYPURE 0
54 
55 /* Push parsers. */
56 #define YYPUSH 0
57 
58 /* Pull parsers. */
59 #define YYPULL 1
60 
61 
62 
63 
64 /* Copy the first part of user declarations. */
65 #line 36 "ada-exp.y" /* yacc.c:339 */
66 
67 
68 #include "defs.h"
69 #include <ctype.h>
70 #include "expression.h"
71 #include "value.h"
72 #include "parser-defs.h"
73 #include "language.h"
74 #include "ada-lang.h"
75 #include "bfd.h" /* Required by objfiles.h. */
76 #include "symfile.h" /* Required by objfiles.h. */
77 #include "objfiles.h" /* For have_full_symbols and have_partial_symbols */
78 #include "frame.h"
79 #include "block.h"
80 
81 #define parse_type(ps) builtin_type (parse_gdbarch (ps))
82 
83 /* Remap normal yacc parser interface names (yyparse, yylex, yyerror,
84  etc). */
85 #define GDB_YY_REMAP_PREFIX ada_
86 #include "yy-remap.h"
87 
88 struct name_info {
89  struct symbol *sym;
91  const struct block *block;
92  struct stoken stoken;
93 };
94 
95 /* The state of the parser, used internally when we are parsing the
96  expression. */
97 
98 static struct parser_state *pstate = NULL;
99 
100 static struct stoken empty_stoken = { "", 0 };
101 
102 /* If expression is in the context of TYPE'(...), then TYPE, else
103  * NULL. */
104 static struct type *type_qualifier;
105 
106 int yyparse (void);
107 
108 static int yylex (void);
109 
110 void yyerror (const char *);
111 
112 static void write_int (struct parser_state *, LONGEST, struct type *);
113 
114 static void write_object_renaming (struct parser_state *,
115  const struct block *, const char *, int,
116  const char *, int);
117 
118 static struct type* write_var_or_type (struct parser_state *,
119  const struct block *, struct stoken);
120 
121 static void write_name_assoc (struct parser_state *, struct stoken);
122 
123 static void write_exp_op_with_string (struct parser_state *, enum exp_opcode,
124  struct stoken);
125 
126 static const struct block *block_lookup (const struct block *, const char *);
127 
128 static LONGEST convert_char_literal (struct type *, LONGEST);
129 
130 static void write_ambiguous_var (struct parser_state *,
131  const struct block *, char *, int);
132 
133 static struct type *type_int (struct parser_state *);
134 
135 static struct type *type_long (struct parser_state *);
136 
137 static struct type *type_long_long (struct parser_state *);
138 
139 static struct type *type_long_double (struct parser_state *);
140 
141 static struct type *type_char (struct parser_state *);
142 
143 static struct type *type_boolean (struct parser_state *);
144 
145 static struct type *type_system_address (struct parser_state *);
146 
147 
148 #line 149 "ada-exp.c" /* yacc.c:339 */
149 
150 # ifndef YY_NULLPTRPTR
151 # if defined __cplusplus && 201103L <= __cplusplus
152 # define YY_NULLPTRPTR nullptr
153 # else
154 # define YY_NULLPTRPTR 0
155 # endif
156 # endif
157 
158 /* Enabling verbose error messages. */
159 #ifdef YYERROR_VERBOSE
160 # undef YYERROR_VERBOSE
161 # define YYERROR_VERBOSE 1
162 #else
163 # define YYERROR_VERBOSE 0
164 #endif
165 
166 
167 /* Debug traces. */
168 #ifndef YYDEBUG
169 # define YYDEBUG 0
170 #endif
171 #if YYDEBUG
172 extern int yydebug;
173 #endif
174 
175 /* Token type. */
176 #ifndef YYTOKENTYPE
177 # define YYTOKENTYPE
179  {
180  INT = 258,
181  NULL_PTR = 259,
182  CHARLIT = 260,
183  FLOAT = 261,
184  TRUEKEYWORD = 262,
186  COLONCOLON = 264,
187  STRING = 265,
188  NAME = 266,
189  DOT_ID = 267,
190  DOT_ALL = 268,
192  ASSIGN = 270,
193  _AND_ = 271,
194  OR = 272,
195  XOR = 273,
196  THEN = 274,
197  ELSE = 275,
198  NOTEQUAL = 276,
199  LEQ = 277,
200  GEQ = 278,
201  IN = 279,
202  DOTDOT = 280,
203  UNARY = 281,
204  MOD = 282,
205  REM = 283,
206  STARSTAR = 284,
207  ABS = 285,
208  NOT = 286,
209  VAR = 287,
210  ARROW = 288,
211  TICK_ACCESS = 289,
213  TICK_FIRST = 291,
214  TICK_LAST = 292,
215  TICK_LENGTH = 293,
216  TICK_MAX = 294,
217  TICK_MIN = 295,
219  TICK_POS = 297,
220  TICK_RANGE = 298,
221  TICK_SIZE = 299,
222  TICK_TAG = 300,
223  TICK_VAL = 301,
224  NEW = 302,
225  OTHERS = 303
226  };
227 #endif
228 /* Tokens. */
229 #define INT 258
230 #define NULL_PTR 259
231 #define CHARLIT 260
232 #define FLOAT 261
233 #define TRUEKEYWORD 262
234 #define FALSEKEYWORD 263
235 #define COLONCOLON 264
236 #define STRING 265
237 #define NAME 266
238 #define DOT_ID 267
239 #define DOT_ALL 268
240 #define SPECIAL_VARIABLE 269
241 #define ASSIGN 270
242 #define _AND_ 271
243 #define OR 272
244 #define XOR 273
245 #define THEN 274
246 #define ELSE 275
247 #define NOTEQUAL 276
248 #define LEQ 277
249 #define GEQ 278
250 #define IN 279
251 #define DOTDOT 280
252 #define UNARY 281
253 #define MOD 282
254 #define REM 283
255 #define STARSTAR 284
256 #define ABS 285
257 #define NOT 286
258 #define VAR 287
259 #define ARROW 288
260 #define TICK_ACCESS 289
261 #define TICK_ADDRESS 290
262 #define TICK_FIRST 291
263 #define TICK_LAST 292
264 #define TICK_LENGTH 293
265 #define TICK_MAX 294
266 #define TICK_MIN 295
267 #define TICK_MODULUS 296
268 #define TICK_POS 297
269 #define TICK_RANGE 298
270 #define TICK_SIZE 299
271 #define TICK_TAG 300
272 #define TICK_VAL 301
273 #define NEW 302
274 #define OTHERS 303
275 
276 /* Value type. */
277 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
278 
279 union YYSTYPE
280 {
281 #line 120 "ada-exp.y" /* yacc.c:355 */
282 
284  struct {
286  struct type *type;
287  } typed_val;
288  struct {
290  struct type *type;
291  } typed_val_float;
292  struct type *tval;
293  struct stoken sval;
294  const struct block *bval;
295  struct internalvar *ivar;
296 
297 
298 #line 299 "ada-exp.c" /* yacc.c:355 */
299 };
300 
301 typedef union YYSTYPE YYSTYPE;
302 # define YYSTYPE_IS_TRIVIAL 1
303 # define YYSTYPE_IS_DECLARED 1
304 #endif
305 
306 
307 extern YYSTYPE yylval;
308 
309 int yyparse (void);
310 
311 
312 
313 /* Copy the second part of user declarations. */
314 
315 #line 316 "ada-exp.c" /* yacc.c:358 */
316 
317 #ifdef short
318 # undef short
319 #endif
320 
321 #ifdef YYTYPE_UINT8
322 typedef YYTYPE_UINT8 yytype_uint8;
323 #else
324 typedef unsigned char yytype_uint8;
325 #endif
326 
327 #ifdef YYTYPE_INT8
328 typedef YYTYPE_INT8 yytype_int8;
329 #else
330 typedef signed char yytype_int8;
331 #endif
332 
333 #ifdef YYTYPE_UINT16
334 typedef YYTYPE_UINT16 yytype_uint16;
335 #else
336 typedef unsigned short int yytype_uint16;
337 #endif
338 
339 #ifdef YYTYPE_INT16
340 typedef YYTYPE_INT16 yytype_int16;
341 #else
342 typedef short int yytype_int16;
343 #endif
344 
345 #ifndef YYSIZE_T
346 # ifdef __SIZE_TYPE__
347 # define YYSIZE_T __SIZE_TYPE__
348 # elif defined size_t
349 # define YYSIZE_T size_t
350 # elif ! defined YYSIZE_T
351 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
352 # define YYSIZE_T size_t
353 # else
354 # define YYSIZE_T unsigned int
355 # endif
356 #endif
357 
358 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
359 
360 #ifndef YY_
361 # if defined YYENABLE_NLS && YYENABLE_NLS
362 # if ENABLE_NLS
363 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
364 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
365 # endif
366 # endif
367 # ifndef YY_
368 # define YY_(Msgid) Msgid
369 # endif
370 #endif
371 
372 #ifndef YY_ATTRIBUTE
373 # if (defined __GNUC__ \
374  && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
375  || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
376 # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
377 # else
378 # define YY_ATTRIBUTE(Spec) /* empty */
379 # endif
380 #endif
381 
382 #ifndef YY_ATTRIBUTE_PURE
383 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
384 #endif
385 
386 #ifndef YY_ATTRIBUTE_UNUSED
387 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
388 #endif
389 
390 #if !defined _Noreturn \
391  && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
392 # if defined _MSC_VER && 1200 <= _MSC_VER
393 # define _Noreturn __declspec (noreturn)
394 # else
395 # define _Noreturn YY_ATTRIBUTE ((__noreturn__))
396 # endif
397 #endif
398 
399 /* Suppress unused-variable warnings by "using" E. */
400 #if ! defined lint || defined __GNUC__
401 # define YYUSE(E) ((void) (E))
402 #else
403 # define YYUSE(E) /* empty */
404 #endif
405 
406 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
407 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
408 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
409  _Pragma ("GCC diagnostic push") \
410  _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
411  _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
412 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
413  _Pragma ("GCC diagnostic pop")
414 #else
415 # define YY_INITIAL_VALUE(Value) Value
416 #endif
417 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
418 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
419 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
420 #endif
421 #ifndef YY_INITIAL_VALUE
422 # define YY_INITIAL_VALUE(Value) /* Nothing. */
423 #endif
424 
425 
426 #if ! defined yyoverflow || YYERROR_VERBOSE
427 
428 /* The parser invokes alloca or xmalloc; define the necessary symbols. */
429 
430 # ifdef YYSTACK_USE_ALLOCA
431 # if YYSTACK_USE_ALLOCA
432 # ifdef __GNUC__
433 # define YYSTACK_ALLOC __builtin_alloca
434 # elif defined __BUILTIN_VA_ARG_INCR
435 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
436 # elif defined _AIX
437 # define YYSTACK_ALLOC __alloca
438 # elif defined _MSC_VER
439 # define alloca _alloca
440 # else
441 # define YYSTACK_ALLOC alloca
442 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
443 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
444  /* Use EXIT_SUCCESS as a witness for stdlib.h. */
445 # ifndef EXIT_SUCCESS
446 # define EXIT_SUCCESS 0
447 # endif
448 # endif
449 # endif
450 # endif
451 # endif
452 
453 # ifdef YYSTACK_ALLOC
454  /* Pacify GCC's 'empty if-body' warning. */
455 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
456 # ifndef YYSTACK_ALLOC_MAXIMUM
457  /* The OS might guarantee only one guard page at the bottom of the stack,
458  and a page size can be as small as 4096 bytes. So we cannot safely
459  invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
460  to allow for a few compiler-allocated temporary stack slots. */
461 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
462 # endif
463 # else
464 # define YYSTACK_ALLOC YYMALLOC
465 # define YYSTACK_FREE YYFREE
466 # ifndef YYSTACK_ALLOC_MAXIMUM
467 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
468 # endif
469 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
470  && ! ((defined YYMALLOC || defined xmalloc) \
471  && (defined YYFREE || defined xfree)))
472 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
473 # ifndef EXIT_SUCCESS
474 # define EXIT_SUCCESS 0
475 # endif
476 # endif
477 # ifndef YYMALLOC
478 # define YYMALLOC xmalloc
479 # if ! defined xmalloc && ! defined EXIT_SUCCESS
480 void *xmalloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
481 # endif
482 # endif
483 # ifndef YYFREE
484 # define YYFREE xfree
485 # if ! defined xfree && ! defined EXIT_SUCCESS
486 void xfree (void *); /* INFRINGES ON USER NAME SPACE */
487 # endif
488 # endif
489 # endif
490 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
491 
492 
493 #if (! defined yyoverflow \
494  && (! defined __cplusplus \
495  || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
496 
497 /* A type that is properly aligned for any stack member. */
498 union yyalloc
499 {
502 };
503 
504 /* The size of the maximum gap between one aligned stack and the next. */
505 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
506 
507 /* The size of an array large to enough to hold all stacks, each with
508  N elements. */
509 # define YYSTACK_BYTES(N) \
510  ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
511  + YYSTACK_GAP_MAXIMUM)
512 
513 # define YYCOPY_NEEDED 1
514 
515 /* Relocate STACK from its old location to the new one. The
516  local variables YYSIZE and YYSTACKSIZE give the old and new number of
517  elements in the stack, and YYPTR gives the new location of the
518  stack. Advance YYPTR to a properly aligned location for the next
519  stack. */
520 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
521  do \
522  { \
523  YYSIZE_T yynewbytes; \
524  YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
525  Stack = &yyptr->Stack_alloc; \
526  yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
527  yyptr += yynewbytes / sizeof (*yyptr); \
528  } \
529  while (0)
530 
531 #endif
532 
533 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
534 /* Copy COUNT objects from SRC to DST. The source and destination do
535  not overlap. */
536 # ifndef YYCOPY
537 # if defined __GNUC__ && 1 < __GNUC__
538 # define YYCOPY(Dst, Src, Count) \
539  __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
540 # else
541 # define YYCOPY(Dst, Src, Count) \
542  do \
543  { \
544  YYSIZE_T yyi; \
545  for (yyi = 0; yyi < (Count); yyi++) \
546  (Dst)[yyi] = (Src)[yyi]; \
547  } \
548  while (0)
549 # endif
550 # endif
551 #endif /* !YYCOPY_NEEDED */
552 
553 /* YYFINAL -- State number of the termination state. */
554 #define YYFINAL 57
555 /* YYLAST -- Last index in YYTABLE. */
556 #define YYLAST 746
557 
558 /* YYNTOKENS -- Number of terminals. */
559 #define YYNTOKENS 69
560 /* YYNNTS -- Number of nonterminals. */
561 #define YYNNTS 31
562 /* YYNRULES -- Number of rules. */
563 #define YYNRULES 122
564 /* YYNSTATES -- Number of states. */
565 #define YYNSTATES 233
566 
567 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
568  by yylex, with out-of-bounds checking. */
569 #define YYUNDEFTOK 2
570 #define YYMAXUTOK 303
571 
572 #define YYTRANSLATE(YYX) \
573  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
574 
575 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
576  as returned by yylex, without out-of-bounds checking. */
577 static const yytype_uint8 yytranslate[] =
578 {
579  0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
580  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
581  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
582  2, 2, 2, 2, 2, 2, 2, 2, 32, 64,
583  58, 63, 34, 30, 65, 31, 57, 35, 2, 2,
584  2, 2, 2, 2, 2, 2, 2, 2, 2, 62,
585  23, 21, 24, 2, 29, 2, 2, 2, 2, 2,
586  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
587  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
588  2, 59, 2, 68, 2, 2, 2, 2, 2, 2,
589  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
590  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
591  2, 2, 2, 66, 43, 67, 2, 2, 2, 2,
592  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
593  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
594  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
595  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
596  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
597  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
598  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
599  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
600  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
601  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
602  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
603  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
604  2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
605  5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
606  15, 16, 17, 18, 19, 20, 22, 25, 26, 27,
607  28, 33, 36, 37, 38, 39, 40, 41, 42, 44,
608  45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
609  55, 56, 60, 61
610 };
611 
612 #if YYDEBUG
613  /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
614 static const yytype_uint16 yyrline[] =
615 {
616  0, 185, 185, 189, 190, 192, 197, 201, 206, 212,
617  231, 231, 243, 247, 249, 257, 268, 278, 282, 285,
618  288, 292, 296, 300, 304, 307, 309, 311, 313, 317,
619  330, 334, 338, 342, 346, 350, 354, 358, 362, 366,
620  369, 373, 377, 381, 383, 388, 396, 400, 406, 417,
621  421, 425, 429, 430, 431, 432, 433, 434, 438, 440,
622  445, 447, 452, 454, 459, 461, 465, 467, 479, 481,
623  488, 491, 494, 497, 499, 501, 503, 505, 507, 509,
624  513, 515, 520, 530, 532, 539, 543, 551, 559, 563,
625  569, 571, 575, 579, 581, 583, 591, 602, 604, 609,
626  618, 619, 625, 630, 636, 645, 646, 647, 651, 656,
627  671, 670, 673, 676, 675, 682, 681, 684, 687, 686,
628  694, 696, 698
629 };
630 #endif
631 
632 #if YYDEBUG || YYERROR_VERBOSE || 0
633 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
634  First, the terminals, then, starting at YYNTOKENS, nonterminals. */
635 static const char *const yytname[] =
636 {
637  "$end", "error", "$undefined", "INT", "NULL_PTR", "CHARLIT", "FLOAT",
638  "TRUEKEYWORD", "FALSEKEYWORD", "COLONCOLON", "STRING", "NAME", "DOT_ID",
639  "DOT_ALL", "SPECIAL_VARIABLE", "ASSIGN", "_AND_", "OR", "XOR", "THEN",
640  "ELSE", "'='", "NOTEQUAL", "'<'", "'>'", "LEQ", "GEQ", "IN", "DOTDOT",
641  "'@'", "'+'", "'-'", "'&'", "UNARY", "'*'", "'/'", "MOD", "REM",
642  "STARSTAR", "ABS", "NOT", "VAR", "ARROW", "'|'", "TICK_ACCESS",
643  "TICK_ADDRESS", "TICK_FIRST", "TICK_LAST", "TICK_LENGTH", "TICK_MAX",
644  "TICK_MIN", "TICK_MODULUS", "TICK_POS", "TICK_RANGE", "TICK_SIZE",
645  "TICK_TAG", "TICK_VAL", "'.'", "'('", "'['", "NEW", "OTHERS", "';'",
646  "')'", "'\\''", "','", "'{'", "'}'", "']'", "$accept", "start", "exp1",
647  "primary", "$@1", "save_qualifier", "simple_exp", "arglist", "relation",
648  "exp", "and_exp", "and_then_exp", "or_exp", "or_else_exp", "xor_exp",
649  "tick_arglist", "type_prefix", "opt_type_prefix", "var_or_type", "block",
650  "aggregate", "aggregate_component_list", "positional_list",
651  "component_groups", "others", "component_group",
652  "component_associations", "$@2", "$@3", "$@4", "$@5", YY_NULLPTRPTR
653 };
654 #endif
655 
656 # ifdef YYPRINT
657 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
658  (internal) symbol number NUM (which must be that of a token). */
659 static const yytype_uint16 yytoknum[] =
660 {
661  0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
662  265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
663  275, 61, 276, 60, 62, 277, 278, 279, 280, 64,
664  43, 45, 38, 281, 42, 47, 282, 283, 284, 285,
665  286, 287, 288, 124, 289, 290, 291, 292, 293, 294,
666  295, 296, 297, 298, 299, 300, 301, 46, 40, 91,
667  302, 303, 59, 41, 39, 44, 123, 125, 93
668 };
669 # endif
670 
671 #define YYPACT_NINF -104
672 
673 #define yypact_value_is_default(Yystate) \
674  (!!((Yystate) == (-104)))
675 
676 #define YYTABLE_NINF -83
677 
678 #define yytable_value_is_error(Yytable_value) \
679  0
680 
681  /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
682  STATE-NUM. */
683 static const yytype_int16 yypact[] =
684 {
685  430, -104, -104, -104, -104, -104, -104, -104, 3, -104,
686  430, 430, 544, 544, 430, 430, 289, 44, 49, 26,
687  -53, -2, 679, 86, -104, 50, 55, 48, 57, 74,
688  -28, -1, 275, 61, -104, -104, -104, 577, 219, 219,
689  9, 9, 219, 219, 54, 58, -31, 616, 42, 45,
690  289, -104, -104, 46, -104, -104, 43, -104, 430, -104,
691  -104, 430, -104, -104, 59, 59, 59, -104, -104, 277,
692  430, 430, 430, 430, 430, 430, 430, 430, 430, 430,
693  430, 430, 430, 430, 430, 430, 430, 89, 353, 392,
694  430, 430, 94, 430, 100, 430, -104, 63, 64, 65,
695  67, 277, -104, 15, -104, -104, 430, -104, 430, 430,
696  468, -104, -104, 62, -104, 289, 544, -104, -104, 125,
697  -104, -104, -104, -4, 639, -57, -104, 70, 117, 117,
698  117, 117, 117, 117, 149, 563, 174, 549, 219, 219,
699  219, 91, 91, 91, 91, 91, 430, 430, -104, 430,
700  -104, -104, -104, 430, -104, 430, -104, 430, 430, 430,
701  430, 659, -38, -104, -104, -104, 430, 468, -104, 339,
702  -104, 692, -104, -104, -104, 9, 69, 430, 430, -104,
703  506, -104, 59, 430, 561, 708, 211, -104, -104, -104,
704  -104, 81, 99, 102, 93, 430, -104, 72, -104, -104,
705  -104, -104, -104, -104, 105, 82, -104, -104, 117, 59,
706  430, -104, 430, 430, -104, 214, 430, 430, 468, -104,
707  430, -104, 117, 106, 107, -104, 109, -104, -104, -104,
708  -104, -104, -104
709 };
710 
711  /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
712  Performed when YYTABLE does not specify something else to do. Zero
713  means the default is an error. */
714 static const yytype_uint8 yydefact[] =
715 {
716  84, 85, 88, 86, 87, 90, 91, 89, 93, 17,
717  84, 84, 84, 84, 84, 84, 84, 0, 0, 0,
718  2, 19, 39, 52, 3, 53, 54, 55, 56, 57,
719  83, 0, 16, 0, 18, 97, 95, 19, 21, 20,
720  121, 120, 23, 22, 93, 0, 0, 39, 3, 0,
721  84, 100, 105, 106, 109, 92, 0, 1, 84, 7,
722  6, 84, 68, 69, 80, 80, 80, 73, 74, 84,
723  84, 84, 84, 84, 84, 84, 84, 84, 84, 84,
724  84, 84, 84, 84, 84, 84, 84, 0, 84, 84,
725  84, 84, 0, 84, 0, 84, 79, 0, 0, 0,
726  0, 84, 12, 94, 110, 115, 84, 15, 84, 84,
727  84, 103, 99, 101, 102, 84, 84, 4, 5, 0,
728  70, 71, 72, 93, 39, 0, 25, 0, 40, 41,
729  50, 51, 42, 49, 19, 0, 16, 35, 36, 38,
730  37, 31, 32, 34, 33, 30, 84, 84, 58, 84,
731  62, 66, 59, 84, 63, 84, 67, 84, 84, 84,
732  84, 39, 0, 10, 98, 96, 84, 84, 108, 0,
733  112, 0, 117, 104, 107, 29, 0, 84, 84, 8,
734  84, 122, 80, 84, 19, 0, 16, 60, 64, 61,
735  65, 0, 0, 0, 0, 84, 9, 0, 111, 116,
736  113, 118, 81, 26, 0, 93, 27, 44, 43, 80,
737  84, 78, 84, 84, 77, 0, 84, 84, 84, 13,
738  84, 47, 46, 0, 0, 14, 0, 114, 119, 28,
739  76, 75, 11
740 };
741 
742  /* YYPGOTO[NTERM-NUM]. */
743 static const yytype_int16 yypgoto[] =
744 {
745  -104, -104, 157, 17, -104, -104, 4, 75, -54, 0,
746  -104, -104, -104, -104, -104, -64, -104, -104, -15, -104,
747  -104, -104, -104, -46, -104, -104, -103, -104, -104, -104,
748  -104
749 };
750 
751  /* YYDEFGOTO[NTERM-NUM]. */
752 static const yytype_int16 yydefgoto[] =
753 {
754  -1, 19, 20, 37, 197, 163, 22, 125, 23, 126,
755  25, 26, 27, 28, 29, 120, 30, 31, 32, 33,
756  34, 49, 50, 51, 52, 53, 54, 166, 217, 167,
757  218
758 };
759 
760  /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
761  positive, shift that token. If negative, reduce the rule whose
762  number is the opposite. If YYTABLE_NINF, syntax error. */
763 static const yytype_int16 yytable[] =
764 {
765  24, 121, 122, 56, 114, 35, 179, 172, 180, 58,
766  59, 60, 35, 61, 38, 39, 48, 21, 42, 43,
767  47, 59, 60, 96, 164, 196, 57, 180, 97, 40,
768  41, 58, 107, 21, 148, 150, 151, 152, 177, 154,
769  36, 156, 62, 63, 64, 65, 66, 36, 98, 99,
770  113, 100, 67, 68, 47, 55, 69, 70, 117, 165,
771  8, 118, 136, 35, 199, 93, 91, 69, 70, 174,
772  127, 92, 103, 124, 94, 128, 129, 130, 131, 132,
773  133, 135, 137, 138, 139, 140, 141, 142, 143, 144,
774  145, 35, 95, 187, 134, 188, 104, 105, 36, 189,
775  106, 190, 88, 89, 90, 161, 168, 111, 112, 170,
776  116, 115, 169, 153, 171, 228, 146, 119, 207, 171,
777  155, 157, 158, 159, 220, 160, 36, 173, 176, 86,
778  216, 186, 202, 175, 78, 79, 80, 81, 181, 82,
779  83, 84, 85, 86, 211, 221, 78, 79, 80, 81,
780  185, 82, 83, 84, 85, 86, 214, 191, 192, 193,
781  194, 59, 60, 184, 212, 0, 198, 213, 219, 230,
782  231, 171, 232, 46, -45, 0, 162, 203, 0, 0,
783  206, 0, 204, 0, 0, 0, 0, 208, 0, 0,
784  -45, -45, -45, 62, 63, 64, 65, 66, 0, 215,
785  0, 0, 182, 67, 68, 0, 0, 69, 70, 0,
786  0, -48, 223, 224, 222, 0, 226, 227, 0, 0,
787  229, 0, 171, -82, -82, -82, -82, -48, -48, -48,
788  -82, 0, 101, 0, 0, 0, -45, -45, 102, -45,
789  0, 0, -45, 78, 79, 80, 81, 0, 82, 83,
790  84, 85, 86, 82, 83, 84, 85, 86, 0, 0,
791  -82, -82, -82, -82, 0, 0, 0, -82, 0, 101,
792  0, 0, 0, -48, -48, 102, -48, 225, 0, -48,
793  1, 2, 3, 4, 5, 6, 0, 7, 123, 0,
794  0, 9, 1, 2, 3, 4, 5, 6, 0, 7,
795  44, 0, 0, 9, 0, 0, 0, 10, 11, 12,
796  0, 13, 0, 0, 0, 0, 14, 15, 0, 10,
797  11, 12, 0, 13, -82, -82, -82, -82, 14, 15,
798  0, -82, 0, 101, 0, 16, 0, 17, 0, 102,
799  -24, 0, -24, 18, 0, 0, 0, 16, 0, 17,
800  45, 0, 0, 0, 0, 18, 1, 2, 3, 4,
801  5, 6, 0, 7, 8, 0, 0, 9, 78, 79,
802  80, 81, 147, 82, 83, 84, 85, 86, 0, 0,
803  0, 200, 201, 10, 11, 12, 0, 13, 0, 0,
804  0, 0, 14, 15, 0, 1, 2, 3, 4, 5,
805  6, 0, 7, 8, 0, 0, 9, 0, 0, 0,
806  0, 16, 149, 17, 0, 0, 0, 0, 0, 18,
807  0, 0, 10, 11, 12, 0, 13, 0, 0, 0,
808  0, 14, 15, 1, 2, 3, 4, 5, 6, 0,
809  7, 8, 0, 0, 9, 0, 0, 0, 0, 0,
810  16, 0, 17, 0, 0, 0, 0, 0, 18, 0,
811  10, 11, 12, 0, 13, 0, 0, 0, 0, 14,
812  15, 1, 2, 3, 4, 5, 6, 0, 7, 44,
813  0, 0, 9, 0, 0, 0, 0, 0, 16, 0,
814  17, 0, 0, 0, 0, 0, 18, 0, 10, 11,
815  12, 0, 13, 0, 0, 0, 0, 14, 15, 1,
816  2, 3, 4, 5, 6, 0, 7, 205, 0, 0,
817  9, 0, 0, 0, 0, 0, 16, 0, 17, 0,
818  0, 0, 0, 0, 18, 0, 10, 11, 12, 0,
819  13, 0, 0, 0, 0, 14, 15, 1, 2, 3,
820  4, 5, 6, 0, 7, 8, 0, 0, 9, 0,
821  0, 0, 0, 0, 16, 0, 17, 0, 0, 0,
822  0, 0, 18, 59, 60, 0, 12, 0, 13, 79,
823  80, 81, 0, 82, 83, 84, 85, 86, 0, 59,
824  60, 183, 78, 79, 80, 81, 0, 82, 83, 84,
825  85, 86, 16, 0, 17, 62, 63, 64, 65, 66,
826  18, 0, 0, 0, 209, 67, 68, 0, 0, 69,
827  70, 62, 63, 64, 65, 66, 0, 0, 0, 0,
828  0, 67, 68, 0, 0, 69, 70, 71, 72, 73,
829  74, 75, 76, 77, 108, 78, 79, 80, 81, 0,
830  82, 83, 84, 85, 86, 0, 87, 0, 109, 110,
831  71, 72, 73, 74, 75, 76, 77, 178, 78, 79,
832  80, 81, 0, 82, 83, 84, 85, 86, 0, 87,
833  71, 72, 73, 74, 75, 76, 77, 195, 78, 79,
834  80, 81, 0, 82, 83, 84, 85, 86, 0, 87,
835  71, 72, 73, 74, 75, 76, 77, 0, 78, 79,
836  80, 81, 0, 82, 83, 84, 85, 86, 0, 87,
837  108, 78, 79, 80, 81, 0, 82, 83, 84, 85,
838  86, 0, 0, 0, 109, 110, 210, 78, 79, 80,
839  81, 0, 82, 83, 84, 85, 86
840 };
841 
842 static const yytype_int16 yycheck[] =
843 {
844  0, 65, 66, 18, 50, 9, 63, 110, 65, 62,
845  12, 13, 9, 15, 10, 11, 16, 0, 14, 15,
846  16, 12, 13, 51, 9, 63, 0, 65, 56, 12,
847  13, 62, 63, 16, 88, 89, 90, 91, 42, 93,
848  44, 95, 44, 45, 46, 47, 48, 44, 49, 50,
849  50, 52, 54, 55, 50, 11, 58, 59, 58, 44,
850  11, 61, 77, 9, 167, 17, 16, 58, 59, 115,
851  70, 16, 11, 69, 17, 71, 72, 73, 74, 75,
852  76, 77, 78, 79, 80, 81, 82, 83, 84, 85,
853  86, 9, 18, 147, 77, 149, 42, 43, 44, 153,
854  42, 155, 16, 17, 18, 101, 106, 65, 63, 109,
855  67, 65, 108, 19, 110, 218, 27, 58, 182, 115,
856  20, 58, 58, 58, 42, 58, 44, 65, 3, 38,
857  58, 146, 63, 116, 29, 30, 31, 32, 68, 34,
858  35, 36, 37, 38, 63, 209, 29, 30, 31, 32,
859  146, 34, 35, 36, 37, 38, 63, 157, 158, 159,
860  160, 12, 13, 146, 65, -1, 166, 65, 63, 63,
861  63, 167, 63, 16, 0, -1, 101, 177, -1, -1,
862  180, -1, 178, -1, -1, -1, -1, 183, -1, -1,
863  16, 17, 18, 44, 45, 46, 47, 48, -1, 195,
864  -1, -1, 53, 54, 55, -1, -1, 58, 59, -1,
865  -1, 0, 212, 213, 210, -1, 216, 217, -1, -1,
866  220, -1, 218, 49, 50, 51, 52, 16, 17, 18,
867  56, -1, 58, -1, -1, -1, 62, 63, 64, 65,
868  -1, -1, 68, 29, 30, 31, 32, -1, 34, 35,
869  36, 37, 38, 34, 35, 36, 37, 38, -1, -1,
870  49, 50, 51, 52, -1, -1, -1, 56, -1, 58,
871  -1, -1, -1, 62, 63, 64, 65, 63, -1, 68,
872  3, 4, 5, 6, 7, 8, -1, 10, 11, -1,
873  -1, 14, 3, 4, 5, 6, 7, 8, -1, 10,
874  11, -1, -1, 14, -1, -1, -1, 30, 31, 32,
875  -1, 34, -1, -1, -1, -1, 39, 40, -1, 30,
876  31, 32, -1, 34, 49, 50, 51, 52, 39, 40,
877  -1, 56, -1, 58, -1, 58, -1, 60, -1, 64,
878  63, -1, 65, 66, -1, -1, -1, 58, -1, 60,
879  61, -1, -1, -1, -1, 66, 3, 4, 5, 6,
880  7, 8, -1, 10, 11, -1, -1, 14, 29, 30,
881  31, 32, 19, 34, 35, 36, 37, 38, -1, -1,
882  -1, 42, 43, 30, 31, 32, -1, 34, -1, -1,
883  -1, -1, 39, 40, -1, 3, 4, 5, 6, 7,
884  8, -1, 10, 11, -1, -1, 14, -1, -1, -1,
885  -1, 58, 20, 60, -1, -1, -1, -1, -1, 66,
886  -1, -1, 30, 31, 32, -1, 34, -1, -1, -1,
887  -1, 39, 40, 3, 4, 5, 6, 7, 8, -1,
888  10, 11, -1, -1, 14, -1, -1, -1, -1, -1,
889  58, -1, 60, -1, -1, -1, -1, -1, 66, -1,
890  30, 31, 32, -1, 34, -1, -1, -1, -1, 39,
891  40, 3, 4, 5, 6, 7, 8, -1, 10, 11,
892  -1, -1, 14, -1, -1, -1, -1, -1, 58, -1,
893  60, -1, -1, -1, -1, -1, 66, -1, 30, 31,
894  32, -1, 34, -1, -1, -1, -1, 39, 40, 3,
895  4, 5, 6, 7, 8, -1, 10, 11, -1, -1,
896  14, -1, -1, -1, -1, -1, 58, -1, 60, -1,
897  -1, -1, -1, -1, 66, -1, 30, 31, 32, -1,
898  34, -1, -1, -1, -1, 39, 40, 3, 4, 5,
899  6, 7, 8, -1, 10, 11, -1, -1, 14, -1,
900  -1, -1, -1, -1, 58, -1, 60, -1, -1, -1,
901  -1, -1, 66, 12, 13, -1, 32, -1, 34, 30,
902  31, 32, -1, 34, 35, 36, 37, 38, -1, 12,
903  13, 28, 29, 30, 31, 32, -1, 34, 35, 36,
904  37, 38, 58, -1, 60, 44, 45, 46, 47, 48,
905  66, -1, -1, -1, 53, 54, 55, -1, -1, 58,
906  59, 44, 45, 46, 47, 48, -1, -1, -1, -1,
907  -1, 54, 55, -1, -1, 58, 59, 21, 22, 23,
908  24, 25, 26, 27, 28, 29, 30, 31, 32, -1,
909  34, 35, 36, 37, 38, -1, 40, -1, 42, 43,
910  21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
911  31, 32, -1, 34, 35, 36, 37, 38, -1, 40,
912  21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
913  31, 32, -1, 34, 35, 36, 37, 38, -1, 40,
914  21, 22, 23, 24, 25, 26, 27, -1, 29, 30,
915  31, 32, -1, 34, 35, 36, 37, 38, -1, 40,
916  28, 29, 30, 31, 32, -1, 34, 35, 36, 37,
917  38, -1, -1, -1, 42, 43, 28, 29, 30, 31,
918  32, -1, 34, 35, 36, 37, 38
919 };
920 
921  /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
922  symbol of state STATE-NUM. */
923 static const yytype_uint8 yystos[] =
924 {
925  0, 3, 4, 5, 6, 7, 8, 10, 11, 14,
926  30, 31, 32, 34, 39, 40, 58, 60, 66, 70,
927  71, 72, 75, 77, 78, 79, 80, 81, 82, 83,
928  85, 86, 87, 88, 89, 9, 44, 72, 75, 75,
929  72, 72, 75, 75, 11, 61, 71, 75, 78, 90,
930  91, 92, 93, 94, 95, 11, 87, 0, 62, 12,
931  13, 15, 44, 45, 46, 47, 48, 54, 55, 58,
932  59, 21, 22, 23, 24, 25, 26, 27, 29, 30,
933  31, 32, 34, 35, 36, 37, 38, 40, 16, 17,
934  18, 16, 16, 17, 17, 18, 51, 56, 49, 50,
935  52, 58, 64, 11, 42, 43, 42, 63, 28, 42,
936  43, 65, 63, 78, 92, 65, 67, 78, 78, 58,
937  84, 84, 84, 11, 75, 76, 78, 78, 75, 75,
938  75, 75, 75, 75, 72, 75, 87, 75, 75, 75,
939  75, 75, 75, 75, 75, 75, 27, 19, 77, 20,
940  77, 77, 77, 19, 77, 20, 77, 58, 58, 58,
941  58, 75, 76, 74, 9, 44, 96, 98, 78, 75,
942  78, 75, 95, 65, 92, 72, 3, 42, 28, 63,
943  65, 68, 53, 28, 72, 75, 87, 77, 77, 77,
944  77, 78, 78, 78, 78, 28, 63, 73, 78, 95,
945  42, 43, 63, 78, 75, 11, 78, 84, 75, 53,
946  28, 63, 65, 65, 63, 75, 58, 97, 99, 63,
947  42, 84, 75, 78, 78, 63, 78, 78, 95, 78,
948  63, 63, 63
949 };
950 
951  /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
952 static const yytype_uint8 yyr1[] =
953 {
954  0, 69, 70, 71, 71, 71, 72, 72, 72, 72,
955  73, 72, 74, 72, 72, 72, 72, 72, 72, 75,
956  75, 75, 75, 75, 76, 76, 76, 76, 76, 72,
957  75, 75, 75, 75, 75, 75, 75, 75, 75, 77,
958  77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
959  77, 77, 78, 78, 78, 78, 78, 78, 79, 79,
960  80, 80, 81, 81, 82, 82, 83, 83, 72, 72,
961  72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
962  84, 84, 85, 86, 86, 72, 72, 72, 72, 72,
963  72, 72, 72, 87, 87, 87, 87, 88, 88, 89,
964  90, 90, 90, 91, 91, 92, 92, 92, 93, 94,
965  96, 95, 95, 97, 95, 98, 95, 95, 99, 95,
966  72, 72, 72
967 };
968 
969  /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
970 static const yytype_uint8 yyr2[] =
971 {
972  0, 2, 1, 1, 3, 3, 2, 2, 4, 4,
973  0, 7, 0, 6, 6, 3, 1, 1, 1, 1,
974  2, 2, 2, 2, 0, 1, 3, 3, 5, 4,
975  3, 3, 3, 3, 3, 3, 3, 3, 3, 1,
976  3, 3, 3, 5, 5, 3, 6, 6, 4, 3,
977  3, 3, 1, 1, 1, 1, 1, 1, 3, 3,
978  4, 4, 3, 3, 4, 4, 3, 3, 2, 2,
979  3, 3, 3, 2, 2, 7, 7, 5, 5, 2,
980  0, 3, 1, 1, 0, 1, 1, 1, 1, 1,
981  1, 1, 2, 1, 2, 2, 3, 2, 3, 3,
982  1, 2, 2, 2, 3, 1, 1, 3, 3, 1,
983  0, 4, 3, 0, 6, 0, 4, 3, 0, 6,
984  2, 2, 4
985 };
986 
987 
988 #define yyerrok (yyerrstatus = 0)
989 #define yyclearin (yychar = YYEMPTY)
990 #define YYEMPTY (-2)
991 #define YYEOF 0
992 
993 #define YYACCEPT goto yyacceptlab
994 #define YYABORT goto yyabortlab
995 #define YYERROR goto yyerrorlab
996 
997 
998 #define YYRECOVERING() (!!yyerrstatus)
999 
1000 #define YYBACKUP(Token, Value) \
1001 do \
1002  if (yychar == YYEMPTY) \
1003  { \
1004  yychar = (Token); \
1005  yylval = (Value); \
1006  YYPOPSTACK (yylen); \
1007  yystate = *yyssp; \
1008  goto yybackup; \
1009  } \
1010  else \
1011  { \
1012  yyerror (YY_("syntax error: cannot back up")); \
1013  YYERROR; \
1014  } \
1015 while (0)
1016 
1017 /* Error token number */
1018 #define YYTERROR 1
1019 #define YYERRCODE 256
1020 
1021 
1022 
1023 /* Enable debugging if requested. */
1024 #if YYDEBUG
1025 
1026 # ifndef YYFPRINTF
1027 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1028 # define YYFPRINTF fprintf
1029 # endif
1030 
1031 # define YYDPRINTF(Args) \
1032 do { \
1033  if (yydebug) \
1034  YYFPRINTF Args; \
1035 } while (0)
1036 
1037 /* This macro is provided for backward compatibility. */
1038 #ifndef YY_LOCATION_PRINT
1039 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1040 #endif
1041 
1042 
1043 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1044 do { \
1045  if (yydebug) \
1046  { \
1047  YYFPRINTF (stderr, "%s ", Title); \
1048  yy_symbol_print (stderr, \
1049  Type, Value); \
1050  YYFPRINTF (stderr, "\n"); \
1051  } \
1052 } while (0)
1053 
1054 
1055 /*----------------------------------------.
1056 | Print this symbol's value on YYOUTPUT. |
1057 `----------------------------------------*/
1058 
1059 static void
1060 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1061 {
1062  FILE *yyo = yyoutput;
1063  YYUSE (yyo);
1064  if (!yyvaluep)
1065  return;
1066 # ifdef YYPRINT
1067  if (yytype < YYNTOKENS)
1068  YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1069 # endif
1070  YYUSE (yytype);
1071 }
1072 
1073 
1074 /*--------------------------------.
1075 | Print this symbol on YYOUTPUT. |
1076 `--------------------------------*/
1077 
1078 static void
1079 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1080 {
1081  YYFPRINTF (yyoutput, "%s %s (",
1082  yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
1083 
1084  yy_symbol_value_print (yyoutput, yytype, yyvaluep);
1085  YYFPRINTF (yyoutput, ")");
1086 }
1087 
1088 /*------------------------------------------------------------------.
1089 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1090 | TOP (included). |
1091 `------------------------------------------------------------------*/
1092 
1093 static void
1095 {
1096  YYFPRINTF (stderr, "Stack now");
1097  for (; yybottom <= yytop; yybottom++)
1098  {
1099  int yybot = *yybottom;
1100  YYFPRINTF (stderr, " %d", yybot);
1101  }
1102  YYFPRINTF (stderr, "\n");
1103 }
1104 
1105 # define YY_STACK_PRINT(Bottom, Top) \
1106 do { \
1107  if (yydebug) \
1108  yy_stack_print ((Bottom), (Top)); \
1109 } while (0)
1110 
1111 
1112 /*------------------------------------------------.
1113 | Report that the YYRULE is going to be reduced. |
1114 `------------------------------------------------*/
1115 
1116 static void
1118 {
1119  unsigned long int yylno = yyrline[yyrule];
1120  int yynrhs = yyr2[yyrule];
1121  int yyi;
1122  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1123  yyrule - 1, yylno);
1124  /* The symbols being reduced. */
1125  for (yyi = 0; yyi < yynrhs; yyi++)
1126  {
1127  YYFPRINTF (stderr, " $%d = ", yyi + 1);
1128  yy_symbol_print (stderr,
1129  yystos[yyssp[yyi + 1 - yynrhs]],
1130  &(yyvsp[(yyi + 1) - (yynrhs)])
1131  );
1132  YYFPRINTF (stderr, "\n");
1133  }
1134 }
1135 
1136 # define YY_REDUCE_PRINT(Rule) \
1137 do { \
1138  if (yydebug) \
1139  yy_reduce_print (yyssp, yyvsp, Rule); \
1140 } while (0)
1141 
1142 /* Nonzero means print parse trace. It is left uninitialized so that
1143  multiple parsers can coexist. */
1145 #else /* !YYDEBUG */
1146 # define YYDPRINTF(Args)
1147 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1148 # define YY_STACK_PRINT(Bottom, Top)
1149 # define YY_REDUCE_PRINT(Rule)
1150 #endif /* !YYDEBUG */
1151 
1152 
1153 /* YYINITDEPTH -- initial size of the parser's stacks. */
1154 #ifndef YYINITDEPTH
1155 # define YYINITDEPTH 200
1156 #endif
1157 
1158 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1159  if the built-in stack extension method is used).
1160 
1161  Do not make this value too large; the results are undefined if
1162  YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1163  evaluated with infinite-precision integer arithmetic. */
1164 
1165 #ifndef YYMAXDEPTH
1166 # define YYMAXDEPTH 10000
1167 #endif
1168 
1169 
1170 #if YYERROR_VERBOSE
1171 
1172 # ifndef yystrlen
1173 # if defined __GLIBC__ && defined _STRING_H
1174 # define yystrlen strlen
1175 # else
1176 /* Return the length of YYSTR. */
1177 static YYSIZE_T
1178 yystrlen (const char *yystr)
1179 {
1180  YYSIZE_T yylen;
1181  for (yylen = 0; yystr[yylen]; yylen++)
1182  continue;
1183  return yylen;
1184 }
1185 # endif
1186 # endif
1187 
1188 # ifndef yystpcpy
1189 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1190 # define yystpcpy stpcpy
1191 # else
1192 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1193  YYDEST. */
1194 static char *
1195 yystpcpy (char *yydest, const char *yysrc)
1196 {
1197  char *yyd = yydest;
1198  const char *yys = yysrc;
1199 
1200  while ((*yyd++ = *yys++) != '\0')
1201  continue;
1202 
1203  return yyd - 1;
1204 }
1205 # endif
1206 # endif
1207 
1208 # ifndef yytnamerr
1209 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1210  quotes and backslashes, so that it's suitable for yyerror. The
1211  heuristic is that double-quoting is unnecessary unless the string
1212  contains an apostrophe, a comma, or backslash (other than
1213  backslash-backslash). YYSTR is taken from yytname. If YYRES is
1214  null, do not copy; instead, return the length of what the result
1215  would have been. */
1216 static YYSIZE_T
1217 yytnamerr (char *yyres, const char *yystr)
1218 {
1219  if (*yystr == '"')
1220  {
1221  YYSIZE_T yyn = 0;
1222  char const *yyp = yystr;
1223 
1224  for (;;)
1225  switch (*++yyp)
1226  {
1227  case '\'':
1228  case ',':
1229  goto do_not_strip_quotes;
1230 
1231  case '\\':
1232  if (*++yyp != '\\')
1233  goto do_not_strip_quotes;
1234  /* Fall through. */
1235  default:
1236  if (yyres)
1237  yyres[yyn] = *yyp;
1238  yyn++;
1239  break;
1240 
1241  case '"':
1242  if (yyres)
1243  yyres[yyn] = '\0';
1244  return yyn;
1245  }
1246  do_not_strip_quotes: ;
1247  }
1248 
1249  if (! yyres)
1250  return yystrlen (yystr);
1251 
1252  return yystpcpy (yyres, yystr) - yyres;
1253 }
1254 # endif
1255 
1256 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1257  about the unexpected token YYTOKEN for the state stack whose top is
1258  YYSSP.
1259 
1260  Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1261  not large enough to hold the message. In that case, also set
1262  *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1263  required number of bytes is too large to store. */
1264 static int
1265 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1266  yytype_int16 *yyssp, int yytoken)
1267 {
1268  YYSIZE_T yysize0 = yytnamerr (YY_NULLPTRPTR, yytname[yytoken]);
1269  YYSIZE_T yysize = yysize0;
1270  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1271  /* Internationalized format string. */
1272  const char *yyformat = YY_NULLPTRPTR;
1273  /* Arguments of yyformat. */
1274  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1275  /* Number of reported tokens (one for the "unexpected", one per
1276  "expected"). */
1277  int yycount = 0;
1278 
1279  /* There are many possibilities here to consider:
1280  - If this state is a consistent state with a default action, then
1281  the only way this function was invoked is if the default action
1282  is an error action. In that case, don't check for expected
1283  tokens because there are none.
1284  - The only way there can be no lookahead present (in yychar) is if
1285  this state is a consistent state with a default action. Thus,
1286  detecting the absence of a lookahead is sufficient to determine
1287  that there is no unexpected or expected token to report. In that
1288  case, just report a simple "syntax error".
1289  - Don't assume there isn't a lookahead just because this state is a
1290  consistent state with a default action. There might have been a
1291  previous inconsistent state, consistent state with a non-default
1292  action, or user semantic action that manipulated yychar.
1293  - Of course, the expected token list depends on states to have
1294  correct lookahead information, and it depends on the parser not
1295  to perform extra reductions after fetching a lookahead from the
1296  scanner and before detecting a syntax error. Thus, state merging
1297  (from LALR or IELR) and default reductions corrupt the expected
1298  token list. However, the list is correct for canonical LR with
1299  one exception: it will still contain any token that will not be
1300  accepted due to an error action in a later state.
1301  */
1302  if (yytoken != YYEMPTY)
1303  {
1304  int yyn = yypact[*yyssp];
1305  yyarg[yycount++] = yytname[yytoken];
1306  if (!yypact_value_is_default (yyn))
1307  {
1308  /* Start YYX at -YYN if negative to avoid negative indexes in
1309  YYCHECK. In other words, skip the first -YYN actions for
1310  this state because they are default actions. */
1311  int yyxbegin = yyn < 0 ? -yyn : 0;
1312  /* Stay within bounds of both yycheck and yytname. */
1313  int yychecklim = YYLAST - yyn + 1;
1314  int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1315  int yyx;
1316 
1317  for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1318  if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1319  && !yytable_value_is_error (yytable[yyx + yyn]))
1320  {
1321  if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1322  {
1323  yycount = 1;
1324  yysize = yysize0;
1325  break;
1326  }
1327  yyarg[yycount++] = yytname[yyx];
1328  {
1329  YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTRPTR, yytname[yyx]);
1330  if (! (yysize <= yysize1
1331  && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1332  return 2;
1333  yysize = yysize1;
1334  }
1335  }
1336  }
1337  }
1338 
1339  switch (yycount)
1340  {
1341 # define YYCASE_(N, S) \
1342  case N: \
1343  yyformat = S; \
1344  break
1345  YYCASE_(0, YY_("syntax error"));
1346  YYCASE_(1, YY_("syntax error, unexpected %s"));
1347  YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1348  YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1349  YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1350  YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1351 # undef YYCASE_
1352  }
1353 
1354  {
1355  YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1356  if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1357  return 2;
1358  yysize = yysize1;
1359  }
1360 
1361  if (*yymsg_alloc < yysize)
1362  {
1363  *yymsg_alloc = 2 * yysize;
1364  if (! (yysize <= *yymsg_alloc
1365  && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1366  *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1367  return 1;
1368  }
1369 
1370  /* Avoid sprintf, as that infringes on the user's name space.
1371  Don't have undefined behavior even if the translation
1372  produced a string with the wrong number of "%s"s. */
1373  {
1374  char *yyp = *yymsg;
1375  int yyi = 0;
1376  while ((*yyp = *yyformat) != '\0')
1377  if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1378  {
1379  yyp += yytnamerr (yyp, yyarg[yyi++]);
1380  yyformat += 2;
1381  }
1382  else
1383  {
1384  yyp++;
1385  yyformat++;
1386  }
1387  }
1388  return 0;
1389 }
1390 #endif /* YYERROR_VERBOSE */
1391 
1392 /*-----------------------------------------------.
1393 | Release the memory associated to this symbol. |
1394 `-----------------------------------------------*/
1395 
1396 static void
1397 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1398 {
1399  YYUSE (yyvaluep);
1400  if (!yymsg)
1401  yymsg = "Deleting";
1402  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1403 
1405  YYUSE (yytype);
1407 }
1408 
1409 
1410 
1411 
1412 /* The lookahead symbol. */
1414 
1415 /* The semantic value of the lookahead symbol. */
1417 /* Number of syntax errors so far. */
1419 
1420 
1421 /*----------.
1422 | yyparse. |
1423 `----------*/
1424 
1425 int
1426 yyparse (void)
1427 {
1428  int yystate;
1429  /* Number of tokens to shift before error messages enabled. */
1430  int yyerrstatus;
1431 
1432  /* The stacks and their tools:
1433  'yyss': related to states.
1434  'yyvs': related to semantic values.
1435 
1436  Refer to the stacks through separate pointers, to allow yyoverflow
1437  to xreallocate them elsewhere. */
1438 
1439  /* The state stack. */
1440  yytype_int16 yyssa[YYINITDEPTH];
1441  yytype_int16 *yyss;
1443 
1444  /* The semantic value stack. */
1445  YYSTYPE yyvsa[YYINITDEPTH];
1446  YYSTYPE *yyvs;
1447  YYSTYPE *yyvsp;
1448 
1450 
1451  int yyn;
1452  int yyresult;
1453  /* Lookahead token as an internal (translated) token number. */
1454  int yytoken = 0;
1455  /* The variables used to return semantic value and location from the
1456  action routines. */
1457  YYSTYPE yyval;
1458 
1459 #if YYERROR_VERBOSE
1460  /* Buffer for error messages, and its allocated size. */
1461  char yymsgbuf[128];
1462  char *yymsg = yymsgbuf;
1463  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1464 #endif
1465 
1466 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1467 
1468  /* The number of symbols on the RHS of the reduced rule.
1469  Keep to zero when no symbol should be popped. */
1470  int yylen = 0;
1471 
1472  yyssp = yyss = yyssa;
1473  yyvsp = yyvs = yyvsa;
1475 
1476  YYDPRINTF ((stderr, "Starting parse\n"));
1477 
1478  yystate = 0;
1479  yyerrstatus = 0;
1480  yynerrs = 0;
1481  yychar = YYEMPTY; /* Cause a token to be read. */
1482  goto yysetstate;
1483 
1484 /*------------------------------------------------------------.
1485 | yynewstate -- Push a new state, which is found in yystate. |
1486 `------------------------------------------------------------*/
1487  yynewstate:
1488  /* In all cases, when you get here, the value and location stacks
1489  have just been pushed. So pushing a state here evens the stacks. */
1490  yyssp++;
1491 
1492  yysetstate:
1493  *yyssp = yystate;
1494 
1495  if (yyss + yystacksize - 1 <= yyssp)
1496  {
1497  /* Get the current used size of the three stacks, in elements. */
1498  YYSIZE_T yysize = yyssp - yyss + 1;
1499 
1500 #ifdef yyoverflow
1501  {
1502  /* Give user a chance to xreallocate the stack. Use copies of
1503  these so that the &'s don't force the real ones into
1504  memory. */
1505  YYSTYPE *yyvs1 = yyvs;
1506  yytype_int16 *yyss1 = yyss;
1507 
1508  /* Each stack pointer address is followed by the size of the
1509  data in use in that stack, in bytes. This used to be a
1510  conditional around just the two extra args, but that might
1511  be undefined if yyoverflow is a macro. */
1512  yyoverflow (YY_("memory exhausted"),
1513  &yyss1, yysize * sizeof (*yyssp),
1514  &yyvs1, yysize * sizeof (*yyvsp),
1515  &yystacksize);
1516 
1517  yyss = yyss1;
1518  yyvs = yyvs1;
1519  }
1520 #else /* no yyoverflow */
1521 # ifndef YYSTACK_RELOCATE
1522  goto yyexhaustedlab;
1523 # else
1524  /* Extend the stack our own way. */
1525  if (YYMAXDEPTH <= yystacksize)
1526  goto yyexhaustedlab;
1527  yystacksize *= 2;
1528  if (YYMAXDEPTH < yystacksize)
1530 
1531  {
1532  yytype_int16 *yyss1 = yyss;
1533  union yyalloc *yyptr =
1535  if (! yyptr)
1536  goto yyexhaustedlab;
1539 # undef YYSTACK_RELOCATE
1540  if (yyss1 != yyssa)
1541  YYSTACK_FREE (yyss1);
1542  }
1543 # endif
1544 #endif /* no yyoverflow */
1545 
1546  yyssp = yyss + yysize - 1;
1547  yyvsp = yyvs + yysize - 1;
1548 
1549  YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1550  (unsigned long int) yystacksize));
1551 
1552  if (yyss + yystacksize - 1 <= yyssp)
1553  YYABORT;
1554  }
1555 
1556  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1557 
1558  if (yystate == YYFINAL)
1559  YYACCEPT;
1560 
1561  goto yybackup;
1562 
1563 /*-----------.
1564 | yybackup. |
1565 `-----------*/
1566 yybackup:
1567 
1568  /* Do appropriate processing given the current state. Read a
1569  lookahead token if we need one and don't already have one. */
1570 
1571  /* First try to decide what to do without reference to lookahead token. */
1572  yyn = yypact[yystate];
1573  if (yypact_value_is_default (yyn))
1574  goto yydefault;
1575 
1576  /* Not known => get a lookahead token if don't already have one. */
1577 
1578  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1579  if (yychar == YYEMPTY)
1580  {
1581  YYDPRINTF ((stderr, "Reading a token: "));
1582  yychar = yylex ();
1583  }
1584 
1585  if (yychar <= YYEOF)
1586  {
1587  yychar = yytoken = YYEOF;
1588  YYDPRINTF ((stderr, "Now at end of input.\n"));
1589  }
1590  else
1591  {
1592  yytoken = YYTRANSLATE (yychar);
1593  YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1594  }
1595 
1596  /* If the proper action on seeing token YYTOKEN is to reduce or to
1597  detect an error, take that action. */
1598  yyn += yytoken;
1599  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1600  goto yydefault;
1601  yyn = yytable[yyn];
1602  if (yyn <= 0)
1603  {
1604  if (yytable_value_is_error (yyn))
1605  goto yyerrlab;
1606  yyn = -yyn;
1607  goto yyreduce;
1608  }
1609 
1610  /* Count tokens shifted since error; after three, turn off error
1611  status. */
1612  if (yyerrstatus)
1613  yyerrstatus--;
1614 
1615  /* Shift the lookahead token. */
1616  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1617 
1618  /* Discard the shifted token. */
1619  yychar = YYEMPTY;
1620 
1621  yystate = yyn;
1623  *++yyvsp = yylval;
1625 
1626  goto yynewstate;
1627 
1628 
1629 /*-----------------------------------------------------------.
1630 | yydefault -- do the default action for the current state. |
1631 `-----------------------------------------------------------*/
1632 yydefault:
1633  yyn = yydefact[yystate];
1634  if (yyn == 0)
1635  goto yyerrlab;
1636  goto yyreduce;
1637 
1638 
1639 /*-----------------------------.
1640 | yyreduce -- Do a reduction. |
1641 `-----------------------------*/
1642 yyreduce:
1643  /* yyn is the number of a rule to reduce with. */
1644  yylen = yyr2[yyn];
1645 
1646  /* If YYLEN is nonzero, implement the default value of the action:
1647  '$$ = $1'.
1648 
1649  Otherwise, the following line sets YYVAL to garbage.
1650  This behavior is undocumented and Bison
1651  users should not rely upon it. Assigning to YYVAL
1652  unconditionally makes the parser a bit smaller, and it avoids a
1653  GCC warning that YYVAL may be used uninitialized. */
1654  yyval = yyvsp[1-yylen];
1655 
1656 
1657  YY_REDUCE_PRINT (yyn);
1658  switch (yyn)
1659  {
1660  case 4:
1661 #line 191 "ada-exp.y" /* yacc.c:1646 */
1662  { write_exp_elt_opcode (pstate, BINOP_COMMA); }
1663 #line 1665 "ada-exp.c" /* yacc.c:1646 */
1664  break;
1665 
1666  case 5:
1667 #line 193 "ada-exp.y" /* yacc.c:1646 */
1668  { write_exp_elt_opcode (pstate, BINOP_ASSIGN); }
1669 #line 1671 "ada-exp.c" /* yacc.c:1646 */
1670  break;
1671 
1672  case 6:
1673 #line 198 "ada-exp.y" /* yacc.c:1646 */
1674  { write_exp_elt_opcode (pstate, UNOP_IND); }
1675 #line 1677 "ada-exp.c" /* yacc.c:1646 */
1676  break;
1677 
1678  case 7:
1679 #line 202 "ada-exp.y" /* yacc.c:1646 */
1680  { write_exp_op_with_string (pstate, STRUCTOP_STRUCT,
1681  (yyvsp[0].sval)); }
1682 #line 1684 "ada-exp.c" /* yacc.c:1646 */
1683  break;
1684 
1685  case 8:
1686 #line 207 "ada-exp.y" /* yacc.c:1646 */
1687  {
1688  write_exp_elt_opcode (pstate, OP_FUNCALL);
1689  write_exp_elt_longcst (pstate, (yyvsp[-1].lval));
1690  write_exp_elt_opcode (pstate, OP_FUNCALL);
1691  }
1692 #line 1694 "ada-exp.c" /* yacc.c:1646 */
1693  break;
1694 
1695  case 9:
1696 #line 213 "ada-exp.y" /* yacc.c:1646 */
1697  {
1698  if ((yyvsp[-3].tval) != NULL)
1699  {
1700  if ((yyvsp[-1].lval) != 1)
1701  error (_("Invalid conversion"));
1702  write_exp_elt_opcode (pstate, UNOP_CAST);
1703  write_exp_elt_type (pstate, (yyvsp[-3].tval));
1704  write_exp_elt_opcode (pstate, UNOP_CAST);
1705  }
1706  else
1707  {
1708  write_exp_elt_opcode (pstate, OP_FUNCALL);
1709  write_exp_elt_longcst (pstate, (yyvsp[-1].lval));
1710  write_exp_elt_opcode (pstate, OP_FUNCALL);
1711  }
1712  }
1713 #line 1715 "ada-exp.c" /* yacc.c:1646 */
1714  break;
1715 
1716  case 10:
1717 #line 231 "ada-exp.y" /* yacc.c:1646 */
1718  { type_qualifier = (yyvsp[-2].tval); }
1719 #line 1721 "ada-exp.c" /* yacc.c:1646 */
1720  break;
1721 
1722  case 11:
1723 #line 233 "ada-exp.y" /* yacc.c:1646 */
1724  {
1725  if ((yyvsp[-6].tval) == NULL)
1726  error (_("Type required for qualification"));
1727  write_exp_elt_opcode (pstate, UNOP_QUAL);
1728  write_exp_elt_type (pstate, (yyvsp[-6].tval));
1729  write_exp_elt_opcode (pstate, UNOP_QUAL);
1730  type_qualifier = (yyvsp[-4].tval);
1731  }
1732 #line 1734 "ada-exp.c" /* yacc.c:1646 */
1733  break;
1734 
1735  case 12:
1736 #line 243 "ada-exp.y" /* yacc.c:1646 */
1737  { (yyval.tval) = type_qualifier; }
1738 #line 1740 "ada-exp.c" /* yacc.c:1646 */
1739  break;
1740 
1741  case 13:
1742 #line 248 "ada-exp.y" /* yacc.c:1646 */
1743  { write_exp_elt_opcode (pstate, TERNOP_SLICE); }
1744 #line 1746 "ada-exp.c" /* yacc.c:1646 */
1745  break;
1746 
1747  case 14:
1748 #line 250 "ada-exp.y" /* yacc.c:1646 */
1749  { if ((yyvsp[-5].tval) == NULL)
1750  write_exp_elt_opcode (pstate, TERNOP_SLICE);
1751  else
1752  error (_("Cannot slice a type"));
1753  }
1754 #line 1756 "ada-exp.c" /* yacc.c:1646 */
1755  break;
1756 
1757  case 15:
1758 #line 257 "ada-exp.y" /* yacc.c:1646 */
1759  { }
1760 #line 1762 "ada-exp.c" /* yacc.c:1646 */
1761  break;
1762 
1763  case 16:
1764 #line 269 "ada-exp.y" /* yacc.c:1646 */
1765  { if ((yyvsp[0].tval) != NULL)
1766  {
1767  write_exp_elt_opcode (pstate, OP_TYPE);
1768  write_exp_elt_type (pstate, (yyvsp[0].tval));
1769  write_exp_elt_opcode (pstate, OP_TYPE);
1770  }
1771  }
1772 #line 1774 "ada-exp.c" /* yacc.c:1646 */
1773  break;
1774 
1775  case 17:
1776 #line 279 "ada-exp.y" /* yacc.c:1646 */
1777  { write_dollar_variable (pstate, (yyvsp[0].sval)); }
1778 #line 1780 "ada-exp.c" /* yacc.c:1646 */
1779  break;
1780 
1781  case 20:
1782 #line 289 "ada-exp.y" /* yacc.c:1646 */
1783  { write_exp_elt_opcode (pstate, UNOP_NEG); }
1784 #line 1786 "ada-exp.c" /* yacc.c:1646 */
1785  break;
1786 
1787  case 21:
1788 #line 293 "ada-exp.y" /* yacc.c:1646 */
1789  { write_exp_elt_opcode (pstate, UNOP_PLUS); }
1790 #line 1792 "ada-exp.c" /* yacc.c:1646 */
1791  break;
1792 
1793  case 22:
1794 #line 297 "ada-exp.y" /* yacc.c:1646 */
1795  { write_exp_elt_opcode (pstate, UNOP_LOGICAL_NOT); }
1796 #line 1798 "ada-exp.c" /* yacc.c:1646 */
1797  break;
1798 
1799  case 23:
1800 #line 301 "ada-exp.y" /* yacc.c:1646 */
1801  { write_exp_elt_opcode (pstate, UNOP_ABS); }
1802 #line 1804 "ada-exp.c" /* yacc.c:1646 */
1803  break;
1804 
1805  case 24:
1806 #line 304 "ada-exp.y" /* yacc.c:1646 */
1807  { (yyval.lval) = 0; }
1808 #line 1810 "ada-exp.c" /* yacc.c:1646 */
1809  break;
1810 
1811  case 25:
1812 #line 308 "ada-exp.y" /* yacc.c:1646 */
1813  { (yyval.lval) = 1; }
1814 #line 1816 "ada-exp.c" /* yacc.c:1646 */
1815  break;
1816 
1817  case 26:
1818 #line 310 "ada-exp.y" /* yacc.c:1646 */
1819  { (yyval.lval) = 1; }
1820 #line 1822 "ada-exp.c" /* yacc.c:1646 */
1821  break;
1822 
1823  case 27:
1824 #line 312 "ada-exp.y" /* yacc.c:1646 */
1825  { (yyval.lval) = (yyvsp[-2].lval) + 1; }
1826 #line 1828 "ada-exp.c" /* yacc.c:1646 */
1827  break;
1828 
1829  case 28:
1830 #line 314 "ada-exp.y" /* yacc.c:1646 */
1831  { (yyval.lval) = (yyvsp[-4].lval) + 1; }
1832 #line 1834 "ada-exp.c" /* yacc.c:1646 */
1833  break;
1834 
1835  case 29:
1836 #line 319 "ada-exp.y" /* yacc.c:1646 */
1837  {
1838  if ((yyvsp[-2].tval) == NULL)
1839  error (_("Type required within braces in coercion"));
1840  write_exp_elt_opcode (pstate, UNOP_MEMVAL);
1841  write_exp_elt_type (pstate, (yyvsp[-2].tval));
1842  write_exp_elt_opcode (pstate, UNOP_MEMVAL);
1843  }
1844 #line 1846 "ada-exp.c" /* yacc.c:1646 */
1845  break;
1846 
1847  case 30:
1848 #line 331 "ada-exp.y" /* yacc.c:1646 */
1849  { write_exp_elt_opcode (pstate, BINOP_EXP); }
1850 #line 1852 "ada-exp.c" /* yacc.c:1646 */
1851  break;
1852 
1853  case 31:
1854 #line 335 "ada-exp.y" /* yacc.c:1646 */
1855  { write_exp_elt_opcode (pstate, BINOP_MUL); }
1856 #line 1858 "ada-exp.c" /* yacc.c:1646 */
1857  break;
1858 
1859  case 32:
1860 #line 339 "ada-exp.y" /* yacc.c:1646 */
1861  { write_exp_elt_opcode (pstate, BINOP_DIV); }
1862 #line 1864 "ada-exp.c" /* yacc.c:1646 */
1863  break;
1864 
1865  case 33:
1866 #line 343 "ada-exp.y" /* yacc.c:1646 */
1867  { write_exp_elt_opcode (pstate, BINOP_REM); }
1868 #line 1870 "ada-exp.c" /* yacc.c:1646 */
1869  break;
1870 
1871  case 34:
1872 #line 347 "ada-exp.y" /* yacc.c:1646 */
1873  { write_exp_elt_opcode (pstate, BINOP_MOD); }
1874 #line 1876 "ada-exp.c" /* yacc.c:1646 */
1875  break;
1876 
1877  case 35:
1878 #line 351 "ada-exp.y" /* yacc.c:1646 */
1879  { write_exp_elt_opcode (pstate, BINOP_REPEAT); }
1880 #line 1882 "ada-exp.c" /* yacc.c:1646 */
1881  break;
1882 
1883  case 36:
1884 #line 355 "ada-exp.y" /* yacc.c:1646 */
1885  { write_exp_elt_opcode (pstate, BINOP_ADD); }
1886 #line 1888 "ada-exp.c" /* yacc.c:1646 */
1887  break;
1888 
1889  case 37:
1890 #line 359 "ada-exp.y" /* yacc.c:1646 */
1891  { write_exp_elt_opcode (pstate, BINOP_CONCAT); }
1892 #line 1894 "ada-exp.c" /* yacc.c:1646 */
1893  break;
1894 
1895  case 38:
1896 #line 363 "ada-exp.y" /* yacc.c:1646 */
1897  { write_exp_elt_opcode (pstate, BINOP_SUB); }
1898 #line 1900 "ada-exp.c" /* yacc.c:1646 */
1899  break;
1900 
1901  case 40:
1902 #line 370 "ada-exp.y" /* yacc.c:1646 */
1903  { write_exp_elt_opcode (pstate, BINOP_EQUAL); }
1904 #line 1906 "ada-exp.c" /* yacc.c:1646 */
1905  break;
1906 
1907  case 41:
1908 #line 374 "ada-exp.y" /* yacc.c:1646 */
1909  { write_exp_elt_opcode (pstate, BINOP_NOTEQUAL); }
1910 #line 1912 "ada-exp.c" /* yacc.c:1646 */
1911  break;
1912 
1913  case 42:
1914 #line 378 "ada-exp.y" /* yacc.c:1646 */
1915  { write_exp_elt_opcode (pstate, BINOP_LEQ); }
1916 #line 1918 "ada-exp.c" /* yacc.c:1646 */
1917  break;
1918 
1919  case 43:
1920 #line 382 "ada-exp.y" /* yacc.c:1646 */
1921  { write_exp_elt_opcode (pstate, TERNOP_IN_RANGE); }
1922 #line 1924 "ada-exp.c" /* yacc.c:1646 */
1923  break;
1924 
1925  case 44:
1926 #line 384 "ada-exp.y" /* yacc.c:1646 */
1927  { write_exp_elt_opcode (pstate, BINOP_IN_BOUNDS);
1928  write_exp_elt_longcst (pstate, (LONGEST) (yyvsp[0].lval));
1929  write_exp_elt_opcode (pstate, BINOP_IN_BOUNDS);
1930  }
1931 #line 1933 "ada-exp.c" /* yacc.c:1646 */
1932  break;
1933 
1934  case 45:
1935 #line 389 "ada-exp.y" /* yacc.c:1646 */
1936  {
1937  if ((yyvsp[0].tval) == NULL)
1938  error (_("Right operand of 'in' must be type"));
1939  write_exp_elt_opcode (pstate, UNOP_IN_RANGE);
1940  write_exp_elt_type (pstate, (yyvsp[0].tval));
1941  write_exp_elt_opcode (pstate, UNOP_IN_RANGE);
1942  }
1943 #line 1945 "ada-exp.c" /* yacc.c:1646 */
1944  break;
1945 
1946  case 46:
1947 #line 397 "ada-exp.y" /* yacc.c:1646 */
1948  { write_exp_elt_opcode (pstate, TERNOP_IN_RANGE);
1949  write_exp_elt_opcode (pstate, UNOP_LOGICAL_NOT);
1950  }
1951 #line 1953 "ada-exp.c" /* yacc.c:1646 */
1952  break;
1953 
1954  case 47:
1955 #line 401 "ada-exp.y" /* yacc.c:1646 */
1956  { write_exp_elt_opcode (pstate, BINOP_IN_BOUNDS);
1957  write_exp_elt_longcst (pstate, (LONGEST) (yyvsp[0].lval));
1958  write_exp_elt_opcode (pstate, BINOP_IN_BOUNDS);
1959  write_exp_elt_opcode (pstate, UNOP_LOGICAL_NOT);
1960  }
1961 #line 1963 "ada-exp.c" /* yacc.c:1646 */
1962  break;
1963 
1964  case 48:
1965 #line 407 "ada-exp.y" /* yacc.c:1646 */
1966  {
1967  if ((yyvsp[0].tval) == NULL)
1968  error (_("Right operand of 'in' must be type"));
1969  write_exp_elt_opcode (pstate, UNOP_IN_RANGE);
1970  write_exp_elt_type (pstate, (yyvsp[0].tval));
1971  write_exp_elt_opcode (pstate, UNOP_IN_RANGE);
1972  write_exp_elt_opcode (pstate, UNOP_LOGICAL_NOT);
1973  }
1974 #line 1976 "ada-exp.c" /* yacc.c:1646 */
1975  break;
1976 
1977  case 49:
1978 #line 418 "ada-exp.y" /* yacc.c:1646 */
1979  { write_exp_elt_opcode (pstate, BINOP_GEQ); }
1980 #line 1982 "ada-exp.c" /* yacc.c:1646 */
1981  break;
1982 
1983  case 50:
1984 #line 422 "ada-exp.y" /* yacc.c:1646 */
1985  { write_exp_elt_opcode (pstate, BINOP_LESS); }
1986 #line 1988 "ada-exp.c" /* yacc.c:1646 */
1987  break;
1988 
1989  case 51:
1990 #line 426 "ada-exp.y" /* yacc.c:1646 */
1991  { write_exp_elt_opcode (pstate, BINOP_GTR); }
1992 #line 1994 "ada-exp.c" /* yacc.c:1646 */
1993  break;
1994 
1995  case 58:
1996 #line 439 "ada-exp.y" /* yacc.c:1646 */
1997  { write_exp_elt_opcode (pstate, BINOP_BITWISE_AND); }
1998 #line 2000 "ada-exp.c" /* yacc.c:1646 */
1999  break;
2000 
2001  case 59:
2002 #line 441 "ada-exp.y" /* yacc.c:1646 */
2003  { write_exp_elt_opcode (pstate, BINOP_BITWISE_AND); }
2004 #line 2006 "ada-exp.c" /* yacc.c:1646 */
2005  break;
2006 
2007  case 60:
2008 #line 446 "ada-exp.y" /* yacc.c:1646 */
2009  { write_exp_elt_opcode (pstate, BINOP_LOGICAL_AND); }
2010 #line 2012 "ada-exp.c" /* yacc.c:1646 */
2011  break;
2012 
2013  case 61:
2014 #line 448 "ada-exp.y" /* yacc.c:1646 */
2015  { write_exp_elt_opcode (pstate, BINOP_LOGICAL_AND); }
2016 #line 2018 "ada-exp.c" /* yacc.c:1646 */
2017  break;
2018 
2019  case 62:
2020 #line 453 "ada-exp.y" /* yacc.c:1646 */
2021  { write_exp_elt_opcode (pstate, BINOP_BITWISE_IOR); }
2022 #line 2024 "ada-exp.c" /* yacc.c:1646 */
2023  break;
2024 
2025  case 63:
2026 #line 455 "ada-exp.y" /* yacc.c:1646 */
2027  { write_exp_elt_opcode (pstate, BINOP_BITWISE_IOR); }
2028 #line 2030 "ada-exp.c" /* yacc.c:1646 */
2029  break;
2030 
2031  case 64:
2032 #line 460 "ada-exp.y" /* yacc.c:1646 */
2033  { write_exp_elt_opcode (pstate, BINOP_LOGICAL_OR); }
2034 #line 2036 "ada-exp.c" /* yacc.c:1646 */
2035  break;
2036 
2037  case 65:
2038 #line 462 "ada-exp.y" /* yacc.c:1646 */
2039  { write_exp_elt_opcode (pstate, BINOP_LOGICAL_OR); }
2040 #line 2042 "ada-exp.c" /* yacc.c:1646 */
2041  break;
2042 
2043  case 66:
2044 #line 466 "ada-exp.y" /* yacc.c:1646 */
2045  { write_exp_elt_opcode (pstate, BINOP_BITWISE_XOR); }
2046 #line 2048 "ada-exp.c" /* yacc.c:1646 */
2047  break;
2048 
2049  case 67:
2050 #line 468 "ada-exp.y" /* yacc.c:1646 */
2051  { write_exp_elt_opcode (pstate, BINOP_BITWISE_XOR); }
2052 #line 2054 "ada-exp.c" /* yacc.c:1646 */
2053  break;
2054 
2055  case 68:
2056 #line 480 "ada-exp.y" /* yacc.c:1646 */
2057  { write_exp_elt_opcode (pstate, UNOP_ADDR); }
2058 #line 2060 "ada-exp.c" /* yacc.c:1646 */
2059  break;
2060 
2061  case 69:
2062 #line 482 "ada-exp.y" /* yacc.c:1646 */
2063  { write_exp_elt_opcode (pstate, UNOP_ADDR);
2064  write_exp_elt_opcode (pstate, UNOP_CAST);
2067  write_exp_elt_opcode (pstate, UNOP_CAST);
2068  }
2069 #line 2071 "ada-exp.c" /* yacc.c:1646 */
2070  break;
2071 
2072  case 70:
2073 #line 489 "ada-exp.y" /* yacc.c:1646 */
2074  { write_int (pstate, (yyvsp[0].lval), type_int (pstate));
2075  write_exp_elt_opcode (pstate, OP_ATR_FIRST); }
2076 #line 2078 "ada-exp.c" /* yacc.c:1646 */
2077  break;
2078 
2079  case 71:
2080 #line 492 "ada-exp.y" /* yacc.c:1646 */
2081  { write_int (pstate, (yyvsp[0].lval), type_int (pstate));
2082  write_exp_elt_opcode (pstate, OP_ATR_LAST); }
2083 #line 2085 "ada-exp.c" /* yacc.c:1646 */
2084  break;
2085 
2086  case 72:
2087 #line 495 "ada-exp.y" /* yacc.c:1646 */
2088  { write_int (pstate, (yyvsp[0].lval), type_int (pstate));
2089  write_exp_elt_opcode (pstate, OP_ATR_LENGTH); }
2090 #line 2092 "ada-exp.c" /* yacc.c:1646 */
2091  break;
2092 
2093  case 73:
2094 #line 498 "ada-exp.y" /* yacc.c:1646 */
2095  { write_exp_elt_opcode (pstate, OP_ATR_SIZE); }
2096 #line 2098 "ada-exp.c" /* yacc.c:1646 */
2097  break;
2098 
2099  case 74:
2100 #line 500 "ada-exp.y" /* yacc.c:1646 */
2101  { write_exp_elt_opcode (pstate, OP_ATR_TAG); }
2102 #line 2104 "ada-exp.c" /* yacc.c:1646 */
2103  break;
2104 
2105  case 75:
2106 #line 502 "ada-exp.y" /* yacc.c:1646 */
2107  { write_exp_elt_opcode (pstate, OP_ATR_MIN); }
2108 #line 2110 "ada-exp.c" /* yacc.c:1646 */
2109  break;
2110 
2111  case 76:
2112 #line 504 "ada-exp.y" /* yacc.c:1646 */
2113  { write_exp_elt_opcode (pstate, OP_ATR_MAX); }
2114 #line 2116 "ada-exp.c" /* yacc.c:1646 */
2115  break;
2116 
2117  case 77:
2118 #line 506 "ada-exp.y" /* yacc.c:1646 */
2119  { write_exp_elt_opcode (pstate, OP_ATR_POS); }
2120 #line 2122 "ada-exp.c" /* yacc.c:1646 */
2121  break;
2122 
2123  case 78:
2124 #line 508 "ada-exp.y" /* yacc.c:1646 */
2125  { write_exp_elt_opcode (pstate, OP_ATR_VAL); }
2126 #line 2128 "ada-exp.c" /* yacc.c:1646 */
2127  break;
2128 
2129  case 79:
2130 #line 510 "ada-exp.y" /* yacc.c:1646 */
2131  { write_exp_elt_opcode (pstate, OP_ATR_MODULUS); }
2132 #line 2134 "ada-exp.c" /* yacc.c:1646 */
2133  break;
2134 
2135  case 80:
2136 #line 514 "ada-exp.y" /* yacc.c:1646 */
2137  { (yyval.lval) = 1; }
2138 #line 2140 "ada-exp.c" /* yacc.c:1646 */
2139  break;
2140 
2141  case 81:
2142 #line 516 "ada-exp.y" /* yacc.c:1646 */
2143  { (yyval.lval) = (yyvsp[-1].typed_val).val; }
2144 #line 2146 "ada-exp.c" /* yacc.c:1646 */
2145  break;
2146 
2147  case 82:
2148 #line 521 "ada-exp.y" /* yacc.c:1646 */
2149  {
2150  if ((yyvsp[0].tval) == NULL)
2151  error (_("Prefix must be type"));
2152  write_exp_elt_opcode (pstate, OP_TYPE);
2153  write_exp_elt_type (pstate, (yyvsp[0].tval));
2154  write_exp_elt_opcode (pstate, OP_TYPE); }
2155 #line 2157 "ada-exp.c" /* yacc.c:1646 */
2156  break;
2157 
2158  case 84:
2159 #line 532 "ada-exp.y" /* yacc.c:1646 */
2160  { write_exp_elt_opcode (pstate, OP_TYPE);
2162  parse_type (pstate)->builtin_void);
2163  write_exp_elt_opcode (pstate, OP_TYPE); }
2164 #line 2166 "ada-exp.c" /* yacc.c:1646 */
2165  break;
2166 
2167  case 85:
2168 #line 540 "ada-exp.y" /* yacc.c:1646 */
2169  { write_int (pstate, (LONGEST) (yyvsp[0].typed_val).val, (yyvsp[0].typed_val).type); }
2170 #line 2172 "ada-exp.c" /* yacc.c:1646 */
2171  break;
2172 
2173  case 86:
2174 #line 544 "ada-exp.y" /* yacc.c:1646 */
2175  { write_int (pstate,
2176  convert_char_literal (type_qualifier, (yyvsp[0].typed_val).val),
2177  (type_qualifier == NULL)
2178  ? (yyvsp[0].typed_val).type : type_qualifier);
2179  }
2180 #line 2182 "ada-exp.c" /* yacc.c:1646 */
2181  break;
2182 
2183  case 87:
2184 #line 552 "ada-exp.y" /* yacc.c:1646 */
2185  { write_exp_elt_opcode (pstate, OP_FLOAT);
2188  write_exp_elt_opcode (pstate, OP_FLOAT);
2189  }
2190 #line 2192 "ada-exp.c" /* yacc.c:1646 */
2191  break;
2192 
2193  case 88:
2194 #line 560 "ada-exp.y" /* yacc.c:1646 */
2195  { write_int (pstate, 0, type_int (pstate)); }
2196 #line 2198 "ada-exp.c" /* yacc.c:1646 */
2197  break;
2198 
2199  case 89:
2200 #line 564 "ada-exp.y" /* yacc.c:1646 */
2201  {
2202  write_exp_op_with_string (pstate, OP_STRING, (yyvsp[0].sval));
2203  }
2204 #line 2206 "ada-exp.c" /* yacc.c:1646 */
2205  break;
2206 
2207  case 90:
2208 #line 570 "ada-exp.y" /* yacc.c:1646 */
2209  { write_int (pstate, 1, type_boolean (pstate)); }
2210 #line 2212 "ada-exp.c" /* yacc.c:1646 */
2211  break;
2212 
2213  case 91:
2214 #line 572 "ada-exp.y" /* yacc.c:1646 */
2215  { write_int (pstate, 0, type_boolean (pstate)); }
2216 #line 2218 "ada-exp.c" /* yacc.c:1646 */
2217  break;
2218 
2219  case 92:
2220 #line 576 "ada-exp.y" /* yacc.c:1646 */
2221  { error (_("NEW not implemented.")); }
2222 #line 2224 "ada-exp.c" /* yacc.c:1646 */
2223  break;
2224 
2225  case 93:
2226 #line 580 "ada-exp.y" /* yacc.c:1646 */
2227  { (yyval.tval) = write_var_or_type (pstate, NULL, (yyvsp[0].sval)); }
2228 #line 2230 "ada-exp.c" /* yacc.c:1646 */
2229  break;
2230 
2231  case 94:
2232 #line 582 "ada-exp.y" /* yacc.c:1646 */
2233  { (yyval.tval) = write_var_or_type (pstate, (yyvsp[-1].bval), (yyvsp[0].sval)); }
2234 #line 2236 "ada-exp.c" /* yacc.c:1646 */
2235  break;
2236 
2237  case 95:
2238 #line 584 "ada-exp.y" /* yacc.c:1646 */
2239  {
2240  (yyval.tval) = write_var_or_type (pstate, NULL, (yyvsp[-1].sval));
2241  if ((yyval.tval) == NULL)
2242  write_exp_elt_opcode (pstate, UNOP_ADDR);
2243  else
2244  (yyval.tval) = lookup_pointer_type ((yyval.tval));
2245  }
2246 #line 2248 "ada-exp.c" /* yacc.c:1646 */
2247  break;
2248 
2249  case 96:
2250 #line 592 "ada-exp.y" /* yacc.c:1646 */
2251  {
2252  (yyval.tval) = write_var_or_type (pstate, (yyvsp[-2].bval), (yyvsp[-1].sval));
2253  if ((yyval.tval) == NULL)
2254  write_exp_elt_opcode (pstate, UNOP_ADDR);
2255  else
2256  (yyval.tval) = lookup_pointer_type ((yyval.tval));
2257  }
2258 #line 2260 "ada-exp.c" /* yacc.c:1646 */
2259  break;
2260 
2261  case 97:
2262 #line 603 "ada-exp.y" /* yacc.c:1646 */
2263  { (yyval.bval) = block_lookup (NULL, (yyvsp[-1].sval).ptr); }
2264 #line 2266 "ada-exp.c" /* yacc.c:1646 */
2265  break;
2266 
2267  case 98:
2268 #line 605 "ada-exp.y" /* yacc.c:1646 */
2269  { (yyval.bval) = block_lookup ((yyvsp[-2].bval), (yyvsp[-1].sval).ptr); }
2270 #line 2272 "ada-exp.c" /* yacc.c:1646 */
2271  break;
2272 
2273  case 99:
2274 #line 610 "ada-exp.y" /* yacc.c:1646 */
2275  {
2276  write_exp_elt_opcode (pstate, OP_AGGREGATE);
2277  write_exp_elt_longcst (pstate, (yyvsp[-1].lval));
2278  write_exp_elt_opcode (pstate, OP_AGGREGATE);
2279  }
2280 #line 2282 "ada-exp.c" /* yacc.c:1646 */
2281  break;
2282 
2283  case 100:
2284 #line 618 "ada-exp.y" /* yacc.c:1646 */
2285  { (yyval.lval) = (yyvsp[0].lval); }
2286 #line 2288 "ada-exp.c" /* yacc.c:1646 */
2287  break;
2288 
2289  case 101:
2290 #line 620 "ada-exp.y" /* yacc.c:1646 */
2291  { write_exp_elt_opcode (pstate, OP_POSITIONAL);
2292  write_exp_elt_longcst (pstate, (yyvsp[-1].lval));
2293  write_exp_elt_opcode (pstate, OP_POSITIONAL);
2294  (yyval.lval) = (yyvsp[-1].lval) + 1;
2295  }
2296 #line 2298 "ada-exp.c" /* yacc.c:1646 */
2297  break;
2298 
2299  case 102:
2300 #line 626 "ada-exp.y" /* yacc.c:1646 */
2301  { (yyval.lval) = (yyvsp[-1].lval) + (yyvsp[0].lval); }
2302 #line 2304 "ada-exp.c" /* yacc.c:1646 */
2303  break;
2304 
2305  case 103:
2306 #line 631 "ada-exp.y" /* yacc.c:1646 */
2307  { write_exp_elt_opcode (pstate, OP_POSITIONAL);
2309  write_exp_elt_opcode (pstate, OP_POSITIONAL);
2310  (yyval.lval) = 1;
2311  }
2312 #line 2314 "ada-exp.c" /* yacc.c:1646 */
2313  break;
2314 
2315  case 104:
2316 #line 637 "ada-exp.y" /* yacc.c:1646 */
2317  { write_exp_elt_opcode (pstate, OP_POSITIONAL);
2318  write_exp_elt_longcst (pstate, (yyvsp[-2].lval));
2319  write_exp_elt_opcode (pstate, OP_POSITIONAL);
2320  (yyval.lval) = (yyvsp[-2].lval) + 1;
2321  }
2322 #line 2324 "ada-exp.c" /* yacc.c:1646 */
2323  break;
2324 
2325  case 105:
2326 #line 645 "ada-exp.y" /* yacc.c:1646 */
2327  { (yyval.lval) = 1; }
2328 #line 2330 "ada-exp.c" /* yacc.c:1646 */
2329  break;
2330 
2331  case 106:
2332 #line 646 "ada-exp.y" /* yacc.c:1646 */
2333  { (yyval.lval) = 1; }
2334 #line 2336 "ada-exp.c" /* yacc.c:1646 */
2335  break;
2336 
2337  case 107:
2338 #line 648 "ada-exp.y" /* yacc.c:1646 */
2339  { (yyval.lval) = (yyvsp[0].lval) + 1; }
2340 #line 2342 "ada-exp.c" /* yacc.c:1646 */
2341  break;
2342 
2343  case 108:
2344 #line 652 "ada-exp.y" /* yacc.c:1646 */
2345  { write_exp_elt_opcode (pstate, OP_OTHERS); }
2346 #line 2348 "ada-exp.c" /* yacc.c:1646 */
2347  break;
2348 
2349  case 109:
2350 #line 657 "ada-exp.y" /* yacc.c:1646 */
2351  {
2352  write_exp_elt_opcode (pstate, OP_CHOICES);
2353  write_exp_elt_longcst (pstate, (yyvsp[0].lval));
2354  write_exp_elt_opcode (pstate, OP_CHOICES);
2355  }
2356 #line 2358 "ada-exp.c" /* yacc.c:1646 */
2357  break;
2358 
2359  case 110:
2360 #line 671 "ada-exp.y" /* yacc.c:1646 */
2361  { write_name_assoc (pstate, (yyvsp[-1].sval)); }
2362 #line 2364 "ada-exp.c" /* yacc.c:1646 */
2363  break;
2364 
2365  case 111:
2366 #line 672 "ada-exp.y" /* yacc.c:1646 */
2367  { (yyval.lval) = 1; }
2368 #line 2370 "ada-exp.c" /* yacc.c:1646 */
2369  break;
2370 
2371  case 112:
2372 #line 674 "ada-exp.y" /* yacc.c:1646 */
2373  { (yyval.lval) = 1; }
2374 #line 2376 "ada-exp.c" /* yacc.c:1646 */
2375  break;
2376 
2377  case 113:
2378 #line 676 "ada-exp.y" /* yacc.c:1646 */
2379  { write_exp_elt_opcode (pstate, OP_DISCRETE_RANGE);
2380  write_exp_op_with_string (pstate, OP_NAME,
2381  empty_stoken);
2382  }
2383 #line 2385 "ada-exp.c" /* yacc.c:1646 */
2384  break;
2385 
2386  case 114:
2387 #line 680 "ada-exp.y" /* yacc.c:1646 */
2388  { (yyval.lval) = 1; }
2389 #line 2391 "ada-exp.c" /* yacc.c:1646 */
2390  break;
2391 
2392  case 115:
2393 #line 682 "ada-exp.y" /* yacc.c:1646 */
2394  { write_name_assoc (pstate, (yyvsp[-1].sval)); }
2395 #line 2397 "ada-exp.c" /* yacc.c:1646 */
2396  break;
2397 
2398  case 116:
2399 #line 683 "ada-exp.y" /* yacc.c:1646 */
2400  { (yyval.lval) = (yyvsp[0].lval) + 1; }
2401 #line 2403 "ada-exp.c" /* yacc.c:1646 */
2402  break;
2403 
2404  case 117:
2405 #line 685 "ada-exp.y" /* yacc.c:1646 */
2406  { (yyval.lval) = (yyvsp[0].lval) + 1; }
2407 #line 2409 "ada-exp.c" /* yacc.c:1646 */
2408  break;
2409 
2410  case 118:
2411 #line 687 "ada-exp.y" /* yacc.c:1646 */
2412  { write_exp_elt_opcode (pstate, OP_DISCRETE_RANGE); }
2413 #line 2415 "ada-exp.c" /* yacc.c:1646 */
2414  break;
2415 
2416  case 119:
2417 #line 688 "ada-exp.y" /* yacc.c:1646 */
2418  { (yyval.lval) = (yyvsp[0].lval) + 1; }
2419 #line 2421 "ada-exp.c" /* yacc.c:1646 */
2420  break;
2421 
2422  case 120:
2423 #line 695 "ada-exp.y" /* yacc.c:1646 */
2424  { write_exp_elt_opcode (pstate, UNOP_IND); }
2425 #line 2427 "ada-exp.c" /* yacc.c:1646 */
2426  break;
2427 
2428  case 121:
2429 #line 697 "ada-exp.y" /* yacc.c:1646 */
2430  { write_exp_elt_opcode (pstate, UNOP_ADDR); }
2431 #line 2433 "ada-exp.c" /* yacc.c:1646 */
2432  break;
2433 
2434  case 122:
2435 #line 699 "ada-exp.y" /* yacc.c:1646 */
2436  { write_exp_elt_opcode (pstate, BINOP_SUBSCRIPT); }
2437 #line 2439 "ada-exp.c" /* yacc.c:1646 */
2438  break;
2439 
2440 
2441 #line 2443 "ada-exp.c" /* yacc.c:1646 */
2442  default: break;
2443  }
2444  /* User semantic actions sometimes alter yychar, and that requires
2445  that yytoken be updated with the new translation. We take the
2446  approach of translating immediately before every use of yytoken.
2447  One alternative is translating here after every semantic action,
2448  but that translation would be missed if the semantic action invokes
2449  YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2450  if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2451  incorrect destructor might then be invoked immediately. In the
2452  case of YYERROR or YYBACKUP, subsequent parser actions might lead
2453  to an incorrect destructor call or verbose syntax error message
2454  before the lookahead is translated. */
2455  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2456 
2457  YYPOPSTACK (yylen);
2458  yylen = 0;
2460 
2461  *++yyvsp = yyval;
2462 
2463  /* Now 'shift' the result of the reduction. Determine what state
2464  that goes to, based on the state we popped back to and the rule
2465  number reduced by. */
2466 
2467  yyn = yyr1[yyn];
2468 
2469  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2470  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2471  yystate = yytable[yystate];
2472  else
2473  yystate = yydefgoto[yyn - YYNTOKENS];
2474 
2475  goto yynewstate;
2476 
2477 
2478 /*--------------------------------------.
2479 | yyerrlab -- here on detecting error. |
2480 `--------------------------------------*/
2481 yyerrlab:
2482  /* Make sure we have latest lookahead translation. See comments at
2483  user semantic actions for why this is necessary. */
2484  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
2485 
2486  /* If not already recovering from an error, report this error. */
2487  if (!yyerrstatus)
2488  {
2489  ++yynerrs;
2490 #if ! YYERROR_VERBOSE
2491  yyerror (YY_("syntax error"));
2492 #else
2493 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2494  yyssp, yytoken)
2495  {
2496  char const *yymsgp = YY_("syntax error");
2497  int yysyntax_error_status;
2498  yysyntax_error_status = YYSYNTAX_ERROR;
2499  if (yysyntax_error_status == 0)
2500  yymsgp = yymsg;
2501  else if (yysyntax_error_status == 1)
2502  {
2503  if (yymsg != yymsgbuf)
2504  YYSTACK_FREE (yymsg);
2505  yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
2506  if (!yymsg)
2507  {
2508  yymsg = yymsgbuf;
2509  yymsg_alloc = sizeof yymsgbuf;
2510  yysyntax_error_status = 2;
2511  }
2512  else
2513  {
2514  yysyntax_error_status = YYSYNTAX_ERROR;
2515  yymsgp = yymsg;
2516  }
2517  }
2518  yyerror (yymsgp);
2519  if (yysyntax_error_status == 2)
2520  goto yyexhaustedlab;
2521  }
2522 # undef YYSYNTAX_ERROR
2523 #endif
2524  }
2525 
2526 
2527 
2528  if (yyerrstatus == 3)
2529  {
2530  /* If just tried and failed to reuse lookahead token after an
2531  error, discard it. */
2532 
2533  if (yychar <= YYEOF)
2534  {
2535  /* Return failure if at end of input. */
2536  if (yychar == YYEOF)
2537  YYABORT;
2538  }
2539  else
2540  {
2541  yydestruct ("Error: discarding",
2542  yytoken, &yylval);
2543  yychar = YYEMPTY;
2544  }
2545  }
2546 
2547  /* Else will try to reuse lookahead token after shifting the error
2548  token. */
2549  goto yyerrlab1;
2550 
2551 
2552 /*---------------------------------------------------.
2553 | yyerrorlab -- error raised explicitly by YYERROR. |
2554 `---------------------------------------------------*/
2555 yyerrorlab:
2556 
2557  /* Pacify compilers like GCC when the user code never invokes
2558  YYERROR and the label yyerrorlab therefore never appears in user
2559  code. */
2560  if (/*CONSTCOND*/ 0)
2561  goto yyerrorlab;
2562 
2563  /* Do not reclaim the symbols of the rule whose action triggered
2564  this YYERROR. */
2565  YYPOPSTACK (yylen);
2566  yylen = 0;
2568  yystate = *yyssp;
2569  goto yyerrlab1;
2570 
2571 
2572 /*-------------------------------------------------------------.
2573 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2574 `-------------------------------------------------------------*/
2575 yyerrlab1:
2576  yyerrstatus = 3; /* Each real token shifted decrements this. */
2577 
2578  for (;;)
2579  {
2580  yyn = yypact[yystate];
2581  if (!yypact_value_is_default (yyn))
2582  {
2583  yyn += YYTERROR;
2584  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2585  {
2586  yyn = yytable[yyn];
2587  if (0 < yyn)
2588  break;
2589  }
2590  }
2591 
2592  /* Pop the current state because it cannot handle the error token. */
2593  if (yyssp == yyss)
2594  YYABORT;
2595 
2596 
2597  yydestruct ("Error: popping",
2598  yystos[yystate], yyvsp);
2599  YYPOPSTACK (1);
2600  yystate = *yyssp;
2602  }
2603 
2605  *++yyvsp = yylval;
2607 
2608 
2609  /* Shift the error token. */
2610  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2611 
2612  yystate = yyn;
2613  goto yynewstate;
2614 
2615 
2616 /*-------------------------------------.
2617 | yyacceptlab -- YYACCEPT comes here. |
2618 `-------------------------------------*/
2619 yyacceptlab:
2620  yyresult = 0;
2621  goto yyreturn;
2622 
2623 /*-----------------------------------.
2624 | yyabortlab -- YYABORT comes here. |
2625 `-----------------------------------*/
2626 yyabortlab:
2627  yyresult = 1;
2628  goto yyreturn;
2629 
2630 #if !defined yyoverflow || YYERROR_VERBOSE
2631 /*-------------------------------------------------.
2632 | yyexhaustedlab -- memory exhaustion comes here. |
2633 `-------------------------------------------------*/
2634 yyexhaustedlab:
2635  yyerror (YY_("memory exhausted"));
2636  yyresult = 2;
2637  /* Fall through. */
2638 #endif
2639 
2640 yyreturn:
2641  if (yychar != YYEMPTY)
2642  {
2643  /* Make sure we have latest lookahead translation. See comments at
2644  user semantic actions for why this is necessary. */
2645  yytoken = YYTRANSLATE (yychar);
2646  yydestruct ("Cleanup: discarding lookahead",
2647  yytoken, &yylval);
2648  }
2649  /* Do not reclaim the symbols of the rule whose action triggered
2650  this YYABORT or YYACCEPT. */
2651  YYPOPSTACK (yylen);
2653  while (yyssp != yyss)
2654  {
2655  yydestruct ("Cleanup: popping",
2656  yystos[*yyssp], yyvsp);
2657  YYPOPSTACK (1);
2658  }
2659 #ifndef yyoverflow
2660  if (yyss != yyssa)
2661  YYSTACK_FREE (yyss);
2662 #endif
2663 #if YYERROR_VERBOSE
2664  if (yymsg != yymsgbuf)
2665  YYSTACK_FREE (yymsg);
2666 #endif
2667  return yyresult;
2668 }
2669 #line 702 "ada-exp.y" /* yacc.c:1906 */
2670 
2671 
2672 /* yylex defined in ada-lex.c: Reads one token, getting characters */
2673 /* through lexptr. */
2674 
2675 /* Remap normal flex interface names (yylex) as well as gratuitiously */
2676 /* global symbol names, so we can have multiple flex-generated parsers */
2677 /* in gdb. */
2678 
2679 /* (See note above on previous definitions for YACC.) */
2680 
2681 #define yy_create_buffer ada_yy_create_buffer
2682 #define yy_delete_buffer ada_yy_delete_buffer
2683 #define yy_init_buffer ada_yy_init_buffer
2684 #define yy_load_buffer_state ada_yy_load_buffer_state
2685 #define yy_switch_to_buffer ada_yy_switch_to_buffer
2686 #define yyrestart ada_yyrestart
2687 #define yytext ada_yytext
2688 #define yywrap ada_yywrap
2689 
2690 static struct obstack temp_parse_space;
2691 
2692 /* The following kludge was found necessary to prevent conflicts between */
2693 /* defs.h and non-standard stdlib.h files. */
2694 #define qsort __qsort__dummy
2695 #include "ada-lex.c"
2696 
2697 int
2698 ada_parse (struct parser_state *par_state)
2699 {
2700  /* Setting up the parser state. */
2701  scoped_restore pstate_restore = make_scoped_restore (&pstate);
2702  gdb_assert (par_state != NULL);
2703  pstate = par_state;
2704 
2705  lexer_init (yyin); /* (Re-)initialize lexer. */
2706  type_qualifier = NULL;
2707  obstack_free (&temp_parse_space, NULL);
2708  obstack_init (&temp_parse_space);
2709 
2710  return yyparse ();
2711 }
2712 
2713 void
2714 yyerror (const char *msg)
2715 {
2716  error (_("Error in expression, near `%s'."), lexptr);
2717 }
2718 
2719 /* Emit expression to access an instance of SYM, in block BLOCK (if
2720  non-NULL). */
2721 
2722 static void
2724  const struct block *block,
2725  struct symbol *sym)
2726 {
2727  if (symbol_read_needs_frame (sym))
2728  {
2729  if (innermost_block == 0
2732  }
2733 
2734  write_exp_elt_opcode (par_state, OP_VAR_VALUE);
2735  write_exp_elt_block (par_state, block);
2736  write_exp_elt_sym (par_state, sym);
2737  write_exp_elt_opcode (par_state, OP_VAR_VALUE);
2738 }
2739 
2740 /* Write integer or boolean constant ARG of type TYPE. */
2741 
2742 static void
2743 write_int (struct parser_state *par_state, LONGEST arg, struct type *type)
2744 {
2745  write_exp_elt_opcode (par_state, OP_LONG);
2746  write_exp_elt_type (par_state, type);
2747  write_exp_elt_longcst (par_state, arg);
2748  write_exp_elt_opcode (par_state, OP_LONG);
2749 }
2750 
2751 /* Write an OPCODE, string, OPCODE sequence to the current expression. */
2752 static void
2754  enum exp_opcode opcode, struct stoken token)
2755 {
2756  write_exp_elt_opcode (par_state, opcode);
2757  write_exp_string (par_state, token);
2758  write_exp_elt_opcode (par_state, opcode);
2759 }
2760 
2761 /* Emit expression corresponding to the renamed object named
2762  * designated by RENAMED_ENTITY[0 .. RENAMED_ENTITY_LEN-1] in the
2763  * context of ORIG_LEFT_CONTEXT, to which is applied the operations
2764  * encoded by RENAMING_EXPR. MAX_DEPTH is the maximum number of
2765  * cascaded renamings to allow. If ORIG_LEFT_CONTEXT is null, it
2766  * defaults to the currently selected block. ORIG_SYMBOL is the
2767  * symbol that originally encoded the renaming. It is needed only
2768  * because its prefix also qualifies any index variables used to index
2769  * or slice an array. It should not be necessary once we go to the
2770  * new encoding entirely (FIXME pnh 7/20/2007). */
2771 
2772 static void
2774  const struct block *orig_left_context,
2775  const char *renamed_entity, int renamed_entity_len,
2776  const char *renaming_expr, int max_depth)
2777 {
2778  char *name;
2779  enum { SIMPLE_INDEX, LOWER_BOUND, UPPER_BOUND } slice_state;
2780  struct block_symbol sym_info;
2781 
2782  if (max_depth <= 0)
2783  error (_("Could not find renamed symbol"));
2784 
2785  if (orig_left_context == NULL)
2786  orig_left_context = get_selected_block (NULL);
2787 
2788  name = (char *) obstack_copy0 (&temp_parse_space, renamed_entity,
2789  renamed_entity_len);
2790  ada_lookup_encoded_symbol (name, orig_left_context, VAR_DOMAIN, &sym_info);
2791  if (sym_info.symbol == NULL)
2792  error (_("Could not find renamed variable: %s"), ada_decode (name));
2793  else if (SYMBOL_CLASS (sym_info.symbol) == LOC_TYPEDEF)
2794  /* We have a renaming of an old-style renaming symbol. Don't
2795  trust the block information. */
2796  sym_info.block = orig_left_context;
2797 
2798  {
2799  const char *inner_renamed_entity;
2800  int inner_renamed_entity_len;
2801  const char *inner_renaming_expr;
2802 
2803  switch (ada_parse_renaming (sym_info.symbol, &inner_renamed_entity,
2804  &inner_renamed_entity_len,
2805  &inner_renaming_expr))
2806  {
2807  case ADA_NOT_RENAMING:
2808  write_var_from_sym (par_state, sym_info.block, sym_info.symbol);
2809  break;
2810  case ADA_OBJECT_RENAMING:
2811  write_object_renaming (par_state, sym_info.block,
2812  inner_renamed_entity, inner_renamed_entity_len,
2813  inner_renaming_expr, max_depth - 1);
2814  break;
2815  default:
2816  goto BadEncoding;
2817  }
2818  }
2819 
2820  slice_state = SIMPLE_INDEX;
2821  while (*renaming_expr == 'X')
2822  {
2823  renaming_expr += 1;
2824 
2825  switch (*renaming_expr) {
2826  case 'A':
2827  renaming_expr += 1;
2828  write_exp_elt_opcode (par_state, UNOP_IND);
2829  break;
2830  case 'L':
2831  slice_state = LOWER_BOUND;
2832  /* FALLTHROUGH */
2833  case 'S':
2834  renaming_expr += 1;
2835  if (isdigit (*renaming_expr))
2836  {
2837  char *next;
2838  long val = strtol (renaming_expr, &next, 10);
2839  if (next == renaming_expr)
2840  goto BadEncoding;
2841  renaming_expr = next;
2842  write_exp_elt_opcode (par_state, OP_LONG);
2843  write_exp_elt_type (par_state, type_int (par_state));
2844  write_exp_elt_longcst (par_state, (LONGEST) val);
2845  write_exp_elt_opcode (par_state, OP_LONG);
2846  }
2847  else
2848  {
2849  const char *end;
2850  char *index_name;
2851  struct block_symbol index_sym_info;
2852 
2853  end = strchr (renaming_expr, 'X');
2854  if (end == NULL)
2855  end = renaming_expr + strlen (renaming_expr);
2856 
2857  index_name
2858  = (char *) obstack_copy0 (&temp_parse_space, renaming_expr,
2859  end - renaming_expr);
2860  renaming_expr = end;
2861 
2862  ada_lookup_encoded_symbol (index_name, NULL, VAR_DOMAIN,
2863  &index_sym_info);
2864  if (index_sym_info.symbol == NULL)
2865  error (_("Could not find %s"), index_name);
2866  else if (SYMBOL_CLASS (index_sym_info.symbol) == LOC_TYPEDEF)
2867  /* Index is an old-style renaming symbol. */
2868  index_sym_info.block = orig_left_context;
2869  write_var_from_sym (par_state, index_sym_info.block,
2870  index_sym_info.symbol);
2871  }
2872  if (slice_state == SIMPLE_INDEX)
2873  {
2874  write_exp_elt_opcode (par_state, OP_FUNCALL);
2875  write_exp_elt_longcst (par_state, (LONGEST) 1);
2876  write_exp_elt_opcode (par_state, OP_FUNCALL);
2877  }
2878  else if (slice_state == LOWER_BOUND)
2879  slice_state = UPPER_BOUND;
2880  else if (slice_state == UPPER_BOUND)
2881  {
2882  write_exp_elt_opcode (par_state, TERNOP_SLICE);
2883  slice_state = SIMPLE_INDEX;
2884  }
2885  break;
2886 
2887  case 'R':
2888  {
2889  struct stoken field_name;
2890  const char *end;
2891  char *buf;
2892 
2893  renaming_expr += 1;
2894 
2895  if (slice_state != SIMPLE_INDEX)
2896  goto BadEncoding;
2897  end = strchr (renaming_expr, 'X');
2898  if (end == NULL)
2899  end = renaming_expr + strlen (renaming_expr);
2900  field_name.length = end - renaming_expr;
2901  buf = (char *) xmalloc (end - renaming_expr + 1);
2902  field_name.ptr = buf;
2903  strncpy (buf, renaming_expr, end - renaming_expr);
2904  buf[end - renaming_expr] = '\000';
2905  renaming_expr = end;
2906  write_exp_op_with_string (par_state, STRUCTOP_STRUCT, field_name);
2907  break;
2908  }
2909 
2910  default:
2911  goto BadEncoding;
2912  }
2913  }
2914  if (slice_state == SIMPLE_INDEX)
2915  return;
2916 
2917  BadEncoding:
2918  error (_("Internal error in encoding of renaming declaration"));
2919 }
2920 
2921 static const struct block*
2922 block_lookup (const struct block *context, const char *raw_name)
2923 {
2924  const char *name;
2925  struct block_symbol *syms;
2926  int nsyms;
2927  struct symtab *symtab;
2928  struct cleanup *old_chain;
2929  const struct block *result = NULL;
2930 
2931  if (raw_name[0] == '\'')
2932  {
2933  raw_name += 1;
2934  name = raw_name;
2935  }
2936  else
2937  name = ada_encode (raw_name);
2938 
2939  nsyms = ada_lookup_symbol_list (name, context, VAR_DOMAIN, &syms);
2940  old_chain = make_cleanup (xfree, syms);
2941 
2942  if (context == NULL
2943  && (nsyms == 0 || SYMBOL_CLASS (syms[0].symbol) != LOC_BLOCK))
2945  else
2946  symtab = NULL;
2947 
2948  if (symtab != NULL)
2950  else if (nsyms == 0 || SYMBOL_CLASS (syms[0].symbol) != LOC_BLOCK)
2951  {
2952  if (context == NULL)
2953  error (_("No file or function \"%s\"."), raw_name);
2954  else
2955  error (_("No function \"%s\" in specified context."), raw_name);
2956  }
2957  else
2958  {
2959  if (nsyms > 1)
2960  warning (_("Function name \"%s\" ambiguous here"), raw_name);
2961  result = SYMBOL_BLOCK_VALUE (syms[0].symbol);
2962  }
2963 
2964  do_cleanups (old_chain);
2965  return result;
2966 }
2967 
2968 static struct symbol*
2969 select_possible_type_sym (struct block_symbol *syms, int nsyms)
2970 {
2971  int i;
2972  int preferred_index;
2973  struct type *preferred_type;
2974 
2975  preferred_index = -1; preferred_type = NULL;
2976  for (i = 0; i < nsyms; i += 1)
2977  switch (SYMBOL_CLASS (syms[i].symbol))
2978  {
2979  case LOC_TYPEDEF:
2980  if (ada_prefer_type (SYMBOL_TYPE (syms[i].symbol), preferred_type))
2981  {
2982  preferred_index = i;
2983  preferred_type = SYMBOL_TYPE (syms[i].symbol);
2984  }
2985  break;
2986  case LOC_REGISTER:
2987  case LOC_ARG:
2988  case LOC_REF_ARG:
2989  case LOC_REGPARM_ADDR:
2990  case LOC_LOCAL:
2991  case LOC_COMPUTED:
2992  return NULL;
2993  default:
2994  break;
2995  }
2996  if (preferred_type == NULL)
2997  return NULL;
2998  return syms[preferred_index].symbol;
2999 }
3000 
3001 static struct type*
3002 find_primitive_type (struct parser_state *par_state, char *name)
3003 {
3004  struct type *type;
3006  parse_gdbarch (par_state),
3007  name);
3008  if (type == NULL && strcmp ("system__address", name) == 0)
3009  type = type_system_address (par_state);
3010 
3011  if (type != NULL)
3012  {
3013  /* Check to see if we have a regular definition of this
3014  type that just didn't happen to have been read yet. */
3015  struct symbol *sym;
3016  char *expanded_name =
3017  (char *) alloca (strlen (name) + sizeof ("standard__"));
3018  strcpy (expanded_name, "standard__");
3019  strcat (expanded_name, name);
3020  sym = ada_lookup_symbol (expanded_name, NULL, VAR_DOMAIN, NULL).symbol;
3021  if (sym != NULL && SYMBOL_CLASS (sym) == LOC_TYPEDEF)
3022  type = SYMBOL_TYPE (sym);
3023  }
3024 
3025  return type;
3026 }
3027 
3028 static int
3029 chop_selector (char *name, int end)
3030 {
3031  int i;
3032  for (i = end - 1; i > 0; i -= 1)
3033  if (name[i] == '.' || (name[i] == '_' && name[i+1] == '_'))
3034  return i;
3035  return -1;
3036 }
3037 
3038 /* If NAME is a string beginning with a separator (either '__', or
3039  '.'), chop this separator and return the result; else, return
3040  NAME. */
3041 
3042 static char *
3044 {
3045  if (*name == '.')
3046  return name + 1;
3047 
3048  if (name[0] == '_' && name[1] == '_')
3049  return name + 2;
3050 
3051  return name;
3052 }
3053 
3054 /* Given that SELS is a string of the form (<sep><identifier>)*, where
3055  <sep> is '__' or '.', write the indicated sequence of
3056  STRUCTOP_STRUCT expression operators. */
3057 static void
3058 write_selectors (struct parser_state *par_state, char *sels)
3059 {
3060  while (*sels != '\0')
3061  {
3062  struct stoken field_name;
3063  char *p = chop_separator (sels);
3064  sels = p;
3065  while (*sels != '\0' && *sels != '.'
3066  && (sels[0] != '_' || sels[1] != '_'))
3067  sels += 1;
3068  field_name.length = sels - p;
3069  field_name.ptr = p;
3070  write_exp_op_with_string (par_state, STRUCTOP_STRUCT, field_name);
3071  }
3072 }
3073 
3074 /* Write a variable access (OP_VAR_VALUE) to ambiguous encoded name
3075  NAME[0..LEN-1], in block context BLOCK, to be resolved later. Writes
3076  a temporary symbol that is valid until the next call to ada_parse.
3077  */
3078 static void
3080  const struct block *block, char *name, int len)
3081 {
3082  struct symbol *sym = XOBNEW (&temp_parse_space, struct symbol);
3083 
3084  memset (sym, 0, sizeof (struct symbol));
3085  SYMBOL_DOMAIN (sym) = UNDEF_DOMAIN;
3086  SYMBOL_LINKAGE_NAME (sym)
3087  = (const char *) obstack_copy0 (&temp_parse_space, name, len);
3088  SYMBOL_LANGUAGE (sym) = language_ada;
3089 
3090  write_exp_elt_opcode (par_state, OP_VAR_VALUE);
3091  write_exp_elt_block (par_state, block);
3092  write_exp_elt_sym (par_state, sym);
3093  write_exp_elt_opcode (par_state, OP_VAR_VALUE);
3094 }
3095 
3096 /* A convenient wrapper around ada_get_field_index that takes
3097  a non NUL-terminated FIELD_NAME0 and a FIELD_NAME_LEN instead
3098  of a NUL-terminated field name. */
3099 
3100 static int
3101 ada_nget_field_index (const struct type *type, const char *field_name0,
3102  int field_name_len, int maybe_missing)
3103 {
3104  char *field_name = (char *) alloca ((field_name_len + 1) * sizeof (char));
3105 
3106  strncpy (field_name, field_name0, field_name_len);
3107  field_name[field_name_len] = '\0';
3108  return ada_get_field_index (type, field_name, maybe_missing);
3109 }
3110 
3111 /* If encoded_field_name is the name of a field inside symbol SYM,
3112  then return the type of that field. Otherwise, return NULL.
3113 
3114  This function is actually recursive, so if ENCODED_FIELD_NAME
3115  doesn't match one of the fields of our symbol, then try to see
3116  if ENCODED_FIELD_NAME could not be a succession of field names
3117  (in other words, the user entered an expression of the form
3118  TYPE_NAME.FIELD1.FIELD2.FIELD3), in which case we evaluate
3119  each field name sequentially to obtain the desired field type.
3120  In case of failure, we return NULL. */
3121 
3122 static struct type *
3123 get_symbol_field_type (struct symbol *sym, char *encoded_field_name)
3124 {
3125  char *field_name = encoded_field_name;
3126  char *subfield_name;
3127  struct type *type = SYMBOL_TYPE (sym);
3128  int fieldno;
3129 
3130  if (type == NULL || field_name == NULL)
3131  return NULL;
3132  type = check_typedef (type);
3133 
3134  while (field_name[0] != '\0')
3135  {
3137 
3138  fieldno = ada_get_field_index (type, field_name, 1);
3139  if (fieldno >= 0)
3140  return TYPE_FIELD_TYPE (type, fieldno);
3141 
3142  subfield_name = field_name;
3143  while (*subfield_name != '\0' && *subfield_name != '.'
3144  && (subfield_name[0] != '_' || subfield_name[1] != '_'))
3145  subfield_name += 1;
3146 
3147  if (subfield_name[0] == '\0')
3148  return NULL;
3149 
3150  fieldno = ada_nget_field_index (type, field_name,
3151  subfield_name - field_name, 1);
3152  if (fieldno < 0)
3153  return NULL;
3154 
3155  type = TYPE_FIELD_TYPE (type, fieldno);
3156  field_name = subfield_name;
3157  }
3158 
3159  return NULL;
3160 }
3161 
3162 /* Look up NAME0 (an unencoded identifier or dotted name) in BLOCK (or
3163  expression_block_context if NULL). If it denotes a type, return
3164  that type. Otherwise, write expression code to evaluate it as an
3165  object and return NULL. In this second case, NAME0 will, in general,
3166  have the form <name>(.<selector_name>)*, where <name> is an object
3167  or renaming encoded in the debugging data. Calls error if no
3168  prefix <name> matches a name in the debugging data (i.e., matches
3169  either a complete name or, as a wild-card match, the final
3170  identifier). */
3171 
3172 static struct type*
3173 write_var_or_type (struct parser_state *par_state,
3174  const struct block *block, struct stoken name0)
3175 {
3176  int depth;
3177  char *encoded_name;
3178  int name_len;
3179  struct cleanup *old_chain = make_cleanup (null_cleanup, NULL);
3180 
3181  if (block == NULL)
3183 
3184  encoded_name = ada_encode (name0.ptr);
3185  name_len = strlen (encoded_name);
3186  encoded_name
3187  = (char *) obstack_copy0 (&temp_parse_space, encoded_name, name_len);
3188  for (depth = 0; depth < MAX_RENAMING_CHAIN_LENGTH; depth += 1)
3189  {
3190  int tail_index;
3191 
3192  tail_index = name_len;
3193  while (tail_index > 0)
3194  {
3195  int nsyms;
3196  struct block_symbol *syms;
3197  struct symbol *type_sym;
3198  struct symbol *renaming_sym;
3199  const char* renaming;
3200  int renaming_len;
3201  const char* renaming_expr;
3202  int terminator = encoded_name[tail_index];
3203 
3204  encoded_name[tail_index] = '\0';
3205  nsyms = ada_lookup_symbol_list (encoded_name, block,
3206  VAR_DOMAIN, &syms);
3207  make_cleanup (xfree, syms);
3208  encoded_name[tail_index] = terminator;
3209 
3210  /* A single symbol may rename a package or object. */
3211 
3212  /* This should go away when we move entirely to new version.
3213  FIXME pnh 7/20/2007. */
3214  if (nsyms == 1)
3215  {
3216  struct symbol *ren_sym =
3217  ada_find_renaming_symbol (syms[0].symbol, syms[0].block);
3218 
3219  if (ren_sym != NULL)
3220  syms[0].symbol = ren_sym;
3221  }
3222 
3223  type_sym = select_possible_type_sym (syms, nsyms);
3224 
3225  if (type_sym != NULL)
3226  renaming_sym = type_sym;
3227  else if (nsyms == 1)
3228  renaming_sym = syms[0].symbol;
3229  else
3230  renaming_sym = NULL;
3231 
3232  switch (ada_parse_renaming (renaming_sym, &renaming,
3233  &renaming_len, &renaming_expr))
3234  {
3235  case ADA_NOT_RENAMING:
3236  break;
3237  case ADA_PACKAGE_RENAMING:
3240  {
3241  int alloc_len = renaming_len + name_len - tail_index + 1;
3242  char *new_name
3243  = (char *) obstack_alloc (&temp_parse_space, alloc_len);
3244  strncpy (new_name, renaming, renaming_len);
3245  strcpy (new_name + renaming_len, encoded_name + tail_index);
3246  encoded_name = new_name;
3247  name_len = renaming_len + name_len - tail_index;
3248  goto TryAfterRenaming;
3249  }
3250  case ADA_OBJECT_RENAMING:
3251  write_object_renaming (par_state, block, renaming, renaming_len,
3252  renaming_expr, MAX_RENAMING_CHAIN_LENGTH);
3253  write_selectors (par_state, encoded_name + tail_index);
3254  do_cleanups (old_chain);
3255  return NULL;
3256  default:
3257  internal_error (__FILE__, __LINE__,
3258  _("impossible value from ada_parse_renaming"));
3259  }
3260 
3261  if (type_sym != NULL)
3262  {
3263  struct type *field_type;
3264 
3265  if (tail_index == name_len)
3266  {
3267  do_cleanups (old_chain);
3268  return SYMBOL_TYPE (type_sym);
3269  }
3270 
3271  /* We have some extraneous characters after the type name.
3272  If this is an expression "TYPE_NAME.FIELD0.[...].FIELDN",
3273  then try to get the type of FIELDN. */
3274  field_type
3275  = get_symbol_field_type (type_sym, encoded_name + tail_index);
3276  if (field_type != NULL)
3277  {
3278  do_cleanups (old_chain);
3279  return field_type;
3280  }
3281  else
3282  error (_("Invalid attempt to select from type: \"%s\"."),
3283  name0.ptr);
3284  }
3285  else if (tail_index == name_len && nsyms == 0)
3286  {
3287  struct type *type = find_primitive_type (par_state,
3288  encoded_name);
3289 
3290  if (type != NULL)
3291  {
3292  do_cleanups (old_chain);
3293  return type;
3294  }
3295  }
3296 
3297  if (nsyms == 1)
3298  {
3299  write_var_from_sym (par_state, syms[0].block, syms[0].symbol);
3300  write_selectors (par_state, encoded_name + tail_index);
3301  do_cleanups (old_chain);
3302  return NULL;
3303  }
3304  else if (nsyms == 0)
3305  {
3306  struct bound_minimal_symbol msym
3307  = ada_lookup_simple_minsym (encoded_name);
3308  if (msym.minsym != NULL)
3309  {
3310  write_exp_msymbol (par_state, msym);
3311  /* Maybe cause error here rather than later? FIXME? */
3312  write_selectors (par_state, encoded_name + tail_index);
3313  do_cleanups (old_chain);
3314  return NULL;
3315  }
3316 
3317  if (tail_index == name_len
3318  && strncmp (encoded_name, "standard__",
3319  sizeof ("standard__") - 1) == 0)
3320  error (_("No definition of \"%s\" found."), name0.ptr);
3321 
3322  tail_index = chop_selector (encoded_name, tail_index);
3323  }
3324  else
3325  {
3326  write_ambiguous_var (par_state, block, encoded_name,
3327  tail_index);
3328  write_selectors (par_state, encoded_name + tail_index);
3329  do_cleanups (old_chain);
3330  return NULL;
3331  }
3332  }
3333 
3334  if (!have_full_symbols () && !have_partial_symbols () && block == NULL)
3335  error (_("No symbol table is loaded. Use the \"file\" command."));
3337  error (_("No definition of \"%s\" in current context."), name0.ptr);
3338  else
3339  error (_("No definition of \"%s\" in specified context."), name0.ptr);
3340 
3341  TryAfterRenaming: ;
3342  }
3343 
3344  error (_("Could not find renamed symbol \"%s\""), name0.ptr);
3345 
3346 }
3347 
3348 /* Write a left side of a component association (e.g., NAME in NAME =>
3349  exp). If NAME has the form of a selected component, write it as an
3350  ordinary expression. If it is a simple variable that unambiguously
3351  corresponds to exactly one symbol that does not denote a type or an
3352  object renaming, also write it normally as an OP_VAR_VALUE.
3353  Otherwise, write it as an OP_NAME.
3354 
3355  Unfortunately, we don't know at this point whether NAME is supposed
3356  to denote a record component name or the value of an array index.
3357  Therefore, it is not appropriate to disambiguate an ambiguous name
3358  as we normally would, nor to replace a renaming with its referent.
3359  As a result, in the (one hopes) rare case that one writes an
3360  aggregate such as (R => 42) where R renames an object or is an
3361  ambiguous name, one must write instead ((R) => 42). */
3362 
3363 static void
3364 write_name_assoc (struct parser_state *par_state, struct stoken name)
3365 {
3366  if (strchr (name.ptr, '.') == NULL)
3367  {
3368  struct block_symbol *syms;
3370  VAR_DOMAIN, &syms);
3371  struct cleanup *old_chain = make_cleanup (xfree, syms);
3372 
3373  if (nsyms != 1 || SYMBOL_CLASS (syms[0].symbol) == LOC_TYPEDEF)
3374  write_exp_op_with_string (par_state, OP_NAME, name);
3375  else
3376  write_var_from_sym (par_state, syms[0].block, syms[0].symbol);
3377 
3378  do_cleanups (old_chain);
3379  }
3380  else
3381  if (write_var_or_type (par_state, NULL, name) != NULL)
3382  error (_("Invalid use of type."));
3383 }
3384 
3385 /* Convert the character literal whose ASCII value would be VAL to the
3386  appropriate value of type TYPE, if there is a translation.
3387  Otherwise return VAL. Hence, in an enumeration type ('A', 'B'),
3388  the literal 'A' (VAL == 65), returns 0. */
3389 
3390 static LONGEST
3392 {
3393  char name[7];
3394  int f;
3395 
3396  if (type == NULL)
3397  return val;
3398  type = check_typedef (type);
3399  if (TYPE_CODE (type) != TYPE_CODE_ENUM)
3400  return val;
3401 
3402  xsnprintf (name, sizeof (name), "QU%02x", (int) val);
3403  for (f = 0; f < TYPE_NFIELDS (type); f += 1)
3404  {
3405  if (strcmp (name, TYPE_FIELD_NAME (type, f)) == 0)
3406  return TYPE_FIELD_ENUMVAL (type, f);
3407  }
3408  return val;
3409 }
3410 
3411 static struct type *
3412 type_int (struct parser_state *par_state)
3413 {
3414  return parse_type (par_state)->builtin_int;
3415 }
3416 
3417 static struct type *
3418 type_long (struct parser_state *par_state)
3419 {
3420  return parse_type (par_state)->builtin_long;
3421 }
3422 
3423 static struct type *
3424 type_long_long (struct parser_state *par_state)
3425 {
3426  return parse_type (par_state)->builtin_long_long;
3427 }
3428 
3429 static struct type *
3430 type_long_double (struct parser_state *par_state)
3431 {
3432  return parse_type (par_state)->builtin_long_double;
3433 }
3434 
3435 static struct type *
3436 type_char (struct parser_state *par_state)
3437 {
3438  return language_string_char_type (parse_language (par_state),
3439  parse_gdbarch (par_state));
3440 }
3441 
3442 static struct type *
3443 type_boolean (struct parser_state *par_state)
3444 {
3445  return parse_type (par_state)->builtin_bool;
3446 }
3447 
3448 static struct type *
3450 {
3451  struct type *type
3453  parse_gdbarch (par_state),
3454  "system__address");
3455  return type != NULL ? type : parse_type (par_state)->builtin_data_ptr;
3456 }
3457 
3458 void
3460 {
3461  obstack_init (&temp_parse_space);
3462 }
void yyerror(const char *)
Definition: ada-exp.c:2714
#define YY_SYMBOL_PRINT(Title, Type, Value, Location)
Definition: ada-exp.c:1043
static const yytype_uint16 yyrline[]
Definition: ada-exp.c:614
YYSTYPE yylval
Definition: ada-exp.c:1416
struct internalvar * ivar
Definition: ada-exp.c:295
static char * chop_separator(char *name)
Definition: ada-exp.c:3043
static const yytype_int16 yypgoto[]
Definition: ada-exp.c:743
static void write_int(struct parser_state *, LONGEST, struct type *)
Definition: ada-exp.c:2743
#define YYEMPTY
Definition: ada-exp.c:990
#define YYFPRINTF
Definition: yy-remap.h:92
#define yylen
static struct type * write_var_or_type(struct parser_state *, const struct block *, struct stoken)
Definition: ada-exp.c:3173
static const yytype_int16 yypact[]
Definition: ada-exp.c:683
int ada_get_field_index(const struct type *type, const char *field_name, int maybe_missing)
Definition: ada-lang.c:619
struct symbol * sym
Definition: ada-exp.c:89
#define yypact_value_is_default(Yystate)
Definition: ada-exp.c:673
void write_exp_elt_sym(struct parser_state *ps, struct symbol *expelt)
Definition: parse.c:215
#define parse_language(ps)
Definition: parser-defs.h:36
signed char yytype_int8
Definition: ada-exp.c:330
#define parse_gdbarch(ps)
Definition: parser-defs.h:35
#define TRUEKEYWORD
Definition: ada-exp.c:233
#define TYPE_FIELD_NAME(thistype, n)
Definition: gdbtypes.h:1372
#define UNARY
Definition: ada-exp.c:252
#define YYSTACK_ALLOC
Definition: ada-exp.c:464
#define yyvs
#define yylloc
#define MAX_RENAMING_CHAIN_LENGTH
Definition: ada-lang.h:65
char * ada_encode(const char *decoded)
Definition: ada-lang.c:1041
const char * ptr
Definition: parser-defs.h:91
void xfree(void *)
#define yyssp
static void write_name_assoc(struct parser_state *, struct stoken)
Definition: ada-exp.c:3364
void warning(const char *fmt,...)
Definition: errors.c:26
#define YYDPRINTF(Args)
Definition: ada-exp.c:1031
static const yytype_int16 yydefgoto[]
Definition: ada-exp.c:752
#define YYSIZE_T
Definition: ada-exp.c:352
#define yyvsp
struct type * language_string_char_type(const struct language_defn *la, struct gdbarch *gdbarch)
Definition: language.c:972
#define YYSTACK_FREE
Definition: ada-exp.c:465
#define YYUSE(E)
Definition: ada-exp.c:401
struct symtab * lookup_symtab(const char *name)
Definition: symtab.c:502
#define FALSEKEYWORD
Definition: ada-exp.c:234
#define SYMBOL_CLASS(symbol)
Definition: symtab.h:1155
void * memset(T *s, int c, size_t n)=delete
void internal_error(const char *file, int line, const char *fmt,...)
Definition: errors.c:50
#define TICK_MAX
Definition: ada-exp.c:265
const char * ada_decode(const char *encoded)
Definition: ada-lang.c:1166
const struct block * innermost_block
Definition: parse.c:71
int have_partial_symbols(void)
Definition: objfiles.c:1023
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:3101
#define YYTRANSLATE(YYX)
Definition: ada-exp.c:572
Definition: c-exp.c:4864
#define BLOCKVECTOR_BLOCK(blocklist, n)
Definition: block.h:125
static void yydestruct(const char *yymsg, int yytype, YYSTYPE *yyvaluep)
Definition: ada-exp.c:1397
#define NOTEQUAL
Definition: ada-exp.c:247
#define _(String)
Definition: gdb_locale.h:35
static const char *const yytname[]
Definition: ada-exp.c:635
static const yytype_int16 yycheck[]
Definition: ada-exp.c:842
#define YYPRINT(FILE, TYPE, VALUE)
Definition: c-exp.c:328
#define TYPE_FIELD_ENUMVAL(thistype, n)
Definition: gdbtypes.h:1375
#define TYPE_FIELD_TYPE(thistype, n)
Definition: gdbtypes.h:1371
static void write_exp_op_with_string(struct parser_state *, enum exp_opcode, struct stoken)
Definition: ada-exp.c:2753
#define IN
Definition: ada-exp.c:250
#define parse_type(ps)
Definition: ada-exp.c:81
#define YYABORT
Definition: ada-exp.c:994
#define YYINITDEPTH
Definition: ada-exp.c:1155
static struct type * get_symbol_field_type(struct symbol *sym, char *encoded_field_name)
Definition: ada-exp.c:3123
int ada_lookup_symbol_list(const char *name, const struct block *block, domain_enum domain, struct block_symbol **results)
Definition: ada-lang.c:5869
scoped_restore_tmpl< T > make_scoped_restore(T *var)
#define YYSTACK_ALLOC_MAXIMUM
Definition: ada-exp.c:467
void null_cleanup(void *arg)
Definition: cleanups.c:294
#define NULL_PTR
Definition: ada-exp.c:230
const char *const name
Definition: aarch64-tdep.c:76
void write_exp_elt_block(struct parser_state *ps, const struct block *b)
Definition: parse.c:235
#define SYMTAB_BLOCKVECTOR(symtab)
Definition: symtab.h:1334
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
Definition: ada-exp.c:419
void write_exp_elt_longcst(struct parser_state *ps, LONGEST expelt)
Definition: parse.c:255
#define TICK_ADDRESS
Definition: ada-exp.c:261
#define STARSTAR
Definition: ada-exp.c:255
#define TICK_LENGTH
Definition: ada-exp.c:264
struct type * check_typedef(struct type *type)
Definition: gdbtypes.c:2421
#define YYMAXDEPTH
Definition: ada-exp.c:1166
#define FLOAT
Definition: ada-exp.c:232
int contained_in(const struct block *a, const struct block *b)
Definition: block.c:73
static struct type * find_primitive_type(struct parser_state *par_state, char *name)
Definition: ada-exp.c:3002
static const yytype_uint8 yyr1[]
Definition: ada-exp.c:952
static void yy_symbol_value_print(FILE *yyoutput, int yytype, YYSTYPE const *const yyvaluep)
Definition: ada-exp.c:1060
#define TICK_POS
Definition: ada-exp.c:268
static struct parser_state * pstate
Definition: ada-exp.c:98
#define SYMBOL_DOMAIN(symbol)
Definition: symtab.h:1152
int ada_prefer_type(struct type *type0, struct type *type1)
Definition: ada-lang.c:8118
static void yy_symbol_print(FILE *yyoutput, int yytype, YYSTYPE const *const yyvaluep)
Definition: ada-exp.c:1079
#define yyss
#define YYFINAL
Definition: ada-exp.c:554
const struct block * block
Definition: symtab.h:1140
struct YYSTYPE::@2 typed_val_float
struct YYSTYPE::@1 typed_val
#define TICK_RANGE
Definition: ada-exp.c:269
int symbol_read_needs_frame(struct symbol *sym)
Definition: findvar.c:392
#define SPECIAL_VARIABLE
Definition: ada-exp.c:240
static const yytype_uint8 yystos[]
Definition: ada-exp.c:923
int yychar
Definition: ada-exp.c:1413
#define OTHERS
Definition: ada-exp.c:274
struct cleanup * make_cleanup(make_cleanup_ftype *function, void *arg)
Definition: cleanups.c:116
yytype_int16 yyss_alloc
Definition: ada-exp.c:500
#define YYNTOKENS
Definition: ada-exp.c:559
#define YYSTACK_BYTES(N)
Definition: ada-exp.c:509
#define YY_STACK_PRINT(Bottom, Top)
Definition: ada-exp.c:1105
Definition: gdbtypes.h:749
static const yytype_uint8 yydefact[]
Definition: ada-exp.c:714
static struct obstack temp_parse_space
Definition: ada-exp.c:2690
#define NEW
Definition: ada-exp.c:273
yytokentype
Definition: ada-exp.c:178
static const yytype_uint16 yytoknum[]
Definition: c-exp.c:699
FILE * yyin
Definition: ada-lex.c:335
void write_dollar_variable(struct parser_state *ps, struct stoken str)
Definition: parse.c:594
const struct block * block
Definition: ada-exp.c:91
static const char * type
Definition: language.c:113
#define DOT_ALL
Definition: ada-exp.c:239
#define SYMBOL_LINKAGE_NAME(symbol)
Definition: symtab.h:523
YYSTYPE yyvs_alloc
Definition: ada-exp.c:501
#define yyrule
static struct type * type_boolean(struct parser_state *)
Definition: ada-exp.c:3443
static struct symbol * select_possible_type_sym(struct block_symbol *syms, int nsyms)
Definition: ada-exp.c:2969
unsigned short int yytype_uint16
Definition: ada-exp.c:336
#define YYEOF
Definition: ada-exp.c:991
#define OR
Definition: ada-exp.c:243
LONGEST lval
Definition: ada-exp.c:283
#define TICK_SIZE
Definition: ada-exp.c:270
const struct block * bval
Definition: ada-exp.c:294
#define VAR
Definition: ada-exp.c:258
#define CHARLIT
Definition: ada-exp.c:231
void * xmalloc(YYSIZE_T)
void write_exp_msymbol(struct parser_state *ps, struct bound_minimal_symbol bound_msym)
Definition: parse.c:531
enum ada_renaming_category ada_parse_renaming(struct symbol *sym, const char **renamed_entity, int *len, const char **renaming_expr)
Definition: ada-lang.c:4332
struct symbol * symbol
Definition: symtab.h:1136
#define YY_REDUCE_PRINT(Rule)
Definition: ada-exp.c:1136
#define gdb_assert(expr)
Definition: gdb_assert.h:32
Definition: block.h:60
#define REM
Definition: ada-exp.c:254
LONGEST val
Definition: ada-exp.c:285
static struct type * type_long_double(struct parser_state *)
Definition: ada-exp.c:3430
void write_exp_elt_opcode(struct parser_state *ps, enum exp_opcode expelt)
Definition: parse.c:205
static void write_ambiguous_var(struct parser_state *, const struct block *, char *, int)
Definition: ada-exp.c:3079
static const char * lexptr
bfd_byte gdb_byte
Definition: common-types.h:38
int yydebug
Definition: ada-exp.c:1144
static const yytype_uint8 yytranslate[]
Definition: ada-exp.c:577
#define COLONCOLON
Definition: ada-exp.c:235
#define XOR
Definition: ada-exp.c:244
#define ARROW
Definition: ada-exp.c:259
unsigned char yytype_uint8
Definition: ada-exp.c:324
#define ASSIGN
Definition: ada-exp.c:241
void _initialize_ada_exp(void)
Definition: ada-exp.c:3459
#define TICK_TAG
Definition: ada-exp.c:271
#define yys
static int chop_selector(char *name, int end)
Definition: ada-exp.c:3029
int xsnprintf(char *str, size_t size, const char *format,...)
Definition: common-utils.c:134
#define SYMBOL_BLOCK_VALUE(symbol)
Definition: symtab.h:467
static const yytype_int16 yytable[]
Definition: ada-exp.c:763
#define TYPE_CODE(thistype)
Definition: gdbtypes.h:1238
static struct stoken empty_stoken
Definition: ada-exp.c:100
#define NAME
Definition: ada-exp.c:237
struct minimal_symbol * minsym
Definition: minsyms.h:34
int ada_parse(struct parser_state *par_state)
Definition: ada-exp.c:2698
#define YY_(Msgid)
Definition: ada-exp.c:368
#define THEN
Definition: ada-exp.c:245
#define TICK_VAL
Definition: ada-exp.c:272
#define ABS
Definition: ada-exp.c:256
struct type * tval
Definition: ada-exp.c:292
#define INT
Definition: ada-exp.c:229
#define TYPE_NFIELDS(thistype)
Definition: gdbtypes.h:1239
static struct type * type_int(struct parser_state *)
Definition: ada-exp.c:3412
#define SYMBOL_LANGUAGE(symbol)
Definition: symtab.h:469
#define yystate
exp_opcode
Definition: expression.h:42
struct minimal_symbol * msym
Definition: ada-exp.c:90
#define TICK_LAST
Definition: ada-exp.c:263
#define TICK_ACCESS
Definition: ada-exp.c:260
struct block_symbol ada_lookup_symbol(const char *name, const struct block *block0, domain_enum domain, int *is_a_field_of_this)
Definition: ada-lang.c:5933
static struct type * type_long(struct parser_state *)
Definition: ada-exp.c:3418
int have_full_symbols(void)
Definition: objfiles.c:1040
static struct type * type_qualifier
Definition: ada-exp.c:104
struct bound_minimal_symbol ada_lookup_simple_minsym(const char *name)
Definition: ada-lang.c:4945
#define YYACCEPT
Definition: ada-exp.c:993
#define YYPOPSTACK(N)
const struct block * get_selected_block(CORE_ADDR *addr_in_block)
Definition: stack.c:2216
static struct type * type_system_address(struct parser_state *)
Definition: ada-exp.c:3449
const struct block * expression_context_block
Definition: parse.c:69
struct type * type
Definition: ada-exp.c:286
#define LEQ
Definition: ada-exp.c:248
#define ELSE
Definition: ada-exp.c:246
int yynerrs
Definition: ada-exp.c:1418
static PyObject * field_name(struct type *type, int field)
Definition: py-type.c:267
static const yytype_uint8 yyr2[]
Definition: ada-exp.c:970
#define DOTDOT
Definition: ada-exp.c:251
#define NOT
Definition: ada-exp.c:257
#define SYMBOL_TYPE(symbol)
Definition: symtab.h:1161
#define yyval
#define TICK_MODULUS
Definition: ada-exp.c:267
struct symbol * ada_find_renaming_symbol(struct symbol *name_sym, const struct block *block)
Definition: ada-lang.c:8037
#define YY_NULLPTRPTR
Definition: ada-exp.c:154
#define STRING
Definition: ada-exp.c:236
static struct type * type_char(struct parser_state *)
Definition: ada-exp.c:3436
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
Definition: ada-exp.c:520
static const struct block * block_lookup(const struct block *, const char *)
Definition: ada-exp.c:2922
void ada_lookup_encoded_symbol(const char *name, const struct block *block, domain_enum domain, struct block_symbol *info)
Definition: ada-lang.c:5910
short int yytype_int16
Definition: ada-exp.c:342
struct type * language_lookup_primitive_type(const struct language_defn *la, struct gdbarch *gdbarch, const char *name)
Definition: language.c:1025
#define TICK_MIN
Definition: ada-exp.c:266
#define DOT_ID
Definition: ada-exp.c:238
struct stoken sval
Definition: ada-exp.c:293
static LONGEST convert_char_literal(struct type *, LONGEST)
Definition: ada-exp.c:3391
#define GEQ
Definition: ada-exp.c:249
void write_exp_elt_floatcst(struct parser_state *ps, const gdb_byte expelt[16])
Definition: parse.c:265
static void write_selectors(struct parser_state *par_state, char *sels)
Definition: ada-exp.c:3058
int yyparse(void)
Definition: ada-exp.c:1426
#define YYTERROR
Definition: ada-exp.c:1018
void write_exp_string(struct parser_state *ps, struct stoken str)
Definition: parse.c:318
void write_exp_elt_type(struct parser_state *ps, struct type *expelt)
Definition: parse.c:277
#define yystacksize
void error(const char *fmt,...)
Definition: errors.c:38
static void yy_stack_print(yytype_int16 *yybottom, yytype_int16 *yytop)
Definition: ada-exp.c:1094
struct type * lookup_pointer_type(struct type *type)
Definition: gdbtypes.c:381
#define YYLAST
Definition: ada-exp.c:556
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Definition: ada-exp.c:418
long long LONGEST
Definition: common-types.h:52
void do_cleanups(struct cleanup *old_chain)
Definition: cleanups.c:174
static struct type * type_long_long(struct parser_state *)
Definition: ada-exp.c:3424
#define TICK_FIRST
Definition: ada-exp.c:262
#define yytable_value_is_error(Yytable_value)
Definition: ada-exp.c:678
static int yylex(void)
static void write_var_from_sym(struct parser_state *par_state, const struct block *block, struct symbol *sym)
Definition: ada-exp.c:2723
static void write_object_renaming(struct parser_state *, const struct block *, const char *, int, const char *, int)
Definition: ada-exp.c:2773
#define MOD
Definition: ada-exp.c:253
#define _AND_
Definition: ada-exp.c:242
static void yy_reduce_print(yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
Definition: ada-exp.c:1117