47 #define YYBISON_VERSION "3.0.4" 50 #define YYSKELETON_NAME "yacc.c" 82 #define parse_type(ps) builtin_type (parse_gdbarch (ps)) 86 #define GDB_YY_REMAP_PREFIX go_ 96 static int yylex (
void);
103 # ifndef YY_NULLPTRPTR 104 # if defined __cplusplus && 201103L <= __cplusplus 105 # define YY_NULLPTRPTR nullptr 107 # define YY_NULLPTRPTR 0 112 #ifdef YYERROR_VERBOSE 113 # undef YYERROR_VERBOSE 114 # define YYERROR_VERBOSE 1 116 # define YYERROR_VERBOSE 0 180 #define RAW_STRING 260 186 #define NAME_OR_INT 266 187 #define TRUE_KEYWORD 267 188 #define FALSE_KEYWORD 268 189 #define STRUCT_KEYWORD 269 190 #define INTERFACE_KEYWORD 270 191 #define TYPE_KEYWORD 271 192 #define CHAN_KEYWORD 272 193 #define SIZEOF_KEYWORD 273 194 #define LEN_KEYWORD 274 195 #define CAP_KEYWORD 275 196 #define NEW_KEYWORD 276 197 #define IOTA_KEYWORD 277 198 #define NIL_KEYWORD 278 199 #define CONST_KEYWORD 279 200 #define DOTDOTDOT 280 203 #define BYTE_KEYWORD 283 204 #define DOLLAR_VARIABLE 284 205 #define ASSIGN_MODIFY 285 206 #define ABOVE_COMMA 286 217 #define INCREMENT 297 218 #define DECREMENT 298 219 #define LEFT_ARROW 299 222 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED 252 # define YYSTYPE_IS_TRIVIAL 1 253 # define YYSTYPE_IS_DECLARED 1 268 const char *,
int,
int,
YYSTYPE *);
301 # ifdef __SIZE_TYPE__ 302 # define YYSIZE_T __SIZE_TYPE__ 303 # elif defined size_t 304 # define YYSIZE_T size_t 305 # elif ! defined YYSIZE_T 307 # define YYSIZE_T size_t 309 # define YYSIZE_T unsigned int 313 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) 316 # if defined YYENABLE_NLS && YYENABLE_NLS 318 # include <libintl.h> 319 # define YY_(Msgid) dgettext ("bison-runtime", Msgid) 323 # define YY_(Msgid) Msgid 328 # if (defined __GNUC__ \ 329 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ 330 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C 331 # define YY_ATTRIBUTE(Spec) __attribute__(Spec) 333 # define YY_ATTRIBUTE(Spec) 337 #ifndef YY_ATTRIBUTE_PURE 338 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) 341 #ifndef YY_ATTRIBUTE_UNUSED 342 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) 345 #if !defined _Noreturn \ 346 && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) 347 # if defined _MSC_VER && 1200 <= _MSC_VER 348 # define _Noreturn __declspec (noreturn) 350 # define _Noreturn YY_ATTRIBUTE ((__noreturn__)) 355 #if ! defined lint || defined __GNUC__ 356 # define YYUSE(E) ((void) (E)) 361 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ 363 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ 364 _Pragma ("GCC diagnostic push") \ 365 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ 366 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") 367 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ 368 _Pragma ("GCC diagnostic pop") 370 # define YY_INITIAL_VALUE(Value) Value 372 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 373 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 374 # define YY_IGNORE_MAYBE_UNINITIALIZED_END 376 #ifndef YY_INITIAL_VALUE 377 # define YY_INITIAL_VALUE(Value) 381 #if ! defined yyoverflow || YYERROR_VERBOSE 385 # ifdef YYSTACK_USE_ALLOCA 386 # if YYSTACK_USE_ALLOCA 388 # define YYSTACK_ALLOC __builtin_alloca 389 # elif defined __BUILTIN_VA_ARG_INCR 392 # define YYSTACK_ALLOC __alloca 393 # elif defined _MSC_VER 394 # define alloca _alloca 396 # define YYSTACK_ALLOC alloca 397 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS 400 # ifndef EXIT_SUCCESS 401 # define EXIT_SUCCESS 0 408 # ifdef YYSTACK_ALLOC 410 # define YYSTACK_FREE(Ptr) do { ; } while (0) 411 # ifndef YYSTACK_ALLOC_MAXIMUM 416 # define YYSTACK_ALLOC_MAXIMUM 4032 419 # define YYSTACK_ALLOC YYMALLOC 420 # define YYSTACK_FREE YYFREE 421 # ifndef YYSTACK_ALLOC_MAXIMUM 422 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM 424 # if (defined __cplusplus && ! defined EXIT_SUCCESS \ 425 && ! ((defined YYMALLOC || defined xmalloc) \ 426 && (defined YYFREE || defined xfree))) 428 # ifndef EXIT_SUCCESS 429 # define EXIT_SUCCESS 0 433 # define YYMALLOC xmalloc 434 # if ! defined xmalloc && ! defined EXIT_SUCCESS 439 # define YYFREE xfree 440 # if ! defined xfree && ! defined EXIT_SUCCESS 448 #if (! defined yyoverflow \ 449 && (! defined __cplusplus \ 450 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) 460 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) 464 # define YYSTACK_BYTES(N) \ 465 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ 466 + YYSTACK_GAP_MAXIMUM) 468 # define YYCOPY_NEEDED 1 475 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ 478 YYSIZE_T yynewbytes; \ 479 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ 480 Stack = &yyptr->Stack_alloc; \ 481 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ 482 yyptr += yynewbytes / sizeof (*yyptr); \ 488 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED 492 # if defined __GNUC__ && 1 < __GNUC__ 493 # define YYCOPY(Dst, Src, Count) \ 494 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) 496 # define YYCOPY(Dst, Src, Count) \ 500 for (yyi = 0; yyi < (Count); yyi++) \ 501 (Dst)[yyi] = (Src)[yyi]; \ 520 #define YYNSTATES 122 525 #define YYMAXUTOK 299 527 #define YYTRANSLATE(YYX) \ 528 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) 534 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
535 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
536 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
537 2, 2, 2, 62, 2, 2, 2, 54, 39, 2,
538 61, 64, 52, 50, 31, 51, 59, 53, 2, 2,
539 2, 2, 2, 2, 2, 2, 2, 2, 67, 2,
540 43, 33, 44, 34, 49, 2, 2, 2, 2, 2,
541 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
542 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
543 2, 60, 2, 63, 38, 2, 2, 2, 2, 2,
544 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
545 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
546 2, 2, 2, 65, 37, 66, 2, 2, 2, 2,
547 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
548 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
549 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
550 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
551 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
552 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
553 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
554 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
555 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
556 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
557 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
558 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
559 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
560 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
561 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
562 25, 26, 27, 28, 29, 30, 32, 35, 36, 40,
563 41, 42, 45, 46, 47, 48, 55, 56, 57, 58
570 0, 191, 191, 192, 195, 202, 203, 208, 212, 216,
571 220, 224, 228, 232, 236, 242, 248, 255, 265, 272,
572 269, 280, 284, 287, 291, 295, 299, 305, 311, 317,
573 321, 325, 329, 333, 337, 341, 345, 349, 353, 357,
574 361, 365, 369, 373, 377, 381, 385, 389, 393, 397,
575 401, 407, 414, 423, 436, 443, 446, 452, 467, 474,
576 491, 509, 521, 527, 533, 549, 601, 603, 610, 623
580 #if YYDEBUG || YYERROR_VERBOSE || 0 585 "$end",
"error",
"$undefined",
"INT",
"FLOAT",
"RAW_STRING",
"STRING",
586 "CHAR",
"NAME",
"TYPENAME",
"COMPLETE",
"NAME_OR_INT",
"TRUE_KEYWORD",
587 "FALSE_KEYWORD",
"STRUCT_KEYWORD",
"INTERFACE_KEYWORD",
"TYPE_KEYWORD",
588 "CHAN_KEYWORD",
"SIZEOF_KEYWORD",
"LEN_KEYWORD",
"CAP_KEYWORD",
589 "NEW_KEYWORD",
"IOTA_KEYWORD",
"NIL_KEYWORD",
"CONST_KEYWORD",
590 "DOTDOTDOT",
"ENTRY",
"ERROR",
"BYTE_KEYWORD",
"DOLLAR_VARIABLE",
591 "ASSIGN_MODIFY",
"','",
"ABOVE_COMMA",
"'='",
"'?'",
"OROR",
"ANDAND",
592 "'|'",
"'^'",
"'&'",
"ANDNOT",
"EQUAL",
"NOTEQUAL",
"'<'",
"'>'",
"LEQ",
593 "GEQ",
"LSH",
"RSH",
"'@'",
"'+'",
"'-'",
"'*'",
"'/'",
"'%'",
"UNARY",
594 "INCREMENT",
"DECREMENT",
"LEFT_ARROW",
"'.'",
"'['",
"'('",
"'!'",
595 "']'",
"')'",
"'{'",
"'}'",
"':'",
"$accept",
"start",
"type_exp",
596 "exp1",
"exp",
"$@1",
"lcurly",
"arglist",
"rcurly",
"string_exp",
606 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
607 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
608 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
609 285, 44, 286, 61, 63, 287, 288, 124, 94, 38,
610 289, 290, 291, 60, 62, 292, 293, 294, 295, 64,
611 43, 45, 42, 47, 37, 296, 297, 298, 299, 46,
612 91, 40, 33, 93, 41, 123, 125, 58
616 #define YYPACT_NINF -42 618 #define yypact_value_is_default(Yystate) \ 619 (!!((Yystate) == (-42))) 621 #define YYTABLE_NINF -1 623 #define yytable_value_is_error(Yytable_value) \ 630 49, -42, -42, -42, -42, -42, -42, -42, -42, -42,
631 -38, -42, -42, 49, 49, 49, 49, 49, 49, 49,
632 -42, 27, -42, 34, 187, 45, 16, -42, 11, 53,
633 49, -35, 11, -35, -35, -35, -35, 11, 38, -35,
634 -42, 49, 49, 49, 49, 49, 49, 49, 49, 49,
635 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
636 49, 49, 49, 49, -42, -42, -3, 49, -42, 45,
637 9, 74, 49, -42, 123, 10, -42, 187, 187, 187,
638 88, 241, 266, 290, 313, 334, 353, 353, 368, 368,
639 368, 368, -41, -41, 380, 390, 390, -35, -35, -35,
640 -42, 72, 33, 49, -42, -42, 49, -42, 155, -42,
641 -42, 49, -42, -42, 187, 39, -35, -42, 215, 49,
650 0, 51, 54, 59, 52, 69, 67, 53, 62, 63,
651 0, 68, 56, 0, 0, 0, 0, 0, 0, 0,
652 21, 0, 3, 2, 5, 0, 61, 55, 4, 65,
653 0, 12, 0, 8, 10, 9, 7, 66, 0, 11,
654 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
655 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
656 0, 0, 0, 0, 13, 14, 0, 0, 19, 0,
657 0, 0, 0, 64, 0, 0, 28, 6, 50, 49,
658 0, 47, 46, 45, 44, 43, 37, 38, 41, 42,
659 39, 40, 35, 36, 29, 33, 34, 30, 31, 32,
660 17, 15, 0, 22, 66, 25, 0, 60, 0, 58,
661 57, 0, 16, 18, 23, 0, 26, 27, 48, 0,
668 -42, -42, -42, -4, -13, -42, -42, -42, -42, -42,
675 -1, 21, 22, 23, 24, 103, 25, 115, 106, 26,
684 31, 33, 34, 35, 36, 5, 39, 100, 58, 59,
685 60, 61, 62, 63, 38, 64, 65, 74, 66, 67,
686 68, 64, 65, 30, 66, 67, 68, 40, 77, 78,
687 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
688 89, 90, 91, 92, 93, 94, 95, 96, 97, 98,
689 99, 28, 1, 2, 6, 3, 4, 5, 6, 108,
690 7, 8, 9, 102, 41, 41, 71, 10, 37, 41,
691 119, 72, 72, 11, 110, 105, 70, 11, 12, 73,
692 107, 75, 112, 101, 0, 0, 0, 13, 14, 0,
693 114, 0, 0, 116, 0, 0, 113, 69, 118, 15,
694 16, 17, 76, 120, 0, 0, 121, 0, 0, 0,
695 18, 19, 0, 0, 20, 0, 0, 0, 42, 0,
696 104, 43, 44, 45, 46, 47, 48, 49, 0, 50,
697 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
698 61, 62, 63, 0, 64, 65, 0, 66, 67, 68,
699 0, 0, 0, 42, 0, 111, 43, 44, 45, 46,
700 47, 48, 49, 0, 50, 51, 52, 53, 54, 55,
701 56, 57, 58, 59, 60, 61, 62, 63, 0, 64,
702 65, 0, 66, 67, 68, 42, 0, 109, 43, 44,
703 45, 46, 47, 48, 49, 0, 50, 51, 52, 53,
704 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
705 0, 64, 65, 0, 66, 67, 68, 42, 0, 117,
706 43, 44, 45, 46, 47, 48, 49, 0, 50, 51,
707 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
708 62, 63, 0, 64, 65, 0, 66, 67, 68, 44,
709 45, 46, 47, 48, 49, 0, 50, 51, 52, 53,
710 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
711 0, 64, 65, 0, 66, 67, 68, 46, 47, 48,
712 49, 0, 50, 51, 52, 53, 54, 55, 56, 57,
713 58, 59, 60, 61, 62, 63, 0, 64, 65, 0,
714 66, 67, 68, 47, 48, 49, 0, 50, 51, 52,
715 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
716 63, 0, 64, 65, 0, 66, 67, 68, 48, 49,
717 0, 50, 51, 52, 53, 54, 55, 56, 57, 58,
718 59, 60, 61, 62, 63, 0, 64, 65, 0, 66,
719 67, 68, 49, 0, 50, 51, 52, 53, 54, 55,
720 56, 57, 58, 59, 60, 61, 62, 63, 0, 64,
721 65, 0, 66, 67, 68, 50, 51, 52, 53, 54,
722 55, 56, 57, 58, 59, 60, 61, 62, 63, 0,
723 64, 65, 0, 66, 67, 68, 52, 53, 54, 55,
724 56, 57, 58, 59, 60, 61, 62, 63, 0, 64,
725 65, 0, 66, 67, 68, 56, 57, 58, 59, 60,
726 61, 62, 63, 0, 64, 65, 0, 66, 67, 68,
727 59, 60, 61, 62, 63, 0, 64, 65, 0, 66,
728 67, 68, 61, 62, 63, 0, 64, 65, 0, 66,
734 13, 14, 15, 16, 17, 8, 19, 10, 49, 50,
735 51, 52, 53, 54, 18, 56, 57, 30, 59, 60,
736 61, 56, 57, 61, 59, 60, 61, 0, 41, 42,
737 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
738 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
739 63, 0, 3, 4, 9, 6, 7, 8, 9, 72,
740 11, 12, 13, 67, 31, 31, 50, 18, 17, 31,
741 31, 61, 61, 28, 64, 66, 25, 28, 29, 26,
742 6, 30, 10, 66, -1, -1, -1, 38, 39, -1,
743 103, -1, -1, 106, -1, -1, 63, 52, 111, 50,
744 51, 52, 64, 64, -1, -1, 119, -1, -1, -1,
745 61, 62, -1, -1, 65, -1, -1, -1, 30, -1,
746 69, 33, 34, 35, 36, 37, 38, 39, -1, 41,
747 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
748 52, 53, 54, -1, 56, 57, -1, 59, 60, 61,
749 -1, -1, -1, 30, -1, 67, 33, 34, 35, 36,
750 37, 38, 39, -1, 41, 42, 43, 44, 45, 46,
751 47, 48, 49, 50, 51, 52, 53, 54, -1, 56,
752 57, -1, 59, 60, 61, 30, -1, 64, 33, 34,
753 35, 36, 37, 38, 39, -1, 41, 42, 43, 44,
754 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
755 -1, 56, 57, -1, 59, 60, 61, 30, -1, 64,
756 33, 34, 35, 36, 37, 38, 39, -1, 41, 42,
757 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
758 53, 54, -1, 56, 57, -1, 59, 60, 61, 34,
759 35, 36, 37, 38, 39, -1, 41, 42, 43, 44,
760 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
761 -1, 56, 57, -1, 59, 60, 61, 36, 37, 38,
762 39, -1, 41, 42, 43, 44, 45, 46, 47, 48,
763 49, 50, 51, 52, 53, 54, -1, 56, 57, -1,
764 59, 60, 61, 37, 38, 39, -1, 41, 42, 43,
765 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
766 54, -1, 56, 57, -1, 59, 60, 61, 38, 39,
767 -1, 41, 42, 43, 44, 45, 46, 47, 48, 49,
768 50, 51, 52, 53, 54, -1, 56, 57, -1, 59,
769 60, 61, 39, -1, 41, 42, 43, 44, 45, 46,
770 47, 48, 49, 50, 51, 52, 53, 54, -1, 56,
771 57, -1, 59, 60, 61, 41, 42, 43, 44, 45,
772 46, 47, 48, 49, 50, 51, 52, 53, 54, -1,
773 56, 57, -1, 59, 60, 61, 43, 44, 45, 46,
774 47, 48, 49, 50, 51, 52, 53, 54, -1, 56,
775 57, -1, 59, 60, 61, 47, 48, 49, 50, 51,
776 52, 53, 54, -1, 56, 57, -1, 59, 60, 61,
777 50, 51, 52, 53, 54, -1, 56, 57, -1, 59,
778 60, 61, 52, 53, 54, -1, 56, 57, -1, 59,
786 0, 3, 4, 6, 7, 8, 9, 11, 12, 13,
787 18, 28, 29, 38, 39, 50, 51, 52, 61, 62,
788 65, 69, 70, 71, 72, 74, 77, 78, 79, 80,
789 61, 72, 79, 72, 72, 72, 72, 79, 71, 72,
790 0, 31, 30, 33, 34, 35, 36, 37, 38, 39,
791 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
792 51, 52, 53, 54, 56, 57, 59, 60, 61, 52,
793 79, 50, 61, 26, 72, 79, 64, 72, 72, 72,
794 72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
795 72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
796 10, 80, 71, 73, 79, 66, 76, 6, 72, 64,
797 64, 67, 10, 63, 72, 75, 72, 64, 72, 31,
804 0, 68, 69, 69, 70, 71, 71, 72, 72, 72,
805 72, 72, 72, 72, 72, 72, 72, 72, 72, 73,
806 72, 74, 75, 75, 75, 76, 72, 72, 72, 72,
807 72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
808 72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
809 72, 72, 72, 72, 72, 72, 72, 72, 72, 77,
810 77, 72, 72, 72, 78, 78, 79, 79, 79, 80
816 0, 2, 1, 1, 1, 1, 3, 2, 2, 2,
817 2, 2, 2, 2, 2, 3, 4, 3, 4, 0,
818 5, 1, 0, 1, 3, 1, 4, 4, 3, 3,
819 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
820 3, 3, 3, 3, 3, 3, 3, 3, 5, 3,
821 3, 1, 1, 1, 1, 1, 1, 4, 4, 1,
822 3, 1, 1, 1, 2, 1, 2, 1, 1, 1
826 #define yyerrok (yyerrstatus = 0) 827 #define yyclearin (yychar = YYEMPTY) 831 #define YYACCEPT goto yyacceptlab 832 #define YYABORT goto yyabortlab 833 #define YYERROR goto yyerrorlab 836 #define YYRECOVERING() (!!yyerrstatus) 838 #define YYBACKUP(Token, Value) \ 840 if (yychar == YYEMPTY) \ 844 YYPOPSTACK (yylen); \ 850 yyerror (YY_("syntax error: cannot back up")); \ 857 #define YYERRCODE 256 866 # define YYFPRINTF fprintf 869 # define YYDPRINTF(Args) \ 876 #ifndef YY_LOCATION_PRINT 877 # define YY_LOCATION_PRINT(File, Loc) ((void) 0) 881 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ 885 YYFPRINTF (stderr, "%s ", Title); \ 886 yy_symbol_print (stderr, \ 888 YYFPRINTF (stderr, "\n"); \ 900 FILE *yyo = yyoutput;
935 for (; yybottom <= yytop; yybottom++)
937 int yybot = *yybottom;
943 # define YY_STACK_PRINT(Bottom, Top) \ 946 yy_stack_print ((Bottom), (Top)); \ 960 YYFPRINTF (stderr,
"Reducing stack by rule %d (line %lu):\n",
963 for (yyi = 0; yyi < yynrhs; yyi++)
968 &(
yyvsp[(yyi + 1) - (yynrhs)])
974 # define YY_REDUCE_PRINT(Rule) \ 977 yy_reduce_print (yyssp, yyvsp, Rule); \ 984 # define YYDPRINTF(Args) 985 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) 986 # define YY_STACK_PRINT(Bottom, Top) 987 # define YY_REDUCE_PRINT(Rule) 993 # define YYINITDEPTH 200 1004 # define YYMAXDEPTH 10000 1011 # if defined __GLIBC__ && defined _STRING_H 1012 # define yystrlen strlen 1016 yystrlen (
const char *yystr)
1027 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE 1028 # define yystpcpy stpcpy 1033 yystpcpy (
char *yydest,
const char *yysrc)
1036 const char *
yys = yysrc;
1038 while ((*yyd++ = *
yys++) !=
'\0')
1055 yytnamerr (
char *yyres,
const char *yystr)
1060 char const *yyp = yystr;
1067 goto do_not_strip_quotes;
1071 goto do_not_strip_quotes;
1084 do_not_strip_quotes: ;
1088 return yystrlen (yystr);
1090 return yystpcpy (yyres, yystr) - yyres;
1103 yysyntax_error (
YYSIZE_T *yymsg_alloc,
char **yymsg,
1108 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1112 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1143 yyarg[yycount++] =
yytname[yytoken];
1149 int yyxbegin = yyn < 0 ? -yyn : 0;
1151 int yychecklim =
YYLAST - yyn + 1;
1155 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1159 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1165 yyarg[yycount++] =
yytname[yyx];
1168 if (! (yysize <= yysize1
1179 # define YYCASE_(N, S) \ 1183 YYCASE_(0,
YY_(
"syntax error"));
1184 YYCASE_(1,
YY_(
"syntax error, unexpected %s"));
1185 YYCASE_(2,
YY_(
"syntax error, unexpected %s, expecting %s"));
1186 YYCASE_(3,
YY_(
"syntax error, unexpected %s, expecting %s or %s"));
1187 YYCASE_(4,
YY_(
"syntax error, unexpected %s, expecting %s or %s or %s"));
1188 YYCASE_(5,
YY_(
"syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1193 YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1199 if (*yymsg_alloc < yysize)
1201 *yymsg_alloc = 2 * yysize;
1202 if (! (yysize <= *yymsg_alloc
1214 while ((*yyp = *yyformat) !=
'\0')
1215 if (*yyp ==
'%' && yyformat[1] ==
's' && yyi < yycount)
1217 yyp += yytnamerr (yyp, yyarg[yyi++]);
1300 char *yymsg = yymsgbuf;
1301 YYSIZE_T yymsg_alloc =
sizeof yymsgbuf;
1304 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) 1314 YYDPRINTF ((stderr,
"Starting parse\n"));
1350 yyoverflow (
YY_(
"memory exhausted"),
1351 &yyss1, yysize *
sizeof (*
yyssp),
1352 &yyvs1, yysize *
sizeof (*
yyvsp),
1359 # ifndef YYSTACK_RELOCATE 1360 goto yyexhaustedlab;
1364 goto yyexhaustedlab;
1374 goto yyexhaustedlab;
1377 # undef YYSTACK_RELOCATE 1387 YYDPRINTF ((stderr,
"Stack size increased to %lu\n",
1419 YYDPRINTF ((stderr,
"Reading a token: "));
1426 YYDPRINTF ((stderr,
"Now at end of input.\n"));
1499 #line 196 "go-exp.y" 1503 #line 1505 "go-exp.c" 1507 #line 204 "go-exp.y" 1509 #line 1511 "go-exp.c" 1513 #line 209 "go-exp.y" 1515 #line 1517 "go-exp.c" 1519 #line 213 "go-exp.y" 1521 #line 1523 "go-exp.c" 1525 #line 217 "go-exp.y" 1527 #line 1529 "go-exp.c" 1531 #line 221 "go-exp.y" 1533 #line 1535 "go-exp.c" 1537 #line 225 "go-exp.y" 1539 #line 1541 "go-exp.c" 1543 #line 229 "go-exp.y" 1545 #line 1547 "go-exp.c" 1549 #line 233 "go-exp.y" 1551 #line 1553 "go-exp.c" 1555 #line 237 "go-exp.y" 1557 #line 1559 "go-exp.c" 1561 #line 243 "go-exp.y" 1565 #line 1567 "go-exp.c" 1569 #line 249 "go-exp.y" 1574 #line 1576 "go-exp.c" 1578 #line 256 "go-exp.y" 1586 #line 1588 "go-exp.c" 1590 #line 266 "go-exp.y" 1592 #line 1594 "go-exp.c" 1596 #line 272 "go-exp.y" 1598 #line 1600 "go-exp.c" 1602 #line 274 "go-exp.y" 1607 #line 1609 "go-exp.c" 1611 #line 281 "go-exp.y" 1613 #line 1615 "go-exp.c" 1617 #line 288 "go-exp.y" 1619 #line 1621 "go-exp.c" 1623 #line 292 "go-exp.y" 1625 #line 1627 "go-exp.c" 1629 #line 296 "go-exp.y" 1631 #line 1633 "go-exp.c" 1635 #line 300 "go-exp.y" 1639 #line 1641 "go-exp.c" 1643 #line 306 "go-exp.y" 1647 #line 1649 "go-exp.c" 1651 #line 312 "go-exp.y" 1653 #line 1655 "go-exp.c" 1657 #line 318 "go-exp.y" 1659 #line 1661 "go-exp.c" 1663 #line 322 "go-exp.y" 1665 #line 1667 "go-exp.c" 1669 #line 326 "go-exp.y" 1671 #line 1673 "go-exp.c" 1675 #line 330 "go-exp.y" 1677 #line 1679 "go-exp.c" 1681 #line 334 "go-exp.y" 1683 #line 1685 "go-exp.c" 1687 #line 338 "go-exp.y" 1689 #line 1691 "go-exp.c" 1693 #line 342 "go-exp.y" 1695 #line 1697 "go-exp.c" 1699 #line 346 "go-exp.y" 1701 #line 1703 "go-exp.c" 1705 #line 350 "go-exp.y" 1707 #line 1709 "go-exp.c" 1711 #line 354 "go-exp.y" 1713 #line 1715 "go-exp.c" 1717 #line 358 "go-exp.y" 1719 #line 1721 "go-exp.c" 1723 #line 362 "go-exp.y" 1725 #line 1727 "go-exp.c" 1729 #line 366 "go-exp.y" 1731 #line 1733 "go-exp.c" 1735 #line 370 "go-exp.y" 1737 #line 1739 "go-exp.c" 1741 #line 374 "go-exp.y" 1743 #line 1745 "go-exp.c" 1747 #line 378 "go-exp.y" 1749 #line 1751 "go-exp.c" 1753 #line 382 "go-exp.y" 1755 #line 1757 "go-exp.c" 1759 #line 386 "go-exp.y" 1761 #line 1763 "go-exp.c" 1765 #line 390 "go-exp.y" 1767 #line 1769 "go-exp.c" 1771 #line 394 "go-exp.y" 1773 #line 1775 "go-exp.c" 1777 #line 398 "go-exp.y" 1779 #line 1781 "go-exp.c" 1783 #line 402 "go-exp.y" 1787 #line 1789 "go-exp.c" 1791 #line 408 "go-exp.y" 1796 #line 1798 "go-exp.c" 1800 #line 415 "go-exp.y" 1807 #line 1809 "go-exp.c" 1811 #line 424 "go-exp.y" 1814 (
yyvsp[0].ssym).stoken.length, 0, &val);
1821 #line 1823 "go-exp.c" 1825 #line 437 "go-exp.y" 1830 #line 1832 "go-exp.c" 1834 #line 447 "go-exp.y" 1838 #line 1840 "go-exp.c" 1842 #line 453 "go-exp.y" 1855 #line 1857 "go-exp.c" 1859 #line 468 "go-exp.y" 1864 #line 1866 "go-exp.c" 1868 #line 475 "go-exp.y" 1876 (
yyval.svec).len = 1;
1877 (
yyval.svec).tokens = vec;
1882 memcpy (vec->
ptr, (
yyvsp[0].tsval).ptr, (
yyvsp[0].tsval).length + 1);
1884 #line 1886 "go-exp.c" 1888 #line 492 "go-exp.y" 1902 (
yyval.svec).tokens[(
yyval.svec).len - 1].ptr = p;
1904 #line 1906 "go-exp.c" 1908 #line 510 "go-exp.y" 1914 for (i = 0; i < (
yyvsp[0].svec).len; ++i)
1918 #line 1920 "go-exp.c" 1922 #line 522 "go-exp.y" 1926 #line 1928 "go-exp.c" 1930 #line 528 "go-exp.y" 1934 #line 1936 "go-exp.c" 1938 #line 534 "go-exp.y" 1939 {
struct symbol *sym = (
yyvsp[-1].ssym).sym.symbol;
1944 error (
_(
"@entry can be used only for function " 1945 "parameters, not for \"%s\""),
1952 #line 1954 "go-exp.c" 1956 #line 550 "go-exp.y" 1974 else if ((
yyvsp[0].ssym).is_a_field_of_this)
1987 if (msymbol.
minsym != NULL)
1991 error (
_(
"No symbol table is loaded. " 1992 "Use the \"file\" command."));
1994 error (
_(
"No symbol \"%s\" in current context."),
1998 #line 2000 "go-exp.c" 2002 #line 602 "go-exp.y" 2004 #line 2006 "go-exp.c" 2008 #line 604 "go-exp.y" 2010 #line 2012 "go-exp.c" 2014 #line 611 "go-exp.y" 2017 #line 2019 "go-exp.c" 2021 #line 2023 "go-exp.c" 2070 #if ! YYERROR_VERBOSE 2073 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ 2076 char const *yymsgp =
YY_(
"syntax error");
2077 int yysyntax_error_status;
2078 yysyntax_error_status = YYSYNTAX_ERROR;
2079 if (yysyntax_error_status == 0)
2081 else if (yysyntax_error_status == 1)
2083 if (yymsg != yymsgbuf)
2089 yymsg_alloc =
sizeof yymsgbuf;
2090 yysyntax_error_status = 2;
2094 yysyntax_error_status = YYSYNTAX_ERROR;
2099 if (yysyntax_error_status == 2)
2100 goto yyexhaustedlab;
2102 # undef YYSYNTAX_ERROR 2108 if (yyerrstatus == 3)
2210 #if !defined yyoverflow || YYERROR_VERBOSE 2244 if (yymsg != yymsgbuf)
2249 #line 633 "go-exp.y" 2263 const char *p,
int len,
int parsed_float,
YYSTYPE *putithere)
2280 int found_suffix = 0;
2283 struct type *signed_type;
2284 struct type *unsigned_type;
2293 if (len >= 1 && tolower (p[len - 1]) ==
'f')
2299 else if (len >= 1 && tolower (p[len - 1]) ==
'l')
2302 =
parse_type (par_state)->builtin_long_double;
2363 if (c >=
'A' && c <=
'Z')
2365 if (c !=
'l' && c !=
'u')
2367 if (c >=
'0' && c <=
'9')
2375 if (base > 10 && c >=
'a' && c <=
'f')
2379 n += i = c -
'a' + 10;
2400 if (c !=
'l' && c !=
'u' && (prevn >= n) && n != 0)
2406 if (c !=
'l' && c !=
'u' && n != 0)
2409 error (
_(
"Numeric constant too large."));
2439 unsigned_type =
parse_type (par_state)->builtin_unsigned_int;
2440 signed_type =
parse_type (par_state)->builtin_int;
2442 else if (long_p <= 1
2447 unsigned_type =
parse_type (par_state)->builtin_unsigned_long;
2448 signed_type =
parse_type (par_state)->builtin_long;
2460 unsigned_type =
parse_type (par_state)->builtin_unsigned_long_long;
2461 signed_type =
parse_type (par_state)->builtin_long_long;
2469 if (unsigned_p || (n & high_bit))
2510 obstack_free (&
tempbuf, NULL);
2527 else if (c == quote)
2540 if (*tokptr != quote)
2543 error (
_(
"Unterminated string in expression."));
2545 error (
_(
"Unmatched single quote."));
2587 {
"&&",
ANDAND, BINOP_END},
2588 {
"||",
OROR, BINOP_END},
2589 {
"<<",
LSH, BINOP_END},
2590 {
">>",
RSH, BINOP_END},
2591 {
"==",
EQUAL, BINOP_END},
2593 {
"<=",
LEQ, BINOP_END},
2594 {
">=",
GEQ, BINOP_END},
2634 const char *tokstart;
2665 switch (c = *tokstart)
2673 else if (saw_structop)
2727 int got_dot = 0, got_e = 0, toktype;
2728 const char *p = tokstart;
2731 if (c ==
'0' && (p[1] ==
'x' || p[1] ==
'X'))
2742 if (!hex && !got_e && (*p ==
'e' || *p ==
'E'))
2743 got_dot = got_e = 1;
2746 else if (!got_dot && *p ==
'.')
2748 else if (got_e && (p[-1] ==
'e' || p[-1] ==
'E')
2749 && (*p ==
'-' || *p ==
'+'))
2755 else if ((*p < '0' || *p >
'9')
2756 && ((*p < 'a' || *p >
'z')
2757 && (*p < 'A' || *p >
'Z')))
2760 toktype =
parse_number (par_state, tokstart, p - tokstart,
2762 if (toktype ==
ERROR)
2764 char *err_copy = (
char *) alloca (p - tokstart + 1);
2766 memcpy (err_copy, tokstart, p - tokstart);
2767 err_copy[p - tokstart] = 0;
2768 error (
_(
"Invalid number \"%s\"."), err_copy);
2776 const char *p = &tokstart[1];
2777 size_t len = strlen (
"entry");
2779 while (isspace (*p))
2781 if (strncmp (p,
"entry", len) == 0 && !isalnum (p[len])
2820 error (
_(
"Empty character constant."));
2821 else if (host_len > 2 && c ==
'\'')
2824 namelen =
lexptr - tokstart - 1;
2827 else if (host_len > 1)
2828 error (
_(
"Invalid character constant."));
2834 if (!(c ==
'_' || c ==
'$' 2835 || (c >=
'a' && c <=
'z') || (c >=
'A' && c <=
'Z')))
2837 error (
_(
"Invalid character '%c' in expression."), c);
2841 for (c = tokstart[namelen];
2842 (c ==
'_' || c ==
'$' || (c >=
'0' && c <=
'9')
2843 || (c >=
'a' && c <=
'z') || (c >=
'A' && c <=
'Z'));)
2845 c = tokstart[++namelen];
2852 && tokstart[0] ==
'i' 2853 && tokstart[1] ==
'f')
2866 && strncmp (tokstart,
"thread", namelen) == 0
2867 && (tokstart[namelen] ==
' ' || tokstart[namelen] ==
'\t'))
2869 const char *p = tokstart + namelen + 1;
2871 while (*p ==
' ' || *p ==
'\t')
2873 if (*p >=
'0' && *p <=
'9')
2895 if (*tokstart ==
'$')
2928 build_packaged_name (const char *package,
int package_len,
2929 const char *
name,
int name_len)
2933 name_obstack.
clear ();
2934 obstack_grow (&name_obstack, package, package_len);
2936 obstack_grow (&name_obstack,
name, name_len);
2937 obstack_grow (&name_obstack,
"", 1);
2938 result.
ptr = (
char *) obstack_base (&name_obstack);
2939 result.
length = obstack_object_size (&name_obstack) - 1;
2973 if (strcmp (copy,
"Sizeof") == 0)
2979 error (
_(
"Unknown function in `unsafe' package: %s"), copy);
3058 if (current_package_name != NULL)
3061 build_packaged_name (current_package_name,
3062 strlen (current_package_name),
3063 copy, strlen (copy));
3065 xfree (current_package_name);
3067 &is_a_field_of_this);
3081 if ((copy[0] >=
'a' && copy[0] <
'a' +
input_radix - 10)
3082 || (copy[0] >=
'A' && copy[0] <
'A' +
input_radix - 10))
3127 return current.
token;
3135 if (next.
token ==
'.')
3149 if (strcmp (copy,
"unsafe") == 0)
3198 name_obstack.
clear ();
3209 error (
_(
"A %s in expression, near `%s'."), (msg ? msg :
"error"),
lexptr);
struct internalvar * ivar
char * go_block_package_name(const struct block *block)
void write_exp_elt_sym(struct parser_state *ps, struct symbol *expelt)
#define parse_language(ps)
struct YYSTYPE::@18 typed_val_int
static void yydestruct(const char *yymsg, int yytype, YYSTYPE *yyvaluep)
#define parse_gdbarch(ps)
bool parse_float(const char *p, int len, const struct type *type, gdb_byte *data)
static int saw_name_at_eof
#define YY_REDUCE_PRINT(Rule)
int gdbarch_int_bit(struct gdbarch *gdbarch)
static const yytype_int8 yypgoto[]
static struct parser_state * pstate
void yyerror(const char *)
#define SYMBOL_CLASS(symbol)
static const yytype_int8 yydefgoto[]
static void yy_reduce_print(yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
static VEC(token_and_value)
int gdbarch_long_bit(struct gdbarch *gdbarch)
const struct block * innermost_block
int have_partial_symbols(void)
#define VEC_safe_push(T, V, O)
static struct obstack tempbuf
struct block_symbol lookup_symbol(const char *name, const struct block *block, domain_enum domain, struct field_of_this_result *is_a_field_of_this)
int c_parse_escape(const char **ptr, struct obstack *output)
#define yypact_value_is_default(Yystate)
static const yytype_uint8 yyr2[]
static const char *const yytname[]
#define YYPRINT(FILE, TYPE, VALUE)
#define YY_STACK_PRINT(Bottom, Top)
static const yytype_uint8 yydefact[]
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
static const struct token ident_tokens[]
scoped_restore_tmpl< T > make_scoped_restore(T *var)
static const yytype_uint16 yyrline[]
static int classify_unsafe_function(struct stoken function_name)
static const yytype_uint8 yytable[]
struct typed_stoken tsval
static int parse_number(struct parser_state *, const char *, int, int, YYSTYPE *)
void write_exp_elt_block(struct parser_state *ps, const struct block *b)
void write_exp_elt_longcst(struct parser_state *ps, LONGEST expelt)
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
static const yytype_uint8 yyr1[]
struct type * check_typedef(struct type *type)
int contained_in(const struct block *a, const struct block *b)
struct stoken_vector svec
const struct block * block
struct YYSTYPE::@2 typed_val_float
int symbol_read_needs_frame(struct symbol *sym)
#define gdb_assert_not_reached(message)
const struct builtin_go_type * builtin_go_type(struct gdbarch *gdbarch)
static const struct token tokentab3[]
static const yytype_uint8 yytranslate[]
unsigned short int yytype_uint16
#define VEC_index(T, V, I)
static const yytype_uint16 yytoknum[]
void write_dollar_variable(struct parser_state *ps, struct stoken str)
#define YY_SYMBOL_PRINT(Title, Type, Value, Location)
void mark_struct_expression(struct parser_state *ps)
static int classify_packaged_name(const struct block *block)
int go_parse(struct parser_state *par_state)
unsigned short int yytype_uint16
static int classify_name(struct parser_state *par_state, const struct block *block)
#define XRESIZEVEC(T, P, N)
struct type * builtin_float64
void write_exp_msymbol(struct parser_state *ps, struct bound_minimal_symbol bound_msym)
static int parse_string_or_char(const char *tokptr, const char **outptr, struct typed_stoken *value, int *host_chars)
static const struct token tokentab2[]
void write_exp_elt_opcode(struct parser_state *ps, enum exp_opcode expelt)
static const char * lexptr
static void yy_symbol_value_print(FILE *yyoutput, int yytype, YYSTYPE const *const yyvaluep)
unsigned char yytype_uint8
static const yytype_uint8 yystos[]
static int last_was_structop
#define TYPE_CODE(thistype)
static void yy_stack_print(yytype_int16 *yybottom, yytype_int16 *yytop)
struct minimal_symbol * minsym
int gdbarch_long_long_bit(struct gdbarch *gdbarch)
struct bound_minimal_symbol lookup_bound_minimal_symbol(const char *name)
static const yytype_int16 yypact[]
#define obstack_grow_str(OBSTACK, STRING)
static const yytype_int8 yycheck[]
int have_full_symbols(void)
static int package_name_p(const char *name, const struct block *block)
static int lex_one_token(struct parser_state *par_state)
const struct block * expression_context_block
unsigned long long ULONGEST
struct typed_stoken * tokens
#define SYMBOL_TYPE(symbol)
static void yy_symbol_print(FILE *yyoutput, int yytype, YYSTYPE const *const yyvaluep)
#define INTERFACE_KEYWORD
#define TYPE_LENGTH(thistype)
struct type * language_lookup_primitive_type(const struct language_defn *la, struct gdbarch *gdbarch, const char *name)
unsigned char yytype_uint8
#define YYSTACK_ALLOC_MAXIMUM
DEF_VEC_O(token_and_value)
static const char * prev_lexptr
void write_exp_elt_floatcst(struct parser_state *ps, const gdb_byte expelt[16])
struct type * builtin_float32
void write_exp_string(struct parser_state *ps, struct stoken str)
void write_exp_elt_type(struct parser_state *ps, struct type *expelt)
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
void error(const char *fmt,...)
#define yytable_value_is_error(Yytable_value)
void write_exp_string_vector(struct parser_state *ps, int type, struct stoken_vector *vec)
struct type * lookup_pointer_type(struct type *type)
#define SYMBOL_IS_ARGUMENT(symbol)
char * copy_name(struct stoken token)
#define VEC_ordered_remove(T, V, I)