52#define YYBISON_VERSION "3.8.2"
55#define YYSKELETON_NAME "yacc.c"
87#define parse_type(ps) builtin_type (ps->gdbarch ())
91#define GDB_YY_REMAP_PREFIX pascal_
104static int yylex (
void);
106static void yyerror (
const char *);
108static char *
uptok (
const char *,
int);
112#line 113 "p-exp.c.tmp"
116# define YY_CAST(Type, Val) static_cast<Type> (Val)
117# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
119# define YY_CAST(Type, Val) ((Type) (Val))
120# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
123# ifndef YY_NULLPTRPTR
124# if defined __cplusplus
125# if 201103L <= __cplusplus
126# define YY_NULLPTRPTR nullptr
128# define YY_NULLPTRPTR 0
131# define YY_NULLPTRPTR ((void*)0)
203#define NAME_OR_INT 265
207#define COLONCOLON 269
209#define DOLLAR_VARIABLE 271
211#define TRUEKEYWORD 273
212#define FALSEKEYWORD 274
213#define ABOVE_COMMA 275
233#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
261#line 262 "p-exp.c.tmp"
265# define YYSTYPE_IS_TRIVIAL 1
266# define YYSTYPE_IS_DECLARED 1
363 const char *,
int,
int,
YYSTYPE *);
371#line 372 "p-exp.c.tmp"
382#ifndef __PTRDIFF_MAX__
384# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
395#ifdef __INT_LEAST8_MAX__
397#elif defined YY_STDINT_H
403#ifdef __INT_LEAST16_MAX__
405#elif defined YY_STDINT_H
417# undef UINT_LEAST8_MAX
418# undef UINT_LEAST16_MAX
419# define UINT_LEAST8_MAX 255
420# define UINT_LEAST16_MAX 65535
423#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
425#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
426 && UINT_LEAST8_MAX <= INT_MAX)
428#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
434#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
436#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
437 && UINT_LEAST16_MAX <= INT_MAX)
439#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
446# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
447# define YYPTRDIFF_T __PTRDIFF_TYPE__
448# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
449# elif defined PTRDIFF_MAX
453# define YYPTRDIFF_T ptrdiff_t
454# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
456# define YYPTRDIFF_T long
457# define YYPTRDIFF_MAXIMUM LONG_MAX
463# define YYSIZE_T __SIZE_TYPE__
465# define YYSIZE_T size_t
466# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
468# define YYSIZE_T size_t
470# define YYSIZE_T unsigned
474#define YYSIZE_MAXIMUM \
475 YY_CAST (YYPTRDIFF_T, \
476 (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
477 ? YYPTRDIFF_MAXIMUM \
478 : YY_CAST (YYSIZE_T, -1)))
480#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
490# if defined YYENABLE_NLS && YYENABLE_NLS
493# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
497# define YY_(Msgid) Msgid
502#ifndef YY_ATTRIBUTE_PURE
503# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
504# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
506# define YY_ATTRIBUTE_PURE
510#ifndef YY_ATTRIBUTE_UNUSED
511# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
512# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
514# define YY_ATTRIBUTE_UNUSED
519#if ! defined lint || defined __GNUC__
520# define YY_USE(E) ((void) (E))
526#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
527# if __GNUC__ * 100 + __GNUC_MINOR__ < 407
528# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
529 _Pragma ("GCC diagnostic push") \
530 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
532# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
533 _Pragma ("GCC diagnostic push") \
534 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
535 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
537# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
538 _Pragma ("GCC diagnostic pop")
540# define YY_INITIAL_VALUE(Value) Value
542#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
543# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
544# define YY_IGNORE_MAYBE_UNINITIALIZED_END
546#ifndef YY_INITIAL_VALUE
547# define YY_INITIAL_VALUE(Value)
550#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
551# define YY_IGNORE_USELESS_CAST_BEGIN \
552 _Pragma ("GCC diagnostic push") \
553 _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
554# define YY_IGNORE_USELESS_CAST_END \
555 _Pragma ("GCC diagnostic pop")
557#ifndef YY_IGNORE_USELESS_CAST_BEGIN
558# define YY_IGNORE_USELESS_CAST_BEGIN
559# define YY_IGNORE_USELESS_CAST_END
563#define YY_ASSERT(E) ((void) (0 && (E)))
565#if !defined yyoverflow
569# ifdef YYSTACK_USE_ALLOCA
570# if YYSTACK_USE_ALLOCA
572# define YYSTACK_ALLOC __builtin_alloca
573# elif defined __BUILTIN_VA_ARG_INCR
576# define YYSTACK_ALLOC __alloca
577# elif defined _MSC_VER
578# define alloca _alloca
580# define YYSTACK_ALLOC alloca
581# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
585# define EXIT_SUCCESS 0
594# define YYSTACK_FREE(Ptr) do { ; } while (0)
595# ifndef YYSTACK_ALLOC_MAXIMUM
600# define YYSTACK_ALLOC_MAXIMUM 4032
603# define YYSTACK_ALLOC YYMALLOC
604# define YYSTACK_FREE YYFREE
605# ifndef YYSTACK_ALLOC_MAXIMUM
606# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
608# if (defined __cplusplus && ! defined EXIT_SUCCESS \
609 && ! ((defined YYMALLOC || defined xmalloc) \
610 && (defined YYFREE || defined xfree)))
613# define EXIT_SUCCESS 0
617# define YYMALLOC xmalloc
618# if ! defined xmalloc && ! defined EXIT_SUCCESS
624# if ! defined xfree && ! defined EXIT_SUCCESS
631#if (! defined yyoverflow \
632 && (! defined __cplusplus \
633 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
643# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
647# define YYSTACK_BYTES(N) \
648 ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
649 + YYSTACK_GAP_MAXIMUM)
651# define YYCOPY_NEEDED 1
658# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
661 YYPTRDIFF_T yynewbytes; \
662 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
663 Stack = &yyptr->Stack_alloc; \
664 yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
665 yyptr += yynewbytes / YYSIZEOF (*yyptr); \
671#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
675# if defined __GNUC__ && 1 < __GNUC__
676# define YYCOPY(Dst, Src, Count) \
677 __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
679# define YYCOPY(Dst, Src, Count) \
683 for (yyi = 0; yyi < (Count); yyi++) \
684 (Dst)[yyi] = (Src)[yyi]; \
711#define YYTRANSLATE(YYX) \
712 (0 <= (YYX) && (YYX) <= YYMAXUTOK \
713 ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
720 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
721 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
722 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
723 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
724 48, 51, 40, 38, 20, 39, 46, 41, 2, 2,
725 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
726 29, 27, 30, 2, 37, 2, 2, 2, 2, 2,
727 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
728 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
729 2, 47, 2, 52, 49, 2, 2, 2, 2, 2,
730 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
731 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
732 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
733 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
734 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
735 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
736 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
737 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
738 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
739 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
740 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
741 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
742 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
743 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
744 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
745 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
746 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
747 15, 16, 17, 18, 19, 21, 22, 23, 24, 25,
748 26, 28, 31, 32, 33, 34, 35, 36, 42, 43,
756 0, 196, 196, 196, 204, 205, 208, 214, 215, 220,
757 226, 232, 236, 240, 244, 249, 253, 271, 287, 296,
758 307, 305, 330, 327, 344, 345, 347, 351, 365, 371,
759 375, 375, 396, 400, 404, 408, 412, 416, 420, 427,
760 434, 441, 448, 455, 462, 466, 470, 474, 478, 485,
761 492, 500, 512, 521, 524, 550, 559, 563, 585, 612,
762 631, 644, 658, 672, 673, 684, 742, 753, 757, 759,
763 761, 766, 776, 777, 778, 779, 782, 783
768#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
779 "\"end of file\"",
"error",
"\"invalid token\"",
"INT",
"FLOAT",
780 "STRING",
"FIELDNAME",
"COMPLETE",
"NAME",
"TYPENAME",
"NAME_OR_INT",
781 "STRUCT",
"CLASS",
"SIZEOF",
"COLONCOLON",
"ERROR",
"DOLLAR_VARIABLE",
782 "THIS",
"TRUEKEYWORD",
"FALSEKEYWORD",
"','",
"ABOVE_COMMA",
"ASSIGN",
783 "NOT",
"OR",
"XOR",
"ANDAND",
"'='",
"NOTEQUAL",
"'<'",
"'>'",
"LEQ",
784 "GEQ",
"LSH",
"RSH",
"DIV",
"MOD",
"'@'",
"'+'",
"'-'",
"'*'",
"'/'",
785 "UNARY",
"INCREMENT",
"DECREMENT",
"ARROW",
"'.'",
"'['",
"'('",
"'^'",
786 "BLOCKNAME",
"')'",
"']'",
"$accept",
"start",
"$@1",
"normal_start",
787 "type_exp",
"exp1",
"exp",
"field_exp",
"$@2",
"$@3",
"arglist",
"$@4",
788 "block",
"variable",
"qualified_name",
"ptype",
"type",
"typebase",
799#define YYPACT_NINF (-44)
801#define yypact_value_is_default(Yyn) \
802 ((Yyn) == YYPACT_NINF)
804#define YYTABLE_NINF (-61)
806#define yytable_value_is_error(Yyn) \
813 -44, 20, 90, -44, -44, -44, -44, -44, -44, -44,
814 7, 7, -41, 7, -44, -44, -44, -44, 90, 90,
815 90, -39, -24, 90, 10, 13, -44, -44, 8, 231,
816 4, 21, -44, -44, -44, -14, 41, -44, -44, -44,
817 -44, -44, -44, -44, 90, -44, 35, -14, 35, 35,
818 90, 90, 5, -44, 90, 90, 90, 90, 90, 90,
819 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
820 90, 90, -44, -44, -44, -44, -44, -44, -44, 23,
821 7, 90, 7, 119, -43, 147, 175, -44, 231, 231,
822 256, 280, 303, 324, 324, 31, 31, 31, 31, 76,
823 76, 76, 76, 328, 328, 35, 90, 90, 90, -44,
824 44, 203, -44, -44, -44, -44, -44, 35, 9, 231,
825 11, -44, -44, 90, -44, 231
833 2, 0, 0, 1, 50, 52, 57, 76, 69, 51,
834 0, 0, 0, 0, 54, 58, 48, 49, 0, 0,
835 0, 0, 0, 0, 0, 77, 3, 5, 4, 7,
836 0, 0, 53, 63, 67, 6, 66, 65, 72, 74,
837 75, 73, 70, 71, 0, 64, 12, 0, 10, 11,
838 0, 0, 0, 68, 0, 0, 0, 0, 0, 0,
839 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
840 0, 0, 30, 15, 20, 22, 9, 16, 19, 17,
841 0, 0, 0, 0, 0, 0, 0, 28, 8, 47,
842 46, 45, 44, 38, 39, 42, 43, 40, 41, 36,
843 37, 32, 33, 34, 35, 29, 0, 0, 24, 18,
844 61, 0, 62, 56, 55, 13, 14, 31, 0, 25,
851 -44, -44, -44, -44, -44, -20, -18, -44, -44, -44,
852 -44, -44, -44, -44, -44, -44, 16, 50, -7, -44
858 0, 1, 2, 26, 27, 28, 29, 30, 107, 108,
859 120, 106, 31, 32, 33, 34, 47, 36, 42, 37
867 46, 48, 49, 52, 43, 81, 45, 44, 114, 50,
868 77, 78, 38, 39, 40, 38, 39, 40, 35, 8,
869 3, 10, 11, 79, 51, 54, 83, -59, 54, 54,
870 109, 123, 85, 86, 81, 80, 88, 89, 90, 91,
871 92, 93, 94, 95, 96, 97, 98, 99, 100, 101,
872 102, 103, 104, 105, 41, 82, 87, 41, -60, 24,
873 84, 122, 124, 111, 65, 66, 67, 68, 0, 69,
874 70, 71, 72, 110, 53, 112, 0, 73, 74, 75,
875 76, 73, 74, 75, 76, 0, 0, 118, 117, 0,
876 119, 0, 0, 4, 5, 6, 0, 0, 7, 8,
877 9, 10, 11, 12, 13, 125, 14, 15, 16, 17,
878 0, 0, 0, 18, 69, 70, 71, 72, 0, 0,
879 0, 0, 73, 74, 75, 76, 0, 19, 0, 20,
880 0, 0, 0, 21, 22, 0, 0, 0, 23, 24,
881 25, 55, 0, 56, 57, 58, 59, 60, 61, 62,
882 63, 64, 65, 66, 67, 68, 0, 69, 70, 71,
883 72, 0, 0, 0, 0, 73, 74, 75, 76, 55,
884 113, 56, 57, 58, 59, 60, 61, 62, 63, 64,
885 65, 66, 67, 68, 0, 69, 70, 71, 72, 0,
886 0, 0, 0, 73, 74, 75, 76, 55, 115, 56,
887 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
888 67, 68, 0, 69, 70, 71, 72, 0, 0, 0,
889 0, 73, 74, 75, 76, 55, 116, 56, 57, 58,
890 59, 60, 61, 62, 63, 64, 65, 66, 67, 68,
891 0, 69, 70, 71, 72, 0, 0, 0, 0, 73,
892 74, 75, 76, 55, 121, 56, 57, 58, 59, 60,
893 61, 62, 63, 64, 65, 66, 67, 68, 0, 69,
894 70, 71, 72, 0, 0, 0, 0, 73, 74, 75,
895 76, 57, 58, 59, 60, 61, 62, 63, 64, 65,
896 66, 67, 68, 0, 69, 70, 71, 72, 0, 0,
897 0, 0, 73, 74, 75, 76, 58, 59, 60, 61,
898 62, 63, 64, 65, 66, 67, 68, 0, 69, 70,
899 71, 72, 0, 0, 0, 0, 73, 74, 75, 76,
900 59, 60, 61, 62, 63, 64, 65, 66, 67, 68,
901 0, 69, 70, 71, 72, 0, 0, 0, 0, 73,
902 74, 75, 76, 61, 62, 63, 64, 65, 66, 67,
903 68, 0, 69, 70, 71, 72, 0, 0, 71, 72,
904 73, 74, 75, 76, 73, 74, 75, 76
909 18, 19, 20, 23, 11, 48, 13, 48, 51, 48,
910 6, 7, 8, 9, 10, 8, 9, 10, 2, 9,
911 0, 11, 12, 30, 48, 20, 44, 14, 20, 20,
912 7, 20, 50, 51, 48, 14, 54, 55, 56, 57,
913 58, 59, 60, 61, 62, 63, 64, 65, 66, 67,
914 68, 69, 70, 71, 50, 14, 51, 50, 14, 49,
915 44, 52, 51, 81, 33, 34, 35, 36, -1, 38,
916 39, 40, 41, 80, 24, 82, -1, 46, 47, 48,
917 49, 46, 47, 48, 49, -1, -1, 107, 106, -1,
918 108, -1, -1, 3, 4, 5, -1, -1, 8, 9,
919 10, 11, 12, 13, 14, 123, 16, 17, 18, 19,
920 -1, -1, -1, 23, 38, 39, 40, 41, -1, -1,
921 -1, -1, 46, 47, 48, 49, -1, 37, -1, 39,
922 -1, -1, -1, 43, 44, -1, -1, -1, 48, 49,
923 50, 22, -1, 24, 25, 26, 27, 28, 29, 30,
924 31, 32, 33, 34, 35, 36, -1, 38, 39, 40,
925 41, -1, -1, -1, -1, 46, 47, 48, 49, 22,
926 51, 24, 25, 26, 27, 28, 29, 30, 31, 32,
927 33, 34, 35, 36, -1, 38, 39, 40, 41, -1,
928 -1, -1, -1, 46, 47, 48, 49, 22, 51, 24,
929 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
930 35, 36, -1, 38, 39, 40, 41, -1, -1, -1,
931 -1, 46, 47, 48, 49, 22, 51, 24, 25, 26,
932 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
933 -1, 38, 39, 40, 41, -1, -1, -1, -1, 46,
934 47, 48, 49, 22, 51, 24, 25, 26, 27, 28,
935 29, 30, 31, 32, 33, 34, 35, 36, -1, 38,
936 39, 40, 41, -1, -1, -1, -1, 46, 47, 48,
937 49, 25, 26, 27, 28, 29, 30, 31, 32, 33,
938 34, 35, 36, -1, 38, 39, 40, 41, -1, -1,
939 -1, -1, 46, 47, 48, 49, 26, 27, 28, 29,
940 30, 31, 32, 33, 34, 35, 36, -1, 38, 39,
941 40, 41, -1, -1, -1, -1, 46, 47, 48, 49,
942 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
943 -1, 38, 39, 40, 41, -1, -1, -1, -1, 46,
944 47, 48, 49, 29, 30, 31, 32, 33, 34, 35,
945 36, -1, 38, 39, 40, 41, -1, -1, 40, 41,
946 46, 47, 48, 49, 46, 47, 48, 49
953 0, 54, 55, 0, 3, 4, 5, 8, 9, 10,
954 11, 12, 13, 14, 16, 17, 18, 19, 23, 37,
955 39, 43, 44, 48, 49, 50, 56, 57, 58, 59,
956 60, 65, 66, 67, 68, 69, 70, 72, 8, 9,
957 10, 50, 71, 71, 48, 71, 59, 69, 59, 59,
958 48, 48, 58, 70, 20, 22, 24, 25, 26, 27,
959 28, 29, 30, 31, 32, 33, 34, 35, 36, 38,
960 39, 40, 41, 46, 47, 48, 49, 6, 7, 71,
961 14, 48, 14, 59, 69, 59, 59, 51, 59, 59,
962 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
963 59, 59, 59, 59, 59, 59, 64, 61, 62, 7,
964 71, 59, 71, 51, 51, 51, 51, 59, 58, 59,
965 63, 51, 52, 20, 51, 59
971 0, 53, 55, 54, 56, 56, 57, 58, 58, 59,
972 59, 59, 59, 59, 59, 60, 59, 59, 59, 59,
973 61, 59, 62, 59, 63, 63, 63, 59, 59, 59,
974 64, 59, 59, 59, 59, 59, 59, 59, 59, 59,
975 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
976 59, 59, 59, 59, 59, 59, 59, 59, 59, 65,
977 65, 66, 67, 66, 66, 66, 68, 69, 70, 70,
978 70, 70, 71, 71, 71, 71, 72, 72
984 0, 2, 0, 2, 1, 1, 1, 1, 3, 2,
985 2, 2, 2, 4, 4, 2, 2, 2, 3, 2,
986 0, 5, 0, 5, 0, 1, 3, 4, 3, 3,
987 0, 4, 3, 3, 3, 3, 3, 3, 3, 3,
988 3, 3, 3, 3, 3, 3, 3, 3, 1, 1,
989 1, 1, 1, 1, 1, 4, 4, 1, 1, 1,
990 3, 3, 3, 1, 2, 1, 1, 1, 2, 1,
991 2, 2, 1, 1, 1, 1, 1, 1
997#define yyerrok (yyerrstatus = 0)
998#define yyclearin (yychar = YYEMPTY)
1000#define YYACCEPT goto yyacceptlab
1001#define YYABORT goto yyabortlab
1002#define YYERROR goto yyerrorlab
1003#define YYNOMEM goto yyexhaustedlab
1006#define YYRECOVERING() (!!yyerrstatus)
1008#define YYBACKUP(Token, Value) \
1010 if (yychar == YYEMPTY) \
1014 YYPOPSTACK (yylen); \
1020 yyerror (YY_("syntax error: cannot back up")); \
1027#define YYERRCODE YYUNDEF
1035# define YYFPRINTF fprintf
1038# define YYDPRINTF(Args) \
1047# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
1051 YYFPRINTF (stderr, "%s ", Title); \
1052 yy_symbol_print (stderr, \
1054 YYFPRINTF (stderr, "\n"); \
1067 FILE *yyoutput = yyo;
1101 for (; yybottom <= yytop; yybottom++)
1103 int yybot = *yybottom;
1109# define YY_STACK_PRINT(Bottom, Top) \
1112 yy_stack_print ((Bottom), (Top)); \
1127 YYFPRINTF (stderr,
"Reducing stack by rule %d (line %d):\n",
1130 for (yyi = 0; yyi < yynrhs; yyi++)
1135 &
yyvsp[(yyi + 1) - (yynrhs)]);
1140# define YY_REDUCE_PRINT(Rule) \
1143 yy_reduce_print (yyssp, yyvsp, Rule); \
1150# define YYDPRINTF(Args) ((void) 0)
1151# define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
1152# define YY_STACK_PRINT(Bottom, Top)
1153# define YY_REDUCE_PRINT(Rule)
1159# define YYINITDEPTH 200
1170# define YYMAXDEPTH 10000
1217 int yyerrstatus = 0;
1246#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1252 YYDPRINTF ((stderr,
"Starting parse\n"));
1280#if !defined yyoverflow && !defined YYSTACK_RELOCATE
1287# if defined yyoverflow
1299 yyoverflow (
YY_(
"memory exhausted"),
1323# undef YYSTACK_RELOCATE
1333 YYDPRINTF ((stderr,
"Stack size increased to %ld\n",
1366 YYDPRINTF ((stderr,
"Reading a token\n"));
1374 YYDPRINTF ((stderr,
"Now at end of input.\n"));
1460#line 1462 "p-exp.c.tmp"
1466#line 1468 "p-exp.c.tmp"
1474#line 1476 "p-exp.c.tmp"
1480#line 1482 "p-exp.c.tmp"
1488#line 1490 "p-exp.c.tmp"
1496#line 1498 "p-exp.c.tmp"
1502#line 1504 "p-exp.c.tmp"
1508#line 1510 "p-exp.c.tmp"
1514#line 1516 "p-exp.c.tmp"
1520#line 1522 "p-exp.c.tmp"
1526#line 1528 "p-exp.c.tmp"
1545#line 1547 "p-exp.c.tmp"
1564#line 1566 "p-exp.c.tmp"
1576#line 1578 "p-exp.c.tmp"
1587#line 1589 "p-exp.c.tmp"
1592 {
const char *arrayname;
1595 NULL, NULL, &arrayname);
1596 if (arrayfieldindex)
1605#line 1607 "p-exp.c.tmp"
1614#line 1616 "p-exp.c.tmp"
1621#line 1623 "p-exp.c.tmp"
1627 std::vector<operation_up> args
1635#line 1637 "p-exp.c.tmp"
1641#line 1643 "p-exp.c.tmp"
1647#line 1649 "p-exp.c.tmp"
1657 && (((
yyvsp[-3].tval))->code () == TYPE_CODE_STRUCT))
1663#line 1665 "p-exp.c.tmp"
1669#line 1671 "p-exp.c.tmp"
1675#line 1677 "p-exp.c.tmp"
1684#line 1686 "p-exp.c.tmp"
1703#line 1705 "p-exp.c.tmp"
1709#line 1711 "p-exp.c.tmp"
1715#line 1717 "p-exp.c.tmp"
1721#line 1723 "p-exp.c.tmp"
1727#line 1729 "p-exp.c.tmp"
1733#line 1735 "p-exp.c.tmp"
1739#line 1741 "p-exp.c.tmp"
1748#line 1750 "p-exp.c.tmp"
1757#line 1759 "p-exp.c.tmp"
1766#line 1768 "p-exp.c.tmp"
1775#line 1777 "p-exp.c.tmp"
1784#line 1786 "p-exp.c.tmp"
1793#line 1795 "p-exp.c.tmp"
1799#line 1801 "p-exp.c.tmp"
1805#line 1807 "p-exp.c.tmp"
1811#line 1813 "p-exp.c.tmp"
1817#line 1819 "p-exp.c.tmp"
1826#line 1828 "p-exp.c.tmp"
1835#line 1837 "p-exp.c.tmp"
1845#line 1847 "p-exp.c.tmp"
1852 (
yyvsp[0].ssym).stoken.length, 0, &val);
1858#line 1860 "p-exp.c.tmp"
1869#line 1871 "p-exp.c.tmp"
1883 std::string tmp ((
yyvsp[0].sval).ptr, (
yyvsp[0].sval).length);
1887 if (intvar !=
nullptr)
1897#line 1899 "p-exp.c.tmp"
1907 (
yyvsp[-1].tval)->length ()); }
1908#line 1910 "p-exp.c.tmp"
1915#line 1917 "p-exp.c.tmp"
1925 const char *sp = (
yyvsp[0].sval).ptr;
int count = (
yyvsp[0].sval).length;
1927 std::vector<operation_up> args (count + 1);
1928 for (
int i = 0; i < count; ++i)
1929 args[i] = (make_operation<long_const_operation>
1932 args[count] = (make_operation<long_const_operation>
1936 (0, (
yyvsp[0].sval).length, std::move (args));
1938#line 1940 "p-exp.c.tmp"
1944 struct value * this_val;
1945 struct type * this_type;
1956 if (this_type->
code () == TYPE_CODE_PTR)
1965#line 1967 "p-exp.c.tmp"
1971 if ((
yyvsp[0].ssym).sym.symbol != 0)
1972 (
yyval.bval) = (
yyvsp[0].ssym).sym.symbol->value_block ();
1982 error (_(
"No file or function \"%s\"."),
1986#line 1988 "p-exp.c.tmp"
1998 error (_(
"No function \"%s\" in specified context."),
2001#line 2003 "p-exp.c.tmp"
2012 error (_(
"No symbol \"%s\" in specified context."),
2017#line 2019 "p-exp.c.tmp"
2025 if (
type->
code () != TYPE_CODE_STRUCT
2026 &&
type->
code () != TYPE_CODE_UNION)
2027 error (_(
"`%s' is not defined as an aggregate type."),
2033#line 2035 "p-exp.c.tmp"
2046#line 2048 "p-exp.c.tmp"
2060 else if ((
yyvsp[0].ssym).is_a_field_of_this)
2062 struct value * this_val;
2063 struct type * this_type;
2069 = make_operation<op_this_operation> ();
2093 if (msymbol.
minsym != NULL)
2098 error (_(
"No symbol table is loaded. "
2099 "Use the \"file\" command."));
2101 error (_(
"No symbol \"%s\" in current context."),
2105#line 2107 "p-exp.c.tmp"
2111#line 2113 "p-exp.c.tmp"
2117#line 2119 "p-exp.c.tmp"
2126#line 2128 "p-exp.c.tmp"
2135#line 2137 "p-exp.c.tmp"
2141#line 2143 "p-exp.c.tmp"
2147#line 2149 "p-exp.c.tmp"
2153#line 2155 "p-exp.c.tmp"
2159#line 2161 "p-exp.c.tmp"
2163#line 2165 "p-exp.c.tmp"
2213 if (yyerrstatus == 3)
2367 const char *p,
int len,
int parsed_float,
YYSTYPE *putithere)
2381 int found_suffix = 0;
2387 if (len >= 1 && tolower (p[len - 1]) ==
'f')
2393 else if (len >= 1 && tolower (p[len - 1]) ==
'l')
2396 =
parse_type (par_state)->builtin_long_double;
2414 if (p[0] ==
'0' && len > 1)
2447 if (c >=
'A' && c <=
'Z')
2449 if (c !=
'l' && c !=
'u')
2451 if (c >=
'0' && c <=
'9')
2459 if (base > 10 && c >=
'a' && c <=
'f')
2463 n += i = c -
'a' + 10;
2481 if (c !=
'l' && c !=
'u')
2484 if (prevn == 0 && n == 0)
2486 else if (prevn >= n)
2487 error (_(
"Numeric constant too large."));
2507 bool have_signed = !unsigned_p;
2508 bool have_int = long_p == 0;
2509 bool have_long = long_p <= 1;
2510 if (have_int && have_signed &&
fits_in_type (1, n, int_bits,
true))
2512 else if (have_int &&
fits_in_type (1, n, int_bits,
false))
2514 =
parse_type (par_state)->builtin_unsigned_int;
2515 else if (have_long && have_signed &&
fits_in_type (1, n, long_bits,
true))
2517 else if (have_long &&
fits_in_type (1, n, long_bits,
false))
2519 =
parse_type (par_state)->builtin_unsigned_long;
2520 else if (have_signed &&
fits_in_type (1, n, long_long_bits,
true))
2525 =
parse_type (par_state)->builtin_unsigned_long_long;
2527 error (_(
"Numeric constant too large."));
2574 {
"shr",
RSH, OP_NULL},
2575 {
"shl",
LSH, OP_NULL},
2576 {
"and",
ANDAND, OP_NULL},
2577 {
"div",
DIV, OP_NULL},
2578 {
"not",
NOT, OP_NULL},
2579 {
"mod",
MOD, OP_NULL},
2582 {
"xor",
XOR, OP_NULL}
2587 {
"or",
OR, OP_NULL},
2589 {
"<=",
LEQ, OP_NULL},
2590 {
">=",
GEQ, OP_NULL},
2597uptok (
const char *tokstart,
int namelen)
2600 char *uptokstart = (
char *)
xmalloc(namelen+1);
2601 for (i = 0;i <= namelen;i++)
2603 if ((tokstart[i]>=
'a' && tokstart[i]<=
'z'))
2604 uptokstart[i] = tokstart[i]-(
'a'-
'A');
2606 uptokstart[i] = tokstart[i];
2608 uptokstart[namelen]=
'\0';
2619 const char *tokstart;
2636 if (strncasecmp (tokstart,
token.
oper, 3) == 0
2637 && (!isalpha (
token.
oper[0]) || explen == 3
2638 || (!isalpha (tokstart[3])
2639 && !isdigit (tokstart[3]) && tokstart[3] !=
'_')))
2649 if (strncasecmp (tokstart,
token.
oper, 2) == 0
2650 && (!isalpha (
token.
oper[0]) || explen == 2
2651 || (!isalpha (tokstart[2])
2652 && !isdigit (tokstart[2]) && tokstart[2] !=
'_')))
2659 switch (c = *tokstart)
2682 error (_(
"Empty character constant."));
2695 error (_(
"Unmatched single quote."));
2698 uptokstart =
uptok(tokstart,namelen);
2701 error (_(
"Invalid character constant."));
2744 int got_dot = 0, got_e = 0, toktype;
2745 const char *p = tokstart;
2748 if (c ==
'0' && (p[1] ==
'x' || p[1] ==
'X'))
2753 else if (c ==
'0' && (p[1]==
't' || p[1]==
'T'
2754 || p[1]==
'd' || p[1]==
'D'))
2765 if (!hex && !got_e && (*p ==
'e' || *p ==
'E'))
2766 got_dot = got_e = 1;
2769 else if (!got_dot && *p ==
'.')
2771 else if (got_e && (p[-1] ==
'e' || p[-1] ==
'E')
2772 && (*p ==
'-' || *p ==
'+'))
2778 else if ((*p <
'0' || *p >
'9')
2779 && ((*p <
'a' || *p >
'z')
2780 && (*p <
'A' || *p >
'Z')))
2784 p - tokstart, got_dot | got_e, &
yylval);
2785 if (toktype ==
ERROR)
2787 char *err_copy = (
char *) alloca (p - tokstart + 1);
2789 memcpy (err_copy, tokstart, p - tokstart);
2790 err_copy[p - tokstart] = 0;
2791 error (_(
"Invalid number \"%s\"."), err_copy);
2831 tokptr = ++tokstart;
2861 }
while ((*tokptr !=
'"') && (*tokptr !=
'\0'));
2862 if (*tokptr++ !=
'"')
2864 error (_(
"Unterminated string in expression."));
2873 if (!(c ==
'_' || c ==
'$'
2874 || (c >=
'a' && c <=
'z') || (c >=
'A' && c <=
'Z')))
2876 error (_(
"Invalid character '%c' in expression."), c);
2880 for (c = tokstart[namelen];
2881 (c ==
'_' || c ==
'$' || (c >=
'0' && c <=
'9')
2882 || (c >=
'a' && c <=
'z') || (c >=
'A' && c <=
'Z') || c ==
'<');)
2889 int nesting_level = 1;
2890 while (tokstart[++i])
2892 if (tokstart[i] ==
'<')
2894 else if (tokstart[i] ==
'>')
2896 if (--nesting_level == 0)
2900 if (tokstart[i] ==
'>')
2907 c = tokstart[++namelen];
2910 uptokstart =
uptok(tokstart,namelen);
2914 if (namelen == 2 && uptokstart[0] ==
'I' && uptokstart[1] ==
'F')
2928 if (strcmp (uptokstart,
"OBJECT") == 0)
2933 if (strcmp (uptokstart,
"RECORD") == 0)
2938 if (strcmp (uptokstart,
"SIZEOF") == 0)
2945 if (strcmp (uptokstart,
"CLASS") == 0)
2950 if (strcmp (uptokstart,
"FALSE") == 0)
2958 if (strcmp (uptokstart,
"TRUE") == 0)
2964 if (strcmp (uptokstart,
"SELF") == 0)
2968 static const char this_name[] =
"this";
2985 if (*tokstart ==
'$')
3003 is_a_field_of_this.
type = NULL;
3006 tmp.c_str (), 1) != NULL);
3013 if (!sym && is_a_field_of_this.
type == NULL && !is_a_field)
3015 for (
int i = 0; i <= namelen; i++)
3017 if ((tmp[i] >=
'a' && tmp[i] <=
'z'))
3018 tmp[i] -= (
'a'-
'A');
3022 tmp.c_str (), 1) != NULL);
3030 if (!sym && is_a_field_of_this.
type == NULL && !is_a_field)
3032 for (
int i = 0; i <= namelen; i++)
3036 if ((tmp[i] >=
'a' && tmp[i] <=
'z'))
3037 tmp[i] -= (
'a'-
'A');
3040 if ((tmp[i] >=
'A' && tmp[i] <=
'Z'))
3041 tmp[i] -= (
'A'-
'a');
3045 tmp.c_str (), 1) != NULL);
3053 if (is_a_field || (is_a_field_of_this.
type != NULL))
3056 strncpy (
tempbuf, tmp.c_str (), namelen);
3094 const char *namestart;
3113 while (*p ==
' ' || *p ==
'\t' || *p ==
'\n')
3115 if (*p ==
':' && p[1] ==
':')
3120 while (*p ==
' ' || *p ==
'\t' || *p ==
'\n')
3123 while (*p ==
'_' || *p ==
'$' || (*p >=
'0' && *p <=
'9')
3124 || (*p >=
'a' && *p <=
'z')
3125 || (*p >=
'A' && *p <=
'Z'))
3133 = (
char *) alloca (tmp.size () + strlen (namestart)
3138 memcpy (tmp1, tmp.c_str (), tmp.size ());
3139 tmp1 += tmp.size ();
3140 memcpy (tmp1,
"::", 2);
3142 memcpy (tmp1, namestart, p - namestart);
3143 tmp1[p - namestart] =
'\0';
3188 && ((tokstart[0] >=
'a' && tokstart[0] <
'a' +
input_radix - 10)
3189 || (tokstart[0] >=
'A' && tokstart[0] <
'A' +
input_radix - 10)))
3217 scoped_restore pstate_restore = make_scoped_restore (&
pstate);
3218 gdb_assert (par_state != NULL);
3234 error (_(
"A %s in expression, near `%s'."), msg,
pstate->
lexptr);
static struct parser_state * pstate
void * xrealloc(void *ptr, size_t size)
static struct obstack tempbuf
void update(const struct block *b, innermost_block_tracker_types t)
int parser(struct parser_state *ps) const override
const char * skip_quoted(const char *str)
int symbol_read_needs_frame(struct symbol *sym)
int gdbarch_long_long_bit(struct gdbarch *gdbarch)
int gdbarch_int_bit(struct gdbarch *gdbarch)
int gdbarch_long_bit(struct gdbarch *gdbarch)
struct type * lookup_pointer_type(struct type *type)
int is_integral_type(struct type *t)
struct type * lookup_struct_elt_type(struct type *type, const char *name, int noerr)
struct type * lookup_struct(const char *name, const struct block *block)
struct type * check_typedef(struct type *type)
#define TYPE_POINTER_TYPE(thistype)
struct type * language_lookup_primitive_type(const struct language_defn *la, struct gdbarch *gdbarch, const char *name)
struct bound_minimal_symbol lookup_bound_minimal_symbol(const char *name)
std::unique_ptr< operation > operation_up
std::array< gdb_byte, 16 > float_data
int have_partial_symbols(void)
int have_full_symbols(void)
static const char * yysymbol_name(yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
static const yytype_int8 yytranslate[]
@ YYSYMBOL_name_not_typename
@ YYSYMBOL_qualified_name
@ YYSYMBOL_DOLLAR_VARIABLE
static void yy_symbol_print(FILE *yyo, yysymbol_kind_t yykind, YYSTYPE const *const yyvaluep)
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
static const yytype_int8 yydefact[]
#define YY_IGNORE_USELESS_CAST_END
static const yytype_int16 yyrline[]
static const yytype_int8 yycheck[]
#define YY_REDUCE_PRINT(Rule)
#define YY_CAST(Type, Val)
static void yydestruct(const char *yymsg, yysymbol_kind_t yykind, YYSTYPE *yyvaluep)
static struct parser_state * pstate
static const yytype_int16 yypact[]
#define YY_ACCESSING_SYMBOL(State)
#define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
static void push_current_type(void)
static int parse_number(struct parser_state *, const char *, int, int, YYSTYPE *)
static const struct token tokentab3[]
#define YY_STACK_PRINT(Bottom, Top)
static void yy_symbol_value_print(FILE *yyo, yysymbol_kind_t yykind, YYSTYPE const *const yyvaluep)
#define YY_IGNORE_USELESS_CAST_BEGIN
static const yytype_int8 yyr2[]
static const yytype_int8 yytable[]
static void pop_current_type(void)
static void yy_reduce_print(yy_state_t *yyssp, YYSTYPE *yyvsp, int yyrule)
static int leftdiv_is_integer
#define yytable_value_is_error(Yyn)
static const yytype_int8 yystos[]
#define YY_ATTRIBUTE_UNUSED
static const struct token tokentab2[]
static const char *const yytname[]
static struct type * current_type
static const yytype_int8 yypgoto[]
static const yytype_int8 yyr1[]
enum yytokentype yytoken_kind_t
static struct type_push * tp_top
static const yytype_int8 yydefgoto[]
static char * uptok(const char *, int)
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
#define yypact_value_is_default(Yyn)
static void yy_stack_print(yy_state_t *yybottom, yy_state_t *yytop)
int pascal_is_string_type(struct type *type, int *length_pos, int *length_size, int *string_pos, struct type **char_type, const char **arrayname)
bool parse_float(const char *p, int len, const struct type *type, gdb_byte *data)
bool fits_in_type(int n_sign, ULONGEST n, int type_bits, bool type_signed_p)
std::string copy_name(struct stoken token)
const struct block * block
struct block * static_block()
struct minimal_symbol * minsym
struct blockvector * blockvector()
void set_operation(expr::operation_up &&op)
const struct language_defn * language()
struct gdbarch * gdbarch()
struct type * type() const
void push_new(Arg... args)
const struct block *const expression_context_block
std::vector< expr::operation_up > pop_vector(int n)
void push_dollar(struct stoken str)
void push_symbol(const char *name, block_symbol sym)
innermost_block_tracker * block_tracker
void push(expr::operation_up &&op)
void mark_struct_expression(expr::structop_base_operation *op)
const block * value_block() const
address_class aclass() const
struct type * type() const
struct compunit_symtab * compunit() const
struct type * target_type() const
struct field & field(int idx) const
const char * name() const
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)
struct symtab * lookup_symtab(const char *name)
struct YYSTYPE::@23 typed_val_int
struct YYSTYPE::@3 typed_val_float
const struct block * bval
struct internalvar * ivar
std::vector< struct type * > * tvec
int parse_escape(struct gdbarch *gdbarch, const char **string_ptr)
struct value * value_of_this_silent(const struct language_defn *lang)
struct type * value_type(const struct value *value)
struct value * value_of_internalvar(struct gdbarch *gdbarch, struct internalvar *var)
struct internalvar * lookup_only_internalvar(const char *name)