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 36 "jv-exp.y" /* yacc.c:339 */
70 #include "expression.h"
72 #include "parser-defs.h"
75 #include "bfd.h" /* Required by objfiles.h. */
76 #include "symfile.h" /* Required by objfiles.h. */
77 #include "objfiles.h" /* For have_full_symbols and have_partial_symbols */
79 #include "completer.h"
81 #define parse_type(ps) builtin_type (parse_gdbarch (ps))
82 #define parse_java_type(ps) builtin_java_type (parse_gdbarch (ps))
84 /* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc),
85 as well as gratuitiously global symbol names, so we can have multiple
86 yacc generated parsers in gdb. Note that these are only the variables
87 produced by yacc. If other parser generators (bison, byacc, etc) produce
88 additional global names that conflict at link time, then those parser
89 generators need to be fixed instead of adding those names to this list. */
91 #define yymaxdepth java_maxdepth
92 #define yyparse java_parse_internal
93 #define yylex java_lex
94 #define yyerror java_error
95 #define yylval java_lval
96 #define yychar java_char
97 #define yydebug java_debug
98 #define yypact java_pact
101 #define yydef java_def
102 #define yychk java_chk
103 #define yypgo java_pgo
104 #define yyact java_act
105 #define yyexca java_exca
106 #define yyerrflag java_errflag
107 #define yynerrs java_nerrs
111 #define yy_yys java_yys
112 #define yystate java_state
113 #define yytmp java_tmp
115 #define yy_yyv java_yyv
116 #define yyval java_val
117 #define yylloc java_lloc
118 #define yyreds java_reds /* With YYDEBUG defined */
119 #define yytoks java_toks /* With YYDEBUG defined */
120 #define yyname java_name /* With YYDEBUG defined */
121 #define yyrule java_rule /* With YYDEBUG defined */
122 #define yylhs java_yylhs
123 #define yylen java_yylen
124 #define yydefred java_yydefred
125 #define yydgoto java_yydgoto
126 #define yysindex java_yysindex
127 #define yyrindex java_yyrindex
128 #define yygindex java_yygindex
129 #define yytable java_yytable
130 #define yycheck java_yycheck
131 #define yyss java_yyss
132 #define yysslim java_yysslim
133 #define yyssp java_yyssp
134 #define yystacksize java_yystacksize
135 #define yyvs java_yyvs
136 #define yyvsp java_yyvsp
139 #define YYDEBUG 1 /* Default to yydebug support */
142 #define YYFPRINTF parser_fprintf
144 /* The state of the parser, used internally when we are parsing the
147 static struct parser_state *pstate = NULL;
151 static int yylex (void);
153 void yyerror (char *);
155 static struct type *java_type_from_name (struct stoken);
156 static void push_expression_name (struct parser_state *, struct stoken);
157 static void push_fieldnames (struct parser_state *, struct stoken);
159 static struct expression *copy_exp (struct expression *, int);
160 static void insert_exp (struct parser_state *, int, struct expression *);
163 #line 164 "jv-exp.c" /* yacc.c:339 */
166 # if defined __cplusplus && 201103L <= __cplusplus
167 # define YY_NULLPTR nullptr
169 # define YY_NULLPTR 0
173 /* Enabling verbose error messages. */
174 #ifdef YYERROR_VERBOSE
175 # undef YYERROR_VERBOSE
176 # define YYERROR_VERBOSE 1
178 # define YYERROR_VERBOSE 0
195 INTEGER_LITERAL = 258,
196 FLOATING_POINT_LITERAL = 259,
198 STRING_LITERAL = 261,
199 BOOLEAN_LITERAL = 262,
228 #define INTEGER_LITERAL 258
229 #define FLOATING_POINT_LITERAL 259
230 #define IDENTIFIER 260
231 #define STRING_LITERAL 261
232 #define BOOLEAN_LITERAL 262
234 #define NAME_OR_INT 264
245 #define ASSIGN_MODIFY 275
256 #define INCREMENT 286
257 #define DECREMENT 287
260 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
261 typedef union YYSTYPE YYSTYPE;
264 #line 139 "jv-exp.y" /* yacc.c:355 */
279 struct symtoken ssym;
281 enum exp_opcode opcode;
282 struct internalvar *ivar;
286 #line 287 "jv-exp.c" /* yacc.c:355 */
288 # define YYSTYPE_IS_TRIVIAL 1
289 # define YYSTYPE_IS_DECLARED 1
293 extern YYSTYPE yylval;
299 /* Copy the second part of user declarations. */
300 #line 160 "jv-exp.y" /* yacc.c:358 */
302 /* YYSTYPE gets defined by %union */
303 static int parse_number (struct parser_state *, const char *, int,
306 #line 307 "jv-exp.c" /* yacc.c:358 */
313 typedef YYTYPE_UINT8 yytype_uint8;
315 typedef unsigned char yytype_uint8;
319 typedef YYTYPE_INT8 yytype_int8;
321 typedef signed char yytype_int8;
325 typedef YYTYPE_UINT16 yytype_uint16;
327 typedef unsigned short int yytype_uint16;
331 typedef YYTYPE_INT16 yytype_int16;
333 typedef short int yytype_int16;
337 # ifdef __SIZE_TYPE__
338 # define YYSIZE_T __SIZE_TYPE__
339 # elif defined size_t
340 # define YYSIZE_T size_t
341 # elif ! defined YYSIZE_T
342 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
343 # define YYSIZE_T size_t
345 # define YYSIZE_T unsigned int
349 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
352 # if defined YYENABLE_NLS && YYENABLE_NLS
354 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
355 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
359 # define YY_(Msgid) Msgid
364 # if (defined __GNUC__ \
365 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
366 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
367 # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
369 # define YY_ATTRIBUTE(Spec) /* empty */
373 #ifndef YY_ATTRIBUTE_PURE
374 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
377 #ifndef YY_ATTRIBUTE_UNUSED
378 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
381 #if !defined _Noreturn \
382 && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
383 # if defined _MSC_VER && 1200 <= _MSC_VER
384 # define _Noreturn __declspec (noreturn)
386 # define _Noreturn YY_ATTRIBUTE ((__noreturn__))
390 /* Suppress unused-variable warnings by "using" E. */
391 #if ! defined lint || defined __GNUC__
392 # define YYUSE(E) ((void) (E))
394 # define YYUSE(E) /* empty */
397 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
398 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
399 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
400 _Pragma ("GCC diagnostic push") \
401 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
402 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
403 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
404 _Pragma ("GCC diagnostic pop")
406 # define YY_INITIAL_VALUE(Value) Value
408 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
409 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
410 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
412 #ifndef YY_INITIAL_VALUE
413 # define YY_INITIAL_VALUE(Value) /* Nothing. */
417 #if ! defined yyoverflow || YYERROR_VERBOSE
419 /* The parser invokes alloca or xmalloc; define the necessary symbols. */
421 # ifdef YYSTACK_USE_ALLOCA
422 # if YYSTACK_USE_ALLOCA
424 # define YYSTACK_ALLOC __builtin_alloca
425 # elif defined __BUILTIN_VA_ARG_INCR
426 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
428 # define YYSTACK_ALLOC __alloca
429 # elif defined _MSC_VER
430 # define alloca _alloca
432 # define YYSTACK_ALLOC alloca
433 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
434 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
435 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
436 # ifndef EXIT_SUCCESS
437 # define EXIT_SUCCESS 0
444 # ifdef YYSTACK_ALLOC
445 /* Pacify GCC's 'empty if-body' warning. */
446 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
447 # ifndef YYSTACK_ALLOC_MAXIMUM
448 /* The OS might guarantee only one guard page at the bottom of the stack,
449 and a page size can be as small as 4096 bytes. So we cannot safely
450 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
451 to allow for a few compiler-allocated temporary stack slots. */
452 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
455 # define YYSTACK_ALLOC YYMALLOC
456 # define YYSTACK_FREE YYFREE
457 # ifndef YYSTACK_ALLOC_MAXIMUM
458 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
460 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
461 && ! ((defined YYMALLOC || defined xmalloc) \
462 && (defined YYFREE || defined xfree)))
463 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
464 # ifndef EXIT_SUCCESS
465 # define EXIT_SUCCESS 0
469 # define YYMALLOC xmalloc
470 # if ! defined xmalloc && ! defined EXIT_SUCCESS
471 void *xmalloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
475 # define YYFREE xfree
476 # if ! defined xfree && ! defined EXIT_SUCCESS
477 void xfree (void *); /* INFRINGES ON USER NAME SPACE */
481 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
484 #if (! defined yyoverflow \
485 && (! defined __cplusplus \
486 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
488 /* A type that is properly aligned for any stack member. */
491 yytype_int16 yyss_alloc;
495 /* The size of the maximum gap between one aligned stack and the next. */
496 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
498 /* The size of an array large to enough to hold all stacks, each with
500 # define YYSTACK_BYTES(N) \
501 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
502 + YYSTACK_GAP_MAXIMUM)
504 # define YYCOPY_NEEDED 1
506 /* Relocate STACK from its old location to the new one. The
507 local variables YYSIZE and YYSTACKSIZE give the old and new number of
508 elements in the stack, and YYPTR gives the new location of the
509 stack. Advance YYPTR to a properly aligned location for the next
511 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
514 YYSIZE_T yynewbytes; \
515 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
516 Stack = &yyptr->Stack_alloc; \
517 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
518 yyptr += yynewbytes / sizeof (*yyptr); \
524 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
525 /* Copy COUNT objects from SRC to DST. The source and destination do
528 # if defined __GNUC__ && 1 < __GNUC__
529 # define YYCOPY(Dst, Src, Count) \
530 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
532 # define YYCOPY(Dst, Src, Count) \
536 for (yyi = 0; yyi < (Count); yyi++) \
537 (Dst)[yyi] = (Src)[yyi]; \
542 #endif /* !YYCOPY_NEEDED */
544 /* YYFINAL -- State number of the termination state. */
546 /* YYLAST -- Last index in YYTABLE. */
549 /* YYNTOKENS -- Number of terminals. */
551 /* YYNNTS -- Number of nonterminals. */
553 /* YYNRULES -- Number of rules. */
555 /* YYNSTATES -- Number of states. */
556 #define YYNSTATES 209
558 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
559 by yylex, with out-of-bounds checking. */
561 #define YYMAXUTOK 287
563 #define YYTRANSLATE(YYX) \
564 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
566 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
567 as returned by yylex, without out-of-bounds checking. */
568 static const yytype_uint8 yytranslate[] =
570 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
571 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
572 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
573 2, 2, 2, 54, 2, 2, 2, 43, 30, 2,
574 48, 49, 41, 39, 23, 40, 46, 42, 2, 2,
575 2, 2, 2, 2, 2, 2, 2, 2, 55, 2,
576 33, 24, 34, 25, 2, 2, 2, 2, 2, 2,
577 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
578 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
579 2, 47, 2, 52, 29, 2, 2, 2, 2, 2,
580 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
581 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
582 2, 2, 2, 50, 28, 51, 53, 2, 2, 2,
583 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
584 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
585 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
586 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
587 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
588 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
589 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
590 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
591 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
592 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
593 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
594 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
595 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
596 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
597 15, 16, 17, 18, 19, 20, 21, 22, 26, 27,
598 31, 32, 35, 36, 37, 38, 44, 45
602 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
603 static const yytype_uint16 yyrline[] =
605 0, 217, 217, 218, 221, 230, 231, 235, 244, 249,
606 258, 263, 269, 280, 281, 286, 287, 291, 293, 295,
607 297, 299, 304, 306, 318, 323, 327, 329, 334, 335,
608 339, 340, 344, 345, 349, 375, 376, 381, 382, 386,
609 387, 388, 389, 390, 391, 392, 400, 405, 410, 416,
610 418, 424, 425, 429, 432, 438, 439, 443, 447, 449,
611 454, 456, 460, 462, 468, 474, 473, 479, 481, 486,
612 506, 508, 513, 514, 516, 518, 519, 523, 528, 533,
613 534, 535, 536, 538, 541, 545, 550, 555, 556, 558,
614 560, 564, 568, 592, 602, 603, 605, 607, 612, 613,
615 615, 620, 621, 623, 629, 630, 632, 634, 636, 642,
616 643, 645, 650, 651, 656, 657, 661, 662, 667, 668,
617 673, 674, 679, 680, 685, 686, 690, 692, 699, 701,
622 #if YYDEBUG || YYERROR_VERBOSE || 0
623 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
624 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
625 static const char *const yytname[] =
627 "$end", "error", "$undefined", "INTEGER_LITERAL",
628 "FLOATING_POINT_LITERAL", "IDENTIFIER", "STRING_LITERAL",
629 "BOOLEAN_LITERAL", "TYPENAME", "NAME_OR_INT", "ERROR", "LONG", "SHORT",
630 "BYTE", "INT", "CHAR", "BOOLEAN", "DOUBLE", "FLOAT", "VARIABLE",
631 "ASSIGN_MODIFY", "SUPER", "NEW", "','", "'='", "'?'", "OROR", "ANDAND",
632 "'|'", "'^'", "'&'", "EQUAL", "NOTEQUAL", "'<'", "'>'", "LEQ", "GEQ",
633 "LSH", "RSH", "'+'", "'-'", "'*'", "'/'", "'%'", "INCREMENT",
634 "DECREMENT", "'.'", "'['", "'('", "')'", "'{'", "'}'", "']'", "'~'",
635 "'!'", "':'", "$accept", "start", "type_exp", "PrimitiveOrArrayType",
636 "StringLiteral", "Literal", "PrimitiveType", "NumericType",
637 "IntegralType", "FloatingPointType", "ClassOrInterfaceType", "ClassType",
638 "ArrayType", "Name", "ForcedName", "SimpleName", "QualifiedName", "exp1",
639 "Primary", "PrimaryNoNewArray", "lcurly", "rcurly",
640 "ClassInstanceCreationExpression", "ArgumentList", "ArgumentList_opt",
641 "ArrayCreationExpression", "DimExprs", "DimExpr", "Dims", "Dims_opt",
642 "FieldAccess", "FuncStart", "MethodInvocation", "$@1", "ArrayAccess",
643 "PostfixExpression", "PostIncrementExpression",
644 "PostDecrementExpression", "UnaryExpression", "PreIncrementExpression",
645 "PreDecrementExpression", "UnaryExpressionNotPlusMinus",
646 "CastExpression", "MultiplicativeExpression", "AdditiveExpression",
647 "ShiftExpression", "RelationalExpression", "EqualityExpression",
648 "AndExpression", "ExclusiveOrExpression", "InclusiveOrExpression",
649 "ConditionalAndExpression", "ConditionalOrExpression",
650 "ConditionalExpression", "AssignmentExpression", "Assignment",
651 "LeftHandSide", "Expression", YY_NULLPTR
656 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
657 (internal) symbol number NUM (which must be that of a token). */
658 static const yytype_uint16 yytoknum[] =
660 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
661 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
662 275, 276, 277, 44, 61, 63, 278, 279, 124, 94,
663 38, 280, 281, 60, 62, 282, 283, 284, 285, 43,
664 45, 42, 47, 37, 286, 287, 46, 91, 40, 41,
665 123, 125, 93, 126, 33, 58
669 #define YYPACT_NINF -145
671 #define yypact_value_is_default(Yystate) \
672 (!!((Yystate) == (-145)))
674 #define YYTABLE_NINF -132
676 #define yytable_value_is_error(Yytable_value) \
679 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
681 static const yytype_int16 yypact[] =
683 215, -145, -145, -5, -145, -145, 1, -145, -145, -145,
684 -145, -145, -145, -145, -145, -7, -19, 279, 50, 50,
685 50, 50, 50, 215, -145, 50, 50, 46, -145, -145,
686 -145, -145, -9, -145, -145, -145, -145, 87, -145, -145,
687 12, 44, 5, 16, 319, -145, -145, 28, -145, -145,
688 38, 29, -145, -145, -145, -145, -145, -145, -145, 99,
689 53, 85, 52, 94, 66, 41, 71, 74, 122, -145,
690 -145, -145, 40, -145, 26, 319, 26, -145, 59, 59,
691 67, 82, -145, -145, 111, 107, -145, -145, -145, -145,
692 -145, -145, -145, -9, 87, 68, -145, -145, -145, 79,
693 91, 26, 267, -145, 91, 319, 26, 319, -18, -145,
694 319, -145, -145, 50, 50, 50, 50, 50, 50, 50,
695 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
696 319, 50, 50, 50, -145, -145, -145, 112, 126, 319,
697 128, -145, 128, 319, 319, 91, 127, -31, 193, -145,
698 125, -145, 129, -145, 131, 130, 319, -145, -145, 157,
699 135, -145, -145, -145, 99, 99, 53, 53, 85, 85,
700 85, 85, 52, 52, 94, 66, 41, 71, 132, 74,
701 -145, -145, -145, 319, 134, 267, -145, -145, -145, 139,
702 50, 193, -145, -145, -145, 319, -145, -145, -145, 50,
703 141, -145, -145, -145, -145, 144, -145, -145, -145
706 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
707 Performed when YYTABLE does not specify something else to do. Zero
708 means the default is an error. */
709 static const yytype_uint8 yydefact[] =
711 0, 8, 10, 28, 7, 11, 9, 20, 18, 17,
712 19, 21, 14, 23, 22, 74, 0, 0, 0, 0,
713 0, 0, 0, 0, 46, 0, 0, 0, 3, 4,
714 12, 39, 5, 13, 15, 16, 6, 73, 128, 30,
715 29, 2, 72, 37, 0, 41, 38, 42, 65, 43,
716 44, 87, 75, 76, 94, 79, 80, 84, 90, 98,
717 101, 104, 109, 112, 114, 116, 118, 120, 122, 124,
718 132, 125, 0, 35, 0, 0, 0, 28, 0, 25,
719 0, 24, 29, 9, 74, 73, 42, 44, 81, 82,
720 83, 85, 86, 61, 73, 0, 88, 89, 1, 0,
721 26, 0, 0, 64, 27, 0, 0, 0, 0, 49,
722 51, 77, 78, 0, 0, 0, 0, 0, 0, 0,
723 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
724 0, 0, 0, 0, 32, 33, 63, 0, 0, 0,
725 61, 55, 61, 51, 0, 60, 0, 0, 40, 58,
726 0, 34, 0, 36, 62, 0, 0, 47, 45, 52,
727 0, 95, 96, 97, 99, 100, 102, 103, 105, 106,
728 107, 108, 110, 111, 113, 115, 117, 119, 0, 121,
729 127, 126, 70, 51, 0, 0, 56, 53, 54, 0,
730 0, 0, 92, 59, 69, 51, 71, 50, 66, 0,
731 0, 57, 48, 91, 93, 0, 123, 68, 67
734 /* YYPGOTO[NTERM-NUM]. */
735 static const yytype_int16 yypgoto[] =
737 -145, -145, -145, -145, -145, -145, -3, -145, -145, -145,
738 -145, -145, -145, 11, -145, -64, 0, -145, -145, -145,
739 -145, -145, -145, 150, -134, -145, 124, -116, -29, -99,
740 6, -145, -145, -145, 22, -145, -145, -145, 58, -145,
741 -145, -144, -145, 43, 49, -2, 45, 78, 81, 83,
742 77, 92, -145, -131, -145, -145, -145, 7
745 /* YYDEFGOTO[NTERM-NUM]. */
746 static const yytype_int16 yydefgoto[] =
748 -1, 27, 28, 29, 30, 31, 32, 33, 34, 35,
749 79, 80, 36, 85, 38, 39, 82, 41, 42, 43,
750 44, 158, 45, 159, 160, 46, 140, 141, 145, 146,
751 86, 48, 49, 110, 87, 51, 52, 53, 54, 55,
752 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
753 66, 67, 68, 69, 70, 71, 72, 109
756 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
757 positive, shift that token. If negative, reduce the rule whose
758 number is the opposite. If YYTABLE_NINF, syntax error. */
759 static const yytype_int16 yytable[] =
761 40, 180, 181, 100, 192, 156, 47, 73, 104, 189,
762 136, 37, 138, -129, 78, -32, 150, -129, 191, -32,
763 93, -33, 50, 40, 186, -33, 186, 76, 81, 47,
764 95, 134, -31, 157, 94, 135, -31, 151, 99, 74,
765 75, 187, 154, 188, 40, 50, 98, 204, -130, 200,
766 47, 106, -130, 1, 2, 77, 4, 5, -131, 83,
767 132, 205, -131, 107, 133, 147, 50, 105, 206, 84,
768 127, 16, 17, 111, 112, 40, 88, 89, 90, 91,
769 92, 47, 137, 96, 97, 120, 121, 122, 123, 18,
770 19, 20, 116, 117, 21, 22, 126, 50, 23, 128,
771 24, 129, 40, 25, 26, 40, 139, 40, 47, 152,
772 40, 47, 153, 47, 155, 143, 47, 148, 168, 169,
773 170, 171, 118, 119, 50, 124, 125, 50, 101, 50,
774 40, 149, 50, 101, 102, 103, 47, 178, 150, 40,
775 113, 114, 115, 40, 40, 47, 184, 130, 131, 47,
776 47, 152, 50, 101, 144, 103, 40, 74, 75, 164,
777 165, 50, 47, 197, 182, 50, 50, 166, 167, 172,
778 173, 161, 162, 163, 183, 185, 190, 193, 50, 195,
779 156, 194, 196, 40, 198, 40, 201, 199, 202, 47,
780 207, 47, 184, 208, 108, 40, 1, 2, 77, 4,
781 5, 47, 83, 142, 174, 50, 177, 50, 175, 0,
782 0, 176, 84, 0, 16, 17, 0, 50, 1, 2,
783 3, 4, 5, 179, 6, 0, 7, 8, 9, 10,
784 11, 12, 13, 14, 15, 0, 16, 17, 0, 0,
785 0, 23, 0, 24, 0, 0, 25, 26, 203, 0,
786 0, 0, 0, 0, 18, 19, 20, 0, 0, 21,
787 22, 0, 0, 23, 0, 24, 0, 0, 25, 26,
788 1, 2, 3, 4, 5, 0, 6, 0, 0, 0,
789 0, 0, 0, 0, 77, 0, 15, 0, 16, 17,
790 7, 8, 9, 10, 11, 12, 13, 14, 0, 0,
791 0, 0, 0, 0, 0, 0, 18, 19, 20, 0,
792 0, 21, 22, 0, 0, 23, 0, 24, 0, 149,
793 25, 26, 1, 2, 3, 4, 5, 0, 6, 0,
794 0, 0, 0, 0, 0, 0, 0, 0, 15, 0,
795 16, 17, 0, 0, 0, 0, 0, 0, 0, 0,
796 0, 0, 0, 0, 0, 0, 0, 0, 18, 19,
797 20, 0, 0, 21, 22, 0, 0, 23, 0, 24,
801 static const yytype_int16 yycheck[] =
803 0, 132, 133, 32, 148, 23, 0, 0, 37, 143,
804 74, 0, 76, 20, 17, 20, 47, 24, 49, 24,
805 23, 20, 0, 23, 140, 24, 142, 46, 17, 23,
806 23, 5, 20, 51, 23, 9, 24, 101, 47, 46,
807 47, 140, 106, 142, 44, 23, 0, 191, 20, 183,
808 44, 46, 24, 3, 4, 5, 6, 7, 20, 9,
809 20, 195, 24, 47, 24, 94, 44, 23, 199, 19,
810 29, 21, 22, 44, 45, 75, 18, 19, 20, 21,
811 22, 75, 75, 25, 26, 33, 34, 35, 36, 39,
812 40, 41, 39, 40, 44, 45, 30, 75, 48, 28,
813 50, 27, 102, 53, 54, 105, 47, 107, 102, 102,
814 110, 105, 105, 107, 107, 48, 110, 49, 120, 121,
815 122, 123, 37, 38, 102, 31, 32, 105, 46, 107,
816 130, 52, 110, 46, 47, 48, 130, 130, 47, 139,
817 41, 42, 43, 143, 144, 139, 139, 25, 26, 143,
818 144, 144, 130, 46, 47, 48, 156, 46, 47, 116,
819 117, 139, 156, 156, 52, 143, 144, 118, 119, 124,
820 125, 113, 114, 115, 48, 47, 49, 52, 156, 48,
821 23, 52, 52, 183, 49, 185, 52, 55, 49, 183,
822 49, 185, 185, 49, 44, 195, 3, 4, 5, 6,
823 7, 195, 9, 79, 126, 183, 129, 185, 127, -1,
824 -1, 128, 19, -1, 21, 22, -1, 195, 3, 4,
825 5, 6, 7, 131, 9, -1, 11, 12, 13, 14,
826 15, 16, 17, 18, 19, -1, 21, 22, -1, -1,
827 -1, 48, -1, 50, -1, -1, 53, 54, 190, -1,
828 -1, -1, -1, -1, 39, 40, 41, -1, -1, 44,
829 45, -1, -1, 48, -1, 50, -1, -1, 53, 54,
830 3, 4, 5, 6, 7, -1, 9, -1, -1, -1,
831 -1, -1, -1, -1, 5, -1, 19, -1, 21, 22,
832 11, 12, 13, 14, 15, 16, 17, 18, -1, -1,
833 -1, -1, -1, -1, -1, -1, 39, 40, 41, -1,
834 -1, 44, 45, -1, -1, 48, -1, 50, -1, 52,
835 53, 54, 3, 4, 5, 6, 7, -1, 9, -1,
836 -1, -1, -1, -1, -1, -1, -1, -1, 19, -1,
837 21, 22, -1, -1, -1, -1, -1, -1, -1, -1,
838 -1, -1, -1, -1, -1, -1, -1, -1, 39, 40,
839 41, -1, -1, 44, 45, -1, -1, 48, -1, 50,
843 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
844 symbol of state STATE-NUM. */
845 static const yytype_uint8 yystos[] =
847 0, 3, 4, 5, 6, 7, 9, 11, 12, 13,
848 14, 15, 16, 17, 18, 19, 21, 22, 39, 40,
849 41, 44, 45, 48, 50, 53, 54, 57, 58, 59,
850 60, 61, 62, 63, 64, 65, 68, 69, 70, 71,
851 72, 73, 74, 75, 76, 78, 81, 86, 87, 88,
852 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,
853 100, 101, 102, 103, 104, 105, 106, 107, 108, 109,
854 110, 111, 112, 113, 46, 47, 46, 5, 62, 66,
855 67, 69, 72, 9, 19, 69, 86, 90, 94, 94,
856 94, 94, 94, 62, 69, 113, 94, 94, 0, 47,
857 84, 46, 47, 48, 84, 23, 46, 47, 79, 113,
858 89, 44, 45, 41, 42, 43, 39, 40, 37, 38,
859 33, 34, 35, 36, 31, 32, 30, 29, 28, 27,
860 25, 26, 20, 24, 5, 9, 71, 113, 71, 47,
861 82, 83, 82, 48, 47, 84, 85, 84, 49, 52,
862 47, 71, 113, 113, 71, 113, 23, 51, 77, 79,
863 80, 94, 94, 94, 99, 99, 100, 100, 101, 101,
864 101, 101, 102, 102, 103, 104, 105, 106, 113, 107,
865 109, 109, 52, 48, 113, 47, 83, 85, 85, 80,
866 49, 49, 97, 52, 52, 48, 52, 113, 49, 55,
867 80, 52, 49, 94, 97, 80, 109, 49, 49
870 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
871 static const yytype_uint8 yyr1[] =
873 0, 56, 57, 57, 58, 59, 59, 60, 61, 61,
874 61, 61, 61, 62, 62, 63, 63, 64, 64, 64,
875 64, 64, 65, 65, 66, 67, 68, 68, 69, 69,
876 70, 70, 71, 71, 72, 73, 73, 74, 74, 75,
877 75, 75, 75, 75, 75, 75, 76, 77, 78, 79,
878 79, 80, 80, 81, 81, 82, 82, 83, 84, 84,
879 85, 85, 86, 86, 87, 89, 88, 88, 88, 90,
880 90, 90, 91, 91, 91, 91, 91, 92, 93, 94,
881 94, 94, 94, 94, 94, 95, 96, 97, 97, 97,
882 97, 98, 98, 98, 99, 99, 99, 99, 100, 100,
883 100, 101, 101, 101, 102, 102, 102, 102, 102, 103,
884 103, 103, 104, 104, 105, 105, 106, 106, 107, 107,
885 108, 108, 109, 109, 110, 110, 111, 111, 112, 112,
889 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
890 static const yytype_uint8 yyr2[] =
892 0, 2, 1, 1, 1, 1, 1, 1, 1, 1,
893 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
894 1, 1, 1, 1, 1, 1, 2, 2, 1, 1,
895 1, 1, 1, 1, 3, 1, 3, 1, 1, 1,
896 3, 1, 1, 1, 1, 3, 1, 1, 5, 1,
897 3, 0, 1, 4, 4, 1, 2, 3, 2, 3,
898 1, 0, 3, 3, 2, 0, 4, 6, 6, 4,
899 4, 4, 1, 1, 1, 1, 1, 2, 2, 1,
900 1, 2, 2, 2, 1, 2, 2, 1, 2, 2,
901 1, 5, 4, 5, 1, 3, 3, 3, 1, 3,
902 3, 1, 3, 3, 1, 3, 3, 3, 3, 1,
903 3, 3, 1, 3, 1, 3, 1, 3, 1, 3,
904 1, 3, 1, 5, 1, 1, 3, 3, 1, 1,
909 #define yyerrok (yyerrstatus = 0)
910 #define yyclearin (yychar = YYEMPTY)
914 #define YYACCEPT goto yyacceptlab
915 #define YYABORT goto yyabortlab
916 #define YYERROR goto yyerrorlab
919 #define YYRECOVERING() (!!yyerrstatus)
921 #define YYBACKUP(Token, Value) \
923 if (yychar == YYEMPTY) \
927 YYPOPSTACK (yylen); \
933 yyerror (YY_("syntax error: cannot back up")); \
938 /* Error token number */
940 #define YYERRCODE 256
944 /* Enable debugging if requested. */
948 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
949 # define YYFPRINTF fprintf
952 # define YYDPRINTF(Args) \
958 /* This macro is provided for backward compatibility. */
959 #ifndef YY_LOCATION_PRINT
960 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
964 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
968 YYFPRINTF (stderr, "%s ", Title); \
969 yy_symbol_print (stderr, \
971 YYFPRINTF (stderr, "\n"); \
976 /*----------------------------------------.
977 | Print this symbol's value on YYOUTPUT. |
978 `----------------------------------------*/
981 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
983 FILE *yyo = yyoutput;
988 if (yytype < YYNTOKENS)
989 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
995 /*--------------------------------.
996 | Print this symbol on YYOUTPUT. |
997 `--------------------------------*/
1000 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1002 YYFPRINTF (yyoutput, "%s %s (",
1003 yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
1005 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
1006 YYFPRINTF (yyoutput, ")");
1009 /*------------------------------------------------------------------.
1010 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1012 `------------------------------------------------------------------*/
1015 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1017 YYFPRINTF (stderr, "Stack now");
1018 for (; yybottom <= yytop; yybottom++)
1020 int yybot = *yybottom;
1021 YYFPRINTF (stderr, " %d", yybot);
1023 YYFPRINTF (stderr, "\n");
1026 # define YY_STACK_PRINT(Bottom, Top) \
1029 yy_stack_print ((Bottom), (Top)); \
1033 /*------------------------------------------------.
1034 | Report that the YYRULE is going to be reduced. |
1035 `------------------------------------------------*/
1038 yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
1040 unsigned long int yylno = yyrline[yyrule];
1041 int yynrhs = yyr2[yyrule];
1043 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1045 /* The symbols being reduced. */
1046 for (yyi = 0; yyi < yynrhs; yyi++)
1048 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1049 yy_symbol_print (stderr,
1050 yystos[yyssp[yyi + 1 - yynrhs]],
1051 &(yyvsp[(yyi + 1) - (yynrhs)])
1053 YYFPRINTF (stderr, "\n");
1057 # define YY_REDUCE_PRINT(Rule) \
1060 yy_reduce_print (yyssp, yyvsp, Rule); \
1063 /* Nonzero means print parse trace. It is left uninitialized so that
1064 multiple parsers can coexist. */
1066 #else /* !YYDEBUG */
1067 # define YYDPRINTF(Args)
1068 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1069 # define YY_STACK_PRINT(Bottom, Top)
1070 # define YY_REDUCE_PRINT(Rule)
1071 #endif /* !YYDEBUG */
1074 /* YYINITDEPTH -- initial size of the parser's stacks. */
1076 # define YYINITDEPTH 200
1079 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1080 if the built-in stack extension method is used).
1082 Do not make this value too large; the results are undefined if
1083 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1084 evaluated with infinite-precision integer arithmetic. */
1087 # define YYMAXDEPTH 10000
1094 # if defined __GLIBC__ && defined _STRING_H
1095 # define yystrlen strlen
1097 /* Return the length of YYSTR. */
1099 yystrlen (const char *yystr)
1102 for (yylen = 0; yystr[yylen]; yylen++)
1110 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1111 # define yystpcpy stpcpy
1113 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1116 yystpcpy (char *yydest, const char *yysrc)
1119 const char *yys = yysrc;
1121 while ((*yyd++ = *yys++) != '\0')
1130 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1131 quotes and backslashes, so that it's suitable for yyerror. The
1132 heuristic is that double-quoting is unnecessary unless the string
1133 contains an apostrophe, a comma, or backslash (other than
1134 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1135 null, do not copy; instead, return the length of what the result
1138 yytnamerr (char *yyres, const char *yystr)
1143 char const *yyp = yystr;
1150 goto do_not_strip_quotes;
1154 goto do_not_strip_quotes;
1167 do_not_strip_quotes: ;
1171 return yystrlen (yystr);
1173 return yystpcpy (yyres, yystr) - yyres;
1177 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1178 about the unexpected token YYTOKEN for the state stack whose top is
1181 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1182 not large enough to hold the message. In that case, also set
1183 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1184 required number of bytes is too large to store. */
1186 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1187 yytype_int16 *yyssp, int yytoken)
1189 YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
1190 YYSIZE_T yysize = yysize0;
1191 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1192 /* Internationalized format string. */
1193 const char *yyformat = YY_NULLPTR;
1194 /* Arguments of yyformat. */
1195 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1196 /* Number of reported tokens (one for the "unexpected", one per
1200 /* There are many possibilities here to consider:
1201 - If this state is a consistent state with a default action, then
1202 the only way this function was invoked is if the default action
1203 is an error action. In that case, don't check for expected
1204 tokens because there are none.
1205 - The only way there can be no lookahead present (in yychar) is if
1206 this state is a consistent state with a default action. Thus,
1207 detecting the absence of a lookahead is sufficient to determine
1208 that there is no unexpected or expected token to report. In that
1209 case, just report a simple "syntax error".
1210 - Don't assume there isn't a lookahead just because this state is a
1211 consistent state with a default action. There might have been a
1212 previous inconsistent state, consistent state with a non-default
1213 action, or user semantic action that manipulated yychar.
1214 - Of course, the expected token list depends on states to have
1215 correct lookahead information, and it depends on the parser not
1216 to perform extra reductions after fetching a lookahead from the
1217 scanner and before detecting a syntax error. Thus, state merging
1218 (from LALR or IELR) and default reductions corrupt the expected
1219 token list. However, the list is correct for canonical LR with
1220 one exception: it will still contain any token that will not be
1221 accepted due to an error action in a later state.
1223 if (yytoken != YYEMPTY)
1225 int yyn = yypact[*yyssp];
1226 yyarg[yycount++] = yytname[yytoken];
1227 if (!yypact_value_is_default (yyn))
1229 /* Start YYX at -YYN if negative to avoid negative indexes in
1230 YYCHECK. In other words, skip the first -YYN actions for
1231 this state because they are default actions. */
1232 int yyxbegin = yyn < 0 ? -yyn : 0;
1233 /* Stay within bounds of both yycheck and yytname. */
1234 int yychecklim = YYLAST - yyn + 1;
1235 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1238 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1239 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1240 && !yytable_value_is_error (yytable[yyx + yyn]))
1242 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1248 yyarg[yycount++] = yytname[yyx];
1250 YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
1251 if (! (yysize <= yysize1
1252 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1262 # define YYCASE_(N, S) \
1266 YYCASE_(0, YY_("syntax error"));
1267 YYCASE_(1, YY_("syntax error, unexpected %s"));
1268 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1269 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1270 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1271 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1276 YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1277 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1282 if (*yymsg_alloc < yysize)
1284 *yymsg_alloc = 2 * yysize;
1285 if (! (yysize <= *yymsg_alloc
1286 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1287 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1291 /* Avoid sprintf, as that infringes on the user's name space.
1292 Don't have undefined behavior even if the translation
1293 produced a string with the wrong number of "%s"s. */
1297 while ((*yyp = *yyformat) != '\0')
1298 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1300 yyp += yytnamerr (yyp, yyarg[yyi++]);
1311 #endif /* YYERROR_VERBOSE */
1313 /*-----------------------------------------------.
1314 | Release the memory associated to this symbol. |
1315 `-----------------------------------------------*/
1318 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1323 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1325 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1327 YY_IGNORE_MAYBE_UNINITIALIZED_END
1333 /* The lookahead symbol. */
1336 /* The semantic value of the lookahead symbol. */
1338 /* Number of syntax errors so far. */
1350 /* Number of tokens to shift before error messages enabled. */
1353 /* The stacks and their tools:
1354 'yyss': related to states.
1355 'yyvs': related to semantic values.
1357 Refer to the stacks through separate pointers, to allow yyoverflow
1358 to xreallocate them elsewhere. */
1360 /* The state stack. */
1361 yytype_int16 yyssa[YYINITDEPTH];
1363 yytype_int16 *yyssp;
1365 /* The semantic value stack. */
1366 YYSTYPE yyvsa[YYINITDEPTH];
1370 YYSIZE_T yystacksize;
1374 /* Lookahead token as an internal (translated) token number. */
1376 /* The variables used to return semantic value and location from the
1381 /* Buffer for error messages, and its allocated size. */
1383 char *yymsg = yymsgbuf;
1384 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1387 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1389 /* The number of symbols on the RHS of the reduced rule.
1390 Keep to zero when no symbol should be popped. */
1393 yyssp = yyss = yyssa;
1394 yyvsp = yyvs = yyvsa;
1395 yystacksize = YYINITDEPTH;
1397 YYDPRINTF ((stderr, "Starting parse\n"));
1402 yychar = YYEMPTY; /* Cause a token to be read. */
1405 /*------------------------------------------------------------.
1406 | yynewstate -- Push a new state, which is found in yystate. |
1407 `------------------------------------------------------------*/
1409 /* In all cases, when you get here, the value and location stacks
1410 have just been pushed. So pushing a state here evens the stacks. */
1416 if (yyss + yystacksize - 1 <= yyssp)
1418 /* Get the current used size of the three stacks, in elements. */
1419 YYSIZE_T yysize = yyssp - yyss + 1;
1423 /* Give user a chance to xreallocate the stack. Use copies of
1424 these so that the &'s don't force the real ones into
1426 YYSTYPE *yyvs1 = yyvs;
1427 yytype_int16 *yyss1 = yyss;
1429 /* Each stack pointer address is followed by the size of the
1430 data in use in that stack, in bytes. This used to be a
1431 conditional around just the two extra args, but that might
1432 be undefined if yyoverflow is a macro. */
1433 yyoverflow (YY_("memory exhausted"),
1434 &yyss1, yysize * sizeof (*yyssp),
1435 &yyvs1, yysize * sizeof (*yyvsp),
1441 #else /* no yyoverflow */
1442 # ifndef YYSTACK_RELOCATE
1443 goto yyexhaustedlab;
1445 /* Extend the stack our own way. */
1446 if (YYMAXDEPTH <= yystacksize)
1447 goto yyexhaustedlab;
1449 if (YYMAXDEPTH < yystacksize)
1450 yystacksize = YYMAXDEPTH;
1453 yytype_int16 *yyss1 = yyss;
1454 union yyalloc *yyptr =
1455 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1457 goto yyexhaustedlab;
1458 YYSTACK_RELOCATE (yyss_alloc, yyss);
1459 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1460 # undef YYSTACK_RELOCATE
1462 YYSTACK_FREE (yyss1);
1465 #endif /* no yyoverflow */
1467 yyssp = yyss + yysize - 1;
1468 yyvsp = yyvs + yysize - 1;
1470 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1471 (unsigned long int) yystacksize));
1473 if (yyss + yystacksize - 1 <= yyssp)
1477 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1479 if (yystate == YYFINAL)
1489 /* Do appropriate processing given the current state. Read a
1490 lookahead token if we need one and don't already have one. */
1492 /* First try to decide what to do without reference to lookahead token. */
1493 yyn = yypact[yystate];
1494 if (yypact_value_is_default (yyn))
1497 /* Not known => get a lookahead token if don't already have one. */
1499 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1500 if (yychar == YYEMPTY)
1502 YYDPRINTF ((stderr, "Reading a token: "));
1506 if (yychar <= YYEOF)
1508 yychar = yytoken = YYEOF;
1509 YYDPRINTF ((stderr, "Now at end of input.\n"));
1513 yytoken = YYTRANSLATE (yychar);
1514 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1517 /* If the proper action on seeing token YYTOKEN is to reduce or to
1518 detect an error, take that action. */
1520 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1525 if (yytable_value_is_error (yyn))
1531 /* Count tokens shifted since error; after three, turn off error
1536 /* Shift the lookahead token. */
1537 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1539 /* Discard the shifted token. */
1543 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1545 YY_IGNORE_MAYBE_UNINITIALIZED_END
1550 /*-----------------------------------------------------------.
1551 | yydefault -- do the default action for the current state. |
1552 `-----------------------------------------------------------*/
1554 yyn = yydefact[yystate];
1560 /*-----------------------------.
1561 | yyreduce -- Do a reduction. |
1562 `-----------------------------*/
1564 /* yyn is the number of a rule to reduce with. */
1567 /* If YYLEN is nonzero, implement the default value of the action:
1570 Otherwise, the following line sets YYVAL to garbage.
1571 This behavior is undocumented and Bison
1572 users should not rely upon it. Assigning to YYVAL
1573 unconditionally makes the parser a bit smaller, and it avoids a
1574 GCC warning that YYVAL may be used uninitialized. */
1575 yyval = yyvsp[1-yylen];
1578 YY_REDUCE_PRINT (yyn);
1582 #line 222 "jv-exp.y" /* yacc.c:1646 */
1584 write_exp_elt_opcode (pstate, OP_TYPE);
1585 write_exp_elt_type (pstate, (yyvsp[0].tval));
1586 write_exp_elt_opcode (pstate, OP_TYPE);
1588 #line 1590 "jv-exp.c" /* yacc.c:1646 */
1592 #line 236 "jv-exp.y" /* yacc.c:1646 */
1594 write_exp_elt_opcode (pstate, OP_STRING);
1595 write_exp_string (pstate, (yyvsp[0].sval));
1596 write_exp_elt_opcode (pstate, OP_STRING);
1598 #line 1600 "jv-exp.c" /* yacc.c:1646 */
1602 #line 245 "jv-exp.y" /* yacc.c:1646 */
1603 { write_exp_elt_opcode (pstate, OP_LONG);
1604 write_exp_elt_type (pstate, (yyvsp[0].typed_val_int).type);
1605 write_exp_elt_longcst (pstate, (LONGEST)((yyvsp[0].typed_val_int).val));
1606 write_exp_elt_opcode (pstate, OP_LONG); }
1607 #line 1609 "jv-exp.c" /* yacc.c:1646 */
1611 #line 250 "jv-exp.y" /* yacc.c:1646 */
1613 parse_number (pstate, (yyvsp[0].sval).ptr, (yyvsp[0].sval).length, 0, &val);
1614 write_exp_elt_opcode (pstate, OP_LONG);
1615 write_exp_elt_type (pstate, val.typed_val_int.type);
1616 write_exp_elt_longcst (pstate,
1617 (LONGEST) val.typed_val_int.val);
1618 write_exp_elt_opcode (pstate, OP_LONG);
1620 #line 1622 "jv-exp.c" /* yacc.c:1646 */
1624 #line 259 "jv-exp.y" /* yacc.c:1646 */
1625 { write_exp_elt_opcode (pstate, OP_DOUBLE);
1626 write_exp_elt_type (pstate, (yyvsp[0].typed_val_float).type);
1627 write_exp_elt_dblcst (pstate, (yyvsp[0].typed_val_float).dval);
1628 write_exp_elt_opcode (pstate, OP_DOUBLE); }
1629 #line 1631 "jv-exp.c" /* yacc.c:1646 */
1633 #line 264 "jv-exp.y" /* yacc.c:1646 */
1634 { write_exp_elt_opcode (pstate, OP_LONG);
1635 write_exp_elt_type (pstate,
1636 parse_java_type (pstate)->builtin_boolean);
1637 write_exp_elt_longcst (pstate, (LONGEST)(yyvsp[0].lval));
1638 write_exp_elt_opcode (pstate, OP_LONG); }
1639 #line 1641 "jv-exp.c" /* yacc.c:1646 */
1643 #line 282 "jv-exp.y" /* yacc.c:1646 */
1644 { (yyval.tval) = parse_java_type (pstate)->builtin_boolean; }
1645 #line 1647 "jv-exp.c" /* yacc.c:1646 */
1649 #line 292 "jv-exp.y" /* yacc.c:1646 */
1650 { (yyval.tval) = parse_java_type (pstate)->builtin_byte; }
1651 #line 1653 "jv-exp.c" /* yacc.c:1646 */
1655 #line 294 "jv-exp.y" /* yacc.c:1646 */
1656 { (yyval.tval) = parse_java_type (pstate)->builtin_short; }
1657 #line 1659 "jv-exp.c" /* yacc.c:1646 */
1661 #line 296 "jv-exp.y" /* yacc.c:1646 */
1662 { (yyval.tval) = parse_java_type (pstate)->builtin_int; }
1663 #line 1665 "jv-exp.c" /* yacc.c:1646 */
1667 #line 298 "jv-exp.y" /* yacc.c:1646 */
1668 { (yyval.tval) = parse_java_type (pstate)->builtin_long; }
1669 #line 1671 "jv-exp.c" /* yacc.c:1646 */
1673 #line 300 "jv-exp.y" /* yacc.c:1646 */
1674 { (yyval.tval) = parse_java_type (pstate)->builtin_char; }
1675 #line 1677 "jv-exp.c" /* yacc.c:1646 */
1679 #line 305 "jv-exp.y" /* yacc.c:1646 */
1680 { (yyval.tval) = parse_java_type (pstate)->builtin_float; }
1681 #line 1683 "jv-exp.c" /* yacc.c:1646 */
1685 #line 307 "jv-exp.y" /* yacc.c:1646 */
1686 { (yyval.tval) = parse_java_type (pstate)->builtin_double; }
1687 #line 1689 "jv-exp.c" /* yacc.c:1646 */
1691 #line 319 "jv-exp.y" /* yacc.c:1646 */
1692 { (yyval.tval) = java_type_from_name ((yyvsp[0].sval)); }
1693 #line 1695 "jv-exp.c" /* yacc.c:1646 */
1697 #line 328 "jv-exp.y" /* yacc.c:1646 */
1698 { (yyval.tval) = java_array_type ((yyvsp[-1].tval), (yyvsp[0].lval)); }
1699 #line 1701 "jv-exp.c" /* yacc.c:1646 */
1703 #line 330 "jv-exp.y" /* yacc.c:1646 */
1704 { (yyval.tval) = java_array_type (java_type_from_name ((yyvsp[-1].sval)), (yyvsp[0].lval)); }
1705 #line 1707 "jv-exp.c" /* yacc.c:1646 */
1709 #line 350 "jv-exp.y" /* yacc.c:1646 */
1710 { (yyval.sval).length = (yyvsp[-2].sval).length + (yyvsp[0].sval).length + 1;
1711 if ((yyvsp[-2].sval).ptr + (yyvsp[-2].sval).length + 1 == (yyvsp[0].sval).ptr
1712 && (yyvsp[-2].sval).ptr[(yyvsp[-2].sval).length] == '.')
1713 (yyval.sval).ptr = (yyvsp[-2].sval).ptr; /* Optimization. */
1718 buf = xmalloc ((yyval.sval).length + 1);
1719 make_cleanup (xfree, buf);
1720 sprintf (buf, "%.*s.%.*s",
1721 (yyvsp[-2].sval).length, (yyvsp[-2].sval).ptr, (yyvsp[0].sval).length, (yyvsp[0].sval).ptr);
1722 (yyval.sval).ptr = buf;
1724 #line 1726 "jv-exp.c" /* yacc.c:1646 */
1728 #line 377 "jv-exp.y" /* yacc.c:1646 */
1729 { write_exp_elt_opcode (pstate, BINOP_COMMA); }
1730 #line 1732 "jv-exp.c" /* yacc.c:1646 */
1734 #line 393 "jv-exp.y" /* yacc.c:1646 */
1735 { write_exp_elt_opcode (pstate, OP_ARRAY);
1736 write_exp_elt_longcst (pstate, (LONGEST) 0);
1737 write_exp_elt_longcst (pstate, (LONGEST) (yyvsp[0].lval));
1738 write_exp_elt_opcode (pstate, OP_ARRAY); }
1739 #line 1741 "jv-exp.c" /* yacc.c:1646 */
1743 #line 401 "jv-exp.y" /* yacc.c:1646 */
1744 { start_arglist (); }
1745 #line 1747 "jv-exp.c" /* yacc.c:1646 */
1749 #line 406 "jv-exp.y" /* yacc.c:1646 */
1750 { (yyval.lval) = end_arglist () - 1; }
1751 #line 1753 "jv-exp.c" /* yacc.c:1646 */
1755 #line 411 "jv-exp.y" /* yacc.c:1646 */
1756 { internal_error (__FILE__, __LINE__,
1757 _("FIXME - ClassInstanceCreationExpression")); }
1758 #line 1760 "jv-exp.c" /* yacc.c:1646 */
1762 #line 417 "jv-exp.y" /* yacc.c:1646 */
1763 { arglist_len = 1; }
1764 #line 1766 "jv-exp.c" /* yacc.c:1646 */
1768 #line 419 "jv-exp.y" /* yacc.c:1646 */
1770 #line 1772 "jv-exp.c" /* yacc.c:1646 */
1774 #line 424 "jv-exp.y" /* yacc.c:1646 */
1775 { arglist_len = 0; }
1776 #line 1778 "jv-exp.c" /* yacc.c:1646 */
1780 #line 430 "jv-exp.y" /* yacc.c:1646 */
1781 { internal_error (__FILE__, __LINE__,
1782 _("FIXME - ArrayCreationExpression")); }
1783 #line 1785 "jv-exp.c" /* yacc.c:1646 */
1787 #line 433 "jv-exp.y" /* yacc.c:1646 */
1788 { internal_error (__FILE__, __LINE__,
1789 _("FIXME - ArrayCreationExpression")); }
1790 #line 1792 "jv-exp.c" /* yacc.c:1646 */
1794 #line 448 "jv-exp.y" /* yacc.c:1646 */
1795 { (yyval.lval) = 1; }
1796 #line 1798 "jv-exp.c" /* yacc.c:1646 */
1800 #line 450 "jv-exp.y" /* yacc.c:1646 */
1801 { (yyval.lval) = (yyvsp[-2].lval) + 1; }
1802 #line 1804 "jv-exp.c" /* yacc.c:1646 */
1806 #line 456 "jv-exp.y" /* yacc.c:1646 */
1807 { (yyval.lval) = 0; }
1808 #line 1810 "jv-exp.c" /* yacc.c:1646 */
1812 #line 461 "jv-exp.y" /* yacc.c:1646 */
1813 { push_fieldnames (pstate, (yyvsp[0].sval)); }
1814 #line 1816 "jv-exp.c" /* yacc.c:1646 */
1818 #line 463 "jv-exp.y" /* yacc.c:1646 */
1819 { push_fieldnames (pstate, (yyvsp[0].sval)); }
1820 #line 1822 "jv-exp.c" /* yacc.c:1646 */
1824 #line 469 "jv-exp.y" /* yacc.c:1646 */
1825 { push_expression_name (pstate, (yyvsp[-1].sval)); }
1826 #line 1828 "jv-exp.c" /* yacc.c:1646 */
1830 #line 474 "jv-exp.y" /* yacc.c:1646 */
1831 { start_arglist(); }
1832 #line 1834 "jv-exp.c" /* yacc.c:1646 */
1836 #line 476 "jv-exp.y" /* yacc.c:1646 */
1837 { write_exp_elt_opcode (pstate, OP_FUNCALL);
1838 write_exp_elt_longcst (pstate, (LONGEST) end_arglist ());
1839 write_exp_elt_opcode (pstate, OP_FUNCALL); }
1840 #line 1842 "jv-exp.c" /* yacc.c:1646 */
1844 #line 480 "jv-exp.y" /* yacc.c:1646 */
1845 { error (_("Form of method invocation not implemented")); }
1846 #line 1848 "jv-exp.c" /* yacc.c:1646 */
1850 #line 482 "jv-exp.y" /* yacc.c:1646 */
1851 { error (_("Form of method invocation not implemented")); }
1852 #line 1854 "jv-exp.c" /* yacc.c:1646 */
1856 #line 487 "jv-exp.y" /* yacc.c:1646 */
1858 /* Emit code for the Name now, then exchange it in the
1859 expout array with the Expression's code. We could
1860 introduce a OP_SWAP code or a reversed version of
1861 BINOP_SUBSCRIPT, but that makes the rest of GDB pay
1862 for our parsing kludges. */
1863 struct expression *name_expr;
1865 push_expression_name (pstate, (yyvsp[-3].sval));
1866 name_expr = copy_exp (pstate->expout, pstate->expout_ptr);
1867 pstate->expout_ptr -= name_expr->nelts;
1870 - length_of_subexp (pstate->expout,
1871 pstate->expout_ptr),
1874 write_exp_elt_opcode (pstate, BINOP_SUBSCRIPT);
1876 #line 1878 "jv-exp.c" /* yacc.c:1646 */
1880 #line 507 "jv-exp.y" /* yacc.c:1646 */
1881 { write_exp_elt_opcode (pstate, BINOP_SUBSCRIPT); }
1882 #line 1884 "jv-exp.c" /* yacc.c:1646 */
1886 #line 509 "jv-exp.y" /* yacc.c:1646 */
1887 { write_exp_elt_opcode (pstate, BINOP_SUBSCRIPT); }
1888 #line 1890 "jv-exp.c" /* yacc.c:1646 */
1892 #line 515 "jv-exp.y" /* yacc.c:1646 */
1893 { push_expression_name (pstate, (yyvsp[0].sval)); }
1894 #line 1896 "jv-exp.c" /* yacc.c:1646 */
1898 #line 524 "jv-exp.y" /* yacc.c:1646 */
1899 { write_exp_elt_opcode (pstate, UNOP_POSTINCREMENT); }
1900 #line 1902 "jv-exp.c" /* yacc.c:1646 */
1904 #line 529 "jv-exp.y" /* yacc.c:1646 */
1905 { write_exp_elt_opcode (pstate, UNOP_POSTDECREMENT); }
1906 #line 1908 "jv-exp.c" /* yacc.c:1646 */
1910 #line 537 "jv-exp.y" /* yacc.c:1646 */
1911 { write_exp_elt_opcode (pstate, UNOP_NEG); }
1912 #line 1914 "jv-exp.c" /* yacc.c:1646 */
1916 #line 539 "jv-exp.y" /* yacc.c:1646 */
1917 { write_exp_elt_opcode (pstate,
1919 #line 1921 "jv-exp.c" /* yacc.c:1646 */
1923 #line 546 "jv-exp.y" /* yacc.c:1646 */
1924 { write_exp_elt_opcode (pstate, UNOP_PREINCREMENT); }
1925 #line 1927 "jv-exp.c" /* yacc.c:1646 */
1929 #line 551 "jv-exp.y" /* yacc.c:1646 */
1930 { write_exp_elt_opcode (pstate, UNOP_PREDECREMENT); }
1931 #line 1933 "jv-exp.c" /* yacc.c:1646 */
1935 #line 557 "jv-exp.y" /* yacc.c:1646 */
1936 { write_exp_elt_opcode (pstate, UNOP_COMPLEMENT); }
1937 #line 1939 "jv-exp.c" /* yacc.c:1646 */
1941 #line 559 "jv-exp.y" /* yacc.c:1646 */
1942 { write_exp_elt_opcode (pstate, UNOP_LOGICAL_NOT); }
1943 #line 1945 "jv-exp.c" /* yacc.c:1646 */
1947 #line 565 "jv-exp.y" /* yacc.c:1646 */
1948 { write_exp_elt_opcode (pstate, UNOP_CAST);
1949 write_exp_elt_type (pstate, java_array_type ((yyvsp[-3].tval), (yyvsp[-2].lval)));
1950 write_exp_elt_opcode (pstate, UNOP_CAST); }
1951 #line 1953 "jv-exp.c" /* yacc.c:1646 */
1955 #line 569 "jv-exp.y" /* yacc.c:1646 */
1957 int last_exp_size = length_of_subexp (pstate->expout,
1958 pstate->expout_ptr);
1961 int base = pstate->expout_ptr - last_exp_size - 3;
1964 || pstate->expout->elts[base+2].opcode != OP_TYPE)
1965 error (_("Invalid cast expression"));
1966 type = pstate->expout->elts[base+1].type;
1967 /* Remove the 'Expression' and slide the
1968 UnaryExpressionNotPlusMinus down to replace it. */
1969 for (i = 0; i < last_exp_size; i++)
1970 pstate->expout->elts[base + i]
1971 = pstate->expout->elts[base + i + 3];
1972 pstate->expout_ptr -= 3;
1973 if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
1974 type = lookup_pointer_type (type);
1975 write_exp_elt_opcode (pstate, UNOP_CAST);
1976 write_exp_elt_type (pstate, type);
1977 write_exp_elt_opcode (pstate, UNOP_CAST);
1979 #line 1981 "jv-exp.c" /* yacc.c:1646 */
1983 #line 593 "jv-exp.y" /* yacc.c:1646 */
1984 { write_exp_elt_opcode (pstate, UNOP_CAST);
1985 write_exp_elt_type (pstate,
1986 java_array_type (java_type_from_name
1987 ((yyvsp[-3].sval)), (yyvsp[-2].lval)));
1988 write_exp_elt_opcode (pstate, UNOP_CAST); }
1989 #line 1991 "jv-exp.c" /* yacc.c:1646 */
1993 #line 604 "jv-exp.y" /* yacc.c:1646 */
1994 { write_exp_elt_opcode (pstate, BINOP_MUL); }
1995 #line 1997 "jv-exp.c" /* yacc.c:1646 */
1999 #line 606 "jv-exp.y" /* yacc.c:1646 */
2000 { write_exp_elt_opcode (pstate, BINOP_DIV); }
2001 #line 2003 "jv-exp.c" /* yacc.c:1646 */
2005 #line 608 "jv-exp.y" /* yacc.c:1646 */
2006 { write_exp_elt_opcode (pstate, BINOP_REM); }
2007 #line 2009 "jv-exp.c" /* yacc.c:1646 */
2011 #line 614 "jv-exp.y" /* yacc.c:1646 */
2012 { write_exp_elt_opcode (pstate, BINOP_ADD); }
2013 #line 2015 "jv-exp.c" /* yacc.c:1646 */
2017 #line 616 "jv-exp.y" /* yacc.c:1646 */
2018 { write_exp_elt_opcode (pstate, BINOP_SUB); }
2019 #line 2021 "jv-exp.c" /* yacc.c:1646 */
2023 #line 622 "jv-exp.y" /* yacc.c:1646 */
2024 { write_exp_elt_opcode (pstate, BINOP_LSH); }
2025 #line 2027 "jv-exp.c" /* yacc.c:1646 */
2029 #line 624 "jv-exp.y" /* yacc.c:1646 */
2030 { write_exp_elt_opcode (pstate, BINOP_RSH); }
2031 #line 2033 "jv-exp.c" /* yacc.c:1646 */
2035 #line 631 "jv-exp.y" /* yacc.c:1646 */
2036 { write_exp_elt_opcode (pstate, BINOP_LESS); }
2037 #line 2039 "jv-exp.c" /* yacc.c:1646 */
2041 #line 633 "jv-exp.y" /* yacc.c:1646 */
2042 { write_exp_elt_opcode (pstate, BINOP_GTR); }
2043 #line 2045 "jv-exp.c" /* yacc.c:1646 */
2047 #line 635 "jv-exp.y" /* yacc.c:1646 */
2048 { write_exp_elt_opcode (pstate, BINOP_LEQ); }
2049 #line 2051 "jv-exp.c" /* yacc.c:1646 */
2053 #line 637 "jv-exp.y" /* yacc.c:1646 */
2054 { write_exp_elt_opcode (pstate, BINOP_GEQ); }
2055 #line 2057 "jv-exp.c" /* yacc.c:1646 */
2059 #line 644 "jv-exp.y" /* yacc.c:1646 */
2060 { write_exp_elt_opcode (pstate, BINOP_EQUAL); }
2061 #line 2063 "jv-exp.c" /* yacc.c:1646 */
2065 #line 646 "jv-exp.y" /* yacc.c:1646 */
2066 { write_exp_elt_opcode (pstate, BINOP_NOTEQUAL); }
2067 #line 2069 "jv-exp.c" /* yacc.c:1646 */
2071 #line 652 "jv-exp.y" /* yacc.c:1646 */
2072 { write_exp_elt_opcode (pstate, BINOP_BITWISE_AND); }
2073 #line 2075 "jv-exp.c" /* yacc.c:1646 */
2077 #line 658 "jv-exp.y" /* yacc.c:1646 */
2078 { write_exp_elt_opcode (pstate, BINOP_BITWISE_XOR); }
2079 #line 2081 "jv-exp.c" /* yacc.c:1646 */
2083 #line 663 "jv-exp.y" /* yacc.c:1646 */
2084 { write_exp_elt_opcode (pstate, BINOP_BITWISE_IOR); }
2085 #line 2087 "jv-exp.c" /* yacc.c:1646 */
2089 #line 669 "jv-exp.y" /* yacc.c:1646 */
2090 { write_exp_elt_opcode (pstate, BINOP_LOGICAL_AND); }
2091 #line 2093 "jv-exp.c" /* yacc.c:1646 */
2095 #line 675 "jv-exp.y" /* yacc.c:1646 */
2096 { write_exp_elt_opcode (pstate, BINOP_LOGICAL_OR); }
2097 #line 2099 "jv-exp.c" /* yacc.c:1646 */
2101 #line 681 "jv-exp.y" /* yacc.c:1646 */
2102 { write_exp_elt_opcode (pstate, TERNOP_COND); }
2103 #line 2105 "jv-exp.c" /* yacc.c:1646 */
2107 #line 691 "jv-exp.y" /* yacc.c:1646 */
2108 { write_exp_elt_opcode (pstate, BINOP_ASSIGN); }
2109 #line 2111 "jv-exp.c" /* yacc.c:1646 */
2113 #line 693 "jv-exp.y" /* yacc.c:1646 */
2114 { write_exp_elt_opcode (pstate, BINOP_ASSIGN_MODIFY);
2115 write_exp_elt_opcode (pstate, (yyvsp[-1].opcode));
2116 write_exp_elt_opcode (pstate, BINOP_ASSIGN_MODIFY); }
2117 #line 2119 "jv-exp.c" /* yacc.c:1646 */
2121 #line 700 "jv-exp.y" /* yacc.c:1646 */
2122 { push_expression_name (pstate, (yyvsp[0].sval)); }
2123 #line 2125 "jv-exp.c" /* yacc.c:1646 */
2127 #line 2129 "jv-exp.c" /* yacc.c:1646 */
2130 /* User semantic actions sometimes alter yychar, and that requires
2131 that yytoken be updated with the new translation. We take the
2132 approach of translating immediately before every use of yytoken.
2133 One alternative is translating here after every semantic action,
2134 but that translation would be missed if the semantic action invokes
2135 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2136 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2137 incorrect destructor might then be invoked immediately. In the
2138 case of YYERROR or YYBACKUP, subsequent parser actions might lead
2139 to an incorrect destructor call or verbose syntax error message
2140 before the lookahead is translated. */
2141 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2145 YY_STACK_PRINT (yyss, yyssp);
2149 /* Now 'shift' the result of the reduction. Determine what state
2150 that goes to, based on the state we popped back to and the rule
2151 number reduced by. */
2155 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2156 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2157 yystate = yytable[yystate];
2159 yystate = yydefgoto[yyn - YYNTOKENS];
2164 /*--------------------------------------.
2165 | yyerrlab -- here on detecting error. |
2166 `--------------------------------------*/
2168 /* Make sure we have latest lookahead translation. See comments at
2169 user semantic actions for why this is necessary. */
2170 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
2172 /* If not already recovering from an error, report this error. */
2176 #if ! YYERROR_VERBOSE
2177 yyerror (YY_("syntax error"));
2179 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2182 char const *yymsgp = YY_("syntax error");
2183 int yysyntax_error_status;
2184 yysyntax_error_status = YYSYNTAX_ERROR;
2185 if (yysyntax_error_status == 0)
2187 else if (yysyntax_error_status == 1)
2189 if (yymsg != yymsgbuf)
2190 YYSTACK_FREE (yymsg);
2191 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
2195 yymsg_alloc = sizeof yymsgbuf;
2196 yysyntax_error_status = 2;
2200 yysyntax_error_status = YYSYNTAX_ERROR;
2205 if (yysyntax_error_status == 2)
2206 goto yyexhaustedlab;
2208 # undef YYSYNTAX_ERROR
2214 if (yyerrstatus == 3)
2216 /* If just tried and failed to reuse lookahead token after an
2217 error, discard it. */
2219 if (yychar <= YYEOF)
2221 /* Return failure if at end of input. */
2222 if (yychar == YYEOF)
2227 yydestruct ("Error: discarding",
2233 /* Else will try to reuse lookahead token after shifting the error
2238 /*---------------------------------------------------.
2239 | yyerrorlab -- error raised explicitly by YYERROR. |
2240 `---------------------------------------------------*/
2243 /* Pacify compilers like GCC when the user code never invokes
2244 YYERROR and the label yyerrorlab therefore never appears in user
2246 if (/*CONSTCOND*/ 0)
2249 /* Do not reclaim the symbols of the rule whose action triggered
2253 YY_STACK_PRINT (yyss, yyssp);
2258 /*-------------------------------------------------------------.
2259 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2260 `-------------------------------------------------------------*/
2262 yyerrstatus = 3; /* Each real token shifted decrements this. */
2266 yyn = yypact[yystate];
2267 if (!yypact_value_is_default (yyn))
2270 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2278 /* Pop the current state because it cannot handle the error token. */
2283 yydestruct ("Error: popping",
2284 yystos[yystate], yyvsp);
2287 YY_STACK_PRINT (yyss, yyssp);
2290 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2292 YY_IGNORE_MAYBE_UNINITIALIZED_END
2295 /* Shift the error token. */
2296 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2302 /*-------------------------------------.
2303 | yyacceptlab -- YYACCEPT comes here. |
2304 `-------------------------------------*/
2309 /*-----------------------------------.
2310 | yyabortlab -- YYABORT comes here. |
2311 `-----------------------------------*/
2316 #if !defined yyoverflow || YYERROR_VERBOSE
2317 /*-------------------------------------------------.
2318 | yyexhaustedlab -- memory exhaustion comes here. |
2319 `-------------------------------------------------*/
2321 yyerror (YY_("memory exhausted"));
2327 if (yychar != YYEMPTY)
2329 /* Make sure we have latest lookahead translation. See comments at
2330 user semantic actions for why this is necessary. */
2331 yytoken = YYTRANSLATE (yychar);
2332 yydestruct ("Cleanup: discarding lookahead",
2335 /* Do not reclaim the symbols of the rule whose action triggered
2336 this YYABORT or YYACCEPT. */
2338 YY_STACK_PRINT (yyss, yyssp);
2339 while (yyssp != yyss)
2341 yydestruct ("Cleanup: popping",
2342 yystos[*yyssp], yyvsp);
2347 YYSTACK_FREE (yyss);
2350 if (yymsg != yymsgbuf)
2351 YYSTACK_FREE (yymsg);
2355 #line 712 "jv-exp.y" /* yacc.c:1906 */
2357 /* Take care of parsing a number (anything that starts with a digit).
2358 Set yylval and return the token type; update lexptr.
2359 LEN is the number of characters in it. */
2361 /*** Needs some error checking for the float case ***/
2364 parse_number (struct parser_state *par_state,
2365 const char *p, int len, int parsed_float, YYSTYPE *putithere)
2368 ULONGEST limit, limit_div_base;
2371 int base = input_radix;
2380 if (! parse_float (p, len, &putithere->typed_val_float.dval, &suffix))
2383 suffix_len = p + len - suffix;
2385 if (suffix_len == 0)
2386 putithere->typed_val_float.type
2387 = parse_type (par_state)->builtin_double;
2388 else if (suffix_len == 1)
2390 /* See if it has `f' or `d' suffix (float or double). */
2391 if (tolower (*suffix) == 'f')
2392 putithere->typed_val_float.type =
2393 parse_type (par_state)->builtin_float;
2394 else if (tolower (*suffix) == 'd')
2395 putithere->typed_val_float.type =
2396 parse_type (par_state)->builtin_double;
2403 return FLOATING_POINT_LITERAL;
2406 /* Handle base-switching prefixes 0x, 0t, 0d, 0 */
2438 /* A paranoid calculation of (1<<64)-1. */
2439 limit = (ULONGEST)0xffffffff;
2440 limit = ((limit << 16) << 16) | limit;
2441 if (c == 'l' || c == 'L')
2443 type = parse_java_type (par_state)->builtin_long;
2448 type = parse_java_type (par_state)->builtin_int;
2450 limit_div_base = limit / (ULONGEST) base;
2455 if (c >= '0' && c <= '9')
2457 else if (c >= 'A' && c <= 'Z')
2459 else if (c >= 'a' && c <= 'z')
2462 return ERROR; /* Char not a digit */
2465 if (n > limit_div_base
2466 || (n *= base) > limit - c)
2467 error (_("Numeric constant too large"));
2471 /* If the type is bigger than a 32-bit signed integer can be, implicitly
2472 promote to long. Java does not do this, so mark it as
2473 parse_type (par_state)->builtin_uint64 rather than
2474 parse_java_type (par_state)->builtin_long.
2475 0x80000000 will become -0x80000000 instead of 0x80000000L, because we
2476 don't know the sign at this point. */
2477 if (type == parse_java_type (par_state)->builtin_int
2478 && n > (ULONGEST)0x80000000)
2479 type = parse_type (par_state)->builtin_uint64;
2481 putithere->typed_val_int.val = n;
2482 putithere->typed_val_int.type = type;
2484 return INTEGER_LITERAL;
2491 enum exp_opcode opcode;
2494 static const struct token tokentab3[] =
2496 {">>=", ASSIGN_MODIFY, BINOP_RSH},
2497 {"<<=", ASSIGN_MODIFY, BINOP_LSH}
2500 static const struct token tokentab2[] =
2502 {"+=", ASSIGN_MODIFY, BINOP_ADD},
2503 {"-=", ASSIGN_MODIFY, BINOP_SUB},
2504 {"*=", ASSIGN_MODIFY, BINOP_MUL},
2505 {"/=", ASSIGN_MODIFY, BINOP_DIV},
2506 {"%=", ASSIGN_MODIFY, BINOP_REM},
2507 {"|=", ASSIGN_MODIFY, BINOP_BITWISE_IOR},
2508 {"&=", ASSIGN_MODIFY, BINOP_BITWISE_AND},
2509 {"^=", ASSIGN_MODIFY, BINOP_BITWISE_XOR},
2510 {"++", INCREMENT, BINOP_END},
2511 {"--", DECREMENT, BINOP_END},
2512 {"&&", ANDAND, BINOP_END},
2513 {"||", OROR, BINOP_END},
2514 {"<<", LSH, BINOP_END},
2515 {">>", RSH, BINOP_END},
2516 {"==", EQUAL, BINOP_END},
2517 {"!=", NOTEQUAL, BINOP_END},
2518 {"<=", LEQ, BINOP_END},
2519 {">=", GEQ, BINOP_END}
2522 /* Read one token, getting characters through lexptr. */
2530 const char *tokstart;
2533 static char *tempbuf;
2534 static int tempbufsize;
2538 prev_lexptr = lexptr;
2541 /* See if it is a special token of length 3. */
2542 for (i = 0; i < sizeof tokentab3 / sizeof tokentab3[0]; i++)
2543 if (strncmp (tokstart, tokentab3[i].operator, 3) == 0)
2546 yylval.opcode = tokentab3[i].opcode;
2547 return tokentab3[i].token;
2550 /* See if it is a special token of length 2. */
2551 for (i = 0; i < sizeof tokentab2 / sizeof tokentab2[0]; i++)
2552 if (strncmp (tokstart, tokentab2[i].operator, 2) == 0)
2555 yylval.opcode = tokentab2[i].opcode;
2556 return tokentab2[i].token;
2559 switch (c = *tokstart)
2571 /* We either have a character constant ('0' or '\177' for example)
2572 or we have a quoted symbol reference ('foo(int,int)' in C++
2577 c = parse_escape (parse_gdbarch (pstate), &lexptr);
2579 error (_("Empty character constant"));
2581 yylval.typed_val_int.val = c;
2582 yylval.typed_val_int.type = parse_java_type (pstate)->builtin_char;
2587 namelen = skip_quoted (tokstart) - tokstart;
2590 lexptr = tokstart + namelen;
2591 if (lexptr[-1] != '\'')
2592 error (_("Unmatched single quote"));
2597 error (_("Invalid character constant"));
2599 return INTEGER_LITERAL;
2607 if (paren_depth == 0)
2614 if (comma_terminates && paren_depth == 0)
2620 /* Might be a floating point number. */
2621 if (lexptr[1] < '0' || lexptr[1] > '9')
2622 goto symbol; /* Nope, must be a symbol. */
2623 /* FALL THRU into number case. */
2636 /* It's a number. */
2637 int got_dot = 0, got_e = 0, toktype;
2638 const char *p = tokstart;
2639 int hex = input_radix > 10;
2641 if (c == '0' && (p[1] == 'x' || p[1] == 'X'))
2646 else if (c == '0' && (p[1]=='t' || p[1]=='T' || p[1]=='d' || p[1]=='D'))
2654 /* This test includes !hex because 'e' is a valid hex digit
2655 and thus does not indicate a floating point number when
2656 the radix is hex. */
2657 if (!hex && !got_e && (*p == 'e' || *p == 'E'))
2658 got_dot = got_e = 1;
2659 /* This test does not include !hex, because a '.' always indicates
2660 a decimal floating point number regardless of the radix. */
2661 else if (!got_dot && *p == '.')
2663 else if (got_e && (p[-1] == 'e' || p[-1] == 'E')
2664 && (*p == '-' || *p == '+'))
2665 /* This is the sign of the exponent, not the end of the
2668 /* We will take any letters or digits. parse_number will
2669 complain if past the radix, or if L or U are not final. */
2670 else if ((*p < '0' || *p > '9')
2671 && ((*p < 'a' || *p > 'z')
2672 && (*p < 'A' || *p > 'Z')))
2675 toktype = parse_number (pstate, tokstart, p - tokstart,
2676 got_dot|got_e, &yylval);
2677 if (toktype == ERROR)
2679 char *err_copy = (char *) alloca (p - tokstart + 1);
2681 memcpy (err_copy, tokstart, p - tokstart);
2682 err_copy[p - tokstart] = 0;
2683 error (_("Invalid number \"%s\""), err_copy);
2714 /* Build the gdb internal form of the input string in tempbuf,
2715 translating any standard C escape forms seen. Note that the
2716 buffer is null byte terminated *only* for the convenience of
2717 debugging gdb itself and printing the buffer contents when
2718 the buffer contains no embedded nulls. Gdb does not depend
2719 upon the buffer being null byte terminated, it uses the length
2720 string instead. This allows gdb to handle C strings (as well
2721 as strings in other languages) with embedded null bytes */
2723 tokptr = ++tokstart;
2727 /* Grow the static temp buffer if necessary, including allocating
2728 the first one on demand. */
2729 if (tempbufindex + 1 >= tempbufsize)
2731 tempbuf = (char *) xrealloc (tempbuf, tempbufsize += 64);
2737 /* Do nothing, loop will terminate. */
2741 c = parse_escape (parse_gdbarch (pstate), &tokptr);
2746 tempbuf[tempbufindex++] = c;
2749 tempbuf[tempbufindex++] = *tokptr++;
2752 } while ((*tokptr != '"') && (*tokptr != '\0'));
2753 if (*tokptr++ != '"')
2755 error (_("Unterminated string in expression"));
2757 tempbuf[tempbufindex] = '\0'; /* See note above */
2758 yylval.sval.ptr = tempbuf;
2759 yylval.sval.length = tempbufindex;
2761 return (STRING_LITERAL);
2764 if (!(c == '_' || c == '$'
2765 || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')))
2766 /* We must have come across a bad character (e.g. ';'). */
2767 error (_("Invalid character '%c' in expression"), c);
2769 /* It's a name. See how long it is. */
2771 for (c = tokstart[namelen];
2774 || (c >= '0' && c <= '9')
2775 || (c >= 'a' && c <= 'z')
2776 || (c >= 'A' && c <= 'Z')
2783 while (tokstart[++i] && tokstart[i] != '>');
2784 if (tokstart[i] == '>')
2787 c = tokstart[++namelen];
2790 /* The token "if" terminates the expression and is NOT
2791 removed from the input stream. */
2792 if (namelen == 2 && tokstart[0] == 'i' && tokstart[1] == 'f')
2801 /* Catch specific keywords. Should be done with a data structure. */
2805 if (strncmp (tokstart, "boolean", 7) == 0)
2809 if (strncmp (tokstart, "double", 6) == 0)
2813 if (strncmp (tokstart, "short", 5) == 0)
2815 if (strncmp (tokstart, "false", 5) == 0)
2818 return BOOLEAN_LITERAL;
2820 if (strncmp (tokstart, "super", 5) == 0)
2822 if (strncmp (tokstart, "float", 5) == 0)
2826 if (strncmp (tokstart, "long", 4) == 0)
2828 if (strncmp (tokstart, "byte", 4) == 0)
2830 if (strncmp (tokstart, "char", 4) == 0)
2832 if (strncmp (tokstart, "true", 4) == 0)
2835 return BOOLEAN_LITERAL;
2839 if (strncmp (tokstart, "int", 3) == 0)
2841 if (strncmp (tokstart, "new", 3) == 0)
2848 yylval.sval.ptr = tokstart;
2849 yylval.sval.length = namelen;
2851 if (*tokstart == '$')
2853 write_dollar_variable (pstate, yylval.sval);
2857 /* Input names that aren't symbols but ARE valid hex numbers,
2858 when the input radix permits them, can be names or numbers
2859 depending on the parse. Note we support radixes > 16 here. */
2860 if (((tokstart[0] >= 'a' && tokstart[0] < 'a' + input_radix - 10) ||
2861 (tokstart[0] >= 'A' && tokstart[0] < 'A' + input_radix - 10)))
2863 YYSTYPE newlval; /* Its value is ignored. */
2864 int hextype = parse_number (pstate, tokstart, namelen, 0, &newlval);
2865 if (hextype == INTEGER_LITERAL)
2872 java_parse (struct parser_state *par_state)
2875 struct cleanup *c = make_cleanup_clear_parser_state (&pstate);
2877 /* Setting up the parser state. */
2878 gdb_assert (par_state != NULL);
2881 result = yyparse ();
2891 lexptr = prev_lexptr;
2894 error (_("%s: near `%s'"), msg, lexptr);
2896 error (_("error in expression, near `%s'"), lexptr);
2899 static struct type *
2900 java_type_from_name (struct stoken name)
2902 char *tmp = copy_name (name);
2903 struct type *typ = java_lookup_class (tmp);
2904 if (typ == NULL || TYPE_CODE (typ) != TYPE_CODE_STRUCT)
2905 error (_("No class named `%s'"), tmp);
2909 /* If NAME is a valid variable name in this scope, push it and return 1.
2910 Otherwise, return 0. */
2913 push_variable (struct parser_state *par_state, struct stoken name)
2915 char *tmp = copy_name (name);
2916 struct field_of_this_result is_a_field_of_this;
2919 sym = lookup_symbol (tmp, expression_context_block, VAR_DOMAIN,
2920 &is_a_field_of_this);
2921 if (sym && SYMBOL_CLASS (sym) != LOC_TYPEDEF)
2923 if (symbol_read_needs_frame (sym))
2925 if (innermost_block == 0 ||
2926 contained_in (block_found, innermost_block))
2927 innermost_block = block_found;
2930 write_exp_elt_opcode (par_state, OP_VAR_VALUE);
2931 /* We want to use the selected frame, not another more inner frame
2932 which happens to be in the same block. */
2933 write_exp_elt_block (par_state, NULL);
2934 write_exp_elt_sym (par_state, sym);
2935 write_exp_elt_opcode (par_state, OP_VAR_VALUE);
2938 if (is_a_field_of_this.type != NULL)
2940 /* it hangs off of `this'. Must not inadvertently convert from a
2941 method call to data ref. */
2942 if (innermost_block == 0 ||
2943 contained_in (block_found, innermost_block))
2944 innermost_block = block_found;
2945 write_exp_elt_opcode (par_state, OP_THIS);
2946 write_exp_elt_opcode (par_state, OP_THIS);
2947 write_exp_elt_opcode (par_state, STRUCTOP_PTR);
2948 write_exp_string (par_state, name);
2949 write_exp_elt_opcode (par_state, STRUCTOP_PTR);
2955 /* Assuming a reference expression has been pushed, emit the
2956 STRUCTOP_PTR ops to access the field named NAME. If NAME is a
2957 qualified name (has '.'), generate a field access for each part. */
2960 push_fieldnames (struct parser_state *par_state, struct stoken name)
2963 struct stoken token;
2964 token.ptr = name.ptr;
2967 if (i == name.length || name.ptr[i] == '.')
2969 /* token.ptr is start of current field name. */
2970 token.length = &name.ptr[i] - token.ptr;
2971 write_exp_elt_opcode (par_state, STRUCTOP_PTR);
2972 write_exp_string (par_state, token);
2973 write_exp_elt_opcode (par_state, STRUCTOP_PTR);
2974 token.ptr += token.length + 1;
2976 if (i >= name.length)
2981 /* Helper routine for push_expression_name.
2982 Handle a qualified name, where DOT_INDEX is the index of the first '.' */
2985 push_qualified_expression_name (struct parser_state *par_state,
2986 struct stoken name, int dot_index)
2988 struct stoken token;
2992 token.ptr = name.ptr;
2993 token.length = dot_index;
2995 if (push_variable (par_state, token))
2997 token.ptr = name.ptr + dot_index + 1;
2998 token.length = name.length - dot_index - 1;
2999 push_fieldnames (par_state, token);
3003 token.ptr = name.ptr;
3006 token.length = dot_index;
3007 tmp = copy_name (token);
3008 typ = java_lookup_class (tmp);
3011 if (dot_index == name.length)
3013 write_exp_elt_opcode (par_state, OP_TYPE);
3014 write_exp_elt_type (par_state, typ);
3015 write_exp_elt_opcode (par_state, OP_TYPE);
3018 dot_index++; /* Skip '.' */
3019 name.ptr += dot_index;
3020 name.length -= dot_index;
3022 while (dot_index < name.length && name.ptr[dot_index] != '.')
3024 token.ptr = name.ptr;
3025 token.length = dot_index;
3026 write_exp_elt_opcode (par_state, OP_SCOPE);
3027 write_exp_elt_type (par_state, typ);
3028 write_exp_string (par_state, token);
3029 write_exp_elt_opcode (par_state, OP_SCOPE);
3030 if (dot_index < name.length)
3033 name.ptr += dot_index;
3034 name.length -= dot_index;
3035 push_fieldnames (par_state, name);
3039 else if (dot_index >= name.length)
3041 dot_index++; /* Skip '.' */
3042 while (dot_index < name.length && name.ptr[dot_index] != '.')
3045 error (_("unknown type `%.*s'"), name.length, name.ptr);
3048 /* Handle Name in an expression (or LHS).
3049 Handle VAR, TYPE, TYPE.FIELD1....FIELDN and VAR.FIELD1....FIELDN. */
3052 push_expression_name (struct parser_state *par_state, struct stoken name)
3058 for (i = 0; i < name.length; i++)
3060 if (name.ptr[i] == '.')
3062 /* It's a Qualified Expression Name. */
3063 push_qualified_expression_name (par_state, name, i);
3068 /* It's a Simple Expression Name. */
3070 if (push_variable (par_state, name))
3072 tmp = copy_name (name);
3073 typ = java_lookup_class (tmp);
3076 write_exp_elt_opcode (par_state, OP_TYPE);
3077 write_exp_elt_type (par_state, typ);
3078 write_exp_elt_opcode (par_state, OP_TYPE);
3082 struct bound_minimal_symbol msymbol;
3084 msymbol = lookup_bound_minimal_symbol (tmp);
3085 if (msymbol.minsym != NULL)
3086 write_exp_msymbol (par_state, msymbol);
3087 else if (!have_full_symbols () && !have_partial_symbols ())
3088 error (_("No symbol table is loaded. Use the \"file\" command"));
3090 error (_("No symbol \"%s\" in current context."), tmp);
3096 /* The following two routines, copy_exp and insert_exp, aren't specific to
3097 Java, so they could go in parse.c, but their only purpose is to support
3098 the parsing kludges we use in this file, so maybe it's best to isolate
3101 /* Copy the expression whose last element is at index ENDPOS - 1 in EXPR
3102 into a freshly xmalloc'ed struct expression. Its language_defn is set
3104 static struct expression *
3105 copy_exp (struct expression *expr, int endpos)
3107 int len = length_of_subexp (expr, endpos);
3108 struct expression *new
3109 = (struct expression *) xmalloc (sizeof (*new) + EXP_ELEM_TO_BYTES (len));
3112 memcpy (new->elts, expr->elts + endpos - len, EXP_ELEM_TO_BYTES (len));
3113 new->language_defn = 0;
3118 /* Insert the expression NEW into the current expression (expout) at POS. */
3120 insert_exp (struct parser_state *par_state, int pos, struct expression *new)
3122 int newlen = new->nelts;
3125 /* Grow expout if necessary. In this function's only use at present,
3126 this should never be necessary. */
3127 increase_expout_size (par_state, newlen);
3129 for (i = par_state->expout_ptr - 1; i >= pos; i--)
3130 par_state->expout->elts[i + newlen] = par_state->expout->elts[i];
3132 memcpy (par_state->expout->elts + pos, new->elts,
3133 EXP_ELEM_TO_BYTES (newlen));
3134 par_state->expout_ptr += newlen;