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 */
71 #include "expression.h"
73 #include "parser-defs.h"
76 #include "bfd.h" /* Required by objfiles.h. */
77 #include "symfile.h" /* Required by objfiles.h. */
78 #include "objfiles.h" /* For have_full_symbols and have_partial_symbols */
80 #include "completer.h"
82 #define parse_type(ps) builtin_type (parse_gdbarch (ps))
83 #define parse_java_type(ps) builtin_java_type (parse_gdbarch (ps))
85 /* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc),
86 as well as gratuitiously global symbol names, so we can have multiple
87 yacc generated parsers in gdb. Note that these are only the variables
88 produced by yacc. If other parser generators (bison, byacc, etc) produce
89 additional global names that conflict at link time, then those parser
90 generators need to be fixed instead of adding those names to this list. */
92 #define yymaxdepth java_maxdepth
93 #define yyparse java_parse_internal
94 #define yylex java_lex
95 #define yyerror java_error
96 #define yylval java_lval
97 #define yychar java_char
98 #define yydebug java_debug
99 #define yypact java_pact
102 #define yydef java_def
103 #define yychk java_chk
104 #define yypgo java_pgo
105 #define yyact java_act
106 #define yyexca java_exca
107 #define yyerrflag java_errflag
108 #define yynerrs java_nerrs
112 #define yy_yys java_yys
113 #define yystate java_state
114 #define yytmp java_tmp
116 #define yy_yyv java_yyv
117 #define yyval java_val
118 #define yylloc java_lloc
119 #define yyreds java_reds /* With YYDEBUG defined */
120 #define yytoks java_toks /* With YYDEBUG defined */
121 #define yyname java_name /* With YYDEBUG defined */
122 #define yyrule java_rule /* With YYDEBUG defined */
123 #define yylhs java_yylhs
124 #define yylen java_yylen
125 #define yydefred java_yydefred
126 #define yydgoto java_yydgoto
127 #define yysindex java_yysindex
128 #define yyrindex java_yyrindex
129 #define yygindex java_yygindex
130 #define yytable java_yytable
131 #define yycheck java_yycheck
132 #define yyss java_yyss
133 #define yysslim java_yysslim
134 #define yyssp java_yyssp
135 #define yystacksize java_yystacksize
136 #define yyvs java_yyvs
137 #define yyvsp java_yyvsp
140 #define YYDEBUG 1 /* Default to yydebug support */
143 #define YYFPRINTF parser_fprintf
145 /* The state of the parser, used internally when we are parsing the
148 static struct parser_state *pstate = NULL;
152 static int yylex (void);
154 void yyerror (char *);
156 static struct type *java_type_from_name (struct stoken);
157 static void push_expression_name (struct parser_state *, struct stoken);
158 static void push_fieldnames (struct parser_state *, struct stoken);
160 static struct expression *copy_exp (struct expression *, int);
161 static void insert_exp (struct parser_state *, int, struct expression *);
164 #line 165 "jv-exp.c" /* yacc.c:339 */
167 # if defined __cplusplus && 201103L <= __cplusplus
168 # define YY_NULLPTR nullptr
170 # define YY_NULLPTR 0
174 /* Enabling verbose error messages. */
175 #ifdef YYERROR_VERBOSE
176 # undef YYERROR_VERBOSE
177 # define YYERROR_VERBOSE 1
179 # define YYERROR_VERBOSE 0
196 INTEGER_LITERAL = 258,
197 FLOATING_POINT_LITERAL = 259,
199 STRING_LITERAL = 261,
200 BOOLEAN_LITERAL = 262,
229 #define INTEGER_LITERAL 258
230 #define FLOATING_POINT_LITERAL 259
231 #define IDENTIFIER 260
232 #define STRING_LITERAL 261
233 #define BOOLEAN_LITERAL 262
235 #define NAME_OR_INT 264
246 #define ASSIGN_MODIFY 275
257 #define INCREMENT 286
258 #define DECREMENT 287
261 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
262 typedef union YYSTYPE YYSTYPE;
265 #line 140 "jv-exp.y" /* yacc.c:355 */
280 struct symtoken ssym;
282 enum exp_opcode opcode;
283 struct internalvar *ivar;
287 #line 288 "jv-exp.c" /* yacc.c:355 */
289 # define YYSTYPE_IS_TRIVIAL 1
290 # define YYSTYPE_IS_DECLARED 1
294 extern YYSTYPE yylval;
300 /* Copy the second part of user declarations. */
301 #line 161 "jv-exp.y" /* yacc.c:358 */
303 /* YYSTYPE gets defined by %union */
304 static int parse_number (struct parser_state *, const char *, int,
307 #line 308 "jv-exp.c" /* yacc.c:358 */
314 typedef YYTYPE_UINT8 yytype_uint8;
316 typedef unsigned char yytype_uint8;
320 typedef YYTYPE_INT8 yytype_int8;
322 typedef signed char yytype_int8;
326 typedef YYTYPE_UINT16 yytype_uint16;
328 typedef unsigned short int yytype_uint16;
332 typedef YYTYPE_INT16 yytype_int16;
334 typedef short int yytype_int16;
338 # ifdef __SIZE_TYPE__
339 # define YYSIZE_T __SIZE_TYPE__
340 # elif defined size_t
341 # define YYSIZE_T size_t
342 # elif ! defined YYSIZE_T
343 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
344 # define YYSIZE_T size_t
346 # define YYSIZE_T unsigned int
350 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
353 # if defined YYENABLE_NLS && YYENABLE_NLS
355 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
356 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
360 # define YY_(Msgid) Msgid
365 # if (defined __GNUC__ \
366 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
367 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
368 # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
370 # define YY_ATTRIBUTE(Spec) /* empty */
374 #ifndef YY_ATTRIBUTE_PURE
375 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
378 #ifndef YY_ATTRIBUTE_UNUSED
379 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
382 #if !defined _Noreturn \
383 && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
384 # if defined _MSC_VER && 1200 <= _MSC_VER
385 # define _Noreturn __declspec (noreturn)
387 # define _Noreturn YY_ATTRIBUTE ((__noreturn__))
391 /* Suppress unused-variable warnings by "using" E. */
392 #if ! defined lint || defined __GNUC__
393 # define YYUSE(E) ((void) (E))
395 # define YYUSE(E) /* empty */
398 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
399 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
400 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
401 _Pragma ("GCC diagnostic push") \
402 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
403 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
404 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
405 _Pragma ("GCC diagnostic pop")
407 # define YY_INITIAL_VALUE(Value) Value
409 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
410 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
411 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
413 #ifndef YY_INITIAL_VALUE
414 # define YY_INITIAL_VALUE(Value) /* Nothing. */
418 #if ! defined yyoverflow || YYERROR_VERBOSE
420 /* The parser invokes alloca or xmalloc; define the necessary symbols. */
422 # ifdef YYSTACK_USE_ALLOCA
423 # if YYSTACK_USE_ALLOCA
425 # define YYSTACK_ALLOC __builtin_alloca
426 # elif defined __BUILTIN_VA_ARG_INCR
427 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
429 # define YYSTACK_ALLOC __alloca
430 # elif defined _MSC_VER
431 # define alloca _alloca
433 # define YYSTACK_ALLOC alloca
434 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
435 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
436 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
437 # ifndef EXIT_SUCCESS
438 # define EXIT_SUCCESS 0
445 # ifdef YYSTACK_ALLOC
446 /* Pacify GCC's 'empty if-body' warning. */
447 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
448 # ifndef YYSTACK_ALLOC_MAXIMUM
449 /* The OS might guarantee only one guard page at the bottom of the stack,
450 and a page size can be as small as 4096 bytes. So we cannot safely
451 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
452 to allow for a few compiler-allocated temporary stack slots. */
453 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
456 # define YYSTACK_ALLOC YYMALLOC
457 # define YYSTACK_FREE YYFREE
458 # ifndef YYSTACK_ALLOC_MAXIMUM
459 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
461 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
462 && ! ((defined YYMALLOC || defined xmalloc) \
463 && (defined YYFREE || defined xfree)))
464 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
465 # ifndef EXIT_SUCCESS
466 # define EXIT_SUCCESS 0
470 # define YYMALLOC xmalloc
471 # if ! defined xmalloc && ! defined EXIT_SUCCESS
472 void *xmalloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
476 # define YYFREE xfree
477 # if ! defined xfree && ! defined EXIT_SUCCESS
478 void xfree (void *); /* INFRINGES ON USER NAME SPACE */
482 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
485 #if (! defined yyoverflow \
486 && (! defined __cplusplus \
487 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
489 /* A type that is properly aligned for any stack member. */
492 yytype_int16 yyss_alloc;
496 /* The size of the maximum gap between one aligned stack and the next. */
497 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
499 /* The size of an array large to enough to hold all stacks, each with
501 # define YYSTACK_BYTES(N) \
502 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
503 + YYSTACK_GAP_MAXIMUM)
505 # define YYCOPY_NEEDED 1
507 /* Relocate STACK from its old location to the new one. The
508 local variables YYSIZE and YYSTACKSIZE give the old and new number of
509 elements in the stack, and YYPTR gives the new location of the
510 stack. Advance YYPTR to a properly aligned location for the next
512 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
515 YYSIZE_T yynewbytes; \
516 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
517 Stack = &yyptr->Stack_alloc; \
518 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
519 yyptr += yynewbytes / sizeof (*yyptr); \
525 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
526 /* Copy COUNT objects from SRC to DST. The source and destination do
529 # if defined __GNUC__ && 1 < __GNUC__
530 # define YYCOPY(Dst, Src, Count) \
531 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
533 # define YYCOPY(Dst, Src, Count) \
537 for (yyi = 0; yyi < (Count); yyi++) \
538 (Dst)[yyi] = (Src)[yyi]; \
543 #endif /* !YYCOPY_NEEDED */
545 /* YYFINAL -- State number of the termination state. */
547 /* YYLAST -- Last index in YYTABLE. */
550 /* YYNTOKENS -- Number of terminals. */
552 /* YYNNTS -- Number of nonterminals. */
554 /* YYNRULES -- Number of rules. */
556 /* YYNSTATES -- Number of states. */
557 #define YYNSTATES 209
559 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
560 by yylex, with out-of-bounds checking. */
562 #define YYMAXUTOK 287
564 #define YYTRANSLATE(YYX) \
565 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
567 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
568 as returned by yylex, without out-of-bounds checking. */
569 static const yytype_uint8 yytranslate[] =
571 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
572 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
573 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
574 2, 2, 2, 54, 2, 2, 2, 43, 30, 2,
575 48, 49, 41, 39, 23, 40, 46, 42, 2, 2,
576 2, 2, 2, 2, 2, 2, 2, 2, 55, 2,
577 33, 24, 34, 25, 2, 2, 2, 2, 2, 2,
578 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
579 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
580 2, 47, 2, 52, 29, 2, 2, 2, 2, 2,
581 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
582 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
583 2, 2, 2, 50, 28, 51, 53, 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, 2, 2, 2, 2,
596 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
597 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
598 15, 16, 17, 18, 19, 20, 21, 22, 26, 27,
599 31, 32, 35, 36, 37, 38, 44, 45
603 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
604 static const yytype_uint16 yyrline[] =
606 0, 218, 218, 219, 222, 231, 232, 236, 245, 250,
607 259, 264, 270, 281, 282, 287, 288, 292, 294, 296,
608 298, 300, 305, 307, 319, 324, 328, 330, 335, 336,
609 340, 341, 345, 346, 350, 376, 377, 382, 383, 387,
610 388, 389, 390, 391, 392, 393, 401, 406, 411, 417,
611 419, 425, 426, 430, 433, 439, 440, 444, 448, 450,
612 455, 457, 461, 463, 469, 475, 474, 480, 482, 487,
613 507, 509, 514, 515, 517, 519, 520, 524, 529, 534,
614 535, 536, 537, 539, 542, 546, 551, 556, 557, 559,
615 561, 565, 569, 593, 603, 604, 606, 608, 613, 614,
616 616, 621, 622, 624, 630, 631, 633, 635, 637, 643,
617 644, 646, 651, 652, 657, 658, 662, 663, 668, 669,
618 674, 675, 680, 681, 686, 687, 691, 693, 700, 702,
623 #if YYDEBUG || YYERROR_VERBOSE || 0
624 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
625 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
626 static const char *const yytname[] =
628 "$end", "error", "$undefined", "INTEGER_LITERAL",
629 "FLOATING_POINT_LITERAL", "IDENTIFIER", "STRING_LITERAL",
630 "BOOLEAN_LITERAL", "TYPENAME", "NAME_OR_INT", "ERROR", "LONG", "SHORT",
631 "BYTE", "INT", "CHAR", "BOOLEAN", "DOUBLE", "FLOAT", "VARIABLE",
632 "ASSIGN_MODIFY", "SUPER", "NEW", "','", "'='", "'?'", "OROR", "ANDAND",
633 "'|'", "'^'", "'&'", "EQUAL", "NOTEQUAL", "'<'", "'>'", "LEQ", "GEQ",
634 "LSH", "RSH", "'+'", "'-'", "'*'", "'/'", "'%'", "INCREMENT",
635 "DECREMENT", "'.'", "'['", "'('", "')'", "'{'", "'}'", "']'", "'~'",
636 "'!'", "':'", "$accept", "start", "type_exp", "PrimitiveOrArrayType",
637 "StringLiteral", "Literal", "PrimitiveType", "NumericType",
638 "IntegralType", "FloatingPointType", "ClassOrInterfaceType", "ClassType",
639 "ArrayType", "Name", "ForcedName", "SimpleName", "QualifiedName", "exp1",
640 "Primary", "PrimaryNoNewArray", "lcurly", "rcurly",
641 "ClassInstanceCreationExpression", "ArgumentList", "ArgumentList_opt",
642 "ArrayCreationExpression", "DimExprs", "DimExpr", "Dims", "Dims_opt",
643 "FieldAccess", "FuncStart", "MethodInvocation", "$@1", "ArrayAccess",
644 "PostfixExpression", "PostIncrementExpression",
645 "PostDecrementExpression", "UnaryExpression", "PreIncrementExpression",
646 "PreDecrementExpression", "UnaryExpressionNotPlusMinus",
647 "CastExpression", "MultiplicativeExpression", "AdditiveExpression",
648 "ShiftExpression", "RelationalExpression", "EqualityExpression",
649 "AndExpression", "ExclusiveOrExpression", "InclusiveOrExpression",
650 "ConditionalAndExpression", "ConditionalOrExpression",
651 "ConditionalExpression", "AssignmentExpression", "Assignment",
652 "LeftHandSide", "Expression", YY_NULLPTR
657 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
658 (internal) symbol number NUM (which must be that of a token). */
659 static const yytype_uint16 yytoknum[] =
661 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
662 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
663 275, 276, 277, 44, 61, 63, 278, 279, 124, 94,
664 38, 280, 281, 60, 62, 282, 283, 284, 285, 43,
665 45, 42, 47, 37, 286, 287, 46, 91, 40, 41,
666 123, 125, 93, 126, 33, 58
670 #define YYPACT_NINF -145
672 #define yypact_value_is_default(Yystate) \
673 (!!((Yystate) == (-145)))
675 #define YYTABLE_NINF -132
677 #define yytable_value_is_error(Yytable_value) \
680 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
682 static const yytype_int16 yypact[] =
684 215, -145, -145, -5, -145, -145, 1, -145, -145, -145,
685 -145, -145, -145, -145, -145, -7, -19, 279, 50, 50,
686 50, 50, 50, 215, -145, 50, 50, 46, -145, -145,
687 -145, -145, -9, -145, -145, -145, -145, 87, -145, -145,
688 12, 44, 5, 16, 319, -145, -145, 28, -145, -145,
689 38, 29, -145, -145, -145, -145, -145, -145, -145, 99,
690 53, 85, 52, 94, 66, 41, 71, 74, 122, -145,
691 -145, -145, 40, -145, 26, 319, 26, -145, 59, 59,
692 67, 82, -145, -145, 111, 107, -145, -145, -145, -145,
693 -145, -145, -145, -9, 87, 68, -145, -145, -145, 79,
694 91, 26, 267, -145, 91, 319, 26, 319, -18, -145,
695 319, -145, -145, 50, 50, 50, 50, 50, 50, 50,
696 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
697 319, 50, 50, 50, -145, -145, -145, 112, 126, 319,
698 128, -145, 128, 319, 319, 91, 127, -31, 193, -145,
699 125, -145, 129, -145, 131, 130, 319, -145, -145, 157,
700 135, -145, -145, -145, 99, 99, 53, 53, 85, 85,
701 85, 85, 52, 52, 94, 66, 41, 71, 132, 74,
702 -145, -145, -145, 319, 134, 267, -145, -145, -145, 139,
703 50, 193, -145, -145, -145, 319, -145, -145, -145, 50,
704 141, -145, -145, -145, -145, 144, -145, -145, -145
707 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
708 Performed when YYTABLE does not specify something else to do. Zero
709 means the default is an error. */
710 static const yytype_uint8 yydefact[] =
712 0, 8, 10, 28, 7, 11, 9, 20, 18, 17,
713 19, 21, 14, 23, 22, 74, 0, 0, 0, 0,
714 0, 0, 0, 0, 46, 0, 0, 0, 3, 4,
715 12, 39, 5, 13, 15, 16, 6, 73, 128, 30,
716 29, 2, 72, 37, 0, 41, 38, 42, 65, 43,
717 44, 87, 75, 76, 94, 79, 80, 84, 90, 98,
718 101, 104, 109, 112, 114, 116, 118, 120, 122, 124,
719 132, 125, 0, 35, 0, 0, 0, 28, 0, 25,
720 0, 24, 29, 9, 74, 73, 42, 44, 81, 82,
721 83, 85, 86, 61, 73, 0, 88, 89, 1, 0,
722 26, 0, 0, 64, 27, 0, 0, 0, 0, 49,
723 51, 77, 78, 0, 0, 0, 0, 0, 0, 0,
724 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
725 0, 0, 0, 0, 32, 33, 63, 0, 0, 0,
726 61, 55, 61, 51, 0, 60, 0, 0, 40, 58,
727 0, 34, 0, 36, 62, 0, 0, 47, 45, 52,
728 0, 95, 96, 97, 99, 100, 102, 103, 105, 106,
729 107, 108, 110, 111, 113, 115, 117, 119, 0, 121,
730 127, 126, 70, 51, 0, 0, 56, 53, 54, 0,
731 0, 0, 92, 59, 69, 51, 71, 50, 66, 0,
732 0, 57, 48, 91, 93, 0, 123, 68, 67
735 /* YYPGOTO[NTERM-NUM]. */
736 static const yytype_int16 yypgoto[] =
738 -145, -145, -145, -145, -145, -145, -3, -145, -145, -145,
739 -145, -145, -145, 11, -145, -64, 0, -145, -145, -145,
740 -145, -145, -145, 150, -134, -145, 124, -116, -29, -99,
741 6, -145, -145, -145, 22, -145, -145, -145, 58, -145,
742 -145, -144, -145, 43, 49, -2, 45, 78, 81, 83,
743 77, 92, -145, -131, -145, -145, -145, 7
746 /* YYDEFGOTO[NTERM-NUM]. */
747 static const yytype_int16 yydefgoto[] =
749 -1, 27, 28, 29, 30, 31, 32, 33, 34, 35,
750 79, 80, 36, 85, 38, 39, 82, 41, 42, 43,
751 44, 158, 45, 159, 160, 46, 140, 141, 145, 146,
752 86, 48, 49, 110, 87, 51, 52, 53, 54, 55,
753 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
754 66, 67, 68, 69, 70, 71, 72, 109
757 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
758 positive, shift that token. If negative, reduce the rule whose
759 number is the opposite. If YYTABLE_NINF, syntax error. */
760 static const yytype_int16 yytable[] =
762 40, 180, 181, 100, 192, 156, 47, 73, 104, 189,
763 136, 37, 138, -129, 78, -32, 150, -129, 191, -32,
764 93, -33, 50, 40, 186, -33, 186, 76, 81, 47,
765 95, 134, -31, 157, 94, 135, -31, 151, 99, 74,
766 75, 187, 154, 188, 40, 50, 98, 204, -130, 200,
767 47, 106, -130, 1, 2, 77, 4, 5, -131, 83,
768 132, 205, -131, 107, 133, 147, 50, 105, 206, 84,
769 127, 16, 17, 111, 112, 40, 88, 89, 90, 91,
770 92, 47, 137, 96, 97, 120, 121, 122, 123, 18,
771 19, 20, 116, 117, 21, 22, 126, 50, 23, 128,
772 24, 129, 40, 25, 26, 40, 139, 40, 47, 152,
773 40, 47, 153, 47, 155, 143, 47, 148, 168, 169,
774 170, 171, 118, 119, 50, 124, 125, 50, 101, 50,
775 40, 149, 50, 101, 102, 103, 47, 178, 150, 40,
776 113, 114, 115, 40, 40, 47, 184, 130, 131, 47,
777 47, 152, 50, 101, 144, 103, 40, 74, 75, 164,
778 165, 50, 47, 197, 182, 50, 50, 166, 167, 172,
779 173, 161, 162, 163, 183, 185, 190, 193, 50, 195,
780 156, 194, 196, 40, 198, 40, 201, 199, 202, 47,
781 207, 47, 184, 208, 108, 40, 1, 2, 77, 4,
782 5, 47, 83, 142, 174, 50, 177, 50, 175, 0,
783 0, 176, 84, 0, 16, 17, 0, 50, 1, 2,
784 3, 4, 5, 179, 6, 0, 7, 8, 9, 10,
785 11, 12, 13, 14, 15, 0, 16, 17, 0, 0,
786 0, 23, 0, 24, 0, 0, 25, 26, 203, 0,
787 0, 0, 0, 0, 18, 19, 20, 0, 0, 21,
788 22, 0, 0, 23, 0, 24, 0, 0, 25, 26,
789 1, 2, 3, 4, 5, 0, 6, 0, 0, 0,
790 0, 0, 0, 0, 77, 0, 15, 0, 16, 17,
791 7, 8, 9, 10, 11, 12, 13, 14, 0, 0,
792 0, 0, 0, 0, 0, 0, 18, 19, 20, 0,
793 0, 21, 22, 0, 0, 23, 0, 24, 0, 149,
794 25, 26, 1, 2, 3, 4, 5, 0, 6, 0,
795 0, 0, 0, 0, 0, 0, 0, 0, 15, 0,
796 16, 17, 0, 0, 0, 0, 0, 0, 0, 0,
797 0, 0, 0, 0, 0, 0, 0, 0, 18, 19,
798 20, 0, 0, 21, 22, 0, 0, 23, 0, 24,
802 static const yytype_int16 yycheck[] =
804 0, 132, 133, 32, 148, 23, 0, 0, 37, 143,
805 74, 0, 76, 20, 17, 20, 47, 24, 49, 24,
806 23, 20, 0, 23, 140, 24, 142, 46, 17, 23,
807 23, 5, 20, 51, 23, 9, 24, 101, 47, 46,
808 47, 140, 106, 142, 44, 23, 0, 191, 20, 183,
809 44, 46, 24, 3, 4, 5, 6, 7, 20, 9,
810 20, 195, 24, 47, 24, 94, 44, 23, 199, 19,
811 29, 21, 22, 44, 45, 75, 18, 19, 20, 21,
812 22, 75, 75, 25, 26, 33, 34, 35, 36, 39,
813 40, 41, 39, 40, 44, 45, 30, 75, 48, 28,
814 50, 27, 102, 53, 54, 105, 47, 107, 102, 102,
815 110, 105, 105, 107, 107, 48, 110, 49, 120, 121,
816 122, 123, 37, 38, 102, 31, 32, 105, 46, 107,
817 130, 52, 110, 46, 47, 48, 130, 130, 47, 139,
818 41, 42, 43, 143, 144, 139, 139, 25, 26, 143,
819 144, 144, 130, 46, 47, 48, 156, 46, 47, 116,
820 117, 139, 156, 156, 52, 143, 144, 118, 119, 124,
821 125, 113, 114, 115, 48, 47, 49, 52, 156, 48,
822 23, 52, 52, 183, 49, 185, 52, 55, 49, 183,
823 49, 185, 185, 49, 44, 195, 3, 4, 5, 6,
824 7, 195, 9, 79, 126, 183, 129, 185, 127, -1,
825 -1, 128, 19, -1, 21, 22, -1, 195, 3, 4,
826 5, 6, 7, 131, 9, -1, 11, 12, 13, 14,
827 15, 16, 17, 18, 19, -1, 21, 22, -1, -1,
828 -1, 48, -1, 50, -1, -1, 53, 54, 190, -1,
829 -1, -1, -1, -1, 39, 40, 41, -1, -1, 44,
830 45, -1, -1, 48, -1, 50, -1, -1, 53, 54,
831 3, 4, 5, 6, 7, -1, 9, -1, -1, -1,
832 -1, -1, -1, -1, 5, -1, 19, -1, 21, 22,
833 11, 12, 13, 14, 15, 16, 17, 18, -1, -1,
834 -1, -1, -1, -1, -1, -1, 39, 40, 41, -1,
835 -1, 44, 45, -1, -1, 48, -1, 50, -1, 52,
836 53, 54, 3, 4, 5, 6, 7, -1, 9, -1,
837 -1, -1, -1, -1, -1, -1, -1, -1, 19, -1,
838 21, 22, -1, -1, -1, -1, -1, -1, -1, -1,
839 -1, -1, -1, -1, -1, -1, -1, -1, 39, 40,
840 41, -1, -1, 44, 45, -1, -1, 48, -1, 50,
844 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
845 symbol of state STATE-NUM. */
846 static const yytype_uint8 yystos[] =
848 0, 3, 4, 5, 6, 7, 9, 11, 12, 13,
849 14, 15, 16, 17, 18, 19, 21, 22, 39, 40,
850 41, 44, 45, 48, 50, 53, 54, 57, 58, 59,
851 60, 61, 62, 63, 64, 65, 68, 69, 70, 71,
852 72, 73, 74, 75, 76, 78, 81, 86, 87, 88,
853 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,
854 100, 101, 102, 103, 104, 105, 106, 107, 108, 109,
855 110, 111, 112, 113, 46, 47, 46, 5, 62, 66,
856 67, 69, 72, 9, 19, 69, 86, 90, 94, 94,
857 94, 94, 94, 62, 69, 113, 94, 94, 0, 47,
858 84, 46, 47, 48, 84, 23, 46, 47, 79, 113,
859 89, 44, 45, 41, 42, 43, 39, 40, 37, 38,
860 33, 34, 35, 36, 31, 32, 30, 29, 28, 27,
861 25, 26, 20, 24, 5, 9, 71, 113, 71, 47,
862 82, 83, 82, 48, 47, 84, 85, 84, 49, 52,
863 47, 71, 113, 113, 71, 113, 23, 51, 77, 79,
864 80, 94, 94, 94, 99, 99, 100, 100, 101, 101,
865 101, 101, 102, 102, 103, 104, 105, 106, 113, 107,
866 109, 109, 52, 48, 113, 47, 83, 85, 85, 80,
867 49, 49, 97, 52, 52, 48, 52, 113, 49, 55,
868 80, 52, 49, 94, 97, 80, 109, 49, 49
871 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
872 static const yytype_uint8 yyr1[] =
874 0, 56, 57, 57, 58, 59, 59, 60, 61, 61,
875 61, 61, 61, 62, 62, 63, 63, 64, 64, 64,
876 64, 64, 65, 65, 66, 67, 68, 68, 69, 69,
877 70, 70, 71, 71, 72, 73, 73, 74, 74, 75,
878 75, 75, 75, 75, 75, 75, 76, 77, 78, 79,
879 79, 80, 80, 81, 81, 82, 82, 83, 84, 84,
880 85, 85, 86, 86, 87, 89, 88, 88, 88, 90,
881 90, 90, 91, 91, 91, 91, 91, 92, 93, 94,
882 94, 94, 94, 94, 94, 95, 96, 97, 97, 97,
883 97, 98, 98, 98, 99, 99, 99, 99, 100, 100,
884 100, 101, 101, 101, 102, 102, 102, 102, 102, 103,
885 103, 103, 104, 104, 105, 105, 106, 106, 107, 107,
886 108, 108, 109, 109, 110, 110, 111, 111, 112, 112,
890 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
891 static const yytype_uint8 yyr2[] =
893 0, 2, 1, 1, 1, 1, 1, 1, 1, 1,
894 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
895 1, 1, 1, 1, 1, 1, 2, 2, 1, 1,
896 1, 1, 1, 1, 3, 1, 3, 1, 1, 1,
897 3, 1, 1, 1, 1, 3, 1, 1, 5, 1,
898 3, 0, 1, 4, 4, 1, 2, 3, 2, 3,
899 1, 0, 3, 3, 2, 0, 4, 6, 6, 4,
900 4, 4, 1, 1, 1, 1, 1, 2, 2, 1,
901 1, 2, 2, 2, 1, 2, 2, 1, 2, 2,
902 1, 5, 4, 5, 1, 3, 3, 3, 1, 3,
903 3, 1, 3, 3, 1, 3, 3, 3, 3, 1,
904 3, 3, 1, 3, 1, 3, 1, 3, 1, 3,
905 1, 3, 1, 5, 1, 1, 3, 3, 1, 1,
910 #define yyerrok (yyerrstatus = 0)
911 #define yyclearin (yychar = YYEMPTY)
915 #define YYACCEPT goto yyacceptlab
916 #define YYABORT goto yyabortlab
917 #define YYERROR goto yyerrorlab
920 #define YYRECOVERING() (!!yyerrstatus)
922 #define YYBACKUP(Token, Value) \
924 if (yychar == YYEMPTY) \
928 YYPOPSTACK (yylen); \
934 yyerror (YY_("syntax error: cannot back up")); \
939 /* Error token number */
941 #define YYERRCODE 256
945 /* Enable debugging if requested. */
949 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
950 # define YYFPRINTF fprintf
953 # define YYDPRINTF(Args) \
959 /* This macro is provided for backward compatibility. */
960 #ifndef YY_LOCATION_PRINT
961 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
965 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
969 YYFPRINTF (stderr, "%s ", Title); \
970 yy_symbol_print (stderr, \
972 YYFPRINTF (stderr, "\n"); \
977 /*----------------------------------------.
978 | Print this symbol's value on YYOUTPUT. |
979 `----------------------------------------*/
982 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
984 FILE *yyo = yyoutput;
989 if (yytype < YYNTOKENS)
990 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
996 /*--------------------------------.
997 | Print this symbol on YYOUTPUT. |
998 `--------------------------------*/
1001 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1003 YYFPRINTF (yyoutput, "%s %s (",
1004 yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
1006 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
1007 YYFPRINTF (yyoutput, ")");
1010 /*------------------------------------------------------------------.
1011 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1013 `------------------------------------------------------------------*/
1016 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1018 YYFPRINTF (stderr, "Stack now");
1019 for (; yybottom <= yytop; yybottom++)
1021 int yybot = *yybottom;
1022 YYFPRINTF (stderr, " %d", yybot);
1024 YYFPRINTF (stderr, "\n");
1027 # define YY_STACK_PRINT(Bottom, Top) \
1030 yy_stack_print ((Bottom), (Top)); \
1034 /*------------------------------------------------.
1035 | Report that the YYRULE is going to be reduced. |
1036 `------------------------------------------------*/
1039 yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
1041 unsigned long int yylno = yyrline[yyrule];
1042 int yynrhs = yyr2[yyrule];
1044 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1046 /* The symbols being reduced. */
1047 for (yyi = 0; yyi < yynrhs; yyi++)
1049 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1050 yy_symbol_print (stderr,
1051 yystos[yyssp[yyi + 1 - yynrhs]],
1052 &(yyvsp[(yyi + 1) - (yynrhs)])
1054 YYFPRINTF (stderr, "\n");
1058 # define YY_REDUCE_PRINT(Rule) \
1061 yy_reduce_print (yyssp, yyvsp, Rule); \
1064 /* Nonzero means print parse trace. It is left uninitialized so that
1065 multiple parsers can coexist. */
1067 #else /* !YYDEBUG */
1068 # define YYDPRINTF(Args)
1069 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1070 # define YY_STACK_PRINT(Bottom, Top)
1071 # define YY_REDUCE_PRINT(Rule)
1072 #endif /* !YYDEBUG */
1075 /* YYINITDEPTH -- initial size of the parser's stacks. */
1077 # define YYINITDEPTH 200
1080 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1081 if the built-in stack extension method is used).
1083 Do not make this value too large; the results are undefined if
1084 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1085 evaluated with infinite-precision integer arithmetic. */
1088 # define YYMAXDEPTH 10000
1095 # if defined __GLIBC__ && defined _STRING_H
1096 # define yystrlen strlen
1098 /* Return the length of YYSTR. */
1100 yystrlen (const char *yystr)
1103 for (yylen = 0; yystr[yylen]; yylen++)
1111 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1112 # define yystpcpy stpcpy
1114 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1117 yystpcpy (char *yydest, const char *yysrc)
1120 const char *yys = yysrc;
1122 while ((*yyd++ = *yys++) != '\0')
1131 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1132 quotes and backslashes, so that it's suitable for yyerror. The
1133 heuristic is that double-quoting is unnecessary unless the string
1134 contains an apostrophe, a comma, or backslash (other than
1135 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1136 null, do not copy; instead, return the length of what the result
1139 yytnamerr (char *yyres, const char *yystr)
1144 char const *yyp = yystr;
1151 goto do_not_strip_quotes;
1155 goto do_not_strip_quotes;
1168 do_not_strip_quotes: ;
1172 return yystrlen (yystr);
1174 return yystpcpy (yyres, yystr) - yyres;
1178 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1179 about the unexpected token YYTOKEN for the state stack whose top is
1182 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1183 not large enough to hold the message. In that case, also set
1184 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1185 required number of bytes is too large to store. */
1187 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1188 yytype_int16 *yyssp, int yytoken)
1190 YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
1191 YYSIZE_T yysize = yysize0;
1192 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1193 /* Internationalized format string. */
1194 const char *yyformat = YY_NULLPTR;
1195 /* Arguments of yyformat. */
1196 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1197 /* Number of reported tokens (one for the "unexpected", one per
1201 /* There are many possibilities here to consider:
1202 - If this state is a consistent state with a default action, then
1203 the only way this function was invoked is if the default action
1204 is an error action. In that case, don't check for expected
1205 tokens because there are none.
1206 - The only way there can be no lookahead present (in yychar) is if
1207 this state is a consistent state with a default action. Thus,
1208 detecting the absence of a lookahead is sufficient to determine
1209 that there is no unexpected or expected token to report. In that
1210 case, just report a simple "syntax error".
1211 - Don't assume there isn't a lookahead just because this state is a
1212 consistent state with a default action. There might have been a
1213 previous inconsistent state, consistent state with a non-default
1214 action, or user semantic action that manipulated yychar.
1215 - Of course, the expected token list depends on states to have
1216 correct lookahead information, and it depends on the parser not
1217 to perform extra reductions after fetching a lookahead from the
1218 scanner and before detecting a syntax error. Thus, state merging
1219 (from LALR or IELR) and default reductions corrupt the expected
1220 token list. However, the list is correct for canonical LR with
1221 one exception: it will still contain any token that will not be
1222 accepted due to an error action in a later state.
1224 if (yytoken != YYEMPTY)
1226 int yyn = yypact[*yyssp];
1227 yyarg[yycount++] = yytname[yytoken];
1228 if (!yypact_value_is_default (yyn))
1230 /* Start YYX at -YYN if negative to avoid negative indexes in
1231 YYCHECK. In other words, skip the first -YYN actions for
1232 this state because they are default actions. */
1233 int yyxbegin = yyn < 0 ? -yyn : 0;
1234 /* Stay within bounds of both yycheck and yytname. */
1235 int yychecklim = YYLAST - yyn + 1;
1236 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1239 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1240 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1241 && !yytable_value_is_error (yytable[yyx + yyn]))
1243 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1249 yyarg[yycount++] = yytname[yyx];
1251 YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
1252 if (! (yysize <= yysize1
1253 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1263 # define YYCASE_(N, S) \
1267 YYCASE_(0, YY_("syntax error"));
1268 YYCASE_(1, YY_("syntax error, unexpected %s"));
1269 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1270 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1271 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1272 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1277 YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1278 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1283 if (*yymsg_alloc < yysize)
1285 *yymsg_alloc = 2 * yysize;
1286 if (! (yysize <= *yymsg_alloc
1287 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1288 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1292 /* Avoid sprintf, as that infringes on the user's name space.
1293 Don't have undefined behavior even if the translation
1294 produced a string with the wrong number of "%s"s. */
1298 while ((*yyp = *yyformat) != '\0')
1299 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1301 yyp += yytnamerr (yyp, yyarg[yyi++]);
1312 #endif /* YYERROR_VERBOSE */
1314 /*-----------------------------------------------.
1315 | Release the memory associated to this symbol. |
1316 `-----------------------------------------------*/
1319 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1324 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1326 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1328 YY_IGNORE_MAYBE_UNINITIALIZED_END
1334 /* The lookahead symbol. */
1337 /* The semantic value of the lookahead symbol. */
1339 /* Number of syntax errors so far. */
1351 /* Number of tokens to shift before error messages enabled. */
1354 /* The stacks and their tools:
1355 'yyss': related to states.
1356 'yyvs': related to semantic values.
1358 Refer to the stacks through separate pointers, to allow yyoverflow
1359 to xreallocate them elsewhere. */
1361 /* The state stack. */
1362 yytype_int16 yyssa[YYINITDEPTH];
1364 yytype_int16 *yyssp;
1366 /* The semantic value stack. */
1367 YYSTYPE yyvsa[YYINITDEPTH];
1371 YYSIZE_T yystacksize;
1375 /* Lookahead token as an internal (translated) token number. */
1377 /* The variables used to return semantic value and location from the
1382 /* Buffer for error messages, and its allocated size. */
1384 char *yymsg = yymsgbuf;
1385 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1388 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1390 /* The number of symbols on the RHS of the reduced rule.
1391 Keep to zero when no symbol should be popped. */
1394 yyssp = yyss = yyssa;
1395 yyvsp = yyvs = yyvsa;
1396 yystacksize = YYINITDEPTH;
1398 YYDPRINTF ((stderr, "Starting parse\n"));
1403 yychar = YYEMPTY; /* Cause a token to be read. */
1406 /*------------------------------------------------------------.
1407 | yynewstate -- Push a new state, which is found in yystate. |
1408 `------------------------------------------------------------*/
1410 /* In all cases, when you get here, the value and location stacks
1411 have just been pushed. So pushing a state here evens the stacks. */
1417 if (yyss + yystacksize - 1 <= yyssp)
1419 /* Get the current used size of the three stacks, in elements. */
1420 YYSIZE_T yysize = yyssp - yyss + 1;
1424 /* Give user a chance to xreallocate the stack. Use copies of
1425 these so that the &'s don't force the real ones into
1427 YYSTYPE *yyvs1 = yyvs;
1428 yytype_int16 *yyss1 = yyss;
1430 /* Each stack pointer address is followed by the size of the
1431 data in use in that stack, in bytes. This used to be a
1432 conditional around just the two extra args, but that might
1433 be undefined if yyoverflow is a macro. */
1434 yyoverflow (YY_("memory exhausted"),
1435 &yyss1, yysize * sizeof (*yyssp),
1436 &yyvs1, yysize * sizeof (*yyvsp),
1442 #else /* no yyoverflow */
1443 # ifndef YYSTACK_RELOCATE
1444 goto yyexhaustedlab;
1446 /* Extend the stack our own way. */
1447 if (YYMAXDEPTH <= yystacksize)
1448 goto yyexhaustedlab;
1450 if (YYMAXDEPTH < yystacksize)
1451 yystacksize = YYMAXDEPTH;
1454 yytype_int16 *yyss1 = yyss;
1455 union yyalloc *yyptr =
1456 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1458 goto yyexhaustedlab;
1459 YYSTACK_RELOCATE (yyss_alloc, yyss);
1460 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1461 # undef YYSTACK_RELOCATE
1463 YYSTACK_FREE (yyss1);
1466 #endif /* no yyoverflow */
1468 yyssp = yyss + yysize - 1;
1469 yyvsp = yyvs + yysize - 1;
1471 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1472 (unsigned long int) yystacksize));
1474 if (yyss + yystacksize - 1 <= yyssp)
1478 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1480 if (yystate == YYFINAL)
1490 /* Do appropriate processing given the current state. Read a
1491 lookahead token if we need one and don't already have one. */
1493 /* First try to decide what to do without reference to lookahead token. */
1494 yyn = yypact[yystate];
1495 if (yypact_value_is_default (yyn))
1498 /* Not known => get a lookahead token if don't already have one. */
1500 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1501 if (yychar == YYEMPTY)
1503 YYDPRINTF ((stderr, "Reading a token: "));
1507 if (yychar <= YYEOF)
1509 yychar = yytoken = YYEOF;
1510 YYDPRINTF ((stderr, "Now at end of input.\n"));
1514 yytoken = YYTRANSLATE (yychar);
1515 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1518 /* If the proper action on seeing token YYTOKEN is to reduce or to
1519 detect an error, take that action. */
1521 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1526 if (yytable_value_is_error (yyn))
1532 /* Count tokens shifted since error; after three, turn off error
1537 /* Shift the lookahead token. */
1538 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1540 /* Discard the shifted token. */
1544 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1546 YY_IGNORE_MAYBE_UNINITIALIZED_END
1551 /*-----------------------------------------------------------.
1552 | yydefault -- do the default action for the current state. |
1553 `-----------------------------------------------------------*/
1555 yyn = yydefact[yystate];
1561 /*-----------------------------.
1562 | yyreduce -- Do a reduction. |
1563 `-----------------------------*/
1565 /* yyn is the number of a rule to reduce with. */
1568 /* If YYLEN is nonzero, implement the default value of the action:
1571 Otherwise, the following line sets YYVAL to garbage.
1572 This behavior is undocumented and Bison
1573 users should not rely upon it. Assigning to YYVAL
1574 unconditionally makes the parser a bit smaller, and it avoids a
1575 GCC warning that YYVAL may be used uninitialized. */
1576 yyval = yyvsp[1-yylen];
1579 YY_REDUCE_PRINT (yyn);
1583 #line 223 "jv-exp.y" /* yacc.c:1646 */
1585 write_exp_elt_opcode (pstate, OP_TYPE);
1586 write_exp_elt_type (pstate, (yyvsp[0].tval));
1587 write_exp_elt_opcode (pstate, OP_TYPE);
1589 #line 1591 "jv-exp.c" /* yacc.c:1646 */
1593 #line 237 "jv-exp.y" /* yacc.c:1646 */
1595 write_exp_elt_opcode (pstate, OP_STRING);
1596 write_exp_string (pstate, (yyvsp[0].sval));
1597 write_exp_elt_opcode (pstate, OP_STRING);
1599 #line 1601 "jv-exp.c" /* yacc.c:1646 */
1603 #line 246 "jv-exp.y" /* yacc.c:1646 */
1604 { write_exp_elt_opcode (pstate, OP_LONG);
1605 write_exp_elt_type (pstate, (yyvsp[0].typed_val_int).type);
1606 write_exp_elt_longcst (pstate, (LONGEST)((yyvsp[0].typed_val_int).val));
1607 write_exp_elt_opcode (pstate, OP_LONG); }
1608 #line 1610 "jv-exp.c" /* yacc.c:1646 */
1612 #line 251 "jv-exp.y" /* yacc.c:1646 */
1614 parse_number (pstate, (yyvsp[0].sval).ptr, (yyvsp[0].sval).length, 0, &val);
1615 write_exp_elt_opcode (pstate, OP_LONG);
1616 write_exp_elt_type (pstate, val.typed_val_int.type);
1617 write_exp_elt_longcst (pstate,
1618 (LONGEST) val.typed_val_int.val);
1619 write_exp_elt_opcode (pstate, OP_LONG);
1621 #line 1623 "jv-exp.c" /* yacc.c:1646 */
1625 #line 260 "jv-exp.y" /* yacc.c:1646 */
1626 { write_exp_elt_opcode (pstate, OP_DOUBLE);
1627 write_exp_elt_type (pstate, (yyvsp[0].typed_val_float).type);
1628 write_exp_elt_dblcst (pstate, (yyvsp[0].typed_val_float).dval);
1629 write_exp_elt_opcode (pstate, OP_DOUBLE); }
1630 #line 1632 "jv-exp.c" /* yacc.c:1646 */
1634 #line 265 "jv-exp.y" /* yacc.c:1646 */
1635 { write_exp_elt_opcode (pstate, OP_LONG);
1636 write_exp_elt_type (pstate,
1637 parse_java_type (pstate)->builtin_boolean);
1638 write_exp_elt_longcst (pstate, (LONGEST)(yyvsp[0].lval));
1639 write_exp_elt_opcode (pstate, OP_LONG); }
1640 #line 1642 "jv-exp.c" /* yacc.c:1646 */
1644 #line 283 "jv-exp.y" /* yacc.c:1646 */
1645 { (yyval.tval) = parse_java_type (pstate)->builtin_boolean; }
1646 #line 1648 "jv-exp.c" /* yacc.c:1646 */
1650 #line 293 "jv-exp.y" /* yacc.c:1646 */
1651 { (yyval.tval) = parse_java_type (pstate)->builtin_byte; }
1652 #line 1654 "jv-exp.c" /* yacc.c:1646 */
1656 #line 295 "jv-exp.y" /* yacc.c:1646 */
1657 { (yyval.tval) = parse_java_type (pstate)->builtin_short; }
1658 #line 1660 "jv-exp.c" /* yacc.c:1646 */
1662 #line 297 "jv-exp.y" /* yacc.c:1646 */
1663 { (yyval.tval) = parse_java_type (pstate)->builtin_int; }
1664 #line 1666 "jv-exp.c" /* yacc.c:1646 */
1668 #line 299 "jv-exp.y" /* yacc.c:1646 */
1669 { (yyval.tval) = parse_java_type (pstate)->builtin_long; }
1670 #line 1672 "jv-exp.c" /* yacc.c:1646 */
1674 #line 301 "jv-exp.y" /* yacc.c:1646 */
1675 { (yyval.tval) = parse_java_type (pstate)->builtin_char; }
1676 #line 1678 "jv-exp.c" /* yacc.c:1646 */
1680 #line 306 "jv-exp.y" /* yacc.c:1646 */
1681 { (yyval.tval) = parse_java_type (pstate)->builtin_float; }
1682 #line 1684 "jv-exp.c" /* yacc.c:1646 */
1686 #line 308 "jv-exp.y" /* yacc.c:1646 */
1687 { (yyval.tval) = parse_java_type (pstate)->builtin_double; }
1688 #line 1690 "jv-exp.c" /* yacc.c:1646 */
1692 #line 320 "jv-exp.y" /* yacc.c:1646 */
1693 { (yyval.tval) = java_type_from_name ((yyvsp[0].sval)); }
1694 #line 1696 "jv-exp.c" /* yacc.c:1646 */
1698 #line 329 "jv-exp.y" /* yacc.c:1646 */
1699 { (yyval.tval) = java_array_type ((yyvsp[-1].tval), (yyvsp[0].lval)); }
1700 #line 1702 "jv-exp.c" /* yacc.c:1646 */
1704 #line 331 "jv-exp.y" /* yacc.c:1646 */
1705 { (yyval.tval) = java_array_type (java_type_from_name ((yyvsp[-1].sval)), (yyvsp[0].lval)); }
1706 #line 1708 "jv-exp.c" /* yacc.c:1646 */
1710 #line 351 "jv-exp.y" /* yacc.c:1646 */
1711 { (yyval.sval).length = (yyvsp[-2].sval).length + (yyvsp[0].sval).length + 1;
1712 if ((yyvsp[-2].sval).ptr + (yyvsp[-2].sval).length + 1 == (yyvsp[0].sval).ptr
1713 && (yyvsp[-2].sval).ptr[(yyvsp[-2].sval).length] == '.')
1714 (yyval.sval).ptr = (yyvsp[-2].sval).ptr; /* Optimization. */
1719 buf = xmalloc ((yyval.sval).length + 1);
1720 make_cleanup (xfree, buf);
1721 sprintf (buf, "%.*s.%.*s",
1722 (yyvsp[-2].sval).length, (yyvsp[-2].sval).ptr, (yyvsp[0].sval).length, (yyvsp[0].sval).ptr);
1723 (yyval.sval).ptr = buf;
1725 #line 1727 "jv-exp.c" /* yacc.c:1646 */
1729 #line 378 "jv-exp.y" /* yacc.c:1646 */
1730 { write_exp_elt_opcode (pstate, BINOP_COMMA); }
1731 #line 1733 "jv-exp.c" /* yacc.c:1646 */
1735 #line 394 "jv-exp.y" /* yacc.c:1646 */
1736 { write_exp_elt_opcode (pstate, OP_ARRAY);
1737 write_exp_elt_longcst (pstate, (LONGEST) 0);
1738 write_exp_elt_longcst (pstate, (LONGEST) (yyvsp[0].lval));
1739 write_exp_elt_opcode (pstate, OP_ARRAY); }
1740 #line 1742 "jv-exp.c" /* yacc.c:1646 */
1744 #line 402 "jv-exp.y" /* yacc.c:1646 */
1745 { start_arglist (); }
1746 #line 1748 "jv-exp.c" /* yacc.c:1646 */
1750 #line 407 "jv-exp.y" /* yacc.c:1646 */
1751 { (yyval.lval) = end_arglist () - 1; }
1752 #line 1754 "jv-exp.c" /* yacc.c:1646 */
1756 #line 412 "jv-exp.y" /* yacc.c:1646 */
1757 { internal_error (__FILE__, __LINE__,
1758 _("FIXME - ClassInstanceCreationExpression")); }
1759 #line 1761 "jv-exp.c" /* yacc.c:1646 */
1763 #line 418 "jv-exp.y" /* yacc.c:1646 */
1764 { arglist_len = 1; }
1765 #line 1767 "jv-exp.c" /* yacc.c:1646 */
1769 #line 420 "jv-exp.y" /* yacc.c:1646 */
1771 #line 1773 "jv-exp.c" /* yacc.c:1646 */
1775 #line 425 "jv-exp.y" /* yacc.c:1646 */
1776 { arglist_len = 0; }
1777 #line 1779 "jv-exp.c" /* yacc.c:1646 */
1781 #line 431 "jv-exp.y" /* yacc.c:1646 */
1782 { internal_error (__FILE__, __LINE__,
1783 _("FIXME - ArrayCreationExpression")); }
1784 #line 1786 "jv-exp.c" /* yacc.c:1646 */
1788 #line 434 "jv-exp.y" /* yacc.c:1646 */
1789 { internal_error (__FILE__, __LINE__,
1790 _("FIXME - ArrayCreationExpression")); }
1791 #line 1793 "jv-exp.c" /* yacc.c:1646 */
1795 #line 449 "jv-exp.y" /* yacc.c:1646 */
1796 { (yyval.lval) = 1; }
1797 #line 1799 "jv-exp.c" /* yacc.c:1646 */
1801 #line 451 "jv-exp.y" /* yacc.c:1646 */
1802 { (yyval.lval) = (yyvsp[-2].lval) + 1; }
1803 #line 1805 "jv-exp.c" /* yacc.c:1646 */
1807 #line 457 "jv-exp.y" /* yacc.c:1646 */
1808 { (yyval.lval) = 0; }
1809 #line 1811 "jv-exp.c" /* yacc.c:1646 */
1813 #line 462 "jv-exp.y" /* yacc.c:1646 */
1814 { push_fieldnames (pstate, (yyvsp[0].sval)); }
1815 #line 1817 "jv-exp.c" /* yacc.c:1646 */
1819 #line 464 "jv-exp.y" /* yacc.c:1646 */
1820 { push_fieldnames (pstate, (yyvsp[0].sval)); }
1821 #line 1823 "jv-exp.c" /* yacc.c:1646 */
1825 #line 470 "jv-exp.y" /* yacc.c:1646 */
1826 { push_expression_name (pstate, (yyvsp[-1].sval)); }
1827 #line 1829 "jv-exp.c" /* yacc.c:1646 */
1831 #line 475 "jv-exp.y" /* yacc.c:1646 */
1832 { start_arglist(); }
1833 #line 1835 "jv-exp.c" /* yacc.c:1646 */
1837 #line 477 "jv-exp.y" /* yacc.c:1646 */
1838 { write_exp_elt_opcode (pstate, OP_FUNCALL);
1839 write_exp_elt_longcst (pstate, (LONGEST) end_arglist ());
1840 write_exp_elt_opcode (pstate, OP_FUNCALL); }
1841 #line 1843 "jv-exp.c" /* yacc.c:1646 */
1845 #line 481 "jv-exp.y" /* yacc.c:1646 */
1846 { error (_("Form of method invocation not implemented")); }
1847 #line 1849 "jv-exp.c" /* yacc.c:1646 */
1851 #line 483 "jv-exp.y" /* yacc.c:1646 */
1852 { error (_("Form of method invocation not implemented")); }
1853 #line 1855 "jv-exp.c" /* yacc.c:1646 */
1857 #line 488 "jv-exp.y" /* yacc.c:1646 */
1859 /* Emit code for the Name now, then exchange it in the
1860 expout array with the Expression's code. We could
1861 introduce a OP_SWAP code or a reversed version of
1862 BINOP_SUBSCRIPT, but that makes the rest of GDB pay
1863 for our parsing kludges. */
1864 struct expression *name_expr;
1866 push_expression_name (pstate, (yyvsp[-3].sval));
1867 name_expr = copy_exp (pstate->expout, pstate->expout_ptr);
1868 pstate->expout_ptr -= name_expr->nelts;
1871 - length_of_subexp (pstate->expout,
1872 pstate->expout_ptr),
1875 write_exp_elt_opcode (pstate, BINOP_SUBSCRIPT);
1877 #line 1879 "jv-exp.c" /* yacc.c:1646 */
1881 #line 508 "jv-exp.y" /* yacc.c:1646 */
1882 { write_exp_elt_opcode (pstate, BINOP_SUBSCRIPT); }
1883 #line 1885 "jv-exp.c" /* yacc.c:1646 */
1887 #line 510 "jv-exp.y" /* yacc.c:1646 */
1888 { write_exp_elt_opcode (pstate, BINOP_SUBSCRIPT); }
1889 #line 1891 "jv-exp.c" /* yacc.c:1646 */
1893 #line 516 "jv-exp.y" /* yacc.c:1646 */
1894 { push_expression_name (pstate, (yyvsp[0].sval)); }
1895 #line 1897 "jv-exp.c" /* yacc.c:1646 */
1899 #line 525 "jv-exp.y" /* yacc.c:1646 */
1900 { write_exp_elt_opcode (pstate, UNOP_POSTINCREMENT); }
1901 #line 1903 "jv-exp.c" /* yacc.c:1646 */
1905 #line 530 "jv-exp.y" /* yacc.c:1646 */
1906 { write_exp_elt_opcode (pstate, UNOP_POSTDECREMENT); }
1907 #line 1909 "jv-exp.c" /* yacc.c:1646 */
1911 #line 538 "jv-exp.y" /* yacc.c:1646 */
1912 { write_exp_elt_opcode (pstate, UNOP_NEG); }
1913 #line 1915 "jv-exp.c" /* yacc.c:1646 */
1917 #line 540 "jv-exp.y" /* yacc.c:1646 */
1918 { write_exp_elt_opcode (pstate,
1920 #line 1922 "jv-exp.c" /* yacc.c:1646 */
1924 #line 547 "jv-exp.y" /* yacc.c:1646 */
1925 { write_exp_elt_opcode (pstate, UNOP_PREINCREMENT); }
1926 #line 1928 "jv-exp.c" /* yacc.c:1646 */
1930 #line 552 "jv-exp.y" /* yacc.c:1646 */
1931 { write_exp_elt_opcode (pstate, UNOP_PREDECREMENT); }
1932 #line 1934 "jv-exp.c" /* yacc.c:1646 */
1936 #line 558 "jv-exp.y" /* yacc.c:1646 */
1937 { write_exp_elt_opcode (pstate, UNOP_COMPLEMENT); }
1938 #line 1940 "jv-exp.c" /* yacc.c:1646 */
1942 #line 560 "jv-exp.y" /* yacc.c:1646 */
1943 { write_exp_elt_opcode (pstate, UNOP_LOGICAL_NOT); }
1944 #line 1946 "jv-exp.c" /* yacc.c:1646 */
1948 #line 566 "jv-exp.y" /* yacc.c:1646 */
1949 { write_exp_elt_opcode (pstate, UNOP_CAST);
1950 write_exp_elt_type (pstate, java_array_type ((yyvsp[-3].tval), (yyvsp[-2].lval)));
1951 write_exp_elt_opcode (pstate, UNOP_CAST); }
1952 #line 1954 "jv-exp.c" /* yacc.c:1646 */
1956 #line 570 "jv-exp.y" /* yacc.c:1646 */
1958 int last_exp_size = length_of_subexp (pstate->expout,
1959 pstate->expout_ptr);
1962 int base = pstate->expout_ptr - last_exp_size - 3;
1965 || pstate->expout->elts[base+2].opcode != OP_TYPE)
1966 error (_("Invalid cast expression"));
1967 type = pstate->expout->elts[base+1].type;
1968 /* Remove the 'Expression' and slide the
1969 UnaryExpressionNotPlusMinus down to replace it. */
1970 for (i = 0; i < last_exp_size; i++)
1971 pstate->expout->elts[base + i]
1972 = pstate->expout->elts[base + i + 3];
1973 pstate->expout_ptr -= 3;
1974 if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
1975 type = lookup_pointer_type (type);
1976 write_exp_elt_opcode (pstate, UNOP_CAST);
1977 write_exp_elt_type (pstate, type);
1978 write_exp_elt_opcode (pstate, UNOP_CAST);
1980 #line 1982 "jv-exp.c" /* yacc.c:1646 */
1984 #line 594 "jv-exp.y" /* yacc.c:1646 */
1985 { write_exp_elt_opcode (pstate, UNOP_CAST);
1986 write_exp_elt_type (pstate,
1987 java_array_type (java_type_from_name
1988 ((yyvsp[-3].sval)), (yyvsp[-2].lval)));
1989 write_exp_elt_opcode (pstate, UNOP_CAST); }
1990 #line 1992 "jv-exp.c" /* yacc.c:1646 */
1994 #line 605 "jv-exp.y" /* yacc.c:1646 */
1995 { write_exp_elt_opcode (pstate, BINOP_MUL); }
1996 #line 1998 "jv-exp.c" /* yacc.c:1646 */
2000 #line 607 "jv-exp.y" /* yacc.c:1646 */
2001 { write_exp_elt_opcode (pstate, BINOP_DIV); }
2002 #line 2004 "jv-exp.c" /* yacc.c:1646 */
2006 #line 609 "jv-exp.y" /* yacc.c:1646 */
2007 { write_exp_elt_opcode (pstate, BINOP_REM); }
2008 #line 2010 "jv-exp.c" /* yacc.c:1646 */
2012 #line 615 "jv-exp.y" /* yacc.c:1646 */
2013 { write_exp_elt_opcode (pstate, BINOP_ADD); }
2014 #line 2016 "jv-exp.c" /* yacc.c:1646 */
2018 #line 617 "jv-exp.y" /* yacc.c:1646 */
2019 { write_exp_elt_opcode (pstate, BINOP_SUB); }
2020 #line 2022 "jv-exp.c" /* yacc.c:1646 */
2024 #line 623 "jv-exp.y" /* yacc.c:1646 */
2025 { write_exp_elt_opcode (pstate, BINOP_LSH); }
2026 #line 2028 "jv-exp.c" /* yacc.c:1646 */
2030 #line 625 "jv-exp.y" /* yacc.c:1646 */
2031 { write_exp_elt_opcode (pstate, BINOP_RSH); }
2032 #line 2034 "jv-exp.c" /* yacc.c:1646 */
2036 #line 632 "jv-exp.y" /* yacc.c:1646 */
2037 { write_exp_elt_opcode (pstate, BINOP_LESS); }
2038 #line 2040 "jv-exp.c" /* yacc.c:1646 */
2042 #line 634 "jv-exp.y" /* yacc.c:1646 */
2043 { write_exp_elt_opcode (pstate, BINOP_GTR); }
2044 #line 2046 "jv-exp.c" /* yacc.c:1646 */
2048 #line 636 "jv-exp.y" /* yacc.c:1646 */
2049 { write_exp_elt_opcode (pstate, BINOP_LEQ); }
2050 #line 2052 "jv-exp.c" /* yacc.c:1646 */
2054 #line 638 "jv-exp.y" /* yacc.c:1646 */
2055 { write_exp_elt_opcode (pstate, BINOP_GEQ); }
2056 #line 2058 "jv-exp.c" /* yacc.c:1646 */
2060 #line 645 "jv-exp.y" /* yacc.c:1646 */
2061 { write_exp_elt_opcode (pstate, BINOP_EQUAL); }
2062 #line 2064 "jv-exp.c" /* yacc.c:1646 */
2066 #line 647 "jv-exp.y" /* yacc.c:1646 */
2067 { write_exp_elt_opcode (pstate, BINOP_NOTEQUAL); }
2068 #line 2070 "jv-exp.c" /* yacc.c:1646 */
2072 #line 653 "jv-exp.y" /* yacc.c:1646 */
2073 { write_exp_elt_opcode (pstate, BINOP_BITWISE_AND); }
2074 #line 2076 "jv-exp.c" /* yacc.c:1646 */
2078 #line 659 "jv-exp.y" /* yacc.c:1646 */
2079 { write_exp_elt_opcode (pstate, BINOP_BITWISE_XOR); }
2080 #line 2082 "jv-exp.c" /* yacc.c:1646 */
2084 #line 664 "jv-exp.y" /* yacc.c:1646 */
2085 { write_exp_elt_opcode (pstate, BINOP_BITWISE_IOR); }
2086 #line 2088 "jv-exp.c" /* yacc.c:1646 */
2090 #line 670 "jv-exp.y" /* yacc.c:1646 */
2091 { write_exp_elt_opcode (pstate, BINOP_LOGICAL_AND); }
2092 #line 2094 "jv-exp.c" /* yacc.c:1646 */
2096 #line 676 "jv-exp.y" /* yacc.c:1646 */
2097 { write_exp_elt_opcode (pstate, BINOP_LOGICAL_OR); }
2098 #line 2100 "jv-exp.c" /* yacc.c:1646 */
2102 #line 682 "jv-exp.y" /* yacc.c:1646 */
2103 { write_exp_elt_opcode (pstate, TERNOP_COND); }
2104 #line 2106 "jv-exp.c" /* yacc.c:1646 */
2108 #line 692 "jv-exp.y" /* yacc.c:1646 */
2109 { write_exp_elt_opcode (pstate, BINOP_ASSIGN); }
2110 #line 2112 "jv-exp.c" /* yacc.c:1646 */
2114 #line 694 "jv-exp.y" /* yacc.c:1646 */
2115 { write_exp_elt_opcode (pstate, BINOP_ASSIGN_MODIFY);
2116 write_exp_elt_opcode (pstate, (yyvsp[-1].opcode));
2117 write_exp_elt_opcode (pstate, BINOP_ASSIGN_MODIFY); }
2118 #line 2120 "jv-exp.c" /* yacc.c:1646 */
2122 #line 701 "jv-exp.y" /* yacc.c:1646 */
2123 { push_expression_name (pstate, (yyvsp[0].sval)); }
2124 #line 2126 "jv-exp.c" /* yacc.c:1646 */
2128 #line 2130 "jv-exp.c" /* yacc.c:1646 */
2131 /* User semantic actions sometimes alter yychar, and that requires
2132 that yytoken be updated with the new translation. We take the
2133 approach of translating immediately before every use of yytoken.
2134 One alternative is translating here after every semantic action,
2135 but that translation would be missed if the semantic action invokes
2136 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2137 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2138 incorrect destructor might then be invoked immediately. In the
2139 case of YYERROR or YYBACKUP, subsequent parser actions might lead
2140 to an incorrect destructor call or verbose syntax error message
2141 before the lookahead is translated. */
2142 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2146 YY_STACK_PRINT (yyss, yyssp);
2150 /* Now 'shift' the result of the reduction. Determine what state
2151 that goes to, based on the state we popped back to and the rule
2152 number reduced by. */
2156 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2157 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2158 yystate = yytable[yystate];
2160 yystate = yydefgoto[yyn - YYNTOKENS];
2165 /*--------------------------------------.
2166 | yyerrlab -- here on detecting error. |
2167 `--------------------------------------*/
2169 /* Make sure we have latest lookahead translation. See comments at
2170 user semantic actions for why this is necessary. */
2171 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
2173 /* If not already recovering from an error, report this error. */
2177 #if ! YYERROR_VERBOSE
2178 yyerror (YY_("syntax error"));
2180 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2183 char const *yymsgp = YY_("syntax error");
2184 int yysyntax_error_status;
2185 yysyntax_error_status = YYSYNTAX_ERROR;
2186 if (yysyntax_error_status == 0)
2188 else if (yysyntax_error_status == 1)
2190 if (yymsg != yymsgbuf)
2191 YYSTACK_FREE (yymsg);
2192 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
2196 yymsg_alloc = sizeof yymsgbuf;
2197 yysyntax_error_status = 2;
2201 yysyntax_error_status = YYSYNTAX_ERROR;
2206 if (yysyntax_error_status == 2)
2207 goto yyexhaustedlab;
2209 # undef YYSYNTAX_ERROR
2215 if (yyerrstatus == 3)
2217 /* If just tried and failed to reuse lookahead token after an
2218 error, discard it. */
2220 if (yychar <= YYEOF)
2222 /* Return failure if at end of input. */
2223 if (yychar == YYEOF)
2228 yydestruct ("Error: discarding",
2234 /* Else will try to reuse lookahead token after shifting the error
2239 /*---------------------------------------------------.
2240 | yyerrorlab -- error raised explicitly by YYERROR. |
2241 `---------------------------------------------------*/
2244 /* Pacify compilers like GCC when the user code never invokes
2245 YYERROR and the label yyerrorlab therefore never appears in user
2247 if (/*CONSTCOND*/ 0)
2250 /* Do not reclaim the symbols of the rule whose action triggered
2254 YY_STACK_PRINT (yyss, yyssp);
2259 /*-------------------------------------------------------------.
2260 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2261 `-------------------------------------------------------------*/
2263 yyerrstatus = 3; /* Each real token shifted decrements this. */
2267 yyn = yypact[yystate];
2268 if (!yypact_value_is_default (yyn))
2271 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2279 /* Pop the current state because it cannot handle the error token. */
2284 yydestruct ("Error: popping",
2285 yystos[yystate], yyvsp);
2288 YY_STACK_PRINT (yyss, yyssp);
2291 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2293 YY_IGNORE_MAYBE_UNINITIALIZED_END
2296 /* Shift the error token. */
2297 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2303 /*-------------------------------------.
2304 | yyacceptlab -- YYACCEPT comes here. |
2305 `-------------------------------------*/
2310 /*-----------------------------------.
2311 | yyabortlab -- YYABORT comes here. |
2312 `-----------------------------------*/
2317 #if !defined yyoverflow || YYERROR_VERBOSE
2318 /*-------------------------------------------------.
2319 | yyexhaustedlab -- memory exhaustion comes here. |
2320 `-------------------------------------------------*/
2322 yyerror (YY_("memory exhausted"));
2328 if (yychar != YYEMPTY)
2330 /* Make sure we have latest lookahead translation. See comments at
2331 user semantic actions for why this is necessary. */
2332 yytoken = YYTRANSLATE (yychar);
2333 yydestruct ("Cleanup: discarding lookahead",
2336 /* Do not reclaim the symbols of the rule whose action triggered
2337 this YYABORT or YYACCEPT. */
2339 YY_STACK_PRINT (yyss, yyssp);
2340 while (yyssp != yyss)
2342 yydestruct ("Cleanup: popping",
2343 yystos[*yyssp], yyvsp);
2348 YYSTACK_FREE (yyss);
2351 if (yymsg != yymsgbuf)
2352 YYSTACK_FREE (yymsg);
2356 #line 713 "jv-exp.y" /* yacc.c:1906 */
2358 /* Take care of parsing a number (anything that starts with a digit).
2359 Set yylval and return the token type; update lexptr.
2360 LEN is the number of characters in it. */
2362 /*** Needs some error checking for the float case ***/
2365 parse_number (struct parser_state *par_state,
2366 const char *p, int len, int parsed_float, YYSTYPE *putithere)
2369 ULONGEST limit, limit_div_base;
2372 int base = input_radix;
2381 if (! parse_float (p, len, &putithere->typed_val_float.dval, &suffix))
2384 suffix_len = p + len - suffix;
2386 if (suffix_len == 0)
2387 putithere->typed_val_float.type
2388 = parse_type (par_state)->builtin_double;
2389 else if (suffix_len == 1)
2391 /* See if it has `f' or `d' suffix (float or double). */
2392 if (tolower (*suffix) == 'f')
2393 putithere->typed_val_float.type =
2394 parse_type (par_state)->builtin_float;
2395 else if (tolower (*suffix) == 'd')
2396 putithere->typed_val_float.type =
2397 parse_type (par_state)->builtin_double;
2404 return FLOATING_POINT_LITERAL;
2407 /* Handle base-switching prefixes 0x, 0t, 0d, 0 */
2439 /* A paranoid calculation of (1<<64)-1. */
2440 limit = (ULONGEST)0xffffffff;
2441 limit = ((limit << 16) << 16) | limit;
2442 if (c == 'l' || c == 'L')
2444 type = parse_java_type (par_state)->builtin_long;
2449 type = parse_java_type (par_state)->builtin_int;
2451 limit_div_base = limit / (ULONGEST) base;
2456 if (c >= '0' && c <= '9')
2458 else if (c >= 'A' && c <= 'Z')
2460 else if (c >= 'a' && c <= 'z')
2463 return ERROR; /* Char not a digit */
2466 if (n > limit_div_base
2467 || (n *= base) > limit - c)
2468 error (_("Numeric constant too large"));
2472 /* If the type is bigger than a 32-bit signed integer can be, implicitly
2473 promote to long. Java does not do this, so mark it as
2474 parse_type (par_state)->builtin_uint64 rather than
2475 parse_java_type (par_state)->builtin_long.
2476 0x80000000 will become -0x80000000 instead of 0x80000000L, because we
2477 don't know the sign at this point. */
2478 if (type == parse_java_type (par_state)->builtin_int
2479 && n > (ULONGEST)0x80000000)
2480 type = parse_type (par_state)->builtin_uint64;
2482 putithere->typed_val_int.val = n;
2483 putithere->typed_val_int.type = type;
2485 return INTEGER_LITERAL;
2492 enum exp_opcode opcode;
2495 static const struct token tokentab3[] =
2497 {">>=", ASSIGN_MODIFY, BINOP_RSH},
2498 {"<<=", ASSIGN_MODIFY, BINOP_LSH}
2501 static const struct token tokentab2[] =
2503 {"+=", ASSIGN_MODIFY, BINOP_ADD},
2504 {"-=", ASSIGN_MODIFY, BINOP_SUB},
2505 {"*=", ASSIGN_MODIFY, BINOP_MUL},
2506 {"/=", ASSIGN_MODIFY, BINOP_DIV},
2507 {"%=", ASSIGN_MODIFY, BINOP_REM},
2508 {"|=", ASSIGN_MODIFY, BINOP_BITWISE_IOR},
2509 {"&=", ASSIGN_MODIFY, BINOP_BITWISE_AND},
2510 {"^=", ASSIGN_MODIFY, BINOP_BITWISE_XOR},
2511 {"++", INCREMENT, BINOP_END},
2512 {"--", DECREMENT, BINOP_END},
2513 {"&&", ANDAND, BINOP_END},
2514 {"||", OROR, BINOP_END},
2515 {"<<", LSH, BINOP_END},
2516 {">>", RSH, BINOP_END},
2517 {"==", EQUAL, BINOP_END},
2518 {"!=", NOTEQUAL, BINOP_END},
2519 {"<=", LEQ, BINOP_END},
2520 {">=", GEQ, BINOP_END}
2523 /* Read one token, getting characters through lexptr. */
2531 const char *tokstart;
2534 static char *tempbuf;
2535 static int tempbufsize;
2539 prev_lexptr = lexptr;
2542 /* See if it is a special token of length 3. */
2543 for (i = 0; i < sizeof tokentab3 / sizeof tokentab3[0]; i++)
2544 if (strncmp (tokstart, tokentab3[i].operator, 3) == 0)
2547 yylval.opcode = tokentab3[i].opcode;
2548 return tokentab3[i].token;
2551 /* See if it is a special token of length 2. */
2552 for (i = 0; i < sizeof tokentab2 / sizeof tokentab2[0]; i++)
2553 if (strncmp (tokstart, tokentab2[i].operator, 2) == 0)
2556 yylval.opcode = tokentab2[i].opcode;
2557 return tokentab2[i].token;
2560 switch (c = *tokstart)
2572 /* We either have a character constant ('0' or '\177' for example)
2573 or we have a quoted symbol reference ('foo(int,int)' in C++
2578 c = parse_escape (parse_gdbarch (pstate), &lexptr);
2580 error (_("Empty character constant"));
2582 yylval.typed_val_int.val = c;
2583 yylval.typed_val_int.type = parse_java_type (pstate)->builtin_char;
2588 namelen = skip_quoted (tokstart) - tokstart;
2591 lexptr = tokstart + namelen;
2592 if (lexptr[-1] != '\'')
2593 error (_("Unmatched single quote"));
2598 error (_("Invalid character constant"));
2600 return INTEGER_LITERAL;
2608 if (paren_depth == 0)
2615 if (comma_terminates && paren_depth == 0)
2621 /* Might be a floating point number. */
2622 if (lexptr[1] < '0' || lexptr[1] > '9')
2623 goto symbol; /* Nope, must be a symbol. */
2624 /* FALL THRU into number case. */
2637 /* It's a number. */
2638 int got_dot = 0, got_e = 0, toktype;
2639 const char *p = tokstart;
2640 int hex = input_radix > 10;
2642 if (c == '0' && (p[1] == 'x' || p[1] == 'X'))
2647 else if (c == '0' && (p[1]=='t' || p[1]=='T' || p[1]=='d' || p[1]=='D'))
2655 /* This test includes !hex because 'e' is a valid hex digit
2656 and thus does not indicate a floating point number when
2657 the radix is hex. */
2658 if (!hex && !got_e && (*p == 'e' || *p == 'E'))
2659 got_dot = got_e = 1;
2660 /* This test does not include !hex, because a '.' always indicates
2661 a decimal floating point number regardless of the radix. */
2662 else if (!got_dot && *p == '.')
2664 else if (got_e && (p[-1] == 'e' || p[-1] == 'E')
2665 && (*p == '-' || *p == '+'))
2666 /* This is the sign of the exponent, not the end of the
2669 /* We will take any letters or digits. parse_number will
2670 complain if past the radix, or if L or U are not final. */
2671 else if ((*p < '0' || *p > '9')
2672 && ((*p < 'a' || *p > 'z')
2673 && (*p < 'A' || *p > 'Z')))
2676 toktype = parse_number (pstate, tokstart, p - tokstart,
2677 got_dot|got_e, &yylval);
2678 if (toktype == ERROR)
2680 char *err_copy = (char *) alloca (p - tokstart + 1);
2682 memcpy (err_copy, tokstart, p - tokstart);
2683 err_copy[p - tokstart] = 0;
2684 error (_("Invalid number \"%s\""), err_copy);
2715 /* Build the gdb internal form of the input string in tempbuf,
2716 translating any standard C escape forms seen. Note that the
2717 buffer is null byte terminated *only* for the convenience of
2718 debugging gdb itself and printing the buffer contents when
2719 the buffer contains no embedded nulls. Gdb does not depend
2720 upon the buffer being null byte terminated, it uses the length
2721 string instead. This allows gdb to handle C strings (as well
2722 as strings in other languages) with embedded null bytes */
2724 tokptr = ++tokstart;
2728 /* Grow the static temp buffer if necessary, including allocating
2729 the first one on demand. */
2730 if (tempbufindex + 1 >= tempbufsize)
2732 tempbuf = (char *) xrealloc (tempbuf, tempbufsize += 64);
2738 /* Do nothing, loop will terminate. */
2742 c = parse_escape (parse_gdbarch (pstate), &tokptr);
2747 tempbuf[tempbufindex++] = c;
2750 tempbuf[tempbufindex++] = *tokptr++;
2753 } while ((*tokptr != '"') && (*tokptr != '\0'));
2754 if (*tokptr++ != '"')
2756 error (_("Unterminated string in expression"));
2758 tempbuf[tempbufindex] = '\0'; /* See note above */
2759 yylval.sval.ptr = tempbuf;
2760 yylval.sval.length = tempbufindex;
2762 return (STRING_LITERAL);
2765 if (!(c == '_' || c == '$'
2766 || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')))
2767 /* We must have come across a bad character (e.g. ';'). */
2768 error (_("Invalid character '%c' in expression"), c);
2770 /* It's a name. See how long it is. */
2772 for (c = tokstart[namelen];
2775 || (c >= '0' && c <= '9')
2776 || (c >= 'a' && c <= 'z')
2777 || (c >= 'A' && c <= 'Z')
2784 while (tokstart[++i] && tokstart[i] != '>');
2785 if (tokstart[i] == '>')
2788 c = tokstart[++namelen];
2791 /* The token "if" terminates the expression and is NOT
2792 removed from the input stream. */
2793 if (namelen == 2 && tokstart[0] == 'i' && tokstart[1] == 'f')
2802 /* Catch specific keywords. Should be done with a data structure. */
2806 if (strncmp (tokstart, "boolean", 7) == 0)
2810 if (strncmp (tokstart, "double", 6) == 0)
2814 if (strncmp (tokstart, "short", 5) == 0)
2816 if (strncmp (tokstart, "false", 5) == 0)
2819 return BOOLEAN_LITERAL;
2821 if (strncmp (tokstart, "super", 5) == 0)
2823 if (strncmp (tokstart, "float", 5) == 0)
2827 if (strncmp (tokstart, "long", 4) == 0)
2829 if (strncmp (tokstart, "byte", 4) == 0)
2831 if (strncmp (tokstart, "char", 4) == 0)
2833 if (strncmp (tokstart, "true", 4) == 0)
2836 return BOOLEAN_LITERAL;
2840 if (strncmp (tokstart, "int", 3) == 0)
2842 if (strncmp (tokstart, "new", 3) == 0)
2849 yylval.sval.ptr = tokstart;
2850 yylval.sval.length = namelen;
2852 if (*tokstart == '$')
2854 write_dollar_variable (pstate, yylval.sval);
2858 /* Input names that aren't symbols but ARE valid hex numbers,
2859 when the input radix permits them, can be names or numbers
2860 depending on the parse. Note we support radixes > 16 here. */
2861 if (((tokstart[0] >= 'a' && tokstart[0] < 'a' + input_radix - 10) ||
2862 (tokstart[0] >= 'A' && tokstart[0] < 'A' + input_radix - 10)))
2864 YYSTYPE newlval; /* Its value is ignored. */
2865 int hextype = parse_number (pstate, tokstart, namelen, 0, &newlval);
2866 if (hextype == INTEGER_LITERAL)
2873 java_parse (struct parser_state *par_state)
2876 struct cleanup *c = make_cleanup_clear_parser_state (&pstate);
2878 /* Setting up the parser state. */
2879 gdb_assert (par_state != NULL);
2882 result = yyparse ();
2892 lexptr = prev_lexptr;
2895 error (_("%s: near `%s'"), msg, lexptr);
2897 error (_("error in expression, near `%s'"), lexptr);
2900 static struct type *
2901 java_type_from_name (struct stoken name)
2903 char *tmp = copy_name (name);
2904 struct type *typ = java_lookup_class (tmp);
2905 if (typ == NULL || TYPE_CODE (typ) != TYPE_CODE_STRUCT)
2906 error (_("No class named `%s'"), tmp);
2910 /* If NAME is a valid variable name in this scope, push it and return 1.
2911 Otherwise, return 0. */
2914 push_variable (struct parser_state *par_state, struct stoken name)
2916 char *tmp = copy_name (name);
2917 struct field_of_this_result is_a_field_of_this;
2920 sym = lookup_symbol (tmp, expression_context_block, VAR_DOMAIN,
2921 &is_a_field_of_this);
2922 if (sym && SYMBOL_CLASS (sym) != LOC_TYPEDEF)
2924 if (symbol_read_needs_frame (sym))
2926 if (innermost_block == 0 ||
2927 contained_in (block_found, innermost_block))
2928 innermost_block = block_found;
2931 write_exp_elt_opcode (par_state, OP_VAR_VALUE);
2932 /* We want to use the selected frame, not another more inner frame
2933 which happens to be in the same block. */
2934 write_exp_elt_block (par_state, NULL);
2935 write_exp_elt_sym (par_state, sym);
2936 write_exp_elt_opcode (par_state, OP_VAR_VALUE);
2939 if (is_a_field_of_this.type != NULL)
2941 /* it hangs off of `this'. Must not inadvertently convert from a
2942 method call to data ref. */
2943 if (innermost_block == 0 ||
2944 contained_in (block_found, innermost_block))
2945 innermost_block = block_found;
2946 write_exp_elt_opcode (par_state, OP_THIS);
2947 write_exp_elt_opcode (par_state, OP_THIS);
2948 write_exp_elt_opcode (par_state, STRUCTOP_PTR);
2949 write_exp_string (par_state, name);
2950 write_exp_elt_opcode (par_state, STRUCTOP_PTR);
2956 /* Assuming a reference expression has been pushed, emit the
2957 STRUCTOP_PTR ops to access the field named NAME. If NAME is a
2958 qualified name (has '.'), generate a field access for each part. */
2961 push_fieldnames (struct parser_state *par_state, struct stoken name)
2964 struct stoken token;
2965 token.ptr = name.ptr;
2968 if (i == name.length || name.ptr[i] == '.')
2970 /* token.ptr is start of current field name. */
2971 token.length = &name.ptr[i] - token.ptr;
2972 write_exp_elt_opcode (par_state, STRUCTOP_PTR);
2973 write_exp_string (par_state, token);
2974 write_exp_elt_opcode (par_state, STRUCTOP_PTR);
2975 token.ptr += token.length + 1;
2977 if (i >= name.length)
2982 /* Helper routine for push_expression_name.
2983 Handle a qualified name, where DOT_INDEX is the index of the first '.' */
2986 push_qualified_expression_name (struct parser_state *par_state,
2987 struct stoken name, int dot_index)
2989 struct stoken token;
2993 token.ptr = name.ptr;
2994 token.length = dot_index;
2996 if (push_variable (par_state, token))
2998 token.ptr = name.ptr + dot_index + 1;
2999 token.length = name.length - dot_index - 1;
3000 push_fieldnames (par_state, token);
3004 token.ptr = name.ptr;
3007 token.length = dot_index;
3008 tmp = copy_name (token);
3009 typ = java_lookup_class (tmp);
3012 if (dot_index == name.length)
3014 write_exp_elt_opcode (par_state, OP_TYPE);
3015 write_exp_elt_type (par_state, typ);
3016 write_exp_elt_opcode (par_state, OP_TYPE);
3019 dot_index++; /* Skip '.' */
3020 name.ptr += dot_index;
3021 name.length -= dot_index;
3023 while (dot_index < name.length && name.ptr[dot_index] != '.')
3025 token.ptr = name.ptr;
3026 token.length = dot_index;
3027 write_exp_elt_opcode (par_state, OP_SCOPE);
3028 write_exp_elt_type (par_state, typ);
3029 write_exp_string (par_state, token);
3030 write_exp_elt_opcode (par_state, OP_SCOPE);
3031 if (dot_index < name.length)
3034 name.ptr += dot_index;
3035 name.length -= dot_index;
3036 push_fieldnames (par_state, name);
3040 else if (dot_index >= name.length)
3042 dot_index++; /* Skip '.' */
3043 while (dot_index < name.length && name.ptr[dot_index] != '.')
3046 error (_("unknown type `%.*s'"), name.length, name.ptr);
3049 /* Handle Name in an expression (or LHS).
3050 Handle VAR, TYPE, TYPE.FIELD1....FIELDN and VAR.FIELD1....FIELDN. */
3053 push_expression_name (struct parser_state *par_state, struct stoken name)
3059 for (i = 0; i < name.length; i++)
3061 if (name.ptr[i] == '.')
3063 /* It's a Qualified Expression Name. */
3064 push_qualified_expression_name (par_state, name, i);
3069 /* It's a Simple Expression Name. */
3071 if (push_variable (par_state, name))
3073 tmp = copy_name (name);
3074 typ = java_lookup_class (tmp);
3077 write_exp_elt_opcode (par_state, OP_TYPE);
3078 write_exp_elt_type (par_state, typ);
3079 write_exp_elt_opcode (par_state, OP_TYPE);
3083 struct bound_minimal_symbol msymbol;
3085 msymbol = lookup_bound_minimal_symbol (tmp);
3086 if (msymbol.minsym != NULL)
3087 write_exp_msymbol (par_state, msymbol);
3088 else if (!have_full_symbols () && !have_partial_symbols ())
3089 error (_("No symbol table is loaded. Use the \"file\" command"));
3091 error (_("No symbol \"%s\" in current context."), tmp);
3097 /* The following two routines, copy_exp and insert_exp, aren't specific to
3098 Java, so they could go in parse.c, but their only purpose is to support
3099 the parsing kludges we use in this file, so maybe it's best to isolate
3102 /* Copy the expression whose last element is at index ENDPOS - 1 in EXPR
3103 into a freshly xmalloc'ed struct expression. Its language_defn is set
3105 static struct expression *
3106 copy_exp (struct expression *expr, int endpos)
3108 int len = length_of_subexp (expr, endpos);
3109 struct expression *new
3110 = (struct expression *) xmalloc (sizeof (*new) + EXP_ELEM_TO_BYTES (len));
3113 memcpy (new->elts, expr->elts + endpos - len, EXP_ELEM_TO_BYTES (len));
3114 new->language_defn = 0;
3119 /* Insert the expression NEW into the current expression (expout) at POS. */
3121 insert_exp (struct parser_state *par_state, int pos, struct expression *new)
3123 int newlen = new->nelts;
3126 /* Grow expout if necessary. In this function's only use at present,
3127 this should never be necessary. */
3128 increase_expout_size (par_state, newlen);
3130 for (i = par_state->expout_ptr - 1; i >= pos; i--)
3131 par_state->expout->elts[i + newlen] = par_state->expout->elts[i];
3133 memcpy (par_state->expout->elts + pos, new->elts,
3134 EXP_ELEM_TO_BYTES (newlen));
3135 par_state->expout_ptr += newlen;