1 /* A Bison parser, made by GNU Bison 3.0.2. */
3 /* Bison implementation for Yacc-like parsers in C
5 Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20 /* As a special exception, you may create a larger work that contains
21 part or all of the Bison parser skeleton and distribute that work
22 under terms of your choice, so long as that work isn't itself a
23 parser generator using the skeleton or a modified version thereof
24 as a parser skeleton. Alternatively, if you modify or redistribute
25 the parser skeleton itself, you may (at your option) remove this
26 special exception, which will cause the skeleton and the resulting
27 Bison output files to be licensed under the GNU General Public
28 License without this special exception.
30 This special exception was added by the Free Software Foundation in
31 version 2.2 of Bison. */
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34 simplifying the original so-called "semantic" parser. */
36 /* All symbols defined below should begin with yy or YY, to avoid
37 infringing on user name space. This should be done even for local
38 variables, as they might otherwise be expanded by user macros.
39 There are some unavoidable exceptions within include files to
40 define necessary library symbols; they are noted "INFRINGES ON
41 USER NAME SPACE" below. */
43 /* Identify Bison output. */
47 #define YYBISON_VERSION "3.0.2"
50 #define YYSKELETON_NAME "yacc.c"
64 /* Copy the first part of user declarations. */
65 #line 38 "m2-exp.y" /* yacc.c:339 */
69 #include "expression.h"
72 #include "parser-defs.h"
74 #include "bfd.h" /* Required by objfiles.h. */
75 #include "symfile.h" /* Required by objfiles.h. */
76 #include "objfiles.h" /* For have_full_symbols and have_partial_symbols */
79 #define parse_type(ps) builtin_type (parse_gdbarch (ps))
80 #define parse_m2_type(ps) builtin_m2_type (parse_gdbarch (ps))
82 /* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc),
83 as well as gratuitiously global symbol names, so we can have multiple
84 yacc generated parsers in gdb. Note that these are only the variables
85 produced by yacc. If other parser generators (bison, byacc, etc) produce
86 additional global names that conflict at link time, then those parser
87 generators need to be fixed instead of adding those names to this list. */
89 #define yymaxdepth m2_maxdepth
90 #define yyparse m2_parse_internal
92 #define yyerror m2_error
93 #define yylval m2_lval
94 #define yychar m2_char
95 #define yydebug m2_debug
96 #define yypact m2_pact
103 #define yyexca m2_exca
104 #define yyerrflag m2_errflag
105 #define yynerrs m2_nerrs
109 #define yy_yys m2_yys
110 #define yystate m2_state
113 #define yy_yyv m2_yyv
115 #define yylloc m2_lloc
116 #define yyreds m2_reds /* With YYDEBUG defined */
117 #define yytoks m2_toks /* With YYDEBUG defined */
118 #define yyname m2_name /* With YYDEBUG defined */
119 #define yyrule m2_rule /* With YYDEBUG defined */
120 #define yylhs m2_yylhs
121 #define yylen m2_yylen
122 #define yydefred m2_yydefred
123 #define yydgoto m2_yydgoto
124 #define yysindex m2_yysindex
125 #define yyrindex m2_yyrindex
126 #define yygindex m2_yygindex
127 #define yytable m2_yytable
128 #define yycheck m2_yycheck
130 #define yysslim m2_yysslim
131 #define yyssp m2_yyssp
132 #define yystacksize m2_yystacksize
134 #define yyvsp m2_yyvsp
137 #define YYDEBUG 1 /* Default to yydebug support */
140 #define YYFPRINTF parser_fprintf
142 /* The state of the parser, used internally when we are parsing the
145 static struct parser_state *pstate = NULL;
149 static int yylex (void);
151 void yyerror (char *);
153 static int parse_number (int);
155 /* The sign of the number being parsed. */
156 static int number_sign = 1;
159 #line 160 "m2-exp.c" /* yacc.c:339 */
162 # if defined __cplusplus && 201103L <= __cplusplus
163 # define YY_NULLPTR nullptr
165 # define YY_NULLPTR 0
169 /* Enabling verbose error messages. */
170 #ifdef YYERROR_VERBOSE
171 # undef YYERROR_VERBOSE
172 # define YYERROR_VERBOSE 1
174 # define YYERROR_VERBOSE 0
251 #define BLOCKNAME 268
262 #define FLOAT_FUNC 279
272 #define COLONCOLON 289
273 #define INTERNAL_VAR 290
274 #define ABOVE_COMMA 291
281 #define LOGICAL_AND 298
290 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
291 typedef union YYSTYPE YYSTYPE;
294 #line 137 "m2-exp.y" /* yacc.c:355 */
303 const struct block *bval;
304 enum exp_opcode opcode;
305 struct internalvar *ivar;
311 #line 312 "m2-exp.c" /* yacc.c:355 */
313 # define YYSTYPE_IS_TRIVIAL 1
314 # define YYSTYPE_IS_DECLARED 1
318 extern YYSTYPE yylval;
324 /* Copy the second part of user declarations. */
326 #line 327 "m2-exp.c" /* yacc.c:358 */
333 typedef YYTYPE_UINT8 yytype_uint8;
335 typedef unsigned char yytype_uint8;
339 typedef YYTYPE_INT8 yytype_int8;
341 typedef signed char yytype_int8;
345 typedef YYTYPE_UINT16 yytype_uint16;
347 typedef unsigned short int yytype_uint16;
351 typedef YYTYPE_INT16 yytype_int16;
353 typedef short int yytype_int16;
357 # ifdef __SIZE_TYPE__
358 # define YYSIZE_T __SIZE_TYPE__
359 # elif defined size_t
360 # define YYSIZE_T size_t
361 # elif ! defined YYSIZE_T
362 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
363 # define YYSIZE_T size_t
365 # define YYSIZE_T unsigned int
369 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
372 # if defined YYENABLE_NLS && YYENABLE_NLS
374 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
375 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
379 # define YY_(Msgid) Msgid
384 # if (defined __GNUC__ \
385 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
386 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
387 # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
389 # define YY_ATTRIBUTE(Spec) /* empty */
393 #ifndef YY_ATTRIBUTE_PURE
394 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
397 #ifndef YY_ATTRIBUTE_UNUSED
398 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
401 #if !defined _Noreturn \
402 && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
403 # if defined _MSC_VER && 1200 <= _MSC_VER
404 # define _Noreturn __declspec (noreturn)
406 # define _Noreturn YY_ATTRIBUTE ((__noreturn__))
410 /* Suppress unused-variable warnings by "using" E. */
411 #if ! defined lint || defined __GNUC__
412 # define YYUSE(E) ((void) (E))
414 # define YYUSE(E) /* empty */
417 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
418 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
419 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
420 _Pragma ("GCC diagnostic push") \
421 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
422 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
423 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
424 _Pragma ("GCC diagnostic pop")
426 # define YY_INITIAL_VALUE(Value) Value
428 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
429 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
430 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
432 #ifndef YY_INITIAL_VALUE
433 # define YY_INITIAL_VALUE(Value) /* Nothing. */
437 #if ! defined yyoverflow || YYERROR_VERBOSE
439 /* The parser invokes alloca or xmalloc; define the necessary symbols. */
441 # ifdef YYSTACK_USE_ALLOCA
442 # if YYSTACK_USE_ALLOCA
444 # define YYSTACK_ALLOC __builtin_alloca
445 # elif defined __BUILTIN_VA_ARG_INCR
446 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
448 # define YYSTACK_ALLOC __alloca
449 # elif defined _MSC_VER
450 # define alloca _alloca
452 # define YYSTACK_ALLOC alloca
453 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
454 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
455 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
456 # ifndef EXIT_SUCCESS
457 # define EXIT_SUCCESS 0
464 # ifdef YYSTACK_ALLOC
465 /* Pacify GCC's 'empty if-body' warning. */
466 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
467 # ifndef YYSTACK_ALLOC_MAXIMUM
468 /* The OS might guarantee only one guard page at the bottom of the stack,
469 and a page size can be as small as 4096 bytes. So we cannot safely
470 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
471 to allow for a few compiler-allocated temporary stack slots. */
472 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
475 # define YYSTACK_ALLOC YYMALLOC
476 # define YYSTACK_FREE YYFREE
477 # ifndef YYSTACK_ALLOC_MAXIMUM
478 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
480 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
481 && ! ((defined YYMALLOC || defined xmalloc) \
482 && (defined YYFREE || defined xfree)))
483 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
484 # ifndef EXIT_SUCCESS
485 # define EXIT_SUCCESS 0
489 # define YYMALLOC xmalloc
490 # if ! defined xmalloc && ! defined EXIT_SUCCESS
491 void *xmalloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
495 # define YYFREE xfree
496 # if ! defined xfree && ! defined EXIT_SUCCESS
497 void xfree (void *); /* INFRINGES ON USER NAME SPACE */
501 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
504 #if (! defined yyoverflow \
505 && (! defined __cplusplus \
506 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
508 /* A type that is properly aligned for any stack member. */
511 yytype_int16 yyss_alloc;
515 /* The size of the maximum gap between one aligned stack and the next. */
516 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
518 /* The size of an array large to enough to hold all stacks, each with
520 # define YYSTACK_BYTES(N) \
521 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
522 + YYSTACK_GAP_MAXIMUM)
524 # define YYCOPY_NEEDED 1
526 /* Relocate STACK from its old location to the new one. The
527 local variables YYSIZE and YYSTACKSIZE give the old and new number of
528 elements in the stack, and YYPTR gives the new location of the
529 stack. Advance YYPTR to a properly aligned location for the next
531 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
534 YYSIZE_T yynewbytes; \
535 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
536 Stack = &yyptr->Stack_alloc; \
537 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
538 yyptr += yynewbytes / sizeof (*yyptr); \
544 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
545 /* Copy COUNT objects from SRC to DST. The source and destination do
548 # if defined __GNUC__ && 1 < __GNUC__
549 # define YYCOPY(Dst, Src, Count) \
550 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
552 # define YYCOPY(Dst, Src, Count) \
556 for (yyi = 0; yyi < (Count); yyi++) \
557 (Dst)[yyi] = (Src)[yyi]; \
562 #endif /* !YYCOPY_NEEDED */
564 /* YYFINAL -- State number of the termination state. */
566 /* YYLAST -- Last index in YYTABLE. */
569 /* YYNTOKENS -- Number of terminals. */
571 /* YYNNTS -- Number of nonterminals. */
573 /* YYNRULES -- Number of rules. */
575 /* YYNSTATES -- Number of states. */
576 #define YYNSTATES 187
578 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
579 by yylex, with out-of-bounds checking. */
581 #define YYMAXUTOK 304
583 #define YYTRANSLATE(YYX) \
584 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
586 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
587 as returned by yylex, without out-of-bounds checking. */
588 static const yytype_uint8 yytranslate[] =
590 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
591 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
592 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
593 2, 2, 2, 2, 2, 45, 2, 2, 49, 2,
594 61, 65, 53, 51, 36, 52, 2, 54, 2, 2,
595 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
596 39, 43, 40, 2, 50, 2, 2, 2, 2, 2,
597 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
598 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
599 2, 60, 2, 68, 58, 2, 2, 2, 2, 2,
600 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
601 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
602 2, 2, 2, 66, 2, 67, 63, 2, 2, 2,
603 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
604 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
605 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
606 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
607 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
608 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
609 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
610 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
611 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
612 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
613 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
614 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
615 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
616 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
617 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
618 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
619 35, 37, 38, 41, 42, 44, 46, 47, 48, 55,
624 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
625 static const yytype_uint16 yyrline[] =
627 0, 206, 206, 207, 210, 219, 224, 223, 230, 234,
628 238, 239, 242, 246, 250, 254, 258, 264, 270, 274,
629 280, 284, 288, 292, 296, 301, 305, 312, 316, 323,
630 329, 332, 336, 340, 344, 346, 356, 352, 364, 371,
631 368, 379, 382, 386, 391, 396, 401, 407, 413, 421,
632 425, 429, 433, 437, 441, 445, 449, 453, 455, 459,
633 463, 467, 471, 475, 479, 483, 490, 496, 502, 510,
634 521, 531, 540, 543, 552, 559, 563, 573, 585, 593,
639 #if YYDEBUG || YYERROR_VERBOSE || 0
640 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
641 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
642 static const char *const yytname[] =
644 "$end", "error", "$undefined", "INT", "HEX", "ERROR", "UINT", "M2_TRUE",
645 "M2_FALSE", "CHAR", "FLOAT", "STRING", "NAME", "BLOCKNAME", "IDENT",
646 "VARNAME", "TYPENAME", "SIZE", "CAP", "ORD", "HIGH", "ABS", "MIN_FUNC",
647 "MAX_FUNC", "FLOAT_FUNC", "VAL", "CHR", "ODD", "TRUNC", "TSIZE", "INC",
648 "DEC", "INCL", "EXCL", "COLONCOLON", "INTERNAL_VAR", "','",
649 "ABOVE_COMMA", "ASSIGN", "'<'", "'>'", "LEQ", "GEQ", "'='", "NOTEQUAL",
650 "'#'", "IN", "OROR", "LOGICAL_AND", "'&'", "'@'", "'+'", "'-'", "'*'",
651 "'/'", "DIV", "MOD", "UNARY", "'^'", "DOT", "'['", "'('", "NOT", "'~'",
652 "QID", "')'", "'{'", "'}'", "']'", "$accept", "start", "type_exp", "exp",
653 "$@1", "not_exp", "set", "$@2", "$@3", "arglist", "non_empty_arglist",
654 "block", "fblock", "variable", "type", YY_NULLPTR
659 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
660 (internal) symbol number NUM (which must be that of a token). */
661 static const yytype_uint16 yytoknum[] =
663 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
664 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
665 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
666 285, 286, 287, 288, 289, 290, 44, 291, 292, 60,
667 62, 293, 294, 61, 295, 35, 296, 297, 298, 38,
668 64, 43, 45, 42, 47, 299, 300, 301, 94, 302,
669 91, 40, 303, 126, 304, 41, 123, 125, 93
673 #define YYPACT_NINF -90
675 #define yypact_value_is_default(Yystate) \
676 (!!((Yystate) == (-90)))
678 #define YYTABLE_NINF -76
680 #define yytable_value_is_error(Yytable_value) \
681 (!!((Yytable_value) == (-76)))
683 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
685 static const yytype_int16 yypact[] =
687 163, -90, -90, -90, -90, -90, -90, -90, -90, -90,
688 -90, 224, -35, -28, -22, -18, 2, 8, 17, 28,
689 30, 31, 32, 34, 35, 36, 38, 39, -90, 163,
690 -90, 163, -90, -90, 163, 27, -90, 807, 163, -90,
691 -6, -4, -90, -21, 163, 7, -21, 163, 163, 163,
692 163, 85, 85, 163, 85, 163, 163, 163, 163, 163,
693 163, 163, 163, 7, 163, 309, 807, -32, -42, -90,
694 163, 163, 163, 163, 163, 163, 163, 163, -15, 163,
695 163, 163, 163, 163, 163, 163, 163, 163, -90, 90,
696 163, -90, 7, -5, 163, 163, -24, 337, 365, 393,
697 421, -19, 42, 449, 67, 477, 505, 533, 561, 253,
698 281, 757, 783, 7, -90, 163, -90, 163, 831, -38,
699 -38, -38, -38, -38, -38, -38, 163, -90, 43, 149,
700 210, 842, 851, 851, 7, 7, 7, 7, -90, 83,
701 163, 163, -90, -90, 589, -31, -90, -90, -90, -90,
702 -90, -90, -90, -90, 163, -90, -90, -90, -90, 163,
703 -90, 163, -90, 163, 163, 807, 7, -90, 807, -34,
704 -33, -90, -90, 617, 645, 673, 701, 729, 163, -90,
705 -90, -90, -90, -90, -90, -90, 807
708 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
709 Performed when YYTABLE does not specify something else to do. Zero
710 means the default is an error. */
711 static const yytype_uint8 yydefact[] =
713 0, 68, 69, 66, 67, 70, 71, 74, 81, 76,
714 82, 0, 0, 0, 0, 0, 0, 0, 0, 0,
715 0, 0, 0, 0, 0, 0, 0, 0, 79, 0,
716 6, 0, 10, 11, 41, 0, 3, 2, 0, 30,
717 0, 78, 72, 4, 0, 24, 0, 0, 0, 0,
718 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
719 0, 0, 0, 8, 0, 0, 42, 0, 0, 1,
720 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
721 0, 0, 0, 0, 0, 0, 0, 0, 5, 0,
722 0, 39, 9, 0, 0, 41, 0, 0, 0, 0,
723 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
724 0, 0, 0, 7, 48, 0, 34, 0, 65, 61,
725 62, 59, 60, 56, 57, 58, 41, 31, 0, 64,
726 63, 49, 54, 55, 50, 51, 52, 53, 29, 0,
727 0, 41, 80, 77, 0, 0, 73, 12, 13, 15,
728 14, 16, 17, 18, 0, 20, 21, 22, 23, 0,
729 25, 0, 27, 0, 0, 43, 46, 38, 44, 0,
730 0, 47, 35, 0, 0, 0, 0, 0, 0, 37,
731 40, 19, 26, 28, 32, 33, 45
734 /* YYPGOTO[NTERM-NUM]. */
735 static const yytype_int8 yypgoto[] =
737 -90, -90, -90, 0, -90, -90, 26, -90, -90, -89,
738 -90, -90, -90, -90, 54
741 /* YYDEFGOTO[NTERM-NUM]. */
742 static const yytype_int16 yydefgoto[] =
744 -1, 35, 36, 66, 64, 38, 39, 140, 141, 67,
748 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
749 positive, shift that token. If negative, reduce the rule whose
750 number is the opposite. If YYTABLE_NINF, syntax error. */
751 static const yytype_int16 yytable[] =
753 37, 10, 178, 115, 115, 115, 145, 142, 143, 79,
754 80, 45, 81, 82, 83, 84, 85, 86, 87, 94,
755 88, 89, 90, 91, 95, 117, 47, 69, 93, 63,
756 -75, 65, 180, 48, 179, 116, 172, 94, 92, 49,
757 94, 146, 95, 50, 65, 95, 151, 97, 98, 99,
758 100, 126, 170, 103, 43, 105, 106, 107, 108, 109,
759 110, 111, 112, 51, 113, 88, 89, 90, 91, 52,
760 118, 119, 120, 121, 122, 123, 124, 125, 53, 129,
761 130, 131, 132, 133, 134, 135, 136, 137, 68, 54,
762 139, 55, 56, 57, 144, 58, 59, 60, 96, 61,
763 62, 10, 138, 154, 127, 101, 102, 152, 104, 95,
764 0, 0, 0, 0, 0, 165, 0, 166, 0, 0,
765 0, 70, 71, 72, 73, 74, 75, 76, 77, 78,
766 79, 80, 128, 81, 82, 83, 84, 85, 86, 87,
767 168, 88, 89, 90, 91, 0, 0, 0, 0, 0,
768 0, 167, 0, 0, 173, 0, 0, 0, 0, 174,
769 0, 175, 0, 176, 177, 0, 1, 0, 0, 2,
770 3, 4, 5, 6, 7, 8, 9, 0, 186, 10,
771 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
772 21, 22, 23, 24, 25, 26, 27, 80, 28, 81,
773 82, 83, 84, 85, 86, 87, 0, 88, 89, 90,
774 91, 0, 0, 0, 29, 30, 0, 0, 0, 0,
775 0, 0, 0, 0, 31, 32, 33, 1, 0, 34,
776 2, 3, 4, 5, 6, 7, 8, 9, 0, 0,
777 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
778 20, 21, 22, 23, 24, 25, 26, 27, 0, 28,
779 81, 82, 83, 84, 85, 86, 87, 0, 88, 89,
780 90, 91, 0, 0, 0, 29, 30, 0, 0, 0,
781 0, 0, 0, 0, 0, 44, 32, 33, 0, 159,
782 34, 70, 71, 72, 73, 74, 75, 76, 77, 78,
783 79, 80, 0, 81, 82, 83, 84, 85, 86, 87,
784 0, 88, 89, 90, 91, 0, 0, 161, 160, 70,
785 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
786 0, 81, 82, 83, 84, 85, 86, 87, 0, 88,
787 89, 90, 91, 0, 0, 0, 162, 70, 71, 72,
788 73, 74, 75, 76, 77, 78, 79, 80, 0, 81,
789 82, 83, 84, 85, 86, 87, 0, 88, 89, 90,
790 91, 0, 0, 0, 114, 70, 71, 72, 73, 74,
791 75, 76, 77, 78, 79, 80, 0, 81, 82, 83,
792 84, 85, 86, 87, 0, 88, 89, 90, 91, 0,
793 0, 0, 147, 70, 71, 72, 73, 74, 75, 76,
794 77, 78, 79, 80, 0, 81, 82, 83, 84, 85,
795 86, 87, 0, 88, 89, 90, 91, 0, 0, 0,
796 148, 70, 71, 72, 73, 74, 75, 76, 77, 78,
797 79, 80, 0, 81, 82, 83, 84, 85, 86, 87,
798 0, 88, 89, 90, 91, 0, 0, 0, 149, 70,
799 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
800 0, 81, 82, 83, 84, 85, 86, 87, 0, 88,
801 89, 90, 91, 0, 0, 0, 150, 70, 71, 72,
802 73, 74, 75, 76, 77, 78, 79, 80, 0, 81,
803 82, 83, 84, 85, 86, 87, 0, 88, 89, 90,
804 91, 0, 0, 0, 153, 70, 71, 72, 73, 74,
805 75, 76, 77, 78, 79, 80, 0, 81, 82, 83,
806 84, 85, 86, 87, 0, 88, 89, 90, 91, 0,
807 0, 0, 155, 70, 71, 72, 73, 74, 75, 76,
808 77, 78, 79, 80, 0, 81, 82, 83, 84, 85,
809 86, 87, 0, 88, 89, 90, 91, 0, 0, 0,
810 156, 70, 71, 72, 73, 74, 75, 76, 77, 78,
811 79, 80, 0, 81, 82, 83, 84, 85, 86, 87,
812 0, 88, 89, 90, 91, 0, 0, 0, 157, 70,
813 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
814 0, 81, 82, 83, 84, 85, 86, 87, 0, 88,
815 89, 90, 91, 0, 0, 0, 158, 70, 71, 72,
816 73, 74, 75, 76, 77, 78, 79, 80, 0, 81,
817 82, 83, 84, 85, 86, 87, 0, 88, 89, 90,
818 91, 0, 0, 0, 171, 70, 71, 72, 73, 74,
819 75, 76, 77, 78, 79, 80, 0, 81, 82, 83,
820 84, 85, 86, 87, 0, 88, 89, 90, 91, 0,
821 0, 0, 181, 70, 71, 72, 73, 74, 75, 76,
822 77, 78, 79, 80, 0, 81, 82, 83, 84, 85,
823 86, 87, 0, 88, 89, 90, 91, 0, 0, 0,
824 182, 70, 71, 72, 73, 74, 75, 76, 77, 78,
825 79, 80, 0, 81, 82, 83, 84, 85, 86, 87,
826 0, 88, 89, 90, 91, 0, 0, 0, 183, 70,
827 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
828 0, 81, 82, 83, 84, 85, 86, 87, 0, 88,
829 89, 90, 91, 0, 0, 0, 184, 70, 71, 72,
830 73, 74, 75, 76, 77, 78, 79, 80, 0, 81,
831 82, 83, 84, 85, 86, 87, 0, 88, 89, 90,
832 91, 0, 0, 163, 185, 70, 71, 72, 73, 74,
833 75, 76, 77, 78, 79, 80, 0, 81, 82, 83,
834 84, 85, 86, 87, 0, 88, 89, 90, 91, 164,
835 0, 70, 71, 72, 73, 74, 75, 76, 77, 78,
836 79, 80, 0, 81, 82, 83, 84, 85, 86, 87,
837 0, 88, 89, 90, 91, 70, 71, 72, 73, 74,
838 75, 76, 77, 78, 79, 80, 0, 81, 82, 83,
839 84, 85, 86, 87, 0, 88, 89, 90, 91, -76,
840 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
841 0, 81, 82, 83, 84, 85, 86, 87, 0, 88,
842 89, 90, 91, 82, 83, 84, 85, 86, 87, 0,
843 88, 89, 90, 91, 84, 85, 86, 87, 0, 88,
847 static const yytype_int16 yycheck[] =
849 0, 16, 36, 36, 36, 36, 95, 12, 13, 47,
850 48, 11, 50, 51, 52, 53, 54, 55, 56, 61,
851 58, 59, 60, 61, 66, 67, 61, 0, 34, 29,
852 34, 31, 65, 61, 68, 67, 67, 61, 38, 61,
853 61, 65, 66, 61, 44, 66, 65, 47, 48, 49,
854 50, 66, 141, 53, 0, 55, 56, 57, 58, 59,
855 60, 61, 62, 61, 64, 58, 59, 60, 61, 61,
856 70, 71, 72, 73, 74, 75, 76, 77, 61, 79,
857 80, 81, 82, 83, 84, 85, 86, 87, 34, 61,
858 90, 61, 61, 61, 94, 61, 61, 61, 44, 61,
859 61, 16, 12, 36, 78, 51, 52, 65, 54, 66,
860 -1, -1, -1, -1, -1, 115, -1, 117, -1, -1,
861 -1, 38, 39, 40, 41, 42, 43, 44, 45, 46,
862 47, 48, 78, 50, 51, 52, 53, 54, 55, 56,
863 140, 58, 59, 60, 61, -1, -1, -1, -1, -1,
864 -1, 68, -1, -1, 154, -1, -1, -1, -1, 159,
865 -1, 161, -1, 163, 164, -1, 3, -1, -1, 6,
866 7, 8, 9, 10, 11, 12, 13, -1, 178, 16,
867 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
868 27, 28, 29, 30, 31, 32, 33, 48, 35, 50,
869 51, 52, 53, 54, 55, 56, -1, 58, 59, 60,
870 61, -1, -1, -1, 51, 52, -1, -1, -1, -1,
871 -1, -1, -1, -1, 61, 62, 63, 3, -1, 66,
872 6, 7, 8, 9, 10, 11, 12, 13, -1, -1,
873 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
874 26, 27, 28, 29, 30, 31, 32, 33, -1, 35,
875 50, 51, 52, 53, 54, 55, 56, -1, 58, 59,
876 60, 61, -1, -1, -1, 51, 52, -1, -1, -1,
877 -1, -1, -1, -1, -1, 61, 62, 63, -1, 36,
878 66, 38, 39, 40, 41, 42, 43, 44, 45, 46,
879 47, 48, -1, 50, 51, 52, 53, 54, 55, 56,
880 -1, 58, 59, 60, 61, -1, -1, 36, 65, 38,
881 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
882 -1, 50, 51, 52, 53, 54, 55, 56, -1, 58,
883 59, 60, 61, -1, -1, -1, 65, 38, 39, 40,
884 41, 42, 43, 44, 45, 46, 47, 48, -1, 50,
885 51, 52, 53, 54, 55, 56, -1, 58, 59, 60,
886 61, -1, -1, -1, 65, 38, 39, 40, 41, 42,
887 43, 44, 45, 46, 47, 48, -1, 50, 51, 52,
888 53, 54, 55, 56, -1, 58, 59, 60, 61, -1,
889 -1, -1, 65, 38, 39, 40, 41, 42, 43, 44,
890 45, 46, 47, 48, -1, 50, 51, 52, 53, 54,
891 55, 56, -1, 58, 59, 60, 61, -1, -1, -1,
892 65, 38, 39, 40, 41, 42, 43, 44, 45, 46,
893 47, 48, -1, 50, 51, 52, 53, 54, 55, 56,
894 -1, 58, 59, 60, 61, -1, -1, -1, 65, 38,
895 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
896 -1, 50, 51, 52, 53, 54, 55, 56, -1, 58,
897 59, 60, 61, -1, -1, -1, 65, 38, 39, 40,
898 41, 42, 43, 44, 45, 46, 47, 48, -1, 50,
899 51, 52, 53, 54, 55, 56, -1, 58, 59, 60,
900 61, -1, -1, -1, 65, 38, 39, 40, 41, 42,
901 43, 44, 45, 46, 47, 48, -1, 50, 51, 52,
902 53, 54, 55, 56, -1, 58, 59, 60, 61, -1,
903 -1, -1, 65, 38, 39, 40, 41, 42, 43, 44,
904 45, 46, 47, 48, -1, 50, 51, 52, 53, 54,
905 55, 56, -1, 58, 59, 60, 61, -1, -1, -1,
906 65, 38, 39, 40, 41, 42, 43, 44, 45, 46,
907 47, 48, -1, 50, 51, 52, 53, 54, 55, 56,
908 -1, 58, 59, 60, 61, -1, -1, -1, 65, 38,
909 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
910 -1, 50, 51, 52, 53, 54, 55, 56, -1, 58,
911 59, 60, 61, -1, -1, -1, 65, 38, 39, 40,
912 41, 42, 43, 44, 45, 46, 47, 48, -1, 50,
913 51, 52, 53, 54, 55, 56, -1, 58, 59, 60,
914 61, -1, -1, -1, 65, 38, 39, 40, 41, 42,
915 43, 44, 45, 46, 47, 48, -1, 50, 51, 52,
916 53, 54, 55, 56, -1, 58, 59, 60, 61, -1,
917 -1, -1, 65, 38, 39, 40, 41, 42, 43, 44,
918 45, 46, 47, 48, -1, 50, 51, 52, 53, 54,
919 55, 56, -1, 58, 59, 60, 61, -1, -1, -1,
920 65, 38, 39, 40, 41, 42, 43, 44, 45, 46,
921 47, 48, -1, 50, 51, 52, 53, 54, 55, 56,
922 -1, 58, 59, 60, 61, -1, -1, -1, 65, 38,
923 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
924 -1, 50, 51, 52, 53, 54, 55, 56, -1, 58,
925 59, 60, 61, -1, -1, -1, 65, 38, 39, 40,
926 41, 42, 43, 44, 45, 46, 47, 48, -1, 50,
927 51, 52, 53, 54, 55, 56, -1, 58, 59, 60,
928 61, -1, -1, 36, 65, 38, 39, 40, 41, 42,
929 43, 44, 45, 46, 47, 48, -1, 50, 51, 52,
930 53, 54, 55, 56, -1, 58, 59, 60, 61, 36,
931 -1, 38, 39, 40, 41, 42, 43, 44, 45, 46,
932 47, 48, -1, 50, 51, 52, 53, 54, 55, 56,
933 -1, 58, 59, 60, 61, 38, 39, 40, 41, 42,
934 43, 44, 45, 46, 47, 48, -1, 50, 51, 52,
935 53, 54, 55, 56, -1, 58, 59, 60, 61, 38,
936 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
937 -1, 50, 51, 52, 53, 54, 55, 56, -1, 58,
938 59, 60, 61, 51, 52, 53, 54, 55, 56, -1,
939 58, 59, 60, 61, 53, 54, 55, 56, -1, 58,
943 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
944 symbol of state STATE-NUM. */
945 static const yytype_uint8 yystos[] =
947 0, 3, 6, 7, 8, 9, 10, 11, 12, 13,
948 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
949 26, 27, 28, 29, 30, 31, 32, 33, 35, 51,
950 52, 61, 62, 63, 66, 70, 71, 72, 74, 75,
951 80, 81, 82, 83, 61, 72, 83, 61, 61, 61,
952 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
953 61, 61, 61, 72, 73, 72, 72, 78, 83, 0,
954 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
955 48, 50, 51, 52, 53, 54, 55, 56, 58, 59,
956 60, 61, 72, 34, 61, 66, 83, 72, 72, 72,
957 72, 83, 83, 72, 83, 72, 72, 72, 72, 72,
958 72, 72, 72, 72, 65, 36, 67, 67, 72, 72,
959 72, 72, 72, 72, 72, 72, 66, 75, 83, 72,
960 72, 72, 72, 72, 72, 72, 72, 72, 12, 72,
961 76, 77, 12, 13, 72, 78, 65, 65, 65, 65,
962 65, 65, 65, 65, 36, 65, 65, 65, 65, 36,
963 65, 36, 65, 36, 36, 72, 72, 68, 72, 79,
964 78, 65, 67, 72, 72, 72, 72, 72, 36, 68,
965 65, 65, 65, 65, 65, 65, 72
968 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
969 static const yytype_uint8 yyr1[] =
971 0, 69, 70, 70, 71, 72, 73, 72, 72, 72,
972 74, 74, 72, 72, 72, 72, 72, 72, 72, 72,
973 72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
974 72, 72, 72, 72, 75, 75, 76, 72, 72, 77,
975 72, 78, 78, 78, 79, 79, 72, 72, 72, 72,
976 72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
977 72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
978 72, 72, 72, 72, 72, 80, 81, 81, 82, 82,
982 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
983 static const yytype_uint8 yyr2[] =
985 0, 2, 1, 1, 1, 2, 0, 3, 2, 2,
986 1, 1, 4, 4, 4, 4, 4, 4, 4, 6,
987 4, 4, 4, 4, 2, 4, 6, 4, 6, 3,
988 1, 3, 6, 6, 3, 4, 0, 5, 4, 0,
989 5, 0, 1, 3, 1, 3, 4, 4, 3, 3,
990 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
991 3, 3, 3, 3, 3, 3, 1, 1, 1, 1,
992 1, 1, 1, 4, 1, 1, 1, 3, 1, 1,
997 #define yyerrok (yyerrstatus = 0)
998 #define yyclearin (yychar = YYEMPTY)
1002 #define YYACCEPT goto yyacceptlab
1003 #define YYABORT goto yyabortlab
1004 #define YYERROR goto yyerrorlab
1007 #define YYRECOVERING() (!!yyerrstatus)
1009 #define YYBACKUP(Token, Value) \
1011 if (yychar == YYEMPTY) \
1015 YYPOPSTACK (yylen); \
1021 yyerror (YY_("syntax error: cannot back up")); \
1026 /* Error token number */
1028 #define YYERRCODE 256
1032 /* Enable debugging if requested. */
1036 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1037 # define YYFPRINTF fprintf
1040 # define YYDPRINTF(Args) \
1046 /* This macro is provided for backward compatibility. */
1047 #ifndef YY_LOCATION_PRINT
1048 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1052 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1056 YYFPRINTF (stderr, "%s ", Title); \
1057 yy_symbol_print (stderr, \
1059 YYFPRINTF (stderr, "\n"); \
1064 /*----------------------------------------.
1065 | Print this symbol's value on YYOUTPUT. |
1066 `----------------------------------------*/
1069 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1071 FILE *yyo = yyoutput;
1076 if (yytype < YYNTOKENS)
1077 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1083 /*--------------------------------.
1084 | Print this symbol on YYOUTPUT. |
1085 `--------------------------------*/
1088 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1090 YYFPRINTF (yyoutput, "%s %s (",
1091 yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
1093 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
1094 YYFPRINTF (yyoutput, ")");
1097 /*------------------------------------------------------------------.
1098 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1100 `------------------------------------------------------------------*/
1103 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1105 YYFPRINTF (stderr, "Stack now");
1106 for (; yybottom <= yytop; yybottom++)
1108 int yybot = *yybottom;
1109 YYFPRINTF (stderr, " %d", yybot);
1111 YYFPRINTF (stderr, "\n");
1114 # define YY_STACK_PRINT(Bottom, Top) \
1117 yy_stack_print ((Bottom), (Top)); \
1121 /*------------------------------------------------.
1122 | Report that the YYRULE is going to be reduced. |
1123 `------------------------------------------------*/
1126 yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
1128 unsigned long int yylno = yyrline[yyrule];
1129 int yynrhs = yyr2[yyrule];
1131 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1133 /* The symbols being reduced. */
1134 for (yyi = 0; yyi < yynrhs; yyi++)
1136 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1137 yy_symbol_print (stderr,
1138 yystos[yyssp[yyi + 1 - yynrhs]],
1139 &(yyvsp[(yyi + 1) - (yynrhs)])
1141 YYFPRINTF (stderr, "\n");
1145 # define YY_REDUCE_PRINT(Rule) \
1148 yy_reduce_print (yyssp, yyvsp, Rule); \
1151 /* Nonzero means print parse trace. It is left uninitialized so that
1152 multiple parsers can coexist. */
1154 #else /* !YYDEBUG */
1155 # define YYDPRINTF(Args)
1156 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1157 # define YY_STACK_PRINT(Bottom, Top)
1158 # define YY_REDUCE_PRINT(Rule)
1159 #endif /* !YYDEBUG */
1162 /* YYINITDEPTH -- initial size of the parser's stacks. */
1164 # define YYINITDEPTH 200
1167 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1168 if the built-in stack extension method is used).
1170 Do not make this value too large; the results are undefined if
1171 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1172 evaluated with infinite-precision integer arithmetic. */
1175 # define YYMAXDEPTH 10000
1182 # if defined __GLIBC__ && defined _STRING_H
1183 # define yystrlen strlen
1185 /* Return the length of YYSTR. */
1187 yystrlen (const char *yystr)
1190 for (yylen = 0; yystr[yylen]; yylen++)
1198 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1199 # define yystpcpy stpcpy
1201 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1204 yystpcpy (char *yydest, const char *yysrc)
1207 const char *yys = yysrc;
1209 while ((*yyd++ = *yys++) != '\0')
1218 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1219 quotes and backslashes, so that it's suitable for yyerror. The
1220 heuristic is that double-quoting is unnecessary unless the string
1221 contains an apostrophe, a comma, or backslash (other than
1222 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1223 null, do not copy; instead, return the length of what the result
1226 yytnamerr (char *yyres, const char *yystr)
1231 char const *yyp = yystr;
1238 goto do_not_strip_quotes;
1242 goto do_not_strip_quotes;
1255 do_not_strip_quotes: ;
1259 return yystrlen (yystr);
1261 return yystpcpy (yyres, yystr) - yyres;
1265 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1266 about the unexpected token YYTOKEN for the state stack whose top is
1269 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1270 not large enough to hold the message. In that case, also set
1271 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1272 required number of bytes is too large to store. */
1274 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1275 yytype_int16 *yyssp, int yytoken)
1277 YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
1278 YYSIZE_T yysize = yysize0;
1279 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1280 /* Internationalized format string. */
1281 const char *yyformat = YY_NULLPTR;
1282 /* Arguments of yyformat. */
1283 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1284 /* Number of reported tokens (one for the "unexpected", one per
1288 /* There are many possibilities here to consider:
1289 - If this state is a consistent state with a default action, then
1290 the only way this function was invoked is if the default action
1291 is an error action. In that case, don't check for expected
1292 tokens because there are none.
1293 - The only way there can be no lookahead present (in yychar) is if
1294 this state is a consistent state with a default action. Thus,
1295 detecting the absence of a lookahead is sufficient to determine
1296 that there is no unexpected or expected token to report. In that
1297 case, just report a simple "syntax error".
1298 - Don't assume there isn't a lookahead just because this state is a
1299 consistent state with a default action. There might have been a
1300 previous inconsistent state, consistent state with a non-default
1301 action, or user semantic action that manipulated yychar.
1302 - Of course, the expected token list depends on states to have
1303 correct lookahead information, and it depends on the parser not
1304 to perform extra reductions after fetching a lookahead from the
1305 scanner and before detecting a syntax error. Thus, state merging
1306 (from LALR or IELR) and default reductions corrupt the expected
1307 token list. However, the list is correct for canonical LR with
1308 one exception: it will still contain any token that will not be
1309 accepted due to an error action in a later state.
1311 if (yytoken != YYEMPTY)
1313 int yyn = yypact[*yyssp];
1314 yyarg[yycount++] = yytname[yytoken];
1315 if (!yypact_value_is_default (yyn))
1317 /* Start YYX at -YYN if negative to avoid negative indexes in
1318 YYCHECK. In other words, skip the first -YYN actions for
1319 this state because they are default actions. */
1320 int yyxbegin = yyn < 0 ? -yyn : 0;
1321 /* Stay within bounds of both yycheck and yytname. */
1322 int yychecklim = YYLAST - yyn + 1;
1323 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1326 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1327 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1328 && !yytable_value_is_error (yytable[yyx + yyn]))
1330 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1336 yyarg[yycount++] = yytname[yyx];
1338 YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
1339 if (! (yysize <= yysize1
1340 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1350 # define YYCASE_(N, S) \
1354 YYCASE_(0, YY_("syntax error"));
1355 YYCASE_(1, YY_("syntax error, unexpected %s"));
1356 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1357 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1358 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1359 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1364 YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1365 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1370 if (*yymsg_alloc < yysize)
1372 *yymsg_alloc = 2 * yysize;
1373 if (! (yysize <= *yymsg_alloc
1374 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1375 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1379 /* Avoid sprintf, as that infringes on the user's name space.
1380 Don't have undefined behavior even if the translation
1381 produced a string with the wrong number of "%s"s. */
1385 while ((*yyp = *yyformat) != '\0')
1386 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1388 yyp += yytnamerr (yyp, yyarg[yyi++]);
1399 #endif /* YYERROR_VERBOSE */
1401 /*-----------------------------------------------.
1402 | Release the memory associated to this symbol. |
1403 `-----------------------------------------------*/
1406 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1411 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1413 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1415 YY_IGNORE_MAYBE_UNINITIALIZED_END
1421 /* The lookahead symbol. */
1424 /* The semantic value of the lookahead symbol. */
1426 /* Number of syntax errors so far. */
1438 /* Number of tokens to shift before error messages enabled. */
1441 /* The stacks and their tools:
1442 'yyss': related to states.
1443 'yyvs': related to semantic values.
1445 Refer to the stacks through separate pointers, to allow yyoverflow
1446 to xreallocate them elsewhere. */
1448 /* The state stack. */
1449 yytype_int16 yyssa[YYINITDEPTH];
1451 yytype_int16 *yyssp;
1453 /* The semantic value stack. */
1454 YYSTYPE yyvsa[YYINITDEPTH];
1458 YYSIZE_T yystacksize;
1462 /* Lookahead token as an internal (translated) token number. */
1464 /* The variables used to return semantic value and location from the
1469 /* Buffer for error messages, and its allocated size. */
1471 char *yymsg = yymsgbuf;
1472 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1475 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1477 /* The number of symbols on the RHS of the reduced rule.
1478 Keep to zero when no symbol should be popped. */
1481 yyssp = yyss = yyssa;
1482 yyvsp = yyvs = yyvsa;
1483 yystacksize = YYINITDEPTH;
1485 YYDPRINTF ((stderr, "Starting parse\n"));
1490 yychar = YYEMPTY; /* Cause a token to be read. */
1493 /*------------------------------------------------------------.
1494 | yynewstate -- Push a new state, which is found in yystate. |
1495 `------------------------------------------------------------*/
1497 /* In all cases, when you get here, the value and location stacks
1498 have just been pushed. So pushing a state here evens the stacks. */
1504 if (yyss + yystacksize - 1 <= yyssp)
1506 /* Get the current used size of the three stacks, in elements. */
1507 YYSIZE_T yysize = yyssp - yyss + 1;
1511 /* Give user a chance to xreallocate the stack. Use copies of
1512 these so that the &'s don't force the real ones into
1514 YYSTYPE *yyvs1 = yyvs;
1515 yytype_int16 *yyss1 = yyss;
1517 /* Each stack pointer address is followed by the size of the
1518 data in use in that stack, in bytes. This used to be a
1519 conditional around just the two extra args, but that might
1520 be undefined if yyoverflow is a macro. */
1521 yyoverflow (YY_("memory exhausted"),
1522 &yyss1, yysize * sizeof (*yyssp),
1523 &yyvs1, yysize * sizeof (*yyvsp),
1529 #else /* no yyoverflow */
1530 # ifndef YYSTACK_RELOCATE
1531 goto yyexhaustedlab;
1533 /* Extend the stack our own way. */
1534 if (YYMAXDEPTH <= yystacksize)
1535 goto yyexhaustedlab;
1537 if (YYMAXDEPTH < yystacksize)
1538 yystacksize = YYMAXDEPTH;
1541 yytype_int16 *yyss1 = yyss;
1542 union yyalloc *yyptr =
1543 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1545 goto yyexhaustedlab;
1546 YYSTACK_RELOCATE (yyss_alloc, yyss);
1547 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1548 # undef YYSTACK_RELOCATE
1550 YYSTACK_FREE (yyss1);
1553 #endif /* no yyoverflow */
1555 yyssp = yyss + yysize - 1;
1556 yyvsp = yyvs + yysize - 1;
1558 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1559 (unsigned long int) yystacksize));
1561 if (yyss + yystacksize - 1 <= yyssp)
1565 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1567 if (yystate == YYFINAL)
1577 /* Do appropriate processing given the current state. Read a
1578 lookahead token if we need one and don't already have one. */
1580 /* First try to decide what to do without reference to lookahead token. */
1581 yyn = yypact[yystate];
1582 if (yypact_value_is_default (yyn))
1585 /* Not known => get a lookahead token if don't already have one. */
1587 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1588 if (yychar == YYEMPTY)
1590 YYDPRINTF ((stderr, "Reading a token: "));
1594 if (yychar <= YYEOF)
1596 yychar = yytoken = YYEOF;
1597 YYDPRINTF ((stderr, "Now at end of input.\n"));
1601 yytoken = YYTRANSLATE (yychar);
1602 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1605 /* If the proper action on seeing token YYTOKEN is to reduce or to
1606 detect an error, take that action. */
1608 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1613 if (yytable_value_is_error (yyn))
1619 /* Count tokens shifted since error; after three, turn off error
1624 /* Shift the lookahead token. */
1625 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1627 /* Discard the shifted token. */
1631 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1633 YY_IGNORE_MAYBE_UNINITIALIZED_END
1638 /*-----------------------------------------------------------.
1639 | yydefault -- do the default action for the current state. |
1640 `-----------------------------------------------------------*/
1642 yyn = yydefact[yystate];
1648 /*-----------------------------.
1649 | yyreduce -- Do a reduction. |
1650 `-----------------------------*/
1652 /* yyn is the number of a rule to reduce with. */
1655 /* If YYLEN is nonzero, implement the default value of the action:
1658 Otherwise, the following line sets YYVAL to garbage.
1659 This behavior is undocumented and Bison
1660 users should not rely upon it. Assigning to YYVAL
1661 unconditionally makes the parser a bit smaller, and it avoids a
1662 GCC warning that YYVAL may be used uninitialized. */
1663 yyval = yyvsp[1-yylen];
1666 YY_REDUCE_PRINT (yyn);
1670 #line 211 "m2-exp.y" /* yacc.c:1646 */
1671 { write_exp_elt_opcode (pstate, OP_TYPE);
1672 write_exp_elt_type (pstate, (yyvsp[0].tval));
1673 write_exp_elt_opcode (pstate, OP_TYPE);
1675 #line 1677 "m2-exp.c" /* yacc.c:1646 */
1679 #line 220 "m2-exp.y" /* yacc.c:1646 */
1680 { write_exp_elt_opcode (pstate, UNOP_IND); }
1681 #line 1683 "m2-exp.c" /* yacc.c:1646 */
1685 #line 224 "m2-exp.y" /* yacc.c:1646 */
1686 { number_sign = -1; }
1687 #line 1689 "m2-exp.c" /* yacc.c:1646 */
1691 #line 226 "m2-exp.y" /* yacc.c:1646 */
1693 write_exp_elt_opcode (pstate, UNOP_NEG); }
1694 #line 1696 "m2-exp.c" /* yacc.c:1646 */
1698 #line 231 "m2-exp.y" /* yacc.c:1646 */
1699 { write_exp_elt_opcode (pstate, UNOP_PLUS); }
1700 #line 1702 "m2-exp.c" /* yacc.c:1646 */
1704 #line 235 "m2-exp.y" /* yacc.c:1646 */
1705 { write_exp_elt_opcode (pstate, UNOP_LOGICAL_NOT); }
1706 #line 1708 "m2-exp.c" /* yacc.c:1646 */
1710 #line 243 "m2-exp.y" /* yacc.c:1646 */
1711 { write_exp_elt_opcode (pstate, UNOP_CAP); }
1712 #line 1714 "m2-exp.c" /* yacc.c:1646 */
1716 #line 247 "m2-exp.y" /* yacc.c:1646 */
1717 { write_exp_elt_opcode (pstate, UNOP_ORD); }
1718 #line 1720 "m2-exp.c" /* yacc.c:1646 */
1722 #line 251 "m2-exp.y" /* yacc.c:1646 */
1723 { write_exp_elt_opcode (pstate, UNOP_ABS); }
1724 #line 1726 "m2-exp.c" /* yacc.c:1646 */
1728 #line 255 "m2-exp.y" /* yacc.c:1646 */
1729 { write_exp_elt_opcode (pstate, UNOP_HIGH); }
1730 #line 1732 "m2-exp.c" /* yacc.c:1646 */
1734 #line 259 "m2-exp.y" /* yacc.c:1646 */
1735 { write_exp_elt_opcode (pstate, UNOP_MIN);
1736 write_exp_elt_type (pstate, (yyvsp[-1].tval));
1737 write_exp_elt_opcode (pstate, UNOP_MIN); }
1738 #line 1740 "m2-exp.c" /* yacc.c:1646 */
1742 #line 265 "m2-exp.y" /* yacc.c:1646 */
1743 { write_exp_elt_opcode (pstate, UNOP_MAX);
1744 write_exp_elt_type (pstate, (yyvsp[-1].tval));
1745 write_exp_elt_opcode (pstate, UNOP_MAX); }
1746 #line 1748 "m2-exp.c" /* yacc.c:1646 */
1750 #line 271 "m2-exp.y" /* yacc.c:1646 */
1751 { write_exp_elt_opcode (pstate, UNOP_FLOAT); }
1752 #line 1754 "m2-exp.c" /* yacc.c:1646 */
1756 #line 275 "m2-exp.y" /* yacc.c:1646 */
1757 { write_exp_elt_opcode (pstate, BINOP_VAL);
1758 write_exp_elt_type (pstate, (yyvsp[-3].tval));
1759 write_exp_elt_opcode (pstate, BINOP_VAL); }
1760 #line 1762 "m2-exp.c" /* yacc.c:1646 */
1764 #line 281 "m2-exp.y" /* yacc.c:1646 */
1765 { write_exp_elt_opcode (pstate, UNOP_CHR); }
1766 #line 1768 "m2-exp.c" /* yacc.c:1646 */
1770 #line 285 "m2-exp.y" /* yacc.c:1646 */
1771 { write_exp_elt_opcode (pstate, UNOP_ODD); }
1772 #line 1774 "m2-exp.c" /* yacc.c:1646 */
1776 #line 289 "m2-exp.y" /* yacc.c:1646 */
1777 { write_exp_elt_opcode (pstate, UNOP_TRUNC); }
1778 #line 1780 "m2-exp.c" /* yacc.c:1646 */
1782 #line 293 "m2-exp.y" /* yacc.c:1646 */
1783 { write_exp_elt_opcode (pstate, UNOP_SIZEOF); }
1784 #line 1786 "m2-exp.c" /* yacc.c:1646 */
1788 #line 297 "m2-exp.y" /* yacc.c:1646 */
1789 { write_exp_elt_opcode (pstate, UNOP_SIZEOF); }
1790 #line 1792 "m2-exp.c" /* yacc.c:1646 */
1794 #line 302 "m2-exp.y" /* yacc.c:1646 */
1795 { write_exp_elt_opcode (pstate, UNOP_PREINCREMENT); }
1796 #line 1798 "m2-exp.c" /* yacc.c:1646 */
1800 #line 306 "m2-exp.y" /* yacc.c:1646 */
1801 { write_exp_elt_opcode (pstate, BINOP_ASSIGN_MODIFY);
1802 write_exp_elt_opcode (pstate, BINOP_ADD);
1803 write_exp_elt_opcode (pstate,
1804 BINOP_ASSIGN_MODIFY); }
1805 #line 1807 "m2-exp.c" /* yacc.c:1646 */
1809 #line 313 "m2-exp.y" /* yacc.c:1646 */
1810 { write_exp_elt_opcode (pstate, UNOP_PREDECREMENT);}
1811 #line 1813 "m2-exp.c" /* yacc.c:1646 */
1815 #line 317 "m2-exp.y" /* yacc.c:1646 */
1816 { write_exp_elt_opcode (pstate, BINOP_ASSIGN_MODIFY);
1817 write_exp_elt_opcode (pstate, BINOP_SUB);
1818 write_exp_elt_opcode (pstate,
1819 BINOP_ASSIGN_MODIFY); }
1820 #line 1822 "m2-exp.c" /* yacc.c:1646 */
1824 #line 324 "m2-exp.y" /* yacc.c:1646 */
1825 { write_exp_elt_opcode (pstate, STRUCTOP_STRUCT);
1826 write_exp_string (pstate, (yyvsp[0].sval));
1827 write_exp_elt_opcode (pstate, STRUCTOP_STRUCT); }
1828 #line 1830 "m2-exp.c" /* yacc.c:1646 */
1832 #line 333 "m2-exp.y" /* yacc.c:1646 */
1833 { error (_("Sets are not implemented."));}
1834 #line 1836 "m2-exp.c" /* yacc.c:1646 */
1838 #line 337 "m2-exp.y" /* yacc.c:1646 */
1839 { error (_("Sets are not implemented."));}
1840 #line 1842 "m2-exp.c" /* yacc.c:1646 */
1844 #line 341 "m2-exp.y" /* yacc.c:1646 */
1845 { error (_("Sets are not implemented."));}
1846 #line 1848 "m2-exp.c" /* yacc.c:1646 */
1850 #line 345 "m2-exp.y" /* yacc.c:1646 */
1851 { error (_("Sets are not implemented."));}
1852 #line 1854 "m2-exp.c" /* yacc.c:1646 */
1856 #line 347 "m2-exp.y" /* yacc.c:1646 */
1857 { error (_("Sets are not implemented."));}
1858 #line 1860 "m2-exp.c" /* yacc.c:1646 */
1862 #line 356 "m2-exp.y" /* yacc.c:1646 */
1863 { start_arglist(); }
1864 #line 1866 "m2-exp.c" /* yacc.c:1646 */
1868 #line 358 "m2-exp.y" /* yacc.c:1646 */
1869 { write_exp_elt_opcode (pstate, MULTI_SUBSCRIPT);
1870 write_exp_elt_longcst (pstate,
1871 (LONGEST) end_arglist());
1872 write_exp_elt_opcode (pstate, MULTI_SUBSCRIPT); }
1873 #line 1875 "m2-exp.c" /* yacc.c:1646 */
1877 #line 365 "m2-exp.y" /* yacc.c:1646 */
1878 { write_exp_elt_opcode (pstate, BINOP_SUBSCRIPT); }
1879 #line 1881 "m2-exp.c" /* yacc.c:1646 */
1883 #line 371 "m2-exp.y" /* yacc.c:1646 */
1884 { start_arglist (); }
1885 #line 1887 "m2-exp.c" /* yacc.c:1646 */
1889 #line 373 "m2-exp.y" /* yacc.c:1646 */
1890 { write_exp_elt_opcode (pstate, OP_FUNCALL);
1891 write_exp_elt_longcst (pstate,
1892 (LONGEST) end_arglist ());
1893 write_exp_elt_opcode (pstate, OP_FUNCALL); }
1894 #line 1896 "m2-exp.c" /* yacc.c:1646 */
1898 #line 383 "m2-exp.y" /* yacc.c:1646 */
1899 { arglist_len = 1; }
1900 #line 1902 "m2-exp.c" /* yacc.c:1646 */
1904 #line 387 "m2-exp.y" /* yacc.c:1646 */
1906 #line 1908 "m2-exp.c" /* yacc.c:1646 */
1910 #line 392 "m2-exp.y" /* yacc.c:1646 */
1911 { arglist_len = 1; }
1912 #line 1914 "m2-exp.c" /* yacc.c:1646 */
1916 #line 397 "m2-exp.y" /* yacc.c:1646 */
1918 #line 1920 "m2-exp.c" /* yacc.c:1646 */
1922 #line 402 "m2-exp.y" /* yacc.c:1646 */
1923 { write_exp_elt_opcode (pstate, UNOP_MEMVAL);
1924 write_exp_elt_type (pstate, (yyvsp[-2].tval));
1925 write_exp_elt_opcode (pstate, UNOP_MEMVAL); }
1926 #line 1928 "m2-exp.c" /* yacc.c:1646 */
1930 #line 408 "m2-exp.y" /* yacc.c:1646 */
1931 { write_exp_elt_opcode (pstate, UNOP_CAST);
1932 write_exp_elt_type (pstate, (yyvsp[-3].tval));
1933 write_exp_elt_opcode (pstate, UNOP_CAST); }
1934 #line 1936 "m2-exp.c" /* yacc.c:1646 */
1938 #line 414 "m2-exp.y" /* yacc.c:1646 */
1940 #line 1942 "m2-exp.c" /* yacc.c:1646 */
1944 #line 422 "m2-exp.y" /* yacc.c:1646 */
1945 { write_exp_elt_opcode (pstate, BINOP_REPEAT); }
1946 #line 1948 "m2-exp.c" /* yacc.c:1646 */
1950 #line 426 "m2-exp.y" /* yacc.c:1646 */
1951 { write_exp_elt_opcode (pstate, BINOP_MUL); }
1952 #line 1954 "m2-exp.c" /* yacc.c:1646 */
1956 #line 430 "m2-exp.y" /* yacc.c:1646 */
1957 { write_exp_elt_opcode (pstate, BINOP_DIV); }
1958 #line 1960 "m2-exp.c" /* yacc.c:1646 */
1962 #line 434 "m2-exp.y" /* yacc.c:1646 */
1963 { write_exp_elt_opcode (pstate, BINOP_INTDIV); }
1964 #line 1966 "m2-exp.c" /* yacc.c:1646 */
1968 #line 438 "m2-exp.y" /* yacc.c:1646 */
1969 { write_exp_elt_opcode (pstate, BINOP_REM); }
1970 #line 1972 "m2-exp.c" /* yacc.c:1646 */
1974 #line 442 "m2-exp.y" /* yacc.c:1646 */
1975 { write_exp_elt_opcode (pstate, BINOP_ADD); }
1976 #line 1978 "m2-exp.c" /* yacc.c:1646 */
1980 #line 446 "m2-exp.y" /* yacc.c:1646 */
1981 { write_exp_elt_opcode (pstate, BINOP_SUB); }
1982 #line 1984 "m2-exp.c" /* yacc.c:1646 */
1986 #line 450 "m2-exp.y" /* yacc.c:1646 */
1987 { write_exp_elt_opcode (pstate, BINOP_EQUAL); }
1988 #line 1990 "m2-exp.c" /* yacc.c:1646 */
1992 #line 454 "m2-exp.y" /* yacc.c:1646 */
1993 { write_exp_elt_opcode (pstate, BINOP_NOTEQUAL); }
1994 #line 1996 "m2-exp.c" /* yacc.c:1646 */
1998 #line 456 "m2-exp.y" /* yacc.c:1646 */
1999 { write_exp_elt_opcode (pstate, BINOP_NOTEQUAL); }
2000 #line 2002 "m2-exp.c" /* yacc.c:1646 */
2004 #line 460 "m2-exp.y" /* yacc.c:1646 */
2005 { write_exp_elt_opcode (pstate, BINOP_LEQ); }
2006 #line 2008 "m2-exp.c" /* yacc.c:1646 */
2010 #line 464 "m2-exp.y" /* yacc.c:1646 */
2011 { write_exp_elt_opcode (pstate, BINOP_GEQ); }
2012 #line 2014 "m2-exp.c" /* yacc.c:1646 */
2016 #line 468 "m2-exp.y" /* yacc.c:1646 */
2017 { write_exp_elt_opcode (pstate, BINOP_LESS); }
2018 #line 2020 "m2-exp.c" /* yacc.c:1646 */
2022 #line 472 "m2-exp.y" /* yacc.c:1646 */
2023 { write_exp_elt_opcode (pstate, BINOP_GTR); }
2024 #line 2026 "m2-exp.c" /* yacc.c:1646 */
2028 #line 476 "m2-exp.y" /* yacc.c:1646 */
2029 { write_exp_elt_opcode (pstate, BINOP_LOGICAL_AND); }
2030 #line 2032 "m2-exp.c" /* yacc.c:1646 */
2034 #line 480 "m2-exp.y" /* yacc.c:1646 */
2035 { write_exp_elt_opcode (pstate, BINOP_LOGICAL_OR); }
2036 #line 2038 "m2-exp.c" /* yacc.c:1646 */
2040 #line 484 "m2-exp.y" /* yacc.c:1646 */
2041 { write_exp_elt_opcode (pstate, BINOP_ASSIGN); }
2042 #line 2044 "m2-exp.c" /* yacc.c:1646 */
2046 #line 491 "m2-exp.y" /* yacc.c:1646 */
2047 { write_exp_elt_opcode (pstate, OP_BOOL);
2048 write_exp_elt_longcst (pstate, (LONGEST) (yyvsp[0].ulval));
2049 write_exp_elt_opcode (pstate, OP_BOOL); }
2050 #line 2052 "m2-exp.c" /* yacc.c:1646 */
2054 #line 497 "m2-exp.y" /* yacc.c:1646 */
2055 { write_exp_elt_opcode (pstate, OP_BOOL);
2056 write_exp_elt_longcst (pstate, (LONGEST) (yyvsp[0].ulval));
2057 write_exp_elt_opcode (pstate, OP_BOOL); }
2058 #line 2060 "m2-exp.c" /* yacc.c:1646 */
2062 #line 503 "m2-exp.y" /* yacc.c:1646 */
2063 { write_exp_elt_opcode (pstate, OP_LONG);
2064 write_exp_elt_type (pstate,
2065 parse_m2_type (pstate)->builtin_int);
2066 write_exp_elt_longcst (pstate, (LONGEST) (yyvsp[0].lval));
2067 write_exp_elt_opcode (pstate, OP_LONG); }
2068 #line 2070 "m2-exp.c" /* yacc.c:1646 */
2072 #line 511 "m2-exp.y" /* yacc.c:1646 */
2074 write_exp_elt_opcode (pstate, OP_LONG);
2075 write_exp_elt_type (pstate,
2076 parse_m2_type (pstate)
2078 write_exp_elt_longcst (pstate, (LONGEST) (yyvsp[0].ulval));
2079 write_exp_elt_opcode (pstate, OP_LONG);
2081 #line 2083 "m2-exp.c" /* yacc.c:1646 */
2085 #line 522 "m2-exp.y" /* yacc.c:1646 */
2086 { write_exp_elt_opcode (pstate, OP_LONG);
2087 write_exp_elt_type (pstate,
2088 parse_m2_type (pstate)
2090 write_exp_elt_longcst (pstate, (LONGEST) (yyvsp[0].ulval));
2091 write_exp_elt_opcode (pstate, OP_LONG); }
2092 #line 2094 "m2-exp.c" /* yacc.c:1646 */
2096 #line 532 "m2-exp.y" /* yacc.c:1646 */
2097 { write_exp_elt_opcode (pstate, OP_DOUBLE);
2098 write_exp_elt_type (pstate,
2099 parse_m2_type (pstate)
2101 write_exp_elt_dblcst (pstate, (yyvsp[0].dval));
2102 write_exp_elt_opcode (pstate, OP_DOUBLE); }
2103 #line 2105 "m2-exp.c" /* yacc.c:1646 */
2107 #line 544 "m2-exp.y" /* yacc.c:1646 */
2108 { write_exp_elt_opcode (pstate, OP_LONG);
2109 write_exp_elt_type (pstate,
2110 parse_type (pstate)->builtin_int);
2111 write_exp_elt_longcst (pstate,
2112 (LONGEST) TYPE_LENGTH ((yyvsp[-1].tval)));
2113 write_exp_elt_opcode (pstate, OP_LONG); }
2114 #line 2116 "m2-exp.c" /* yacc.c:1646 */
2118 #line 553 "m2-exp.y" /* yacc.c:1646 */
2119 { write_exp_elt_opcode (pstate, OP_M2_STRING);
2120 write_exp_string (pstate, (yyvsp[0].sval));
2121 write_exp_elt_opcode (pstate, OP_M2_STRING); }
2122 #line 2124 "m2-exp.c" /* yacc.c:1646 */
2126 #line 560 "m2-exp.y" /* yacc.c:1646 */
2127 { (yyval.bval) = SYMBOL_BLOCK_VALUE((yyvsp[0].sym)); }
2128 #line 2130 "m2-exp.c" /* yacc.c:1646 */
2132 #line 564 "m2-exp.y" /* yacc.c:1646 */
2133 { struct symbol *sym
2134 = lookup_symbol (copy_name ((yyvsp[0].sval)),
2135 expression_context_block,
2138 #line 2140 "m2-exp.c" /* yacc.c:1646 */
2142 #line 574 "m2-exp.y" /* yacc.c:1646 */
2143 { struct symbol *tem
2144 = lookup_symbol (copy_name ((yyvsp[0].sval)), (yyvsp[-2].bval),
2146 if (!tem || SYMBOL_CLASS (tem) != LOC_BLOCK)
2147 error (_("No function \"%s\" in specified context."),
2148 copy_name ((yyvsp[0].sval)));
2151 #line 2153 "m2-exp.c" /* yacc.c:1646 */
2155 #line 586 "m2-exp.y" /* yacc.c:1646 */
2156 { write_exp_elt_opcode (pstate, OP_VAR_VALUE);
2157 write_exp_elt_block (pstate, NULL);
2158 write_exp_elt_sym (pstate, (yyvsp[0].sym));
2159 write_exp_elt_opcode (pstate, OP_VAR_VALUE); }
2160 #line 2162 "m2-exp.c" /* yacc.c:1646 */
2164 #line 598 "m2-exp.y" /* yacc.c:1646 */
2165 { struct symbol *sym;
2166 sym = lookup_symbol (copy_name ((yyvsp[0].sval)), (yyvsp[-2].bval),
2169 error (_("No symbol \"%s\" in specified context."),
2170 copy_name ((yyvsp[0].sval)));
2171 if (symbol_read_needs_frame (sym))
2173 if (innermost_block == 0
2174 || contained_in (block_found,
2176 innermost_block = block_found;
2179 write_exp_elt_opcode (pstate, OP_VAR_VALUE);
2180 /* block_found is set by lookup_symbol. */
2181 write_exp_elt_block (pstate, block_found);
2182 write_exp_elt_sym (pstate, sym);
2183 write_exp_elt_opcode (pstate, OP_VAR_VALUE); }
2184 #line 2186 "m2-exp.c" /* yacc.c:1646 */
2188 #line 621 "m2-exp.y" /* yacc.c:1646 */
2189 { struct symbol *sym;
2190 struct field_of_this_result is_a_field_of_this;
2192 sym = lookup_symbol (copy_name ((yyvsp[0].sval)),
2193 expression_context_block,
2195 &is_a_field_of_this);
2198 if (symbol_read_needs_frame (sym))
2200 if (innermost_block == 0 ||
2201 contained_in (block_found,
2203 innermost_block = block_found;
2206 write_exp_elt_opcode (pstate, OP_VAR_VALUE);
2207 /* We want to use the selected frame, not
2208 another more inner frame which happens to
2209 be in the same block. */
2210 write_exp_elt_block (pstate, NULL);
2211 write_exp_elt_sym (pstate, sym);
2212 write_exp_elt_opcode (pstate, OP_VAR_VALUE);
2216 struct bound_minimal_symbol msymbol;
2217 char *arg = copy_name ((yyvsp[0].sval));
2220 lookup_bound_minimal_symbol (arg);
2221 if (msymbol.minsym != NULL)
2222 write_exp_msymbol (pstate, msymbol);
2223 else if (!have_full_symbols () && !have_partial_symbols ())
2224 error (_("No symbol table is loaded. Use the \"symbol-file\" command."));
2226 error (_("No symbol \"%s\" in current context."),
2227 copy_name ((yyvsp[0].sval)));
2230 #line 2232 "m2-exp.c" /* yacc.c:1646 */
2234 #line 666 "m2-exp.y" /* yacc.c:1646 */
2235 { (yyval.tval) = lookup_typename (parse_language (pstate),
2236 parse_gdbarch (pstate),
2237 copy_name ((yyvsp[0].sval)),
2238 expression_context_block, 0); }
2239 #line 2241 "m2-exp.c" /* yacc.c:1646 */
2243 #line 2245 "m2-exp.c" /* yacc.c:1646 */
2246 /* User semantic actions sometimes alter yychar, and that requires
2247 that yytoken be updated with the new translation. We take the
2248 approach of translating immediately before every use of yytoken.
2249 One alternative is translating here after every semantic action,
2250 but that translation would be missed if the semantic action invokes
2251 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2252 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2253 incorrect destructor might then be invoked immediately. In the
2254 case of YYERROR or YYBACKUP, subsequent parser actions might lead
2255 to an incorrect destructor call or verbose syntax error message
2256 before the lookahead is translated. */
2257 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2261 YY_STACK_PRINT (yyss, yyssp);
2265 /* Now 'shift' the result of the reduction. Determine what state
2266 that goes to, based on the state we popped back to and the rule
2267 number reduced by. */
2271 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2272 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2273 yystate = yytable[yystate];
2275 yystate = yydefgoto[yyn - YYNTOKENS];
2280 /*--------------------------------------.
2281 | yyerrlab -- here on detecting error. |
2282 `--------------------------------------*/
2284 /* Make sure we have latest lookahead translation. See comments at
2285 user semantic actions for why this is necessary. */
2286 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
2288 /* If not already recovering from an error, report this error. */
2292 #if ! YYERROR_VERBOSE
2293 yyerror (YY_("syntax error"));
2295 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2298 char const *yymsgp = YY_("syntax error");
2299 int yysyntax_error_status;
2300 yysyntax_error_status = YYSYNTAX_ERROR;
2301 if (yysyntax_error_status == 0)
2303 else if (yysyntax_error_status == 1)
2305 if (yymsg != yymsgbuf)
2306 YYSTACK_FREE (yymsg);
2307 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
2311 yymsg_alloc = sizeof yymsgbuf;
2312 yysyntax_error_status = 2;
2316 yysyntax_error_status = YYSYNTAX_ERROR;
2321 if (yysyntax_error_status == 2)
2322 goto yyexhaustedlab;
2324 # undef YYSYNTAX_ERROR
2330 if (yyerrstatus == 3)
2332 /* If just tried and failed to reuse lookahead token after an
2333 error, discard it. */
2335 if (yychar <= YYEOF)
2337 /* Return failure if at end of input. */
2338 if (yychar == YYEOF)
2343 yydestruct ("Error: discarding",
2349 /* Else will try to reuse lookahead token after shifting the error
2354 /*---------------------------------------------------.
2355 | yyerrorlab -- error raised explicitly by YYERROR. |
2356 `---------------------------------------------------*/
2359 /* Pacify compilers like GCC when the user code never invokes
2360 YYERROR and the label yyerrorlab therefore never appears in user
2362 if (/*CONSTCOND*/ 0)
2365 /* Do not reclaim the symbols of the rule whose action triggered
2369 YY_STACK_PRINT (yyss, yyssp);
2374 /*-------------------------------------------------------------.
2375 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2376 `-------------------------------------------------------------*/
2378 yyerrstatus = 3; /* Each real token shifted decrements this. */
2382 yyn = yypact[yystate];
2383 if (!yypact_value_is_default (yyn))
2386 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2394 /* Pop the current state because it cannot handle the error token. */
2399 yydestruct ("Error: popping",
2400 yystos[yystate], yyvsp);
2403 YY_STACK_PRINT (yyss, yyssp);
2406 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2408 YY_IGNORE_MAYBE_UNINITIALIZED_END
2411 /* Shift the error token. */
2412 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2418 /*-------------------------------------.
2419 | yyacceptlab -- YYACCEPT comes here. |
2420 `-------------------------------------*/
2425 /*-----------------------------------.
2426 | yyabortlab -- YYABORT comes here. |
2427 `-----------------------------------*/
2432 #if !defined yyoverflow || YYERROR_VERBOSE
2433 /*-------------------------------------------------.
2434 | yyexhaustedlab -- memory exhaustion comes here. |
2435 `-------------------------------------------------*/
2437 yyerror (YY_("memory exhausted"));
2443 if (yychar != YYEMPTY)
2445 /* Make sure we have latest lookahead translation. See comments at
2446 user semantic actions for why this is necessary. */
2447 yytoken = YYTRANSLATE (yychar);
2448 yydestruct ("Cleanup: discarding lookahead",
2451 /* Do not reclaim the symbols of the rule whose action triggered
2452 this YYABORT or YYACCEPT. */
2454 YY_STACK_PRINT (yyss, yyssp);
2455 while (yyssp != yyss)
2457 yydestruct ("Cleanup: popping",
2458 yystos[*yyssp], yyvsp);
2463 YYSTACK_FREE (yyss);
2466 if (yymsg != yymsgbuf)
2467 YYSTACK_FREE (yymsg);
2471 #line 673 "m2-exp.y" /* yacc.c:1906 */
2474 /* Take care of parsing a number (anything that starts with a digit).
2475 Set yylval and return the token type; update lexptr.
2476 LEN is the number of characters in it. */
2478 /*** Needs some error checking for the float case ***/
2481 parse_number (int olen)
2483 const char *p = lexptr;
2487 int base = input_radix;
2489 int unsigned_p = number_sign == 1 ? 1 : 0;
2496 else if(p[len-1] == 'C' || p[len-1] == 'B')
2499 ischar = p[len-1] == 'C';
2503 /* Scan the number */
2504 for (c = 0; c < len; c++)
2506 if (p[c] == '.' && base == 10)
2508 /* It's a float since it contains a point. */
2509 yylval.dval = atof (p);
2513 if (p[c] == '.' && base != 10)
2514 error (_("Floating point numbers must be base 10."));
2515 if (base == 10 && (p[c] < '0' || p[c] > '9'))
2516 error (_("Invalid digit \'%c\' in number."),p[c]);
2523 if( base == 8 && (c == '8' || c == '9'))
2524 error (_("Invalid digit \'%c\' in octal number."),c);
2525 if (c >= '0' && c <= '9')
2529 if (base == 16 && c >= 'A' && c <= 'F')
2537 if(!unsigned_p && number_sign == 1 && (prevn >= n))
2538 unsigned_p=1; /* Try something unsigned */
2539 /* Don't do the range check if n==i and i==0, since that special
2540 case will give an overflow error. */
2541 if(RANGE_CHECK && n!=i && i)
2543 if((unsigned_p && (unsigned)prevn >= (unsigned)n) ||
2544 ((!unsigned_p && number_sign==-1) && -prevn <= -n))
2545 range_error (_("Overflow on numeric constant."));
2551 if(*p == 'B' || *p == 'C' || *p == 'H')
2552 lexptr++; /* Advance past B,C or H */
2559 else if ( unsigned_p && number_sign == 1)
2564 else if((unsigned_p && (n<0))) {
2565 range_error (_("Overflow on numeric constant -- number too large."));
2566 /* But, this can return if range_check == range_warn. */
2581 { {'<', '>'}, NOTEQUAL },
2582 { {':', '='}, ASSIGN },
2583 { {'<', '='}, LEQ },
2584 { {'>', '='}, GEQ },
2585 { {':', ':'}, COLONCOLON },
2589 /* Some specific keywords */
2596 static struct keyword keytab[] =
2599 {"IN", IN },/* Note space after IN */
2600 {"AND", LOGICAL_AND},
2618 {"FLOAT", FLOAT_FUNC },
2624 /* Read one token, getting characters through lexptr. */
2626 /* This is where we will check to make sure that the language and the
2627 operators used are compatible */
2635 const char *tokstart;
2640 prev_lexptr = lexptr;
2645 /* See if it is a special token of length 2 */
2646 for( i = 0 ; i < (int) (sizeof tokentab2 / sizeof tokentab2[0]) ; i++)
2647 if (strncmp (tokentab2[i].name, tokstart, 2) == 0)
2650 return tokentab2[i].token;
2653 switch (c = *tokstart)
2670 if (paren_depth == 0)
2677 if (comma_terminates && paren_depth == 0)
2683 /* Might be a floating point number. */
2684 if (lexptr[1] >= '0' && lexptr[1] <= '9')
2685 break; /* Falls into number code. */
2692 /* These are character tokens that appear as-is in the YACC grammar */
2715 for (namelen = 1; (c = tokstart[namelen]) != quote && c != '\0'; namelen++)
2718 c = tokstart[++namelen];
2719 if (c >= '0' && c <= '9')
2721 c = tokstart[++namelen];
2722 if (c >= '0' && c <= '9')
2723 c = tokstart[++namelen];
2727 error (_("Unterminated string or character constant."));
2728 yylval.sval.ptr = tokstart + 1;
2729 yylval.sval.length = namelen - 1;
2730 lexptr += namelen + 1;
2732 if(namelen == 2) /* Single character */
2734 yylval.ulval = tokstart[1];
2741 /* Is it a number? */
2742 /* Note: We have already dealt with the case of the token '.'.
2743 See case '.' above. */
2744 if ((c >= '0' && c <= '9'))
2746 /* It's a number. */
2747 int got_dot = 0, got_e = 0;
2748 const char *p = tokstart;
2753 if (!got_e && (*p == 'e' || *p == 'E'))
2754 got_dot = got_e = 1;
2755 else if (!got_dot && *p == '.')
2757 else if (got_e && (p[-1] == 'e' || p[-1] == 'E')
2758 && (*p == '-' || *p == '+'))
2759 /* This is the sign of the exponent, not the end of the
2762 else if ((*p < '0' || *p > '9') &&
2763 (*p < 'A' || *p > 'F') &&
2764 (*p != 'H')) /* Modula-2 hexadecimal number */
2767 toktype = parse_number (p - tokstart);
2768 if (toktype == ERROR)
2770 char *err_copy = (char *) alloca (p - tokstart + 1);
2772 memcpy (err_copy, tokstart, p - tokstart);
2773 err_copy[p - tokstart] = 0;
2774 error (_("Invalid number \"%s\"."), err_copy);
2780 if (!(c == '_' || c == '$'
2781 || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')))
2782 /* We must have come across a bad character (e.g. ';'). */
2783 error (_("Invalid character '%c' in expression."), c);
2785 /* It's a name. See how long it is. */
2787 for (c = tokstart[namelen];
2788 (c == '_' || c == '$' || (c >= '0' && c <= '9')
2789 || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'));
2790 c = tokstart[++namelen])
2793 /* The token "if" terminates the expression and is NOT
2794 removed from the input stream. */
2795 if (namelen == 2 && tokstart[0] == 'i' && tokstart[1] == 'f')
2802 /* Lookup special keywords */
2803 for(i = 0 ; i < (int) (sizeof(keytab) / sizeof(keytab[0])) ; i++)
2804 if (namelen == strlen (keytab[i].keyw)
2805 && strncmp (tokstart, keytab[i].keyw, namelen) == 0)
2806 return keytab[i].token;
2808 yylval.sval.ptr = tokstart;
2809 yylval.sval.length = namelen;
2811 if (*tokstart == '$')
2813 write_dollar_variable (pstate, yylval.sval);
2814 return INTERNAL_VAR;
2817 /* Use token-type BLOCKNAME for symbols that happen to be defined as
2818 functions. If this is not so, then ...
2819 Use token-type TYPENAME for symbols that happen to be defined
2820 currently as names of types; NAME for other symbols.
2821 The caller is not constrained to care about the distinction. */
2825 char *tmp = copy_name (yylval.sval);
2828 if (lookup_symtab (tmp))
2830 sym = lookup_symbol (tmp, expression_context_block, VAR_DOMAIN, 0);
2831 if (sym && SYMBOL_CLASS (sym) == LOC_BLOCK)
2833 if (lookup_typename (parse_language (pstate), parse_gdbarch (pstate),
2834 copy_name (yylval.sval),
2835 expression_context_block, 1))
2840 switch(SYMBOL_CLASS (sym))
2846 case LOC_REGPARM_ADDR:
2849 case LOC_CONST_BYTES:
2850 case LOC_OPTIMIZED_OUT:
2861 error (_("internal: Undefined class in m2lex()"));
2864 case LOC_UNRESOLVED:
2865 error (_("internal: Unforseen case in m2lex()"));
2868 error (_("unhandled token in m2lex()"));
2874 /* Built-in BOOLEAN type. This is sort of a hack. */
2875 if (strncmp (tokstart, "TRUE", 4) == 0)
2880 else if (strncmp (tokstart, "FALSE", 5) == 0)
2887 /* Must be another type of name... */
2893 m2_parse (struct parser_state *par_state)
2896 struct cleanup *c = make_cleanup_clear_parser_state (&pstate);
2898 /* Setting up the parser state. */
2899 gdb_assert (par_state != NULL);
2902 result = yyparse ();
2912 lexptr = prev_lexptr;
2914 error (_("A %s in expression, near `%s'."), (msg ? msg : "error"), lexptr);