1 /* A Bison parser, made by GNU Bison 1.875. */
3 /* Skeleton parser for Yacc-like parsing with Bison,
4 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
21 /* As a special exception, when this file is copied by Bison into a
22 Bison output file, you may use that output file without restriction.
23 This special exception was added by the Free Software Foundation
24 in version 1.24 of Bison. */
26 /* Written by Richard Stallman by simplifying the original so called
27 ``semantic'' parser. */
29 /* All symbols defined below should begin with yy or YY, to avoid
30 infringing on user name space. This should be done even for local
31 variables, as they might otherwise be expanded by user macros.
32 There are some unavoidable exceptions within include files to
33 define necessary library symbols; they are noted "INFRINGES ON
34 USER NAME SPACE" below. */
36 /* Identify Bison output. */
40 #define YYSKELETON_NAME "yacc.c"
45 /* Using locations. */
46 #define YYLSP_NEEDED 0
53 /* Put the tokens into the symbol table, so that GDB and other debuggers
65 OBJECT_RENAMING = 267,
69 INTERNAL_VARIABLE = 271,
109 #define BLOCKNAME 263
113 #define OBJECT_RENAMING 267
117 #define INTERNAL_VARIABLE 271
135 #define TICK_LENGTH 289
136 #define TICK_LAST 290
137 #define TICK_FIRST 291
138 #define TICK_ADDRESS 292
139 #define TICK_ACCESS 293
140 #define TICK_MODULUS 294
145 #define TICK_SIZE 299
146 #define TICK_RANGE 300
154 /* Copy the first part of user declarations. */
161 #include "expression.h"
163 #include "parser-defs.h"
164 #include "language.h"
165 #include "ada-lang.h"
166 #include "bfd.h" /* Required by objfiles.h. */
167 #include "symfile.h" /* Required by objfiles.h. */
168 #include "objfiles.h" /* For have_full_symbols and have_partial_symbols */
172 /* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc),
173 as well as gratuitiously global symbol names, so we can have multiple
174 yacc generated parsers in gdb. These are only the variables
175 produced by yacc. If other parser generators (bison, byacc, etc) produce
176 additional global names that conflict at link time, then those parser
177 generators need to be fixed instead of adding those names to this list. */
179 /* NOTE: This is clumsy, especially since BISON and FLEX provide --prefix
180 options. I presume we are maintaining it to accommodate systems
181 without BISON? (PNH) */
183 #define yymaxdepth ada_maxdepth
184 #define yyparse _ada_parse /* ada_parse calls this after initialization */
185 #define yylex ada_lex
186 #define yyerror ada_error
187 #define yylval ada_lval
188 #define yychar ada_char
189 #define yydebug ada_debug
190 #define yypact ada_pact
193 #define yydef ada_def
194 #define yychk ada_chk
195 #define yypgo ada_pgo
196 #define yyact ada_act
197 #define yyexca ada_exca
198 #define yyerrflag ada_errflag
199 #define yynerrs ada_nerrs
203 #define yy_yys ada_yys
204 #define yystate ada_state
205 #define yytmp ada_tmp
207 #define yy_yyv ada_yyv
208 #define yyval ada_val
209 #define yylloc ada_lloc
210 #define yyreds ada_reds /* With YYDEBUG defined */
211 #define yytoks ada_toks /* With YYDEBUG defined */
212 #define yyname ada_name /* With YYDEBUG defined */
213 #define yyrule ada_rule /* With YYDEBUG defined */
216 #define YYDEBUG 1 /* Default to yydebug support */
219 #define YYFPRINTF parser_fprintf
223 struct minimal_symbol* msym;
225 struct stoken stoken;
228 /* If expression is in the context of TYPE'(...), then TYPE, else
230 static struct type* type_qualifier;
234 static int yylex (void);
236 void yyerror (char *);
238 static struct stoken string_to_operator (struct stoken);
240 static void write_attribute_call0 (enum ada_attribute);
242 static void write_attribute_call1 (enum ada_attribute, LONGEST);
244 static void write_attribute_calln (enum ada_attribute, int);
246 static void write_object_renaming (struct block*, struct symbol*);
248 static void write_var_from_name (struct block*, struct name_info);
251 convert_char_literal (struct type*, LONGEST);
254 /* Enabling traces. */
259 /* Enabling verbose error messages. */
260 #ifdef YYERROR_VERBOSE
261 # undef YYERROR_VERBOSE
262 # define YYERROR_VERBOSE 1
264 # define YYERROR_VERBOSE 0
267 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
268 #line 137 "ada-exp.y"
269 typedef union YYSTYPE {
281 struct name_info ssym;
284 struct internalvar *ivar;
287 /* Line 191 of yacc.c. */
288 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
289 # define YYSTYPE_IS_DECLARED 1
290 # define YYSTYPE_IS_TRIVIAL 1
295 /* Copy the second part of user declarations. */
298 /* Line 214 of yacc.c. */
300 #if ! defined (yyoverflow) || YYERROR_VERBOSE
302 /* The parser invokes alloca or xmalloc; define the necessary symbols. */
304 # if YYSTACK_USE_ALLOCA
305 # define YYSTACK_ALLOC alloca
307 # ifndef YYSTACK_USE_ALLOCA
308 # if defined (alloca) || defined (_ALLOCA_H)
309 # define YYSTACK_ALLOC alloca
312 # define YYSTACK_ALLOC __builtin_alloca
318 # ifdef YYSTACK_ALLOC
319 /* Pacify GCC's `empty if-body' warning. */
320 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
322 # if defined (__STDC__) || defined (__cplusplus)
323 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
324 # define YYSIZE_T size_t
326 # define YYSTACK_ALLOC xmalloc
327 # define YYSTACK_FREE free
329 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
332 #if (! defined (yyoverflow) \
333 && (! defined (__cplusplus) \
334 || (YYSTYPE_IS_TRIVIAL)))
336 /* A type that is properly aligned for any stack member. */
343 /* The size of the maximum gap between one aligned stack and the next. */
344 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
346 /* The size of an array large to enough to hold all stacks, each with
348 # define YYSTACK_BYTES(N) \
349 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
350 + YYSTACK_GAP_MAXIMUM)
352 /* Copy COUNT objects from FROM to TO. The source and destination do
356 # define YYCOPY(To, From, Count) \
357 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
359 # define YYCOPY(To, From, Count) \
362 register YYSIZE_T yyi; \
363 for (yyi = 0; yyi < (Count); yyi++) \
364 (To)[yyi] = (From)[yyi]; \
370 /* Relocate STACK from its old location to the new one. The
371 local variables YYSIZE and YYSTACKSIZE give the old and new number of
372 elements in the stack, and YYPTR gives the new location of the
373 stack. Advance YYPTR to a properly aligned location for the next
375 # define YYSTACK_RELOCATE(Stack) \
378 YYSIZE_T yynewbytes; \
379 YYCOPY (&yyptr->Stack, Stack, yysize); \
380 Stack = &yyptr->Stack; \
381 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
382 yyptr += yynewbytes / sizeof (*yyptr); \
388 #if defined (__STDC__) || defined (__cplusplus)
389 typedef signed char yysigned_char;
391 typedef short yysigned_char;
394 /* YYFINAL -- State number of the termination state. */
396 /* YYLAST -- Last index in YYTABLE. */
399 /* YYNTOKENS -- Number of terminals. */
401 /* YYNNTS -- Number of nonterminals. */
403 /* YYNRULES -- Number of rules. */
405 /* YYNRULES -- Number of states. */
406 #define YYNSTATES 184
408 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
410 #define YYMAXUTOK 303
412 #define YYTRANSLATE(YYX) \
413 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
415 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
416 static const unsigned char yytranslate[] =
418 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
419 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
420 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
421 2, 2, 2, 2, 2, 2, 2, 2, 34, 63,
422 57, 62, 36, 32, 64, 33, 56, 37, 2, 2,
423 2, 2, 2, 2, 2, 2, 2, 2, 2, 61,
424 24, 23, 25, 2, 31, 2, 2, 2, 2, 2,
425 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
426 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
427 2, 58, 2, 67, 2, 2, 2, 2, 2, 2,
428 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
429 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
430 2, 2, 2, 65, 2, 66, 2, 2, 2, 2,
431 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
432 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
433 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
434 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
435 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
436 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
437 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
438 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
439 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
440 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
441 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
442 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
443 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
444 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
445 15, 16, 17, 18, 19, 20, 21, 22, 26, 27,
446 28, 29, 30, 35, 38, 39, 40, 41, 42, 43,
447 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
452 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
454 static const unsigned short yyprhs[] =
456 0, 0, 3, 5, 7, 9, 13, 16, 19, 24,
457 29, 30, 38, 39, 46, 50, 52, 54, 56, 58,
458 60, 64, 67, 70, 73, 76, 77, 79, 83, 87,
459 93, 98, 102, 106, 110, 114, 118, 122, 126, 130,
460 134, 138, 142, 146, 152, 158, 162, 169, 176, 181,
461 185, 189, 193, 197, 202, 206, 211, 215, 218, 221,
462 225, 229, 233, 236, 239, 247, 255, 261, 265, 269,
463 273, 279, 282, 283, 287, 289, 291, 292, 294, 296,
464 298, 300, 302, 305, 307, 310, 312, 315, 317, 319,
465 321, 323, 326, 328, 331, 334, 338, 341, 344
468 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
469 static const yysigned_char yyrhs[] =
471 69, 0, -1, 70, -1, 82, -1, 74, -1, 70,
472 61, 74, -1, 71, 13, -1, 71, 11, -1, 71,
473 57, 75, 62, -1, 82, 57, 74, 62, -1, -1,
474 82, 63, 73, 72, 57, 74, 62, -1, -1, 71,
475 57, 74, 26, 74, 62, -1, 57, 70, 62, -1,
476 79, -1, 15, -1, 16, -1, 71, -1, 14, -1,
477 74, 17, 74, -1, 33, 74, -1, 32, 74, -1,
478 40, 74, -1, 41, 74, -1, -1, 74, -1, 80,
479 59, 74, -1, 75, 64, 74, -1, 75, 64, 80,
480 59, 74, -1, 65, 82, 66, 74, -1, 74, 42,
481 74, -1, 74, 36, 74, -1, 74, 37, 74, -1,
482 74, 38, 74, -1, 74, 39, 74, -1, 74, 31,
483 74, -1, 74, 32, 74, -1, 74, 34, 74, -1,
484 74, 33, 74, -1, 74, 23, 74, -1, 74, 30,
485 74, -1, 74, 29, 74, -1, 74, 27, 74, 26,
486 74, -1, 74, 27, 74, 54, 76, -1, 74, 27,
487 7, -1, 74, 40, 27, 74, 26, 74, -1, 74,
488 40, 27, 74, 54, 76, -1, 74, 40, 27, 7,
489 -1, 74, 28, 74, -1, 74, 24, 74, -1, 74,
490 25, 74, -1, 74, 22, 74, -1, 74, 22, 19,
491 74, -1, 74, 21, 74, -1, 74, 21, 18, 74,
492 -1, 74, 20, 74, -1, 71, 47, -1, 71, 46,
493 -1, 71, 45, 76, -1, 71, 44, 76, -1, 71,
494 43, 76, -1, 71, 53, -1, 71, 52, -1, 78,
495 49, 57, 74, 64, 74, 62, -1, 78, 50, 57,
496 74, 64, 74, 62, -1, 78, 55, 57, 74, 62,
497 -1, 77, 45, 76, -1, 77, 44, 76, -1, 77,
498 43, 76, -1, 77, 51, 57, 74, 62, -1, 77,
499 48, -1, -1, 57, 3, 62, -1, 7, -1, 77,
500 -1, -1, 3, -1, 5, -1, 6, -1, 4, -1,
501 9, -1, 60, 7, -1, 10, -1, 81, 10, -1,
502 12, -1, 81, 12, -1, 10, -1, 7, -1, 12,
503 -1, 8, -1, 81, 8, -1, 7, -1, 81, 7,
504 -1, 7, 47, -1, 81, 7, 47, -1, 36, 74,
505 -1, 34, 74, -1, 74, 58, 74, 67, -1
508 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
509 static const unsigned short yyrline[] =
511 0, 208, 208, 209, 215, 216, 221, 225, 232, 240,
512 248, 248, 259, 263, 267, 270, 273, 280, 288, 291,
513 298, 302, 306, 310, 314, 318, 321, 323, 325, 327,
514 331, 341, 345, 349, 353, 357, 361, 365, 369, 373,
515 377, 381, 385, 389, 393, 399, 406, 411, 419, 429,
516 433, 437, 441, 445, 449, 453, 457, 461, 463, 469,
517 471, 473, 475, 477, 479, 481, 483, 485, 487, 489,
518 491, 493, 497, 499, 504, 511, 513, 519, 527, 539,
519 547, 555, 582, 586, 587, 589, 590, 594, 595, 596,
520 599, 601, 606, 607, 608, 610, 617, 619, 621
524 #if YYDEBUG || YYERROR_VERBOSE
525 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
526 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
527 static const char *const yytname[] =
529 "$end", "error", "$undefined", "INT", "NULL_PTR", "CHARLIT", "FLOAT",
530 "TYPENAME", "BLOCKNAME", "STRING", "NAME", "DOT_ID", "OBJECT_RENAMING",
531 "DOT_ALL", "LAST", "REGNAME", "INTERNAL_VARIABLE", "ASSIGN", "ELSE",
532 "THEN", "XOR", "OR", "_AND_", "'='", "'<'", "'>'", "DOTDOT", "IN",
533 "GEQ", "LEQ", "NOTEQUAL", "'@'", "'+'", "'-'", "'&'", "UNARY", "'*'",
534 "'/'", "REM", "MOD", "NOT", "ABS", "STARSTAR", "TICK_LENGTH",
535 "TICK_LAST", "TICK_FIRST", "TICK_ADDRESS", "TICK_ACCESS",
536 "TICK_MODULUS", "TICK_MIN", "TICK_MAX", "TICK_VAL", "TICK_TAG",
537 "TICK_SIZE", "TICK_RANGE", "TICK_POS", "'.'", "'('", "'['", "ARROW",
538 "NEW", "';'", "')'", "'''", "','", "'{'", "'}'", "']'", "$accept",
539 "start", "exp1", "simple_exp", "@1", "save_qualifier", "exp", "arglist",
540 "tick_arglist", "type_prefix", "opt_type_prefix", "variable",
541 "any_name", "block", "type", 0
546 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
548 static const unsigned short yytoknum[] =
550 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
551 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
552 275, 276, 277, 61, 60, 62, 278, 279, 280, 281,
553 282, 64, 43, 45, 38, 283, 42, 47, 284, 285,
554 286, 287, 288, 289, 290, 291, 292, 293, 294, 295,
555 296, 297, 298, 299, 300, 301, 46, 40, 91, 302,
556 303, 59, 41, 39, 44, 123, 125, 93
560 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
561 static const unsigned char yyr1[] =
563 0, 68, 69, 69, 70, 70, 71, 71, 71, 71,
564 72, 71, 73, 71, 71, 71, 71, 71, 74, 71,
565 74, 74, 74, 74, 74, 75, 75, 75, 75, 75,
566 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
567 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
568 74, 74, 74, 74, 74, 74, 74, 71, 71, 71,
569 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
570 71, 71, 76, 76, 77, 78, 78, 74, 74, 74,
571 74, 74, 74, 79, 79, 79, 79, 80, 80, 80,
572 81, 81, 82, 82, 82, 82, 74, 74, 74
575 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
576 static const unsigned char yyr2[] =
578 0, 2, 1, 1, 1, 3, 2, 2, 4, 4,
579 0, 7, 0, 6, 3, 1, 1, 1, 1, 1,
580 3, 2, 2, 2, 2, 0, 1, 3, 3, 5,
581 4, 3, 3, 3, 3, 3, 3, 3, 3, 3,
582 3, 3, 3, 5, 5, 3, 6, 6, 4, 3,
583 3, 3, 3, 4, 3, 4, 3, 2, 2, 3,
584 3, 3, 2, 2, 7, 7, 5, 3, 3, 3,
585 5, 2, 0, 3, 1, 1, 0, 1, 1, 1,
586 1, 1, 2, 1, 2, 1, 2, 1, 1, 1,
587 1, 2, 1, 2, 2, 3, 2, 2, 4
590 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
591 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
592 means the default is an error. */
593 static const unsigned char yydefact[] =
595 76, 77, 80, 78, 79, 74, 90, 81, 83, 85,
596 19, 16, 17, 76, 76, 76, 76, 76, 76, 76,
597 0, 0, 0, 2, 18, 4, 75, 0, 15, 0,
598 3, 94, 22, 0, 21, 97, 96, 23, 24, 0,
599 82, 92, 0, 0, 1, 76, 7, 6, 72, 72,
600 72, 58, 57, 63, 62, 76, 76, 76, 76, 76,
601 76, 76, 76, 76, 76, 76, 76, 76, 76, 76,
602 76, 76, 76, 76, 76, 0, 76, 76, 72, 72,
603 72, 71, 0, 0, 0, 0, 93, 91, 84, 86,
604 76, 12, 14, 76, 5, 0, 61, 60, 59, 74,
605 83, 85, 26, 0, 0, 20, 56, 76, 54, 76,
606 52, 40, 50, 51, 45, 0, 49, 42, 41, 36,
607 37, 39, 38, 32, 33, 34, 35, 76, 31, 0,
608 69, 68, 67, 76, 76, 76, 76, 95, 0, 10,
609 30, 0, 76, 8, 76, 76, 55, 53, 76, 72,
610 48, 0, 98, 0, 0, 0, 0, 9, 0, 73,
611 0, 28, 0, 27, 43, 44, 76, 72, 70, 76,
612 76, 66, 76, 13, 76, 46, 47, 0, 0, 0,
616 /* YYDEFGOTO[NTERM-NUM]. */
617 static const short yydefgoto[] =
619 -1, 22, 23, 24, 158, 139, 25, 103, 96, 26,
623 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
625 #define YYPACT_NINF -44
626 static const short yypact[] =
628 251, -44, -44, -44, -44, 15, -44, -44, -44, -44,
629 -44, -44, -44, 251, 251, 251, 251, 251, 251, 251,
630 17, 2, 31, 10, 55, 947, -18, 20, -44, 118,
631 -29, -44, 374, -29, 374, 18, 18, 374, 374, -21,
632 -44, 32, 66, 16, -44, 251, -44, -44, 24, 24,
633 24, -44, -44, -44, -44, 133, 251, 251, 173, 212,
634 251, 251, 251, 290, 251, 251, 251, 251, 251, 251,
635 251, 251, 251, 251, 251, 59, 251, 251, 24, 24,
636 24, -44, 35, 38, 40, 47, 58, -44, -44, -44,
637 251, -44, -44, 251, 947, 107, -44, -44, -44, 56,
638 52, 57, 915, 3, 68, 979, 1002, 251, 1002, 251,
639 1002, -20, -20, -20, 1004, 837, -20, -20, -20, 51,
640 374, 374, 374, -19, -19, -19, -19, 329, -19, 414,
641 -44, -44, -44, 251, 251, 251, 251, -44, 536, -44,
642 18, 71, 251, -44, 368, 251, 1002, 1002, 251, 24,
643 1004, 876, -44, 579, 446, 491, 622, -44, 60, -44,
644 665, 947, 75, 947, -20, -44, 251, 24, -44, 251,
645 251, -44, 251, -44, 251, -20, -44, 708, 751, 794,
649 /* YYPGOTO[NTERM-NUM]. */
650 static const yysigned_char yypgoto[] =
652 -44, -44, 99, -44, -44, -44, -13, -44, -43, -44,
656 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
657 positive, shift that token. If negative, reduce the rule which
658 number is the opposite. If zero, do what YYDEFACT says.
659 If YYTABLE_NINF, syntax error. */
660 #define YYTABLE_NINF -93
661 static const short yytable[] =
663 32, 34, 35, 36, 37, 38, 97, 98, 30, 41,
664 6, 67, 68, 69, 70, -92, 71, 72, 73, 74,
665 75, 75, 76, 76, 40, 78, 79, 80, 90, 43,
666 81, 44, 94, 82, 91, 130, 131, 132, 77, 77,
667 45, 92, 102, 105, 106, 108, 110, 111, 112, 113,
668 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
669 125, 126, 31, 128, 129, 143, 46, 144, 47, 83,
670 84, 45, -92, 86, 87, 85, 77, 138, -92, 31,
671 140, 95, 93, 68, 69, 70, 127, 71, 72, 73,
672 74, 75, 133, 76, 146, 134, 147, 135, 48, 49,
673 50, 51, 52, 31, 136, 137, 165, 53, 54, 77,
674 141, -87, 55, -92, 151, -88, -89, 172, 39, -92,
675 153, 154, 155, 156, 176, 86, 87, 145, 88, 160,
676 89, 161, 163, 159, 174, 164, 1, 2, 3, 4,
677 99, 6, 7, 100, 162, 101, 42, 10, 11, 12,
678 0, 0, 0, 175, 0, 0, 177, 178, 0, 179,
679 0, 180, 0, 0, 0, 13, 14, 15, 0, 16,
680 0, 0, 0, 17, 18, 0, 1, 2, 3, 4,
681 5, 6, 7, 8, 0, 9, 0, 10, 11, 12,
682 19, 107, 0, 20, 0, -25, 0, -25, 21, 0,
683 0, 0, 0, 0, 0, 13, 14, 15, 0, 16,
684 0, 0, 0, 17, 18, 1, 2, 3, 4, 5,
685 6, 7, 8, 0, 9, 0, 10, 11, 12, 0,
686 19, 109, 0, 20, 0, 0, 0, 0, 21, 0,
687 0, 0, 0, 0, 13, 14, 15, 0, 16, 0,
688 0, 0, 17, 18, 1, 2, 3, 4, 5, 6,
689 7, 8, 0, 9, 0, 10, 11, 12, 0, 19,
690 0, 0, 20, 0, 0, 0, 0, 21, 0, 0,
691 0, 0, 0, 13, 14, 15, 0, 16, 0, 0,
692 0, 17, 18, 1, 2, 3, 4, 114, 6, 7,
693 8, 0, 9, 0, 10, 11, 12, 0, 19, 0,
694 0, 20, 0, 0, 0, 0, 21, 0, 0, 0,
695 0, 0, 13, 14, 15, 0, 16, 0, 0, 0,
696 17, 18, 1, 2, 3, 4, 150, 6, 7, 8,
697 0, 9, 0, 10, 11, 12, 0, 19, 0, 0,
698 20, 0, 0, 0, 0, 21, 0, 0, 0, 0,
699 0, 13, 14, 15, 0, 16, 0, 0, 0, 17,
700 18, 1, 2, 3, 4, 99, 6, 7, 100, 0,
701 101, 0, 10, 11, 12, 0, 19, 0, 0, 20,
702 0, 0, 0, 0, 21, 0, 0, 0, 0, 0,
703 13, 14, 15, 0, 16, 0, 0, 0, 17, 18,
704 71, 72, 73, 74, 75, 0, 76, 0, 0, 0,
705 0, 0, 0, 0, 0, 19, 0, 0, 20, 0,
706 0, 56, 77, 21, 57, 58, 59, 60, 61, 62,
707 0, 63, 64, 65, 66, 67, 68, 69, 70, 0,
708 71, 72, 73, 74, 75, 0, 76, 0, 0, 0,
709 0, 0, 0, 56, 0, 0, 57, 58, 59, 60,
710 61, 62, 77, 63, 64, 65, 66, 67, 68, 69,
711 70, 152, 71, 72, 73, 74, 75, 0, 76, 0,
712 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
713 0, 0, 0, 0, 77, 0, 0, 0, 56, 0,
714 169, 57, 58, 59, 60, 61, 62, 0, 63, 64,
715 65, 66, 67, 68, 69, 70, 0, 71, 72, 73,
716 74, 75, 0, 76, 0, 0, 0, 0, 0, 0,
717 0, 0, 0, 0, 0, 0, 0, 0, 0, 77,
718 0, 0, 0, 56, 0, 170, 57, 58, 59, 60,
719 61, 62, 0, 63, 64, 65, 66, 67, 68, 69,
720 70, 0, 71, 72, 73, 74, 75, 0, 76, 0,
721 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
722 0, 0, 0, 0, 77, 0, 56, 0, 157, 57,
723 58, 59, 60, 61, 62, 0, 63, 64, 65, 66,
724 67, 68, 69, 70, 0, 71, 72, 73, 74, 75,
725 0, 76, 0, 0, 0, 0, 0, 0, 0, 0,
726 0, 0, 0, 0, 0, 0, 0, 77, 0, 56,
727 0, 168, 57, 58, 59, 60, 61, 62, 0, 63,
728 64, 65, 66, 67, 68, 69, 70, 0, 71, 72,
729 73, 74, 75, 0, 76, 0, 0, 0, 0, 0,
730 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
731 77, 0, 56, 0, 171, 57, 58, 59, 60, 61,
732 62, 0, 63, 64, 65, 66, 67, 68, 69, 70,
733 0, 71, 72, 73, 74, 75, 0, 76, 0, 0,
734 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
735 0, 0, 0, 77, 0, 56, 0, 173, 57, 58,
736 59, 60, 61, 62, 0, 63, 64, 65, 66, 67,
737 68, 69, 70, 0, 71, 72, 73, 74, 75, 0,
738 76, 0, 0, 0, 0, 0, 0, 0, 0, 0,
739 0, 0, 0, 0, 0, 0, 77, 0, 56, 0,
740 181, 57, 58, 59, 60, 61, 62, 0, 63, 64,
741 65, 66, 67, 68, 69, 70, 0, 71, 72, 73,
742 74, 75, 0, 76, 0, 0, 0, 0, 0, 0,
743 0, 0, 0, 0, 0, 0, 0, 0, 0, 77,
744 0, 56, 0, 182, 57, 58, 59, 60, 61, 62,
745 0, 63, 64, 65, 66, 67, 68, 69, 70, 0,
746 71, 72, 73, 74, 75, 0, 76, 0, 0, 0,
747 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
748 0, 0, 77, 0, 56, 0, 183, 57, 58, 59,
749 60, 61, 62, 148, 63, 64, 65, 66, 67, 68,
750 69, 70, 0, 71, 72, 73, 74, 75, 0, 76,
751 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
752 0, 149, 0, 56, 0, 77, 57, 58, 59, 60,
753 61, 62, 166, 63, 64, 65, 66, 67, 68, 69,
754 70, 0, 71, 72, 73, 74, 75, 0, 76, 0,
755 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
756 167, 0, 56, 0, 77, 57, 58, 59, 60, 61,
757 62, 142, 63, 64, 65, 66, 67, 68, 69, 70,
758 0, 71, 72, 73, 74, 75, 0, 76, 0, 0,
759 0, 0, 0, 0, 56, 0, 0, 57, 58, 59,
760 60, 61, 62, 77, 63, 64, 65, 66, 67, 68,
761 69, 70, 0, 71, 72, 73, 74, 75, 0, 76,
762 0, 0, 0, 0, 0, 0, -93, 0, 0, 57,
763 58, 59, 60, 61, 62, 77, 63, 64, 65, 66,
764 67, 68, 69, 70, 0, 71, 72, 73, 74, 75,
765 0, 76, 0, 0, 0, 60, 61, 62, 0, 63,
766 64, 65, 66, 67, 68, 69, 70, 77, 71, 72,
767 73, 74, 75, 0, 76, 0, 0, -74, -74, -74,
768 0, 31, -74, -74, -74, -74, 0, 0, 0, -74,
769 77, -92, 0, 0, 0, 0, 0, -92
772 static const short yycheck[] =
774 13, 14, 15, 16, 17, 18, 49, 50, 0, 7,
775 8, 31, 32, 33, 34, 0, 36, 37, 38, 39,
776 40, 40, 42, 42, 7, 43, 44, 45, 57, 21,
777 48, 0, 45, 51, 63, 78, 79, 80, 58, 58,
778 61, 62, 55, 56, 57, 58, 59, 60, 61, 62,
779 63, 64, 65, 66, 67, 68, 69, 70, 71, 72,
780 73, 74, 47, 76, 77, 62, 11, 64, 13, 49,
781 50, 61, 57, 7, 8, 55, 58, 90, 63, 47,
782 93, 57, 66, 32, 33, 34, 27, 36, 37, 38,
783 39, 40, 57, 42, 107, 57, 109, 57, 43, 44,
784 45, 46, 47, 47, 57, 47, 149, 52, 53, 58,
785 3, 59, 57, 57, 127, 59, 59, 57, 19, 63,
786 133, 134, 135, 136, 167, 7, 8, 59, 10, 142,
787 12, 144, 145, 62, 59, 148, 3, 4, 5, 6,
788 7, 8, 9, 10, 144, 12, 21, 14, 15, 16,
789 -1, -1, -1, 166, -1, -1, 169, 170, -1, 172,
790 -1, 174, -1, -1, -1, 32, 33, 34, -1, 36,
791 -1, -1, -1, 40, 41, -1, 3, 4, 5, 6,
792 7, 8, 9, 10, -1, 12, -1, 14, 15, 16,
793 57, 18, -1, 60, -1, 62, -1, 64, 65, -1,
794 -1, -1, -1, -1, -1, 32, 33, 34, -1, 36,
795 -1, -1, -1, 40, 41, 3, 4, 5, 6, 7,
796 8, 9, 10, -1, 12, -1, 14, 15, 16, -1,
797 57, 19, -1, 60, -1, -1, -1, -1, 65, -1,
798 -1, -1, -1, -1, 32, 33, 34, -1, 36, -1,
799 -1, -1, 40, 41, 3, 4, 5, 6, 7, 8,
800 9, 10, -1, 12, -1, 14, 15, 16, -1, 57,
801 -1, -1, 60, -1, -1, -1, -1, 65, -1, -1,
802 -1, -1, -1, 32, 33, 34, -1, 36, -1, -1,
803 -1, 40, 41, 3, 4, 5, 6, 7, 8, 9,
804 10, -1, 12, -1, 14, 15, 16, -1, 57, -1,
805 -1, 60, -1, -1, -1, -1, 65, -1, -1, -1,
806 -1, -1, 32, 33, 34, -1, 36, -1, -1, -1,
807 40, 41, 3, 4, 5, 6, 7, 8, 9, 10,
808 -1, 12, -1, 14, 15, 16, -1, 57, -1, -1,
809 60, -1, -1, -1, -1, 65, -1, -1, -1, -1,
810 -1, 32, 33, 34, -1, 36, -1, -1, -1, 40,
811 41, 3, 4, 5, 6, 7, 8, 9, 10, -1,
812 12, -1, 14, 15, 16, -1, 57, -1, -1, 60,
813 -1, -1, -1, -1, 65, -1, -1, -1, -1, -1,
814 32, 33, 34, -1, 36, -1, -1, -1, 40, 41,
815 36, 37, 38, 39, 40, -1, 42, -1, -1, -1,
816 -1, -1, -1, -1, -1, 57, -1, -1, 60, -1,
817 -1, 17, 58, 65, 20, 21, 22, 23, 24, 25,
818 -1, 27, 28, 29, 30, 31, 32, 33, 34, -1,
819 36, 37, 38, 39, 40, -1, 42, -1, -1, -1,
820 -1, -1, -1, 17, -1, -1, 20, 21, 22, 23,
821 24, 25, 58, 27, 28, 29, 30, 31, 32, 33,
822 34, 67, 36, 37, 38, 39, 40, -1, 42, -1,
823 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
824 -1, -1, -1, -1, 58, -1, -1, -1, 17, -1,
825 64, 20, 21, 22, 23, 24, 25, -1, 27, 28,
826 29, 30, 31, 32, 33, 34, -1, 36, 37, 38,
827 39, 40, -1, 42, -1, -1, -1, -1, -1, -1,
828 -1, -1, -1, -1, -1, -1, -1, -1, -1, 58,
829 -1, -1, -1, 17, -1, 64, 20, 21, 22, 23,
830 24, 25, -1, 27, 28, 29, 30, 31, 32, 33,
831 34, -1, 36, 37, 38, 39, 40, -1, 42, -1,
832 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
833 -1, -1, -1, -1, 58, -1, 17, -1, 62, 20,
834 21, 22, 23, 24, 25, -1, 27, 28, 29, 30,
835 31, 32, 33, 34, -1, 36, 37, 38, 39, 40,
836 -1, 42, -1, -1, -1, -1, -1, -1, -1, -1,
837 -1, -1, -1, -1, -1, -1, -1, 58, -1, 17,
838 -1, 62, 20, 21, 22, 23, 24, 25, -1, 27,
839 28, 29, 30, 31, 32, 33, 34, -1, 36, 37,
840 38, 39, 40, -1, 42, -1, -1, -1, -1, -1,
841 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
842 58, -1, 17, -1, 62, 20, 21, 22, 23, 24,
843 25, -1, 27, 28, 29, 30, 31, 32, 33, 34,
844 -1, 36, 37, 38, 39, 40, -1, 42, -1, -1,
845 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
846 -1, -1, -1, 58, -1, 17, -1, 62, 20, 21,
847 22, 23, 24, 25, -1, 27, 28, 29, 30, 31,
848 32, 33, 34, -1, 36, 37, 38, 39, 40, -1,
849 42, -1, -1, -1, -1, -1, -1, -1, -1, -1,
850 -1, -1, -1, -1, -1, -1, 58, -1, 17, -1,
851 62, 20, 21, 22, 23, 24, 25, -1, 27, 28,
852 29, 30, 31, 32, 33, 34, -1, 36, 37, 38,
853 39, 40, -1, 42, -1, -1, -1, -1, -1, -1,
854 -1, -1, -1, -1, -1, -1, -1, -1, -1, 58,
855 -1, 17, -1, 62, 20, 21, 22, 23, 24, 25,
856 -1, 27, 28, 29, 30, 31, 32, 33, 34, -1,
857 36, 37, 38, 39, 40, -1, 42, -1, -1, -1,
858 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
859 -1, -1, 58, -1, 17, -1, 62, 20, 21, 22,
860 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
861 33, 34, -1, 36, 37, 38, 39, 40, -1, 42,
862 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
863 -1, 54, -1, 17, -1, 58, 20, 21, 22, 23,
864 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
865 34, -1, 36, 37, 38, 39, 40, -1, 42, -1,
866 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
867 54, -1, 17, -1, 58, 20, 21, 22, 23, 24,
868 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
869 -1, 36, 37, 38, 39, 40, -1, 42, -1, -1,
870 -1, -1, -1, -1, 17, -1, -1, 20, 21, 22,
871 23, 24, 25, 58, 27, 28, 29, 30, 31, 32,
872 33, 34, -1, 36, 37, 38, 39, 40, -1, 42,
873 -1, -1, -1, -1, -1, -1, 17, -1, -1, 20,
874 21, 22, 23, 24, 25, 58, 27, 28, 29, 30,
875 31, 32, 33, 34, -1, 36, 37, 38, 39, 40,
876 -1, 42, -1, -1, -1, 23, 24, 25, -1, 27,
877 28, 29, 30, 31, 32, 33, 34, 58, 36, 37,
878 38, 39, 40, -1, 42, -1, -1, 43, 44, 45,
879 -1, 47, 48, 49, 50, 51, -1, -1, -1, 55,
880 58, 57, -1, -1, -1, -1, -1, 63
883 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
884 symbol of state STATE-NUM. */
885 static const unsigned char yystos[] =
887 0, 3, 4, 5, 6, 7, 8, 9, 10, 12,
888 14, 15, 16, 32, 33, 34, 36, 40, 41, 57,
889 60, 65, 69, 70, 71, 74, 77, 78, 79, 81,
890 82, 47, 74, 82, 74, 74, 74, 74, 74, 70,
891 7, 7, 81, 82, 0, 61, 11, 13, 43, 44,
892 45, 46, 47, 52, 53, 57, 17, 20, 21, 22,
893 23, 24, 25, 27, 28, 29, 30, 31, 32, 33,
894 34, 36, 37, 38, 39, 40, 42, 58, 43, 44,
895 45, 48, 51, 49, 50, 55, 7, 8, 10, 12,
896 57, 63, 62, 66, 74, 57, 76, 76, 76, 7,
897 10, 12, 74, 75, 80, 74, 74, 18, 74, 19,
898 74, 74, 74, 74, 7, 74, 74, 74, 74, 74,
899 74, 74, 74, 74, 74, 74, 74, 27, 74, 74,
900 76, 76, 76, 57, 57, 57, 57, 47, 74, 73,
901 74, 3, 26, 62, 64, 59, 74, 74, 26, 54,
902 7, 74, 67, 74, 74, 74, 74, 62, 72, 62,
903 74, 74, 80, 74, 74, 76, 26, 54, 62, 64,
904 64, 62, 57, 62, 59, 74, 76, 74, 74, 74,
908 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
909 # define YYSIZE_T __SIZE_TYPE__
911 #if ! defined (YYSIZE_T) && defined (size_t)
912 # define YYSIZE_T size_t
914 #if ! defined (YYSIZE_T)
915 # if defined (__STDC__) || defined (__cplusplus)
916 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
917 # define YYSIZE_T size_t
920 #if ! defined (YYSIZE_T)
921 # define YYSIZE_T unsigned int
924 #define yyerrok (yyerrstatus = 0)
925 #define yyclearin (yychar = YYEMPTY)
929 #define YYACCEPT goto yyacceptlab
930 #define YYABORT goto yyabortlab
931 #define YYERROR goto yyerrlab1
933 /* Like YYERROR except do call yyerror. This remains here temporarily
934 to ease the transition to the new meaning of YYERROR, for GCC.
935 Once GCC version 2 has supplanted version 1, this can go. */
937 #define YYFAIL goto yyerrlab
939 #define YYRECOVERING() (!!yyerrstatus)
941 #define YYBACKUP(Token, Value) \
943 if (yychar == YYEMPTY && yylen == 1) \
947 yytoken = YYTRANSLATE (yychar); \
953 yyerror ("syntax error: cannot back up");\
959 #define YYERRCODE 256
961 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
964 #ifndef YYLLOC_DEFAULT
965 # define YYLLOC_DEFAULT(Current, Rhs, N) \
966 Current.first_line = Rhs[1].first_line; \
967 Current.first_column = Rhs[1].first_column; \
968 Current.last_line = Rhs[N].last_line; \
969 Current.last_column = Rhs[N].last_column;
972 /* YYLEX -- calling `yylex' with the right arguments. */
975 # define YYLEX yylex (YYLEX_PARAM)
977 # define YYLEX yylex ()
980 /* Enable debugging if requested. */
984 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
985 # define YYFPRINTF fprintf
988 # define YYDPRINTF(Args) \
994 # define YYDSYMPRINT(Args) \
1000 # define YYDSYMPRINTF(Title, Token, Value, Location) \
1004 YYFPRINTF (stderr, "%s ", Title); \
1005 yysymprint (stderr, \
1007 YYFPRINTF (stderr, "\n"); \
1011 /*------------------------------------------------------------------.
1012 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1014 `------------------------------------------------------------------*/
1016 #if defined (__STDC__) || defined (__cplusplus)
1018 yy_stack_print (short *bottom, short *top)
1021 yy_stack_print (bottom, top)
1026 YYFPRINTF (stderr, "Stack now");
1027 for (/* Nothing. */; bottom <= top; ++bottom)
1028 YYFPRINTF (stderr, " %d", *bottom);
1029 YYFPRINTF (stderr, "\n");
1032 # define YY_STACK_PRINT(Bottom, Top) \
1035 yy_stack_print ((Bottom), (Top)); \
1039 /*------------------------------------------------.
1040 | Report that the YYRULE is going to be reduced. |
1041 `------------------------------------------------*/
1043 #if defined (__STDC__) || defined (__cplusplus)
1045 yy_reduce_print (int yyrule)
1048 yy_reduce_print (yyrule)
1053 unsigned int yylineno = yyrline[yyrule];
1054 YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
1055 yyrule - 1, yylineno);
1056 /* Print the symbols being reduced, and their result. */
1057 for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
1058 YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
1059 YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
1062 # define YY_REDUCE_PRINT(Rule) \
1065 yy_reduce_print (Rule); \
1068 /* Nonzero means print parse trace. It is left uninitialized so that
1069 multiple parsers can coexist. */
1071 #else /* !YYDEBUG */
1072 # define YYDPRINTF(Args)
1073 # define YYDSYMPRINT(Args)
1074 # define YYDSYMPRINTF(Title, Token, Value, Location)
1075 # define YY_STACK_PRINT(Bottom, Top)
1076 # define YY_REDUCE_PRINT(Rule)
1077 #endif /* !YYDEBUG */
1080 /* YYINITDEPTH -- initial size of the parser's stacks. */
1082 # define YYINITDEPTH 200
1085 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1086 if the built-in stack extension method is used).
1088 Do not make this value too large; the results are undefined if
1089 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
1090 evaluated with infinite-precision integer arithmetic. */
1097 # define YYMAXDEPTH 10000
1105 # if defined (__GLIBC__) && defined (_STRING_H)
1106 # define yystrlen strlen
1108 /* Return the length of YYSTR. */
1110 # if defined (__STDC__) || defined (__cplusplus)
1111 yystrlen (const char *yystr)
1117 register const char *yys = yystr;
1119 while (*yys++ != '\0')
1122 return yys - yystr - 1;
1128 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
1129 # define yystpcpy stpcpy
1131 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1134 # if defined (__STDC__) || defined (__cplusplus)
1135 yystpcpy (char *yydest, const char *yysrc)
1137 yystpcpy (yydest, yysrc)
1142 register char *yyd = yydest;
1143 register const char *yys = yysrc;
1145 while ((*yyd++ = *yys++) != '\0')
1153 #endif /* !YYERROR_VERBOSE */
1158 /*--------------------------------.
1159 | Print this symbol on YYOUTPUT. |
1160 `--------------------------------*/
1162 #if defined (__STDC__) || defined (__cplusplus)
1164 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
1167 yysymprint (yyoutput, yytype, yyvaluep)
1173 /* Pacify ``unused variable'' warnings. */
1176 if (yytype < YYNTOKENS)
1178 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1180 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1184 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1191 YYFPRINTF (yyoutput, ")");
1194 #endif /* ! YYDEBUG */
1195 /*-----------------------------------------------.
1196 | Release the memory associated to this symbol. |
1197 `-----------------------------------------------*/
1199 #if defined (__STDC__) || defined (__cplusplus)
1201 yydestruct (int yytype, YYSTYPE *yyvaluep)
1204 yydestruct (yytype, yyvaluep)
1209 /* Pacify ``unused variable'' warnings. */
1221 /* Prevent warnings from -Wmissing-prototypes. */
1223 #ifdef YYPARSE_PARAM
1224 # if defined (__STDC__) || defined (__cplusplus)
1225 int yyparse (void *YYPARSE_PARAM);
1229 #else /* ! YYPARSE_PARAM */
1230 #if defined (__STDC__) || defined (__cplusplus)
1235 #endif /* ! YYPARSE_PARAM */
1239 /* The lookahead symbol. */
1242 /* The semantic value of the lookahead symbol. */
1245 /* Number of syntax errors so far. */
1254 #ifdef YYPARSE_PARAM
1255 # if defined (__STDC__) || defined (__cplusplus)
1256 int yyparse (void *YYPARSE_PARAM)
1258 int yyparse (YYPARSE_PARAM)
1259 void *YYPARSE_PARAM;
1261 #else /* ! YYPARSE_PARAM */
1262 #if defined (__STDC__) || defined (__cplusplus)
1273 register int yystate;
1276 /* Number of tokens to shift before error messages enabled. */
1278 /* Lookahead token as an internal (translated) token number. */
1281 /* Three stacks and their tools:
1282 `yyss': related to states,
1283 `yyvs': related to semantic values,
1284 `yyls': related to locations.
1286 Refer to the stacks thru separate pointers, to allow yyoverflow
1287 to xreallocate them elsewhere. */
1289 /* The state stack. */
1290 short yyssa[YYINITDEPTH];
1291 short *yyss = yyssa;
1292 register short *yyssp;
1294 /* The semantic value stack. */
1295 YYSTYPE yyvsa[YYINITDEPTH];
1296 YYSTYPE *yyvs = yyvsa;
1297 register YYSTYPE *yyvsp;
1301 #define YYPOPSTACK (yyvsp--, yyssp--)
1303 YYSIZE_T yystacksize = YYINITDEPTH;
1305 /* The variables used to return semantic value and location from the
1310 /* When reducing, the number of symbols on the RHS of the reduced
1314 YYDPRINTF ((stderr, "Starting parse\n"));
1319 yychar = YYEMPTY; /* Cause a token to be read. */
1321 /* Initialize stack pointers.
1322 Waste one element of value and location stack
1323 so that they stay on the same level as the state stack.
1324 The wasted elements are never initialized. */
1331 /*------------------------------------------------------------.
1332 | yynewstate -- Push a new state, which is found in yystate. |
1333 `------------------------------------------------------------*/
1335 /* In all cases, when you get here, the value and location stacks
1336 have just been pushed. so pushing a state here evens the stacks.
1343 if (yyss + yystacksize - 1 <= yyssp)
1345 /* Get the current used size of the three stacks, in elements. */
1346 YYSIZE_T yysize = yyssp - yyss + 1;
1350 /* Give user a chance to xreallocate the stack. Use copies of
1351 these so that the &'s don't force the real ones into
1353 YYSTYPE *yyvs1 = yyvs;
1354 short *yyss1 = yyss;
1357 /* Each stack pointer address is followed by the size of the
1358 data in use in that stack, in bytes. This used to be a
1359 conditional around just the two extra args, but that might
1360 be undefined if yyoverflow is a macro. */
1361 yyoverflow ("parser stack overflow",
1362 &yyss1, yysize * sizeof (*yyssp),
1363 &yyvs1, yysize * sizeof (*yyvsp),
1370 #else /* no yyoverflow */
1371 # ifndef YYSTACK_RELOCATE
1374 /* Extend the stack our own way. */
1375 if (YYMAXDEPTH <= yystacksize)
1378 if (YYMAXDEPTH < yystacksize)
1379 yystacksize = YYMAXDEPTH;
1382 short *yyss1 = yyss;
1383 union yyalloc *yyptr =
1384 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1387 YYSTACK_RELOCATE (yyss);
1388 YYSTACK_RELOCATE (yyvs);
1390 # undef YYSTACK_RELOCATE
1392 YYSTACK_FREE (yyss1);
1395 #endif /* no yyoverflow */
1397 yyssp = yyss + yysize - 1;
1398 yyvsp = yyvs + yysize - 1;
1401 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1402 (unsigned long int) yystacksize));
1404 if (yyss + yystacksize - 1 <= yyssp)
1408 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1417 /* Do appropriate processing given the current state. */
1418 /* Read a lookahead token if we need one and don't already have one. */
1421 /* First try to decide what to do without reference to lookahead token. */
1423 yyn = yypact[yystate];
1424 if (yyn == YYPACT_NINF)
1427 /* Not known => get a lookahead token if don't already have one. */
1429 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1430 if (yychar == YYEMPTY)
1432 YYDPRINTF ((stderr, "Reading a token: "));
1436 if (yychar <= YYEOF)
1438 yychar = yytoken = YYEOF;
1439 YYDPRINTF ((stderr, "Now at end of input.\n"));
1443 yytoken = YYTRANSLATE (yychar);
1444 YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
1447 /* If the proper action on seeing token YYTOKEN is to reduce or to
1448 detect an error, take that action. */
1450 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1455 if (yyn == 0 || yyn == YYTABLE_NINF)
1464 /* Shift the lookahead token. */
1465 YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
1467 /* Discard the token being shifted unless it is eof. */
1468 if (yychar != YYEOF)
1474 /* Count tokens shifted since error; after three, turn off error
1483 /*-----------------------------------------------------------.
1484 | yydefault -- do the default action for the current state. |
1485 `-----------------------------------------------------------*/
1487 yyn = yydefact[yystate];
1493 /*-----------------------------.
1494 | yyreduce -- Do a reduction. |
1495 `-----------------------------*/
1497 /* yyn is the number of a rule to reduce with. */
1500 /* If YYLEN is nonzero, implement the default value of the action:
1503 Otherwise, the following line sets YYVAL to garbage.
1504 This behavior is undocumented and Bison
1505 users should not rely upon it. Assigning to YYVAL
1506 unconditionally makes the parser a bit smaller, and it avoids a
1507 GCC warning that YYVAL may be used uninitialized. */
1508 yyval = yyvsp[1-yylen];
1511 YY_REDUCE_PRINT (yyn);
1515 #line 209 "ada-exp.y"
1516 { write_exp_elt_opcode (OP_TYPE);
1517 write_exp_elt_type (yyvsp[0].tval);
1518 write_exp_elt_opcode (OP_TYPE); }
1522 #line 217 "ada-exp.y"
1523 { write_exp_elt_opcode (BINOP_COMMA); }
1527 #line 222 "ada-exp.y"
1528 { write_exp_elt_opcode (UNOP_IND); }
1532 #line 226 "ada-exp.y"
1533 { write_exp_elt_opcode (STRUCTOP_STRUCT);
1534 write_exp_string (yyvsp[0].ssym.stoken);
1535 write_exp_elt_opcode (STRUCTOP_STRUCT);
1540 #line 233 "ada-exp.y"
1542 write_exp_elt_opcode (OP_FUNCALL);
1543 write_exp_elt_longcst (yyvsp[-1].lval);
1544 write_exp_elt_opcode (OP_FUNCALL);
1549 #line 241 "ada-exp.y"
1551 write_exp_elt_opcode (UNOP_CAST);
1552 write_exp_elt_type (yyvsp[-3].tval);
1553 write_exp_elt_opcode (UNOP_CAST);
1558 #line 248 "ada-exp.y"
1559 { type_qualifier = yyvsp[-2].tval; }
1563 #line 249 "ada-exp.y"
1565 /* write_exp_elt_opcode (UNOP_QUAL); */
1566 /* FIXME: UNOP_QUAL should be defined in expression.h */
1567 write_exp_elt_type (yyvsp[-6].tval);
1568 /* write_exp_elt_opcode (UNOP_QUAL); */
1569 /* FIXME: UNOP_QUAL should be defined in expression.h */
1570 type_qualifier = yyvsp[-4].tval;
1575 #line 259 "ada-exp.y"
1576 { yyval.tval = type_qualifier; }
1580 #line 264 "ada-exp.y"
1581 { write_exp_elt_opcode (TERNOP_SLICE); }
1585 #line 267 "ada-exp.y"
1590 #line 274 "ada-exp.y"
1591 { write_exp_elt_opcode (OP_REGISTER);
1592 write_exp_elt_longcst ((LONGEST) yyvsp[0].lval);
1593 write_exp_elt_opcode (OP_REGISTER);
1598 #line 281 "ada-exp.y"
1599 { write_exp_elt_opcode (OP_INTERNALVAR);
1600 write_exp_elt_intern (yyvsp[0].ivar);
1601 write_exp_elt_opcode (OP_INTERNALVAR);
1606 #line 292 "ada-exp.y"
1607 { write_exp_elt_opcode (OP_LAST);
1608 write_exp_elt_longcst ((LONGEST) yyvsp[0].lval);
1609 write_exp_elt_opcode (OP_LAST);
1614 #line 299 "ada-exp.y"
1615 { write_exp_elt_opcode (BINOP_ASSIGN); }
1619 #line 303 "ada-exp.y"
1620 { write_exp_elt_opcode (UNOP_NEG); }
1624 #line 307 "ada-exp.y"
1625 { write_exp_elt_opcode (UNOP_PLUS); }
1629 #line 311 "ada-exp.y"
1630 { write_exp_elt_opcode (UNOP_LOGICAL_NOT); }
1634 #line 315 "ada-exp.y"
1635 { write_exp_elt_opcode (UNOP_ABS); }
1639 #line 318 "ada-exp.y"
1644 #line 322 "ada-exp.y"
1649 #line 324 "ada-exp.y"
1654 #line 326 "ada-exp.y"
1655 { yyval.lval = yyvsp[-2].lval + 1; }
1659 #line 328 "ada-exp.y"
1660 { yyval.lval = yyvsp[-4].lval + 1; }
1664 #line 333 "ada-exp.y"
1665 { write_exp_elt_opcode (UNOP_MEMVAL);
1666 write_exp_elt_type (yyvsp[-2].tval);
1667 write_exp_elt_opcode (UNOP_MEMVAL);
1672 #line 342 "ada-exp.y"
1673 { write_exp_elt_opcode (BINOP_EXP); }
1677 #line 346 "ada-exp.y"
1678 { write_exp_elt_opcode (BINOP_MUL); }
1682 #line 350 "ada-exp.y"
1683 { write_exp_elt_opcode (BINOP_DIV); }
1687 #line 354 "ada-exp.y"
1688 { write_exp_elt_opcode (BINOP_REM); }
1692 #line 358 "ada-exp.y"
1693 { write_exp_elt_opcode (BINOP_MOD); }
1697 #line 362 "ada-exp.y"
1698 { write_exp_elt_opcode (BINOP_REPEAT); }
1702 #line 366 "ada-exp.y"
1703 { write_exp_elt_opcode (BINOP_ADD); }
1707 #line 370 "ada-exp.y"
1708 { write_exp_elt_opcode (BINOP_CONCAT); }
1712 #line 374 "ada-exp.y"
1713 { write_exp_elt_opcode (BINOP_SUB); }
1717 #line 378 "ada-exp.y"
1718 { write_exp_elt_opcode (BINOP_EQUAL); }
1722 #line 382 "ada-exp.y"
1723 { write_exp_elt_opcode (BINOP_NOTEQUAL); }
1727 #line 386 "ada-exp.y"
1728 { write_exp_elt_opcode (BINOP_LEQ); }
1732 #line 390 "ada-exp.y"
1733 { /*write_exp_elt_opcode (TERNOP_MBR); */ }
1737 #line 394 "ada-exp.y"
1738 { /*write_exp_elt_opcode (BINOP_MBR); */
1739 /* FIXME: BINOP_MBR should be defined in expression.h */
1740 write_exp_elt_longcst ((LONGEST) yyvsp[0].lval);
1741 /*write_exp_elt_opcode (BINOP_MBR); */
1746 #line 400 "ada-exp.y"
1747 { /*write_exp_elt_opcode (UNOP_MBR); */
1748 /* FIXME: UNOP_QUAL should be defined in expression.h */
1749 write_exp_elt_type (yyvsp[0].tval);
1750 /* write_exp_elt_opcode (UNOP_MBR); */
1751 /* FIXME: UNOP_MBR should be defined in expression.h */
1756 #line 407 "ada-exp.y"
1757 { /*write_exp_elt_opcode (TERNOP_MBR); */
1758 /* FIXME: TERNOP_MBR should be defined in expression.h */
1759 write_exp_elt_opcode (UNOP_LOGICAL_NOT);
1764 #line 412 "ada-exp.y"
1765 { /* write_exp_elt_opcode (BINOP_MBR); */
1766 /* FIXME: BINOP_MBR should be defined in expression.h */
1767 write_exp_elt_longcst ((LONGEST) yyvsp[0].lval);
1768 /*write_exp_elt_opcode (BINOP_MBR);*/
1769 /* FIXME: BINOP_MBR should be defined in expression.h */
1770 write_exp_elt_opcode (UNOP_LOGICAL_NOT);
1775 #line 420 "ada-exp.y"
1776 { /*write_exp_elt_opcode (UNOP_MBR);*/
1777 /* FIXME: UNOP_MBR should be defined in expression.h */
1778 write_exp_elt_type (yyvsp[0].tval);
1779 /* write_exp_elt_opcode (UNOP_MBR);*/
1780 /* FIXME: UNOP_MBR should be defined in expression.h */
1781 write_exp_elt_opcode (UNOP_LOGICAL_NOT);
1786 #line 430 "ada-exp.y"
1787 { write_exp_elt_opcode (BINOP_GEQ); }
1791 #line 434 "ada-exp.y"
1792 { write_exp_elt_opcode (BINOP_LESS); }
1796 #line 438 "ada-exp.y"
1797 { write_exp_elt_opcode (BINOP_GTR); }
1801 #line 442 "ada-exp.y"
1802 { write_exp_elt_opcode (BINOP_BITWISE_AND); }
1806 #line 446 "ada-exp.y"
1807 { write_exp_elt_opcode (BINOP_LOGICAL_AND); }
1811 #line 450 "ada-exp.y"
1812 { write_exp_elt_opcode (BINOP_BITWISE_IOR); }
1816 #line 454 "ada-exp.y"
1817 { write_exp_elt_opcode (BINOP_LOGICAL_OR); }
1821 #line 458 "ada-exp.y"
1822 { write_exp_elt_opcode (BINOP_BITWISE_XOR); }
1826 #line 462 "ada-exp.y"
1827 { write_exp_elt_opcode (UNOP_ADDR); }
1831 #line 464 "ada-exp.y"
1832 { write_exp_elt_opcode (UNOP_ADDR);
1833 write_exp_elt_opcode (UNOP_CAST);
1834 write_exp_elt_type (builtin_type_ada_system_address);
1835 write_exp_elt_opcode (UNOP_CAST);
1840 #line 470 "ada-exp.y"
1841 { write_attribute_call1 (ATR_FIRST, yyvsp[0].lval); }
1845 #line 472 "ada-exp.y"
1846 { write_attribute_call1 (ATR_LAST, yyvsp[0].lval); }
1850 #line 474 "ada-exp.y"
1851 { write_attribute_call1 (ATR_LENGTH, yyvsp[0].lval); }
1855 #line 476 "ada-exp.y"
1856 { write_attribute_call0 (ATR_SIZE); }
1860 #line 478 "ada-exp.y"
1861 { write_attribute_call0 (ATR_TAG); }
1865 #line 480 "ada-exp.y"
1866 { write_attribute_calln (ATR_MIN, 2); }
1870 #line 482 "ada-exp.y"
1871 { write_attribute_calln (ATR_MAX, 2); }
1875 #line 484 "ada-exp.y"
1876 { write_attribute_calln (ATR_POS, 1); }
1880 #line 486 "ada-exp.y"
1881 { write_attribute_call1 (ATR_FIRST, yyvsp[0].lval); }
1885 #line 488 "ada-exp.y"
1886 { write_attribute_call1 (ATR_LAST, yyvsp[0].lval); }
1890 #line 490 "ada-exp.y"
1891 { write_attribute_call1 (ATR_LENGTH, yyvsp[0].lval); }
1895 #line 492 "ada-exp.y"
1896 { write_attribute_calln (ATR_VAL, 1); }
1900 #line 494 "ada-exp.y"
1901 { write_attribute_call0 (ATR_MODULUS); }
1905 #line 498 "ada-exp.y"
1910 #line 500 "ada-exp.y"
1911 { yyval.lval = yyvsp[-1].typed_val.val; }
1915 #line 505 "ada-exp.y"
1916 { write_exp_elt_opcode (OP_TYPE);
1917 write_exp_elt_type (yyvsp[0].tval);
1918 write_exp_elt_opcode (OP_TYPE); }
1922 #line 513 "ada-exp.y"
1923 { write_exp_elt_opcode (OP_TYPE);
1924 write_exp_elt_type (builtin_type_void);
1925 write_exp_elt_opcode (OP_TYPE); }
1929 #line 520 "ada-exp.y"
1930 { write_exp_elt_opcode (OP_LONG);
1931 write_exp_elt_type (yyvsp[0].typed_val.type);
1932 write_exp_elt_longcst ((LONGEST)(yyvsp[0].typed_val.val));
1933 write_exp_elt_opcode (OP_LONG);
1938 #line 528 "ada-exp.y"
1939 { write_exp_elt_opcode (OP_LONG);
1940 if (type_qualifier == NULL)
1941 write_exp_elt_type (yyvsp[0].typed_val.type);
1943 write_exp_elt_type (type_qualifier);
1944 write_exp_elt_longcst
1945 (convert_char_literal (type_qualifier, yyvsp[0].typed_val.val));
1946 write_exp_elt_opcode (OP_LONG);
1951 #line 540 "ada-exp.y"
1952 { write_exp_elt_opcode (OP_DOUBLE);
1953 write_exp_elt_type (yyvsp[0].typed_val_float.type);
1954 write_exp_elt_dblcst (yyvsp[0].typed_val_float.dval);
1955 write_exp_elt_opcode (OP_DOUBLE);
1960 #line 548 "ada-exp.y"
1961 { write_exp_elt_opcode (OP_LONG);
1962 write_exp_elt_type (builtin_type_int);
1963 write_exp_elt_longcst ((LONGEST)(0));
1964 write_exp_elt_opcode (OP_LONG);
1969 #line 556 "ada-exp.y"
1970 { /* Ada strings are converted into array constants
1971 a lower bound of 1. Thus, the array upper bound
1972 is the string length. */
1973 char *sp = yyvsp[0].sval.ptr; int count;
1974 if (yyvsp[0].sval.length == 0)
1975 { /* One dummy character for the type */
1976 write_exp_elt_opcode (OP_LONG);
1977 write_exp_elt_type (builtin_type_ada_char);
1978 write_exp_elt_longcst ((LONGEST)(0));
1979 write_exp_elt_opcode (OP_LONG);
1981 for (count = yyvsp[0].sval.length; count > 0; count -= 1)
1983 write_exp_elt_opcode (OP_LONG);
1984 write_exp_elt_type (builtin_type_ada_char);
1985 write_exp_elt_longcst ((LONGEST)(*sp));
1987 write_exp_elt_opcode (OP_LONG);
1989 write_exp_elt_opcode (OP_ARRAY);
1990 write_exp_elt_longcst ((LONGEST) 1);
1991 write_exp_elt_longcst ((LONGEST) (yyvsp[0].sval.length));
1992 write_exp_elt_opcode (OP_ARRAY);
1997 #line 583 "ada-exp.y"
1998 { error ("NEW not implemented."); }
2002 #line 586 "ada-exp.y"
2003 { write_var_from_name (NULL, yyvsp[0].ssym); }
2007 #line 588 "ada-exp.y"
2008 { write_var_from_name (yyvsp[-1].bval, yyvsp[0].ssym); }
2012 #line 589 "ada-exp.y"
2013 { write_object_renaming (NULL, yyvsp[0].ssym.sym); }
2017 #line 591 "ada-exp.y"
2018 { write_object_renaming (yyvsp[-1].bval, yyvsp[0].ssym.sym); }
2022 #line 594 "ada-exp.y"
2027 #line 595 "ada-exp.y"
2032 #line 596 "ada-exp.y"
2037 #line 600 "ada-exp.y"
2038 { yyval.bval = yyvsp[0].bval; }
2042 #line 602 "ada-exp.y"
2043 { yyval.bval = yyvsp[0].bval; }
2047 #line 606 "ada-exp.y"
2048 { yyval.tval = yyvsp[0].tval; }
2052 #line 607 "ada-exp.y"
2053 { yyval.tval = yyvsp[0].tval; }
2057 #line 609 "ada-exp.y"
2058 { yyval.tval = lookup_pointer_type (yyvsp[-1].tval); }
2062 #line 611 "ada-exp.y"
2063 { yyval.tval = lookup_pointer_type (yyvsp[-1].tval); }
2067 #line 618 "ada-exp.y"
2068 { write_exp_elt_opcode (UNOP_IND); }
2072 #line 620 "ada-exp.y"
2073 { write_exp_elt_opcode (UNOP_ADDR); }
2077 #line 622 "ada-exp.y"
2078 { write_exp_elt_opcode (BINOP_SUBSCRIPT); }
2084 /* Line 991 of yacc.c. */
2090 YY_STACK_PRINT (yyss, yyssp);
2095 /* Now `shift' the result of the reduction. Determine what state
2096 that goes to, based on the state we popped back to and the rule
2097 number reduced by. */
2101 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2102 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2103 yystate = yytable[yystate];
2105 yystate = yydefgoto[yyn - YYNTOKENS];
2110 /*------------------------------------.
2111 | yyerrlab -- here on detecting error |
2112 `------------------------------------*/
2114 /* If not already recovering from an error, report this error. */
2119 yyn = yypact[yystate];
2121 if (YYPACT_NINF < yyn && yyn < YYLAST)
2123 YYSIZE_T yysize = 0;
2124 int yytype = YYTRANSLATE (yychar);
2129 /* Start YYX at -YYN if negative to avoid negative indexes in
2131 for (yyx = yyn < 0 ? -yyn : 0;
2132 yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
2133 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
2134 yysize += yystrlen (yytname[yyx]) + 15, yycount++;
2135 yysize += yystrlen ("syntax error, unexpected ") + 1;
2136 yysize += yystrlen (yytname[yytype]);
2137 yymsg = (char *) YYSTACK_ALLOC (yysize);
2140 char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
2141 yyp = yystpcpy (yyp, yytname[yytype]);
2146 for (yyx = yyn < 0 ? -yyn : 0;
2147 yyx < (int) (sizeof (yytname) / sizeof (char *));
2149 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
2151 const char *yyq = ! yycount ? ", expecting " : " or ";
2152 yyp = yystpcpy (yyp, yyq);
2153 yyp = yystpcpy (yyp, yytname[yyx]);
2158 YYSTACK_FREE (yymsg);
2161 yyerror ("syntax error; also virtual memory exhausted");
2164 #endif /* YYERROR_VERBOSE */
2165 yyerror ("syntax error");
2170 if (yyerrstatus == 3)
2172 /* If just tried and failed to reuse lookahead token after an
2173 error, discard it. */
2175 /* Return failure if at end of input. */
2176 if (yychar == YYEOF)
2178 /* Pop the error token. */
2180 /* Pop the rest of the stack. */
2181 while (yyss < yyssp)
2183 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
2184 yydestruct (yystos[*yyssp], yyvsp);
2190 YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
2191 yydestruct (yytoken, &yylval);
2196 /* Else will try to reuse lookahead token after shifting the error
2201 /*----------------------------------------------------.
2202 | yyerrlab1 -- error raised explicitly by an action. |
2203 `----------------------------------------------------*/
2206 /* Suppress GCC warning that yyerrlab1 is unused when no action
2207 invokes YYERROR. Doesn't work in C++ */
2209 #if defined (__GNUC_MINOR__) && 2093 <= (__GNUC__ * 1000 + __GNUC_MINOR__)
2210 __attribute__ ((__unused__))
2218 /*---------------------------------------------------------------.
2219 | yyerrlab2 -- pop states until the error token can be shifted. |
2220 `---------------------------------------------------------------*/
2222 yyerrstatus = 3; /* Each real token shifted decrements this. */
2226 yyn = yypact[yystate];
2227 if (yyn != YYPACT_NINF)
2230 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2238 /* Pop the current state because it cannot handle the error token. */
2242 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
2243 yydestruct (yystos[yystate], yyvsp);
2247 YY_STACK_PRINT (yyss, yyssp);
2253 YYDPRINTF ((stderr, "Shifting error token, "));
2262 /*-------------------------------------.
2263 | yyacceptlab -- YYACCEPT comes here. |
2264 `-------------------------------------*/
2269 /*-----------------------------------.
2270 | yyabortlab -- YYABORT comes here. |
2271 `-----------------------------------*/
2277 /*----------------------------------------------.
2278 | yyoverflowlab -- parser overflow comes here. |
2279 `----------------------------------------------*/
2281 yyerror ("parser stack overflow");
2289 YYSTACK_FREE (yyss);
2295 #line 625 "ada-exp.y"
2298 /* yylex defined in ada-lex.c: Reads one token, getting characters */
2299 /* through lexptr. */
2301 /* Remap normal flex interface names (yylex) as well as gratuitiously */
2302 /* global symbol names, so we can have multiple flex-generated parsers */
2305 /* (See note above on previous definitions for YACC.) */
2307 #define yy_create_buffer ada_yy_create_buffer
2308 #define yy_delete_buffer ada_yy_delete_buffer
2309 #define yy_init_buffer ada_yy_init_buffer
2310 #define yy_load_buffer_state ada_yy_load_buffer_state
2311 #define yy_switch_to_buffer ada_yy_switch_to_buffer
2312 #define yyrestart ada_yyrestart
2313 #define yytext ada_yytext
2314 #define yywrap ada_yywrap
2316 /* The following kludge was found necessary to prevent conflicts between */
2317 /* defs.h and non-standard stdlib.h files. */
2318 #define qsort __qsort__dummy
2319 #include "ada-lex.c"
2324 lexer_init (yyin); /* (Re-)initialize lexer. */
2325 left_block_context = NULL;
2326 type_qualifier = NULL;
2328 return _ada_parse ();
2335 error ("A %s in expression, near `%s'.", (msg ? msg : "error"), lexptr);
2338 /* The operator name corresponding to operator symbol STRING (adds
2339 quotes and maps to lower-case). Destroys the previous contents of
2340 the array pointed to by STRING.ptr. Error if STRING does not match
2341 a valid Ada operator. Assumes that STRING.ptr points to a
2342 null-terminated string and that, if STRING is a valid operator
2343 symbol, the array pointed to by STRING.ptr contains at least
2344 STRING.length+3 characters. */
2346 static struct stoken
2347 string_to_operator (string)
2348 struct stoken string;
2352 for (i = 0; ada_opname_table[i].mangled != NULL; i += 1)
2354 if (string.length == strlen (ada_opname_table[i].demangled)-2
2355 && strncasecmp (string.ptr, ada_opname_table[i].demangled+1,
2356 string.length) == 0)
2358 strncpy (string.ptr, ada_opname_table[i].demangled,
2364 error ("Invalid operator symbol `%s'", string.ptr);
2367 /* Emit expression to access an instance of SYM, in block BLOCK (if
2368 * non-NULL), and with :: qualification ORIG_LEFT_CONTEXT. */
2370 write_var_from_sym (orig_left_context, block, sym)
2371 struct block* orig_left_context;
2372 struct block* block;
2375 if (orig_left_context == NULL && symbol_read_needs_frame (sym))
2377 if (innermost_block == 0 ||
2378 contained_in (block, innermost_block))
2379 innermost_block = block;
2382 write_exp_elt_opcode (OP_VAR_VALUE);
2383 /* We want to use the selected frame, not another more inner frame
2384 which happens to be in the same block */
2385 write_exp_elt_block (NULL);
2386 write_exp_elt_sym (sym);
2387 write_exp_elt_opcode (OP_VAR_VALUE);
2390 /* Emit expression to access an instance of NAME. */
2392 write_var_from_name (orig_left_context, name)
2393 struct block* orig_left_context;
2394 struct name_info name;
2396 if (name.msym != NULL)
2398 write_exp_msymbol (name.msym,
2399 lookup_function_type (builtin_type_int),
2402 else if (name.sym == NULL)
2404 /* Multiple matches: record name and starting block for later
2405 resolution by ada_resolve. */
2406 /* write_exp_elt_opcode (OP_UNRESOLVED_VALUE); */
2407 /* FIXME: OP_UNRESOLVED_VALUE should be defined in expression.h */
2408 write_exp_elt_block (name.block);
2409 /* write_exp_elt_name (name.stoken.ptr); */
2410 /* FIXME: write_exp_elt_name should be defined in defs.h, located in parse.c */
2411 /* write_exp_elt_opcode (OP_UNRESOLVED_VALUE); */
2412 /* FIXME: OP_UNRESOLVED_VALUE should be defined in expression.h */
2415 write_var_from_sym (orig_left_context, name.block, name.sym);
2418 /* Write a call on parameterless attribute ATR. */
2421 write_attribute_call0 (atr)
2422 enum ada_attribute atr;
2424 /* write_exp_elt_opcode (OP_ATTRIBUTE); */
2425 /* FIXME: OP_ATTRIBUTE should be defined in expression.h */
2426 write_exp_elt_longcst ((LONGEST) 0);
2427 write_exp_elt_longcst ((LONGEST) atr);
2428 /* write_exp_elt_opcode (OP_ATTRIBUTE); */
2429 /* FIXME: OP_ATTRIBUTE should be defined in expression.h */
2432 /* Write a call on an attribute ATR with one constant integer
2436 write_attribute_call1 (atr, arg)
2437 enum ada_attribute atr;
2440 write_exp_elt_opcode (OP_LONG);
2441 write_exp_elt_type (builtin_type_int);
2442 write_exp_elt_longcst (arg);
2443 write_exp_elt_opcode (OP_LONG);
2444 /*write_exp_elt_opcode (OP_ATTRIBUTE);*/
2445 /* FIXME: OP_ATTRIBUTE should be defined in expression.h */
2446 write_exp_elt_longcst ((LONGEST) 1);
2447 write_exp_elt_longcst ((LONGEST) atr);
2448 /*write_exp_elt_opcode (OP_ATTRIBUTE);*/
2449 /* FIXME: OP_ATTRIBUTE should be defined in expression.h */
2452 /* Write a call on an attribute ATR with N parameters, whose code must have
2453 * been generated previously. */
2456 write_attribute_calln (atr, n)
2457 enum ada_attribute atr;
2460 /*write_exp_elt_opcode (OP_ATTRIBUTE);*/
2461 /* FIXME: OP_ATTRIBUTE should be defined in expression.h */
2462 write_exp_elt_longcst ((LONGEST) n);
2463 write_exp_elt_longcst ((LONGEST) atr);
2464 /* write_exp_elt_opcode (OP_ATTRIBUTE);*/
2465 /* FIXME: OP_ATTRIBUTE should be defined in expression.h */
2468 /* Emit expression corresponding to the renamed object designated by
2469 * the type RENAMING, which must be the referent of an object renaming
2470 * type, in the context of ORIG_LEFT_CONTEXT (?). */
2472 write_object_renaming (orig_left_context, renaming)
2473 struct block* orig_left_context;
2474 struct symbol* renaming;
2476 const char* qualification = DEPRECATED_SYMBOL_NAME (renaming);
2477 const char* simple_tail;
2478 const char* expr = TYPE_FIELD_NAME (SYMBOL_TYPE (renaming), 0);
2482 enum { SIMPLE_INDEX, LOWER_BOUND, UPPER_BOUND } slice_state;
2484 /* if orig_left_context is null, then use the currently selected
2485 block, otherwise we might fail our symbol lookup below */
2486 if (orig_left_context == NULL)
2487 orig_left_context = get_selected_block (NULL);
2489 for (simple_tail = qualification + strlen (qualification);
2490 simple_tail != qualification; simple_tail -= 1)
2492 if (*simple_tail == '.')
2497 else if (DEPRECATED_STREQN (simple_tail, "__", 2))
2504 suffix = strstr (expr, "___XE");
2508 name = (char*) xmalloc (suffix - expr + 1);
2509 /* add_name_string_cleanup (name); */
2510 /* FIXME: add_name_string_cleanup should be defined in
2511 parser-defs.h, implemented in parse.c */
2512 strncpy (name, expr, suffix-expr);
2513 name[suffix-expr] = '\000';
2514 sym = lookup_symbol (name, orig_left_context, VAR_DOMAIN, 0, NULL);
2516 error ("Could not find renamed variable: %s", ada_demangle (name));
2518 /* FIXME: ada_demangle should be defined in defs.h, implemented in ada-lang.c */
2519 write_var_from_sym (orig_left_context, block_found, sym);
2522 slice_state = SIMPLE_INDEX;
2523 while (*suffix == 'X')
2529 slice_state = LOWER_BOUND;
2532 if (isdigit (*suffix))
2535 long val = strtol (suffix, &next, 10);
2539 write_exp_elt_opcode (OP_LONG);
2540 write_exp_elt_type (builtin_type_ada_int);
2541 write_exp_elt_longcst ((LONGEST) val);
2542 write_exp_elt_opcode (OP_LONG);
2549 struct symbol* index_sym;
2551 end = strchr (suffix, 'X');
2553 end = suffix + strlen (suffix);
2555 index_len = simple_tail - qualification + 2 + (suffix - end) + 1;
2556 index_name = (char*) xmalloc (index_len);
2557 memset (index_name, '\000', index_len);
2558 /* add_name_string_cleanup (index_name);*/
2559 /* FIXME: add_name_string_cleanup should be defined in
2560 parser-defs.h, implemented in parse.c */
2561 strncpy (index_name, qualification, simple_tail - qualification);
2562 index_name[simple_tail - qualification] = '\000';
2563 strncat (index_name, suffix, suffix-end);
2567 lookup_symbol (index_name, NULL, VAR_DOMAIN, 0, NULL);
2568 if (index_sym == NULL)
2569 error ("Could not find %s", index_name);
2570 write_var_from_sym (NULL, block_found, sym);
2572 if (slice_state == SIMPLE_INDEX)
2574 write_exp_elt_opcode (OP_FUNCALL);
2575 write_exp_elt_longcst ((LONGEST) 1);
2576 write_exp_elt_opcode (OP_FUNCALL);
2578 else if (slice_state == LOWER_BOUND)
2579 slice_state = UPPER_BOUND;
2580 else if (slice_state == UPPER_BOUND)
2582 write_exp_elt_opcode (TERNOP_SLICE);
2583 slice_state = SIMPLE_INDEX;
2589 struct stoken field_name;
2593 if (slice_state != SIMPLE_INDEX)
2595 end = strchr (suffix, 'X');
2597 end = suffix + strlen (suffix);
2598 field_name.length = end - suffix;
2599 field_name.ptr = (char*) xmalloc (end - suffix + 1);
2600 strncpy (field_name.ptr, suffix, end - suffix);
2601 field_name.ptr[end - suffix] = '\000';
2603 write_exp_elt_opcode (STRUCTOP_STRUCT);
2604 write_exp_string (field_name);
2605 write_exp_elt_opcode (STRUCTOP_STRUCT);
2613 if (slice_state == SIMPLE_INDEX)
2617 error ("Internal error in encoding of renaming declaration: %s",
2618 DEPRECATED_SYMBOL_NAME (renaming));
2621 /* Convert the character literal whose ASCII value would be VAL to the
2622 appropriate value of type TYPE, if there is a translation.
2623 Otherwise return VAL. Hence, in an enumeration type ('A', 'B'),
2624 the literal 'A' (VAL == 65), returns 0. */
2626 convert_char_literal (struct type* type, LONGEST val)
2631 if (type == NULL || TYPE_CODE (type) != TYPE_CODE_ENUM)
2633 sprintf (name, "QU%02x", (int) val);
2634 for (f = 0; f < TYPE_NFIELDS (type); f += 1)
2636 if (DEPRECATED_STREQ (name, TYPE_FIELD_NAME (type, f)))
2637 return TYPE_FIELD_BITPOS (type, f);