1 /* A Bison parser, made by GNU Bison 1.875c. */
3 /* Skeleton parser for Yacc-like parsing with Bison,
4 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
21 /* As a special exception, when this file is copied by Bison into a
22 Bison output file, you may use that output file without restriction.
23 This special exception was added by the Free Software Foundation
24 in version 1.24 of Bison. */
26 /* Written by Richard Stallman by simplifying the original so called
27 ``semantic'' parser. */
29 /* All symbols defined below should begin with yy or YY, to avoid
30 infringing on user name space. This should be done even for local
31 variables, as they might otherwise be expanded by user macros.
32 There are some unavoidable exceptions within include files to
33 define necessary library symbols; they are noted "INFRINGES ON
34 USER NAME SPACE" below. */
36 /* Identify Bison output. */
40 #define YYSKELETON_NAME "yacc.c"
45 /* Using locations. */
46 #define YYLSP_NEEDED 0
53 /* Put the tokens into the symbol table, so that GDB and other debuggers
79 VOLATILE_KEYWORD = 281,
106 #define CLASSNAME 265
107 #define NAME_OR_INT 266
114 #define COLONCOLON 273
117 #define SIGNED_KEYWORD 276
120 #define INT_KEYWORD 279
121 #define CONST_KEYWORD 280
122 #define VOLATILE_KEYWORD 281
123 #define DOUBLE_KEYWORD 282
125 #define ASSIGN_MODIFY 284
126 #define ABOVE_COMMA 285
135 #define DECREMENT 294
136 #define INCREMENT 295
139 #define BLOCKNAME 298
144 /* Copy the first part of user declarations. */
145 #line 35 "objc-exp.y"
149 #include "gdb_string.h"
151 #include "expression.h"
153 #include "objc-lang.h" /* For objc language constructs. */
156 #include "parser-defs.h"
157 #include "language.h"
159 #include "bfd.h" /* Required by objfiles.h. */
160 #include "symfile.h" /* Required by objfiles.h. */
161 #include "objfiles.h" /* For have_full_symbols and have_partial_symbols. */
163 #include "completer.h" /* For skip_quoted(). */
166 #define parse_type builtin_type (parse_gdbarch)
168 /* Remap normal yacc parser interface names (yyparse, yylex, yyerror,
169 etc), as well as gratuitiously global symbol names, so we can have
170 multiple yacc generated parsers in gdb. Note that these are only
171 the variables produced by yacc. If other parser generators (bison,
172 byacc, etc) produce additional global names that conflict at link
173 time, then those parser generators need to be fixed instead of
174 adding those names to this list. */
176 #define yymaxdepth objc_maxdepth
177 #define yyparse objc_parse
178 #define yylex objc_lex
179 #define yyerror objc_error
180 #define yylval objc_lval
181 #define yychar objc_char
182 #define yydebug objc_debug
183 #define yypact objc_pact
186 #define yydef objc_def
187 #define yychk objc_chk
188 #define yypgo objc_pgo
189 #define yyact objc_act
190 #define yyexca objc_exca
191 #define yyerrflag objc_errflag
192 #define yynerrs objc_nerrs
196 #define yy_yys objc_yys
197 #define yystate objc_state
198 #define yytmp objc_tmp
200 #define yy_yyv objc_yyv
201 #define yyval objc_val
202 #define yylloc objc_lloc
203 #define yyreds objc_reds /* With YYDEBUG defined */
204 #define yytoks objc_toks /* With YYDEBUG defined */
205 #define yyname objc_name /* With YYDEBUG defined */
206 #define yyrule objc_rule /* With YYDEBUG defined */
207 #define yylhs objc_yylhs
208 #define yylen objc_yylen
209 #define yydefred objc_yydefred
210 #define yydgoto objc_yydgoto
211 #define yysindex objc_yysindex
212 #define yyrindex objc_yyrindex
213 #define yygindex objc_yygindex
214 #define yytable objc_yytable
215 #define yycheck objc_yycheck
218 #define YYDEBUG 0 /* Default to no yydebug support. */
232 /* Enabling traces. */
237 /* Enabling verbose error messages. */
238 #ifdef YYERROR_VERBOSE
239 # undef YYERROR_VERBOSE
240 # define YYERROR_VERBOSE 1
242 # define YYERROR_VERBOSE 0
245 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
246 #line 126 "objc-exp.y"
247 typedef union YYSTYPE {
261 struct symtoken ssym;
264 enum exp_opcode opcode;
265 struct internalvar *ivar;
266 struct objc_class_str class;
271 /* Line 191 of yacc.c. */
272 #line 273 "objc-exp.c.tmp"
273 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
274 # define YYSTYPE_IS_DECLARED 1
275 # define YYSTYPE_IS_TRIVIAL 1
280 /* Copy the second part of user declarations. */
281 #line 151 "objc-exp.y"
283 /* YYSTYPE gets defined by %union. */
285 parse_number (char *, int, int, YYSTYPE *);
288 /* Line 214 of yacc.c. */
289 #line 290 "objc-exp.c.tmp"
291 #if ! defined (yyoverflow) || YYERROR_VERBOSE
294 # define YYFREE xfree
297 # define YYMALLOC xmalloc
300 /* The parser invokes alloca or xmalloc; define the necessary symbols. */
302 # ifdef YYSTACK_USE_ALLOCA
303 # if YYSTACK_USE_ALLOCA
304 # define YYSTACK_ALLOC alloca
307 # if defined (alloca) || defined (_ALLOCA_H)
308 # define YYSTACK_ALLOC alloca
311 # define YYSTACK_ALLOC __builtin_alloca
316 # ifdef YYSTACK_ALLOC
317 /* Pacify GCC's `empty if-body' warning. */
318 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
320 # if defined (__STDC__) || defined (__cplusplus)
321 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
322 # define YYSIZE_T size_t
324 # define YYSTACK_ALLOC YYMALLOC
325 # define YYSTACK_FREE YYFREE
327 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
330 #if (! defined (yyoverflow) \
331 && (! defined (__cplusplus) \
332 || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
334 /* A type that is properly aligned for any stack member. */
341 /* The size of the maximum gap between one aligned stack and the next. */
342 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
344 /* The size of an array large to enough to hold all stacks, each with
346 # define YYSTACK_BYTES(N) \
347 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
348 + YYSTACK_GAP_MAXIMUM)
350 /* Copy COUNT objects from FROM to TO. The source and destination do
353 # if defined (__GNUC__) && 1 < __GNUC__
354 # define YYCOPY(To, From, Count) \
355 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
357 # define YYCOPY(To, From, Count) \
360 register YYSIZE_T yyi; \
361 for (yyi = 0; yyi < (Count); yyi++) \
362 (To)[yyi] = (From)[yyi]; \
368 /* Relocate STACK from its old location to the new one. The
369 local variables YYSIZE and YYSTACKSIZE give the old and new number of
370 elements in the stack, and YYPTR gives the new location of the
371 stack. Advance YYPTR to a properly aligned location for the next
373 # define YYSTACK_RELOCATE(Stack) \
376 YYSIZE_T yynewbytes; \
377 YYCOPY (&yyptr->Stack, Stack, yysize); \
378 Stack = &yyptr->Stack; \
379 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
380 yyptr += yynewbytes / sizeof (*yyptr); \
386 #if defined (__STDC__) || defined (__cplusplus)
387 typedef signed char yysigned_char;
389 typedef short yysigned_char;
392 /* YYFINAL -- State number of the termination state. */
394 /* YYLAST -- Last index in YYTABLE. */
397 /* YYNTOKENS -- Number of terminals. */
399 /* YYNNTS -- Number of nonterminals. */
401 /* YYNRULES -- Number of rules. */
403 /* YYNRULES -- Number of states. */
404 #define YYNSTATES 236
406 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
408 #define YYMAXUTOK 298
410 #define YYTRANSLATE(YYX) \
411 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
413 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
414 static const unsigned char yytranslate[] =
416 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
417 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
418 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
419 2, 2, 2, 61, 2, 2, 2, 52, 38, 2,
420 58, 65, 50, 48, 30, 49, 56, 51, 2, 2,
421 2, 2, 2, 2, 2, 2, 2, 2, 64, 2,
422 41, 32, 42, 33, 47, 2, 2, 2, 2, 2,
423 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
424 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
425 2, 57, 2, 63, 37, 2, 2, 2, 2, 2,
426 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
427 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
428 2, 2, 2, 66, 36, 67, 62, 2, 2, 2,
429 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
430 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
431 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
432 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
433 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
434 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
435 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
436 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
437 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
438 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
439 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
440 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
441 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
442 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
443 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
444 25, 26, 27, 28, 29, 31, 34, 35, 39, 40,
445 43, 44, 45, 46, 53, 54, 55, 59, 60
449 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
451 static const unsigned short yyprhs[] =
453 0, 0, 3, 5, 7, 9, 11, 15, 18, 21,
454 24, 27, 30, 33, 36, 39, 42, 45, 49, 53,
455 58, 62, 66, 71, 76, 77, 83, 84, 90, 91,
456 97, 99, 101, 103, 106, 110, 113, 116, 117, 123,
457 125, 126, 128, 132, 134, 138, 143, 148, 152, 156,
458 160, 164, 168, 172, 176, 180, 184, 188, 192, 196,
459 200, 204, 208, 212, 216, 220, 224, 228, 234, 238,
460 242, 244, 246, 248, 250, 252, 254, 259, 261, 263,
461 265, 269, 273, 277, 282, 284, 287, 289, 291, 294,
462 297, 300, 304, 308, 310, 313, 315, 318, 320, 324,
463 327, 329, 332, 334, 337, 341, 344, 348, 350, 352,
464 354, 356, 358, 360, 363, 367, 370, 374, 378, 383,
465 386, 390, 392, 395, 398, 401, 404, 407, 410, 412,
466 415, 417, 423, 426, 429, 431, 433, 435, 437, 439,
467 443, 445, 447, 449, 451, 453, 455
470 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
471 static const yysigned_char yyrhs[] =
473 69, 0, -1, 71, -1, 70, -1, 91, -1, 72,
474 -1, 71, 30, 72, -1, 50, 72, -1, 38, 72,
475 -1, 49, 72, -1, 61, 72, -1, 62, 72, -1,
476 54, 72, -1, 53, 72, -1, 72, 54, -1, 72,
477 53, -1, 16, 72, -1, 72, 59, 95, -1, 72,
478 59, 85, -1, 72, 59, 50, 72, -1, 72, 56,
479 95, -1, 72, 56, 85, -1, 72, 56, 50, 72,
480 -1, 72, 57, 71, 63, -1, -1, 57, 9, 73,
481 76, 63, -1, -1, 57, 10, 74, 76, 63, -1,
482 -1, 57, 72, 75, 76, 63, -1, 95, -1, 77,
483 -1, 78, -1, 77, 78, -1, 95, 64, 72, -1,
484 64, 72, -1, 30, 72, -1, -1, 72, 58, 79,
485 81, 65, -1, 66, -1, -1, 72, -1, 81, 30,
486 72, -1, 67, -1, 80, 81, 82, -1, 80, 91,
487 82, 72, -1, 58, 91, 65, 72, -1, 58, 71,
488 65, -1, 72, 47, 72, -1, 72, 50, 72, -1,
489 72, 51, 72, -1, 72, 52, 72, -1, 72, 48,
490 72, -1, 72, 49, 72, -1, 72, 46, 72, -1,
491 72, 45, 72, -1, 72, 40, 72, -1, 72, 39,
492 72, -1, 72, 44, 72, -1, 72, 43, 72, -1,
493 72, 41, 72, -1, 72, 42, 72, -1, 72, 38,
494 72, -1, 72, 37, 72, -1, 72, 36, 72, -1,
495 72, 35, 72, -1, 72, 34, 72, -1, 72, 33,
496 72, 64, 72, -1, 72, 32, 72, -1, 72, 29,
497 72, -1, 3, -1, 11, -1, 4, -1, 84, -1,
498 28, -1, 7, -1, 16, 58, 91, 65, -1, 5,
499 -1, 6, -1, 60, -1, 83, 18, 95, -1, 83,
500 18, 95, -1, 92, 18, 95, -1, 92, 18, 62,
501 95, -1, 85, -1, 18, 95, -1, 96, -1, 92,
502 -1, 92, 25, -1, 92, 26, -1, 92, 87, -1,
503 92, 25, 87, -1, 92, 26, 87, -1, 50, -1,
504 50, 87, -1, 38, -1, 38, 87, -1, 88, -1,
505 58, 87, 65, -1, 88, 89, -1, 89, -1, 88,
506 90, -1, 90, -1, 57, 63, -1, 57, 3, 63,
507 -1, 58, 65, -1, 58, 94, 65, -1, 86, -1,
508 9, -1, 10, -1, 24, -1, 22, -1, 23, -1,
509 22, 24, -1, 17, 22, 24, -1, 22, 22, -1,
510 22, 22, 24, -1, 17, 22, 22, -1, 17, 22,
511 22, 24, -1, 23, 24, -1, 17, 23, 24, -1,
512 27, -1, 22, 27, -1, 12, 95, -1, 13, 95,
513 -1, 14, 95, -1, 15, 95, -1, 17, 93, -1,
514 17, -1, 21, 93, -1, 21, -1, 19, 95, 41,
515 91, 42, -1, 25, 92, -1, 26, 92, -1, 9,
516 -1, 24, -1, 22, -1, 23, -1, 91, -1, 94,
517 30, 91, -1, 8, -1, 60, -1, 9, -1, 10,
518 -1, 11, -1, 8, -1, 60, -1
521 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
522 static const unsigned short yyrline[] =
524 0, 231, 231, 232, 235, 242, 243, 248, 252, 256,
525 260, 264, 268, 272, 276, 280, 284, 288, 294, 301,
526 305, 312, 320, 324, 333, 332, 355, 354, 370, 369,
527 378, 380, 383, 384, 387, 389, 391, 398, 395, 405,
528 409, 412, 416, 420, 423, 430, 436, 442, 448, 452,
529 456, 460, 464, 468, 472, 476, 480, 484, 488, 492,
530 496, 500, 504, 508, 512, 516, 520, 524, 528, 532,
531 538, 545, 556, 563, 566, 570, 577, 585, 610, 618,
532 635, 645, 660, 673, 698, 699, 727, 782, 788, 789,
533 790, 792, 794, 798, 800, 802, 804, 806, 809, 811,
534 816, 823, 825, 829, 831, 835, 837, 849, 853, 855,
535 863, 865, 867, 869, 871, 873, 875, 877, 879, 881,
536 883, 885, 887, 889, 892, 895, 898, 901, 905, 907,
537 911, 913, 920, 921, 924, 925, 931, 937, 946, 951,
538 958, 959, 960, 961, 962, 965, 966
542 #if YYDEBUG || YYERROR_VERBOSE
543 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
544 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
545 static const char *const yytname[] =
547 "$end", "error", "$undefined", "INT", "FLOAT", "STRING", "NSSTRING",
548 "SELECTOR", "NAME", "TYPENAME", "CLASSNAME", "NAME_OR_INT", "STRUCT",
549 "CLASS", "UNION", "ENUM", "SIZEOF", "UNSIGNED", "COLONCOLON", "TEMPLATE",
550 "ERROR", "SIGNED_KEYWORD", "LONG", "SHORT", "INT_KEYWORD",
551 "CONST_KEYWORD", "VOLATILE_KEYWORD", "DOUBLE_KEYWORD", "VARIABLE",
552 "ASSIGN_MODIFY", "','", "ABOVE_COMMA", "'='", "'?'", "OROR", "ANDAND",
553 "'|'", "'^'", "'&'", "NOTEQUAL", "EQUAL", "'<'", "'>'", "GEQ", "LEQ",
554 "RSH", "LSH", "'@'", "'+'", "'-'", "'*'", "'/'", "'%'", "DECREMENT",
555 "INCREMENT", "UNARY", "'.'", "'['", "'('", "ARROW", "BLOCKNAME", "'!'",
556 "'~'", "']'", "':'", "')'", "'{'", "'}'", "$accept", "start", "type_exp",
557 "exp1", "exp", "@1", "@2", "@3", "msglist", "msgarglist", "msgarg", "@4",
558 "lcurly", "arglist", "rcurly", "block", "variable", "qualified_name",
559 "ptype", "abs_decl", "direct_abs_decl", "array_mod", "func_mod", "type",
560 "typebase", "typename", "nonempty_typelist", "name", "name_not_typename", 0
565 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
567 static const unsigned short yytoknum[] =
569 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
570 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
571 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
572 44, 285, 61, 63, 286, 287, 124, 94, 38, 288,
573 289, 60, 62, 290, 291, 292, 293, 64, 43, 45,
574 42, 47, 37, 294, 295, 296, 46, 91, 40, 297,
575 298, 33, 126, 93, 58, 41, 123, 125
579 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
580 static const unsigned char yyr1[] =
582 0, 68, 69, 69, 70, 71, 71, 72, 72, 72,
583 72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
584 72, 72, 72, 72, 73, 72, 74, 72, 75, 72,
585 76, 76, 77, 77, 78, 78, 78, 79, 72, 80,
586 81, 81, 81, 82, 72, 72, 72, 72, 72, 72,
587 72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
588 72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
589 72, 72, 72, 72, 72, 72, 72, 72, 72, 83,
590 83, 84, 85, 85, 84, 84, 84, 86, 86, 86,
591 86, 86, 86, 87, 87, 87, 87, 87, 88, 88,
592 88, 88, 88, 89, 89, 90, 90, 91, 92, 92,
593 92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
594 92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
595 92, 92, 92, 92, 93, 93, 93, 93, 94, 94,
596 95, 95, 95, 95, 95, 96, 96
599 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
600 static const unsigned char yyr2[] =
602 0, 2, 1, 1, 1, 1, 3, 2, 2, 2,
603 2, 2, 2, 2, 2, 2, 2, 3, 3, 4,
604 3, 3, 4, 4, 0, 5, 0, 5, 0, 5,
605 1, 1, 1, 2, 3, 2, 2, 0, 5, 1,
606 0, 1, 3, 1, 3, 4, 4, 3, 3, 3,
607 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
608 3, 3, 3, 3, 3, 3, 3, 5, 3, 3,
609 1, 1, 1, 1, 1, 1, 4, 1, 1, 1,
610 3, 3, 3, 4, 1, 2, 1, 1, 2, 2,
611 2, 3, 3, 1, 2, 1, 2, 1, 3, 2,
612 1, 2, 1, 2, 3, 2, 3, 1, 1, 1,
613 1, 1, 1, 2, 3, 2, 3, 3, 4, 2,
614 3, 1, 2, 2, 2, 2, 2, 2, 1, 2,
615 1, 5, 2, 2, 1, 1, 1, 1, 1, 3,
619 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
620 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
621 means the default is an error. */
622 static const unsigned char yydefact[] =
624 0, 70, 72, 77, 78, 75, 145, 108, 109, 71,
625 0, 0, 0, 0, 0, 128, 0, 0, 130, 111,
626 112, 110, 0, 0, 121, 74, 0, 0, 0, 0,
627 0, 0, 0, 146, 0, 0, 39, 0, 3, 2,
628 5, 40, 0, 73, 84, 107, 4, 87, 86, 140,
629 142, 143, 144, 141, 123, 124, 125, 126, 0, 16,
630 0, 134, 136, 137, 135, 127, 85, 0, 136, 137,
631 129, 115, 113, 122, 119, 132, 133, 8, 9, 7,
632 13, 12, 24, 26, 28, 0, 0, 10, 11, 1,
633 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
634 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
635 0, 0, 0, 15, 14, 0, 0, 37, 0, 41,
636 0, 0, 0, 0, 88, 89, 95, 93, 0, 0,
637 90, 97, 100, 102, 0, 117, 114, 120, 0, 116,
638 0, 0, 0, 47, 0, 6, 69, 68, 0, 66,
639 65, 64, 63, 62, 57, 56, 60, 61, 59, 58,
640 55, 54, 48, 52, 53, 49, 50, 51, 142, 143,
641 0, 21, 20, 0, 40, 0, 18, 17, 0, 43,
642 44, 0, 81, 0, 82, 91, 92, 96, 94, 0,
643 103, 105, 0, 138, 87, 0, 0, 99, 101, 76,
644 118, 0, 0, 0, 0, 31, 32, 30, 0, 0,
645 46, 0, 22, 23, 0, 19, 42, 45, 83, 104,
646 98, 0, 106, 131, 36, 35, 25, 33, 0, 0,
647 27, 29, 67, 38, 139, 34
650 /* YYDEFGOTO[NTERM-NUM]. */
651 static const short yydefgoto[] =
653 -1, 37, 38, 85, 40, 140, 141, 142, 204, 205,
654 206, 174, 41, 120, 180, 42, 43, 44, 45, 130,
655 131, 132, 133, 193, 60, 65, 195, 207, 48
658 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
660 #define YYPACT_NINF -86
661 static const short yypact[] =
663 220, -86, -86, -86, -86, -86, -86, -86, -86, -86,
664 19, 19, 19, 19, 284, 28, 19, 19, 118, 16,
665 -9, -86, 240, 240, -86, -86, 220, 220, 220, 220,
666 220, 348, 220, 8, 220, 220, -86, 44, -86, 23,
667 573, 220, 91, -86, -86, -86, -86, 119, -86, -86,
668 -86, -86, -86, -86, -86, -86, -86, -86, 220, 129,
669 93, -86, 47, 88, -86, -86, -86, 73, -86, -86,
670 -86, 100, -86, -86, -86, -86, -86, 129, 129, 129,
671 129, 129, 97, 108, 573, -20, 63, 129, 129, -86,
672 220, 220, 220, 220, 220, 220, 220, 220, 220, 220,
673 220, 220, 220, 220, 220, 220, 220, 220, 220, 220,
674 220, 220, 220, -86, -86, 491, 220, -86, 511, 573,
675 -21, 69, 19, 112, -3, -3, -3, -3, -1, 433,
676 -86, 50, -86, -86, 78, 122, -86, -86, 240, -86,
677 95, 95, 95, -86, 220, 573, 573, 573, 540, 625,
678 649, 672, 694, 715, 734, 734, 157, 157, 157, 157,
679 267, 267, 331, 496, 496, 129, 129, 129, 97, 108,
680 220, -86, -86, 4, 220, 220, -86, -86, 220, -86,
681 -86, 220, 132, 19, -86, -86, -86, -86, -86, 84,
682 -86, -86, 86, -86, 123, -17, 51, -86, -86, 412,
683 -86, 110, 220, 220, 90, 95, -86, 92, 99, 103,
684 129, 220, 129, -86, -16, 129, 573, 129, -86, -86,
685 -86, 240, -86, -86, 573, 573, -86, -86, 92, 220,
686 -86, -86, 600, -86, -86, 573
689 /* YYPGOTO[NTERM-NUM]. */
690 static const short yypgoto[] =
692 -86, -86, -86, 3, -10, -86, -86, -86, -85, -86,
693 -51, -86, -86, -11, 37, -86, -86, -79, -86, 6,
694 -86, 36, 39, 1, 0, 161, -86, -5, -86
697 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
698 positive, shift that token. If negative, reduce the rule which
699 number is the opposite. If zero, do what YYDEFACT says.
700 If YYTABLE_NINF, syntax error. */
701 #define YYTABLE_NINF -110
702 static const short yytable[] =
704 47, 46, 189, 39, 59, 54, 55, 56, 57, 178,
705 90, 66, 67, 221, 178, 74, 77, 78, 79, 80,
706 81, 84, 75, 76, 87, 88, -79, 49, 50, 51,
707 52, 119, 47, 86, 90, 126, 171, 61, 71, 176,
708 72, 47, 121, 73, 89, 143, 179, 127, 222, 233,
709 62, 63, 64, 90, 128, 129, 208, 209, 47, 134,
710 7, 8, 190, 10, 11, 12, 13, 213, 15, 135,
711 17, 136, 18, 19, 20, 21, 22, 23, 24, 53,
712 145, 146, 147, 148, 149, 150, 151, 152, 153, 154,
713 155, 156, 157, 158, 159, 160, 161, 162, 163, 164,
714 165, 166, 167, 49, 50, 51, 52, 128, 196, 122,
715 172, 123, 137, 177, 138, -108, 191, 182, 184, 173,
716 49, 50, 51, 52, 139, 202, -109, 61, 144, 194,
717 185, 186, 187, 188, 210, 192, 179, 123, 194, 201,
718 68, 69, 64, 199, 124, 125, 200, 219, 124, 125,
719 -80, 220, 223, 226, 227, 53, 229, 126, 181, 203,
720 212, 126, 230, 214, 119, 215, 231, 197, 216, 127,
721 198, 217, 53, 127, 183, 0, 128, 129, 218, 70,
722 128, 129, 113, 114, 0, 115, 116, 117, 118, 210,
723 0, 0, 224, 225, 0, 0, 194, 0, 0, 0,
724 228, 232, 105, 106, 107, 108, 109, 110, 111, 112,
725 113, 114, 0, 115, 116, 117, 118, 0, 0, 235,
726 0, 194, 234, 1, 2, 3, 4, 5, 6, 7,
727 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
728 0, 18, 19, 20, 21, 22, 23, 24, 25, 7,
729 8, 0, 10, 11, 12, 13, 0, 15, 26, 17,
730 0, 18, 19, 20, 21, 22, 23, 24, 0, 27,
731 28, 0, 0, 29, 30, 0, 0, 31, 32, 0,
732 33, 34, 35, 0, 0, 0, 36, 1, 2, 3,
733 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
734 14, 15, 16, 17, 0, 18, 19, 20, 21, 22,
735 23, 24, 25, 0, 107, 108, 109, 110, 111, 112,
736 113, 114, 26, 115, 116, 117, 118, 0, 0, 0,
737 0, 0, 0, 27, 28, 0, 0, 29, 30, 0,
738 0, 31, 58, 0, 33, 34, 35, 0, 0, 0,
739 36, 1, 2, 3, 4, 5, 6, 82, 83, 9,
740 10, 11, 12, 13, 14, 15, 16, 17, 0, 18,
741 19, 20, 21, 22, 23, 24, 25, 0, 0, 108,
742 109, 110, 111, 112, 113, 114, 26, 115, 116, 117,
743 118, 0, 0, 0, 0, 0, 0, 27, 28, 0,
744 0, 29, 30, 0, 0, 31, 32, 0, 33, 34,
745 35, 0, 0, 0, 36, 1, 2, 3, 4, 5,
746 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
747 16, 17, 0, 18, 19, 20, 21, 22, 23, 24,
748 25, 0, 7, 8, 0, 10, 11, 12, 13, 0,
749 15, 0, 17, 0, 18, 19, 20, 21, 22, 23,
750 24, 0, 0, 0, 0, 29, 30, 0, 0, 31,
751 32, 126, 33, 34, 35, 0, 0, 0, 36, 0,
752 0, 0, 0, 127, 0, 0, 0, 0, 0, 0,
753 128, 129, 0, 0, 0, 0, 0, 0, 191, 49,
754 168, 169, 52, 10, 11, 12, 13, 0, 15, 0,
755 17, 0, 18, 19, 20, 21, 22, 23, 24, 49,
756 168, 169, 52, 10, 11, 12, 13, 0, 15, 0,
757 17, 0, 18, 19, 20, 21, 22, 23, 24, 0,
758 0, 170, 0, 0, 0, 0, 110, 111, 112, 113,
759 114, 53, 115, 116, 117, 118, 0, 0, 0, 0,
760 0, 175, 0, 0, 0, 0, 0, 0, 0, 91,
761 0, 53, 92, 93, 94, 95, 96, 97, 98, 99,
762 100, 101, 102, 103, 104, 105, 106, 107, 108, 109,
763 110, 111, 112, 113, 114, 0, 115, 116, 117, 118,
764 0, 0, 91, 0, 211, 92, 93, 94, 95, 96,
765 97, 98, 99, 100, 101, 102, 103, 104, 105, 106,
766 107, 108, 109, 110, 111, 112, 113, 114, 0, 115,
767 116, 117, 118, 93, 94, 95, 96, 97, 98, 99,
768 100, 101, 102, 103, 104, 105, 106, 107, 108, 109,
769 110, 111, 112, 113, 114, 0, 115, 116, 117, 118,
770 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
771 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
772 0, 115, 116, 117, 118, 96, 97, 98, 99, 100,
773 101, 102, 103, 104, 105, 106, 107, 108, 109, 110,
774 111, 112, 113, 114, 0, 115, 116, 117, 118, 97,
775 98, 99, 100, 101, 102, 103, 104, 105, 106, 107,
776 108, 109, 110, 111, 112, 113, 114, 0, 115, 116,
777 117, 118, 98, 99, 100, 101, 102, 103, 104, 105,
778 106, 107, 108, 109, 110, 111, 112, 113, 114, 0,
779 115, 116, 117, 118, 99, 100, 101, 102, 103, 104,
780 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
781 0, 115, 116, 117, 118, 101, 102, 103, 104, 105,
782 106, 107, 108, 109, 110, 111, 112, 113, 114, 0,
786 static const short yycheck[] =
788 0, 0, 3, 0, 14, 10, 11, 12, 13, 30,
789 30, 16, 17, 30, 30, 24, 26, 27, 28, 29,
790 30, 31, 22, 23, 34, 35, 18, 8, 9, 10,
791 11, 41, 32, 32, 30, 38, 115, 9, 22, 118,
792 24, 41, 41, 27, 0, 65, 67, 50, 65, 65,
793 22, 23, 24, 30, 57, 58, 141, 142, 58, 58,
794 9, 10, 63, 12, 13, 14, 15, 63, 17, 22,
795 19, 24, 21, 22, 23, 24, 25, 26, 27, 60,
796 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,
797 100, 101, 102, 103, 104, 105, 106, 107, 108, 109,
798 110, 111, 112, 8, 9, 10, 11, 57, 58, 18,
799 115, 18, 24, 118, 41, 18, 65, 122, 123, 116,
800 8, 9, 10, 11, 24, 30, 18, 9, 65, 129,
801 124, 125, 126, 127, 144, 129, 67, 18, 138, 138,
802 22, 23, 24, 65, 25, 26, 24, 63, 25, 26,
803 18, 65, 42, 63, 205, 60, 64, 38, 121, 64,
804 170, 38, 63, 174, 174, 175, 63, 131, 178, 50,
805 131, 181, 60, 50, 62, -1, 57, 58, 183, 18,
806 57, 58, 53, 54, -1, 56, 57, 58, 59, 199,
807 -1, -1, 202, 203, -1, -1, 196, -1, -1, -1,
808 205, 211, 45, 46, 47, 48, 49, 50, 51, 52,
809 53, 54, -1, 56, 57, 58, 59, -1, -1, 229,
810 -1, 221, 221, 3, 4, 5, 6, 7, 8, 9,
811 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
812 -1, 21, 22, 23, 24, 25, 26, 27, 28, 9,
813 10, -1, 12, 13, 14, 15, -1, 17, 38, 19,
814 -1, 21, 22, 23, 24, 25, 26, 27, -1, 49,
815 50, -1, -1, 53, 54, -1, -1, 57, 58, -1,
816 60, 61, 62, -1, -1, -1, 66, 3, 4, 5,
817 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
818 16, 17, 18, 19, -1, 21, 22, 23, 24, 25,
819 26, 27, 28, -1, 47, 48, 49, 50, 51, 52,
820 53, 54, 38, 56, 57, 58, 59, -1, -1, -1,
821 -1, -1, -1, 49, 50, -1, -1, 53, 54, -1,
822 -1, 57, 58, -1, 60, 61, 62, -1, -1, -1,
823 66, 3, 4, 5, 6, 7, 8, 9, 10, 11,
824 12, 13, 14, 15, 16, 17, 18, 19, -1, 21,
825 22, 23, 24, 25, 26, 27, 28, -1, -1, 48,
826 49, 50, 51, 52, 53, 54, 38, 56, 57, 58,
827 59, -1, -1, -1, -1, -1, -1, 49, 50, -1,
828 -1, 53, 54, -1, -1, 57, 58, -1, 60, 61,
829 62, -1, -1, -1, 66, 3, 4, 5, 6, 7,
830 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
831 18, 19, -1, 21, 22, 23, 24, 25, 26, 27,
832 28, -1, 9, 10, -1, 12, 13, 14, 15, -1,
833 17, -1, 19, -1, 21, 22, 23, 24, 25, 26,
834 27, -1, -1, -1, -1, 53, 54, -1, -1, 57,
835 58, 38, 60, 61, 62, -1, -1, -1, 66, -1,
836 -1, -1, -1, 50, -1, -1, -1, -1, -1, -1,
837 57, 58, -1, -1, -1, -1, -1, -1, 65, 8,
838 9, 10, 11, 12, 13, 14, 15, -1, 17, -1,
839 19, -1, 21, 22, 23, 24, 25, 26, 27, 8,
840 9, 10, 11, 12, 13, 14, 15, -1, 17, -1,
841 19, -1, 21, 22, 23, 24, 25, 26, 27, -1,
842 -1, 50, -1, -1, -1, -1, 50, 51, 52, 53,
843 54, 60, 56, 57, 58, 59, -1, -1, -1, -1,
844 -1, 50, -1, -1, -1, -1, -1, -1, -1, 29,
845 -1, 60, 32, 33, 34, 35, 36, 37, 38, 39,
846 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
847 50, 51, 52, 53, 54, -1, 56, 57, 58, 59,
848 -1, -1, 29, -1, 64, 32, 33, 34, 35, 36,
849 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
850 47, 48, 49, 50, 51, 52, 53, 54, -1, 56,
851 57, 58, 59, 33, 34, 35, 36, 37, 38, 39,
852 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
853 50, 51, 52, 53, 54, -1, 56, 57, 58, 59,
854 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
855 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
856 -1, 56, 57, 58, 59, 36, 37, 38, 39, 40,
857 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
858 51, 52, 53, 54, -1, 56, 57, 58, 59, 37,
859 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
860 48, 49, 50, 51, 52, 53, 54, -1, 56, 57,
861 58, 59, 38, 39, 40, 41, 42, 43, 44, 45,
862 46, 47, 48, 49, 50, 51, 52, 53, 54, -1,
863 56, 57, 58, 59, 39, 40, 41, 42, 43, 44,
864 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
865 -1, 56, 57, 58, 59, 41, 42, 43, 44, 45,
866 46, 47, 48, 49, 50, 51, 52, 53, 54, -1,
870 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
871 symbol of state STATE-NUM. */
872 static const unsigned char yystos[] =
874 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
875 12, 13, 14, 15, 16, 17, 18, 19, 21, 22,
876 23, 24, 25, 26, 27, 28, 38, 49, 50, 53,
877 54, 57, 58, 60, 61, 62, 66, 69, 70, 71,
878 72, 80, 83, 84, 85, 86, 91, 92, 96, 8,
879 9, 10, 11, 60, 95, 95, 95, 95, 58, 72,
880 92, 9, 22, 23, 24, 93, 95, 95, 22, 23,
881 93, 22, 24, 27, 24, 92, 92, 72, 72, 72,
882 72, 72, 9, 10, 72, 71, 91, 72, 72, 0,
883 30, 29, 32, 33, 34, 35, 36, 37, 38, 39,
884 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
885 50, 51, 52, 53, 54, 56, 57, 58, 59, 72,
886 81, 91, 18, 18, 25, 26, 38, 50, 57, 58,
887 87, 88, 89, 90, 91, 22, 24, 24, 41, 24,
888 73, 74, 75, 65, 65, 72, 72, 72, 72, 72,
889 72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
890 72, 72, 72, 72, 72, 72, 72, 72, 9, 10,
891 50, 85, 95, 71, 79, 50, 85, 95, 30, 67,
892 82, 82, 95, 62, 95, 87, 87, 87, 87, 3,
893 63, 65, 87, 91, 92, 94, 58, 89, 90, 65,
894 24, 91, 30, 64, 76, 77, 78, 95, 76, 76,
895 72, 64, 72, 63, 81, 72, 72, 72, 95, 63,
896 65, 30, 65, 42, 72, 72, 63, 78, 95, 64,
897 63, 63, 72, 65, 91, 72
900 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
901 # define YYSIZE_T __SIZE_TYPE__
903 #if ! defined (YYSIZE_T) && defined (size_t)
904 # define YYSIZE_T size_t
906 #if ! defined (YYSIZE_T)
907 # if defined (__STDC__) || defined (__cplusplus)
908 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
909 # define YYSIZE_T size_t
912 #if ! defined (YYSIZE_T)
913 # define YYSIZE_T unsigned int
916 #define yyerrok (yyerrstatus = 0)
917 #define yyclearin (yychar = YYEMPTY)
921 #define YYACCEPT goto yyacceptlab
922 #define YYABORT goto yyabortlab
923 #define YYERROR goto yyerrorlab
926 /* Like YYERROR except do call yyerror. This remains here temporarily
927 to ease the transition to the new meaning of YYERROR, for GCC.
928 Once GCC version 2 has supplanted version 1, this can go. */
930 #define YYFAIL goto yyerrlab
932 #define YYRECOVERING() (!!yyerrstatus)
934 #define YYBACKUP(Token, Value) \
936 if (yychar == YYEMPTY && yylen == 1) \
940 yytoken = YYTRANSLATE (yychar); \
946 yyerror ("syntax error: cannot back up");\
952 #define YYERRCODE 256
954 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
957 #ifndef YYLLOC_DEFAULT
958 # define YYLLOC_DEFAULT(Current, Rhs, N) \
959 ((Current).first_line = (Rhs)[1].first_line, \
960 (Current).first_column = (Rhs)[1].first_column, \
961 (Current).last_line = (Rhs)[N].last_line, \
962 (Current).last_column = (Rhs)[N].last_column)
965 /* YYLEX -- calling `yylex' with the right arguments. */
968 # define YYLEX yylex (YYLEX_PARAM)
970 # define YYLEX yylex ()
973 /* Enable debugging if requested. */
977 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
978 # define YYFPRINTF fprintf
981 # define YYDPRINTF(Args) \
987 # define YYDSYMPRINT(Args) \
993 # define YYDSYMPRINTF(Title, Token, Value, Location) \
997 YYFPRINTF (stderr, "%s ", Title); \
998 yysymprint (stderr, \
1000 YYFPRINTF (stderr, "\n"); \
1004 /*------------------------------------------------------------------.
1005 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1007 `------------------------------------------------------------------*/
1009 #if defined (__STDC__) || defined (__cplusplus)
1011 yy_stack_print (short *bottom, short *top)
1014 yy_stack_print (bottom, top)
1019 YYFPRINTF (stderr, "Stack now");
1020 for (/* Nothing. */; bottom <= top; ++bottom)
1021 YYFPRINTF (stderr, " %d", *bottom);
1022 YYFPRINTF (stderr, "\n");
1025 # define YY_STACK_PRINT(Bottom, Top) \
1028 yy_stack_print ((Bottom), (Top)); \
1032 /*------------------------------------------------.
1033 | Report that the YYRULE is going to be reduced. |
1034 `------------------------------------------------*/
1036 #if defined (__STDC__) || defined (__cplusplus)
1038 yy_reduce_print (int yyrule)
1041 yy_reduce_print (yyrule)
1046 unsigned int yylno = yyrline[yyrule];
1047 YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
1049 /* Print the symbols being reduced, and their result. */
1050 for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
1051 YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
1052 YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
1055 # define YY_REDUCE_PRINT(Rule) \
1058 yy_reduce_print (Rule); \
1061 /* Nonzero means print parse trace. It is left uninitialized so that
1062 multiple parsers can coexist. */
1064 #else /* !YYDEBUG */
1065 # define YYDPRINTF(Args)
1066 # define YYDSYMPRINT(Args)
1067 # define YYDSYMPRINTF(Title, Token, Value, Location)
1068 # define YY_STACK_PRINT(Bottom, Top)
1069 # define YY_REDUCE_PRINT(Rule)
1070 #endif /* !YYDEBUG */
1073 /* YYINITDEPTH -- initial size of the parser's stacks. */
1075 # define YYINITDEPTH 200
1078 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1079 if the built-in stack extension method is used).
1081 Do not make this value too large; the results are undefined if
1082 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
1083 evaluated with infinite-precision integer arithmetic. */
1085 #if defined (YYMAXDEPTH) && YYMAXDEPTH == 0
1090 # define YYMAXDEPTH 10000
1098 # if defined (__GLIBC__) && defined (_STRING_H)
1099 # define yystrlen strlen
1101 /* Return the length of YYSTR. */
1103 # if defined (__STDC__) || defined (__cplusplus)
1104 yystrlen (const char *yystr)
1110 register const char *yys = yystr;
1112 while (*yys++ != '\0')
1115 return yys - yystr - 1;
1121 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
1122 # define yystpcpy stpcpy
1124 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1127 # if defined (__STDC__) || defined (__cplusplus)
1128 yystpcpy (char *yydest, const char *yysrc)
1130 yystpcpy (yydest, yysrc)
1135 register char *yyd = yydest;
1136 register const char *yys = yysrc;
1138 while ((*yyd++ = *yys++) != '\0')
1146 #endif /* !YYERROR_VERBOSE */
1151 /*--------------------------------.
1152 | Print this symbol on YYOUTPUT. |
1153 `--------------------------------*/
1155 #if defined (__STDC__) || defined (__cplusplus)
1157 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
1160 yysymprint (yyoutput, yytype, yyvaluep)
1166 /* Pacify ``unused variable'' warnings. */
1169 if (yytype < YYNTOKENS)
1171 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1173 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1177 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1184 YYFPRINTF (yyoutput, ")");
1187 #endif /* ! YYDEBUG */
1188 /*-----------------------------------------------.
1189 | Release the memory associated to this symbol. |
1190 `-----------------------------------------------*/
1192 #if defined (__STDC__) || defined (__cplusplus)
1194 yydestruct (int yytype, YYSTYPE *yyvaluep)
1197 yydestruct (yytype, yyvaluep)
1202 /* Pacify ``unused variable'' warnings. */
1214 /* Prevent warnings from -Wmissing-prototypes. */
1216 #ifdef YYPARSE_PARAM
1217 # if defined (__STDC__) || defined (__cplusplus)
1218 int yyparse (void *YYPARSE_PARAM);
1222 #else /* ! YYPARSE_PARAM */
1223 #if defined (__STDC__) || defined (__cplusplus)
1228 #endif /* ! YYPARSE_PARAM */
1232 /* The lookahead symbol. */
1235 /* The semantic value of the lookahead symbol. */
1238 /* Number of syntax errors so far. */
1247 #ifdef YYPARSE_PARAM
1248 # if defined (__STDC__) || defined (__cplusplus)
1249 int yyparse (void *YYPARSE_PARAM)
1251 int yyparse (YYPARSE_PARAM)
1252 void *YYPARSE_PARAM;
1254 #else /* ! YYPARSE_PARAM */
1255 #if defined (__STDC__) || defined (__cplusplus)
1266 register int yystate;
1269 /* Number of tokens to shift before error messages enabled. */
1271 /* Lookahead token as an internal (translated) token number. */
1274 /* Three stacks and their tools:
1275 `yyss': related to states,
1276 `yyvs': related to semantic values,
1277 `yyls': related to locations.
1279 Refer to the stacks thru separate pointers, to allow yyoverflow
1280 to xreallocate them elsewhere. */
1282 /* The state stack. */
1283 short yyssa[YYINITDEPTH];
1284 short *yyss = yyssa;
1285 register short *yyssp;
1287 /* The semantic value stack. */
1288 YYSTYPE yyvsa[YYINITDEPTH];
1289 YYSTYPE *yyvs = yyvsa;
1290 register YYSTYPE *yyvsp;
1294 #define YYPOPSTACK (yyvsp--, yyssp--)
1296 YYSIZE_T yystacksize = YYINITDEPTH;
1298 /* The variables used to return semantic value and location from the
1303 /* When reducing, the number of symbols on the RHS of the reduced
1307 YYDPRINTF ((stderr, "Starting parse\n"));
1312 yychar = YYEMPTY; /* Cause a token to be read. */
1314 /* Initialize stack pointers.
1315 Waste one element of value and location stack
1316 so that they stay on the same level as the state stack.
1317 The wasted elements are never initialized. */
1324 /*------------------------------------------------------------.
1325 | yynewstate -- Push a new state, which is found in yystate. |
1326 `------------------------------------------------------------*/
1328 /* In all cases, when you get here, the value and location stacks
1329 have just been pushed. so pushing a state here evens the stacks.
1336 if (yyss + yystacksize - 1 <= yyssp)
1338 /* Get the current used size of the three stacks, in elements. */
1339 YYSIZE_T yysize = yyssp - yyss + 1;
1343 /* Give user a chance to xreallocate the stack. Use copies of
1344 these so that the &'s don't force the real ones into
1346 YYSTYPE *yyvs1 = yyvs;
1347 short *yyss1 = yyss;
1350 /* Each stack pointer address is followed by the size of the
1351 data in use in that stack, in bytes. This used to be a
1352 conditional around just the two extra args, but that might
1353 be undefined if yyoverflow is a macro. */
1354 yyoverflow ("parser stack overflow",
1355 &yyss1, yysize * sizeof (*yyssp),
1356 &yyvs1, yysize * sizeof (*yyvsp),
1363 #else /* no yyoverflow */
1364 # ifndef YYSTACK_RELOCATE
1367 /* Extend the stack our own way. */
1368 if (YYMAXDEPTH <= yystacksize)
1371 if (YYMAXDEPTH < yystacksize)
1372 yystacksize = YYMAXDEPTH;
1375 short *yyss1 = yyss;
1376 union yyalloc *yyptr =
1377 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1380 YYSTACK_RELOCATE (yyss);
1381 YYSTACK_RELOCATE (yyvs);
1383 # undef YYSTACK_RELOCATE
1385 YYSTACK_FREE (yyss1);
1388 #endif /* no yyoverflow */
1390 yyssp = yyss + yysize - 1;
1391 yyvsp = yyvs + yysize - 1;
1394 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1395 (unsigned long int) yystacksize));
1397 if (yyss + yystacksize - 1 <= yyssp)
1401 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1410 /* Do appropriate processing given the current state. */
1411 /* Read a lookahead token if we need one and don't already have one. */
1414 /* First try to decide what to do without reference to lookahead token. */
1416 yyn = yypact[yystate];
1417 if (yyn == YYPACT_NINF)
1420 /* Not known => get a lookahead token if don't already have one. */
1422 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1423 if (yychar == YYEMPTY)
1425 YYDPRINTF ((stderr, "Reading a token: "));
1429 if (yychar <= YYEOF)
1431 yychar = yytoken = YYEOF;
1432 YYDPRINTF ((stderr, "Now at end of input.\n"));
1436 yytoken = YYTRANSLATE (yychar);
1437 YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
1440 /* If the proper action on seeing token YYTOKEN is to reduce or to
1441 detect an error, take that action. */
1443 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1448 if (yyn == 0 || yyn == YYTABLE_NINF)
1457 /* Shift the lookahead token. */
1458 YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
1460 /* Discard the token being shifted unless it is eof. */
1461 if (yychar != YYEOF)
1467 /* Count tokens shifted since error; after three, turn off error
1476 /*-----------------------------------------------------------.
1477 | yydefault -- do the default action for the current state. |
1478 `-----------------------------------------------------------*/
1480 yyn = yydefact[yystate];
1486 /*-----------------------------.
1487 | yyreduce -- Do a reduction. |
1488 `-----------------------------*/
1490 /* yyn is the number of a rule to reduce with. */
1493 /* If YYLEN is nonzero, implement the default value of the action:
1496 Otherwise, the following line sets YYVAL to garbage.
1497 This behavior is undocumented and Bison
1498 users should not rely upon it. Assigning to YYVAL
1499 unconditionally makes the parser a bit smaller, and it avoids a
1500 GCC warning that YYVAL may be used uninitialized. */
1501 yyval = yyvsp[1-yylen];
1504 YY_REDUCE_PRINT (yyn);
1508 #line 236 "objc-exp.y"
1509 { write_exp_elt_opcode(OP_TYPE);
1510 write_exp_elt_type(yyvsp[0].tval);
1511 write_exp_elt_opcode(OP_TYPE);}
1515 #line 244 "objc-exp.y"
1516 { write_exp_elt_opcode (BINOP_COMMA); }
1520 #line 249 "objc-exp.y"
1521 { write_exp_elt_opcode (UNOP_IND); }
1525 #line 253 "objc-exp.y"
1526 { write_exp_elt_opcode (UNOP_ADDR); }
1530 #line 257 "objc-exp.y"
1531 { write_exp_elt_opcode (UNOP_NEG); }
1535 #line 261 "objc-exp.y"
1536 { write_exp_elt_opcode (UNOP_LOGICAL_NOT); }
1540 #line 265 "objc-exp.y"
1541 { write_exp_elt_opcode (UNOP_COMPLEMENT); }
1545 #line 269 "objc-exp.y"
1546 { write_exp_elt_opcode (UNOP_PREINCREMENT); }
1550 #line 273 "objc-exp.y"
1551 { write_exp_elt_opcode (UNOP_PREDECREMENT); }
1555 #line 277 "objc-exp.y"
1556 { write_exp_elt_opcode (UNOP_POSTINCREMENT); }
1560 #line 281 "objc-exp.y"
1561 { write_exp_elt_opcode (UNOP_POSTDECREMENT); }
1565 #line 285 "objc-exp.y"
1566 { write_exp_elt_opcode (UNOP_SIZEOF); }
1570 #line 289 "objc-exp.y"
1571 { write_exp_elt_opcode (STRUCTOP_PTR);
1572 write_exp_string (yyvsp[0].sval);
1573 write_exp_elt_opcode (STRUCTOP_PTR); }
1577 #line 295 "objc-exp.y"
1578 { /* exp->type::name becomes exp->*(&type::name) */
1579 /* Note: this doesn't work if name is a
1580 static member! FIXME */
1581 write_exp_elt_opcode (UNOP_ADDR);
1582 write_exp_elt_opcode (STRUCTOP_MPTR); }
1586 #line 302 "objc-exp.y"
1587 { write_exp_elt_opcode (STRUCTOP_MPTR); }
1591 #line 306 "objc-exp.y"
1592 { write_exp_elt_opcode (STRUCTOP_STRUCT);
1593 write_exp_string (yyvsp[0].sval);
1594 write_exp_elt_opcode (STRUCTOP_STRUCT); }
1598 #line 313 "objc-exp.y"
1599 { /* exp.type::name becomes exp.*(&type::name) */
1600 /* Note: this doesn't work if name is a
1601 static member! FIXME */
1602 write_exp_elt_opcode (UNOP_ADDR);
1603 write_exp_elt_opcode (STRUCTOP_MEMBER); }
1607 #line 321 "objc-exp.y"
1608 { write_exp_elt_opcode (STRUCTOP_MEMBER); }
1612 #line 325 "objc-exp.y"
1613 { write_exp_elt_opcode (BINOP_SUBSCRIPT); }
1617 #line 333 "objc-exp.y"
1621 class = lookup_objc_class (parse_gdbarch,
1622 copy_name (yyvsp[0].tsym.stoken));
1624 error ("%s is not an ObjC Class",
1625 copy_name (yyvsp[0].tsym.stoken));
1626 write_exp_elt_opcode (OP_LONG);
1627 write_exp_elt_type (parse_type->builtin_int);
1628 write_exp_elt_longcst ((LONGEST) class);
1629 write_exp_elt_opcode (OP_LONG);
1635 #line 348 "objc-exp.y"
1636 { write_exp_elt_opcode (OP_OBJC_MSGCALL);
1638 write_exp_elt_opcode (OP_OBJC_MSGCALL);
1643 #line 355 "objc-exp.y"
1645 write_exp_elt_opcode (OP_LONG);
1646 write_exp_elt_type (parse_type->builtin_int);
1647 write_exp_elt_longcst ((LONGEST) yyvsp[0].class.class);
1648 write_exp_elt_opcode (OP_LONG);
1654 #line 363 "objc-exp.y"
1655 { write_exp_elt_opcode (OP_OBJC_MSGCALL);
1657 write_exp_elt_opcode (OP_OBJC_MSGCALL);
1662 #line 370 "objc-exp.y"
1663 { start_msglist(); }
1667 #line 372 "objc-exp.y"
1668 { write_exp_elt_opcode (OP_OBJC_MSGCALL);
1670 write_exp_elt_opcode (OP_OBJC_MSGCALL);
1675 #line 379 "objc-exp.y"
1676 { add_msglist(&yyvsp[0].sval, 0); }
1680 #line 388 "objc-exp.y"
1681 { add_msglist(&yyvsp[-2].sval, 1); }
1685 #line 390 "objc-exp.y"
1686 { add_msglist(0, 1); }
1690 #line 392 "objc-exp.y"
1691 { add_msglist(0, 0); }
1695 #line 398 "objc-exp.y"
1696 { start_arglist (); }
1700 #line 400 "objc-exp.y"
1701 { write_exp_elt_opcode (OP_FUNCALL);
1702 write_exp_elt_longcst ((LONGEST) end_arglist ());
1703 write_exp_elt_opcode (OP_FUNCALL); }
1707 #line 406 "objc-exp.y"
1708 { start_arglist (); }
1712 #line 413 "objc-exp.y"
1713 { arglist_len = 1; }
1717 #line 417 "objc-exp.y"
1722 #line 421 "objc-exp.y"
1723 { yyval.lval = end_arglist () - 1; }
1727 #line 424 "objc-exp.y"
1728 { write_exp_elt_opcode (OP_ARRAY);
1729 write_exp_elt_longcst ((LONGEST) 0);
1730 write_exp_elt_longcst ((LONGEST) yyvsp[0].lval);
1731 write_exp_elt_opcode (OP_ARRAY); }
1735 #line 431 "objc-exp.y"
1736 { write_exp_elt_opcode (UNOP_MEMVAL);
1737 write_exp_elt_type (yyvsp[-2].tval);
1738 write_exp_elt_opcode (UNOP_MEMVAL); }
1742 #line 437 "objc-exp.y"
1743 { write_exp_elt_opcode (UNOP_CAST);
1744 write_exp_elt_type (yyvsp[-2].tval);
1745 write_exp_elt_opcode (UNOP_CAST); }
1749 #line 443 "objc-exp.y"
1754 #line 449 "objc-exp.y"
1755 { write_exp_elt_opcode (BINOP_REPEAT); }
1759 #line 453 "objc-exp.y"
1760 { write_exp_elt_opcode (BINOP_MUL); }
1764 #line 457 "objc-exp.y"
1765 { write_exp_elt_opcode (BINOP_DIV); }
1769 #line 461 "objc-exp.y"
1770 { write_exp_elt_opcode (BINOP_REM); }
1774 #line 465 "objc-exp.y"
1775 { write_exp_elt_opcode (BINOP_ADD); }
1779 #line 469 "objc-exp.y"
1780 { write_exp_elt_opcode (BINOP_SUB); }
1784 #line 473 "objc-exp.y"
1785 { write_exp_elt_opcode (BINOP_LSH); }
1789 #line 477 "objc-exp.y"
1790 { write_exp_elt_opcode (BINOP_RSH); }
1794 #line 481 "objc-exp.y"
1795 { write_exp_elt_opcode (BINOP_EQUAL); }
1799 #line 485 "objc-exp.y"
1800 { write_exp_elt_opcode (BINOP_NOTEQUAL); }
1804 #line 489 "objc-exp.y"
1805 { write_exp_elt_opcode (BINOP_LEQ); }
1809 #line 493 "objc-exp.y"
1810 { write_exp_elt_opcode (BINOP_GEQ); }
1814 #line 497 "objc-exp.y"
1815 { write_exp_elt_opcode (BINOP_LESS); }
1819 #line 501 "objc-exp.y"
1820 { write_exp_elt_opcode (BINOP_GTR); }
1824 #line 505 "objc-exp.y"
1825 { write_exp_elt_opcode (BINOP_BITWISE_AND); }
1829 #line 509 "objc-exp.y"
1830 { write_exp_elt_opcode (BINOP_BITWISE_XOR); }
1834 #line 513 "objc-exp.y"
1835 { write_exp_elt_opcode (BINOP_BITWISE_IOR); }
1839 #line 517 "objc-exp.y"
1840 { write_exp_elt_opcode (BINOP_LOGICAL_AND); }
1844 #line 521 "objc-exp.y"
1845 { write_exp_elt_opcode (BINOP_LOGICAL_OR); }
1849 #line 525 "objc-exp.y"
1850 { write_exp_elt_opcode (TERNOP_COND); }
1854 #line 529 "objc-exp.y"
1855 { write_exp_elt_opcode (BINOP_ASSIGN); }
1859 #line 533 "objc-exp.y"
1860 { write_exp_elt_opcode (BINOP_ASSIGN_MODIFY);
1861 write_exp_elt_opcode (yyvsp[-1].opcode);
1862 write_exp_elt_opcode (BINOP_ASSIGN_MODIFY); }
1866 #line 539 "objc-exp.y"
1867 { write_exp_elt_opcode (OP_LONG);
1868 write_exp_elt_type (yyvsp[0].typed_val_int.type);
1869 write_exp_elt_longcst ((LONGEST)(yyvsp[0].typed_val_int.val));
1870 write_exp_elt_opcode (OP_LONG); }
1874 #line 546 "objc-exp.y"
1876 parse_number (yyvsp[0].ssym.stoken.ptr, yyvsp[0].ssym.stoken.length, 0, &val);
1877 write_exp_elt_opcode (OP_LONG);
1878 write_exp_elt_type (val.typed_val_int.type);
1879 write_exp_elt_longcst ((LONGEST)val.typed_val_int.val);
1880 write_exp_elt_opcode (OP_LONG);
1885 #line 557 "objc-exp.y"
1886 { write_exp_elt_opcode (OP_DOUBLE);
1887 write_exp_elt_type (yyvsp[0].typed_val_float.type);
1888 write_exp_elt_dblcst (yyvsp[0].typed_val_float.dval);
1889 write_exp_elt_opcode (OP_DOUBLE); }
1893 #line 571 "objc-exp.y"
1895 write_exp_elt_opcode (OP_OBJC_SELECTOR);
1896 write_exp_string (yyvsp[0].sval);
1897 write_exp_elt_opcode (OP_OBJC_SELECTOR); }
1901 #line 578 "objc-exp.y"
1902 { write_exp_elt_opcode (OP_LONG);
1903 write_exp_elt_type (parse_type->builtin_int);
1904 CHECK_TYPEDEF (yyvsp[-1].tval);
1905 write_exp_elt_longcst ((LONGEST) TYPE_LENGTH (yyvsp[-1].tval));
1906 write_exp_elt_opcode (OP_LONG); }
1910 #line 586 "objc-exp.y"
1911 { /* C strings are converted into array
1912 constants with an explicit null byte
1913 added at the end. Thus the array upper
1914 bound is the string length. There is no
1915 such thing in C as a completely empty
1917 char *sp = yyvsp[0].sval.ptr; int count = yyvsp[0].sval.length;
1920 write_exp_elt_opcode (OP_LONG);
1921 write_exp_elt_type (parse_type->builtin_char);
1922 write_exp_elt_longcst ((LONGEST)(*sp++));
1923 write_exp_elt_opcode (OP_LONG);
1925 write_exp_elt_opcode (OP_LONG);
1926 write_exp_elt_type (parse_type->builtin_char);
1927 write_exp_elt_longcst ((LONGEST)'\0');
1928 write_exp_elt_opcode (OP_LONG);
1929 write_exp_elt_opcode (OP_ARRAY);
1930 write_exp_elt_longcst ((LONGEST) 0);
1931 write_exp_elt_longcst ((LONGEST) (yyvsp[0].sval.length));
1932 write_exp_elt_opcode (OP_ARRAY); }
1936 #line 613 "objc-exp.y"
1937 { write_exp_elt_opcode (OP_OBJC_NSSTRING);
1938 write_exp_string (yyvsp[0].sval);
1939 write_exp_elt_opcode (OP_OBJC_NSSTRING); }
1943 #line 619 "objc-exp.y"
1945 if (yyvsp[0].ssym.sym != 0)
1946 yyval.bval = SYMBOL_BLOCK_VALUE (yyvsp[0].ssym.sym);
1949 struct symtab *tem =
1950 lookup_symtab (copy_name (yyvsp[0].ssym.stoken));
1952 yyval.bval = BLOCKVECTOR_BLOCK (BLOCKVECTOR (tem), STATIC_BLOCK);
1954 error ("No file or function \"%s\".",
1955 copy_name (yyvsp[0].ssym.stoken));
1961 #line 636 "objc-exp.y"
1962 { struct symbol *tem
1963 = lookup_symbol (copy_name (yyvsp[0].sval), yyvsp[-2].bval,
1964 VAR_DOMAIN, (int *) NULL);
1965 if (!tem || SYMBOL_CLASS (tem) != LOC_BLOCK)
1966 error ("No function \"%s\" in specified context.",
1967 copy_name (yyvsp[0].sval));
1968 yyval.bval = SYMBOL_BLOCK_VALUE (tem); }
1972 #line 646 "objc-exp.y"
1973 { struct symbol *sym;
1974 sym = lookup_symbol (copy_name (yyvsp[0].sval), yyvsp[-2].bval,
1975 VAR_DOMAIN, (int *) NULL);
1977 error ("No symbol \"%s\" in specified context.",
1978 copy_name (yyvsp[0].sval));
1980 write_exp_elt_opcode (OP_VAR_VALUE);
1981 /* block_found is set by lookup_symbol. */
1982 write_exp_elt_block (block_found);
1983 write_exp_elt_sym (sym);
1984 write_exp_elt_opcode (OP_VAR_VALUE); }
1988 #line 661 "objc-exp.y"
1990 struct type *type = yyvsp[-2].tval;
1991 if (TYPE_CODE (type) != TYPE_CODE_STRUCT
1992 && TYPE_CODE (type) != TYPE_CODE_UNION)
1993 error ("`%s' is not defined as an aggregate type.",
1996 write_exp_elt_opcode (OP_SCOPE);
1997 write_exp_elt_type (type);
1998 write_exp_string (yyvsp[0].sval);
1999 write_exp_elt_opcode (OP_SCOPE);
2004 #line 674 "objc-exp.y"
2006 struct type *type = yyvsp[-3].tval;
2007 struct stoken tmp_token;
2008 if (TYPE_CODE (type) != TYPE_CODE_STRUCT
2009 && TYPE_CODE (type) != TYPE_CODE_UNION)
2010 error ("`%s' is not defined as an aggregate type.",
2013 if (strcmp (type_name_no_tag (type), yyvsp[0].sval.ptr) != 0)
2014 error ("invalid destructor `%s::~%s'",
2015 type_name_no_tag (type), yyvsp[0].sval.ptr);
2017 tmp_token.ptr = (char*) alloca (yyvsp[0].sval.length + 2);
2018 tmp_token.length = yyvsp[0].sval.length + 1;
2019 tmp_token.ptr[0] = '~';
2020 memcpy (tmp_token.ptr+1, yyvsp[0].sval.ptr, yyvsp[0].sval.length);
2021 tmp_token.ptr[tmp_token.length] = 0;
2022 write_exp_elt_opcode (OP_SCOPE);
2023 write_exp_elt_type (type);
2024 write_exp_string (tmp_token);
2025 write_exp_elt_opcode (OP_SCOPE);
2030 #line 700 "objc-exp.y"
2032 char *name = copy_name (yyvsp[0].sval);
2034 struct minimal_symbol *msymbol;
2037 lookup_symbol (name, (const struct block *) NULL,
2038 VAR_DOMAIN, (int *) NULL);
2041 write_exp_elt_opcode (OP_VAR_VALUE);
2042 write_exp_elt_block (NULL);
2043 write_exp_elt_sym (sym);
2044 write_exp_elt_opcode (OP_VAR_VALUE);
2048 msymbol = lookup_minimal_symbol (name, NULL, NULL);
2049 if (msymbol != NULL)
2050 write_exp_msymbol (msymbol);
2051 else if (!have_full_symbols () && !have_partial_symbols ())
2052 error ("No symbol table is loaded. Use the \"file\" command.");
2054 error ("No symbol \"%s\" in current context.", name);
2059 #line 728 "objc-exp.y"
2060 { struct symbol *sym = yyvsp[0].ssym.sym;
2064 if (symbol_read_needs_frame (sym))
2066 if (innermost_block == 0 ||
2067 contained_in (block_found,
2069 innermost_block = block_found;
2072 write_exp_elt_opcode (OP_VAR_VALUE);
2073 /* We want to use the selected frame, not
2074 another more inner frame which happens to
2075 be in the same block. */
2076 write_exp_elt_block (NULL);
2077 write_exp_elt_sym (sym);
2078 write_exp_elt_opcode (OP_VAR_VALUE);
2080 else if (yyvsp[0].ssym.is_a_field_of_this)
2082 /* C++/ObjC: it hangs off of `this'/'self'.
2083 Must not inadvertently convert from a
2084 method call to data ref. */
2085 if (innermost_block == 0 ||
2086 contained_in (block_found, innermost_block))
2087 innermost_block = block_found;
2088 write_exp_elt_opcode (OP_OBJC_SELF);
2089 write_exp_elt_opcode (OP_OBJC_SELF);
2090 write_exp_elt_opcode (STRUCTOP_PTR);
2091 write_exp_string (yyvsp[0].ssym.stoken);
2092 write_exp_elt_opcode (STRUCTOP_PTR);
2096 struct minimal_symbol *msymbol;
2097 char *arg = copy_name (yyvsp[0].ssym.stoken);
2100 lookup_minimal_symbol (arg, NULL, NULL);
2101 if (msymbol != NULL)
2102 write_exp_msymbol (msymbol);
2103 else if (!have_full_symbols () &&
2104 !have_partial_symbols ())
2105 error ("No symbol table is loaded. Use the \"file\" command.");
2107 error ("No symbol \"%s\" in current context.",
2108 copy_name (yyvsp[0].ssym.stoken));
2114 #line 791 "objc-exp.y"
2115 { yyval.tval = follow_types (yyvsp[-1].tval); }
2119 #line 793 "objc-exp.y"
2120 { yyval.tval = follow_types (yyvsp[-2].tval); }
2124 #line 795 "objc-exp.y"
2125 { yyval.tval = follow_types (yyvsp[-2].tval); }
2129 #line 799 "objc-exp.y"
2130 { push_type (tp_pointer); yyval.voidval = 0; }
2134 #line 801 "objc-exp.y"
2135 { push_type (tp_pointer); yyval.voidval = yyvsp[0].voidval; }
2139 #line 803 "objc-exp.y"
2140 { push_type (tp_reference); yyval.voidval = 0; }
2144 #line 805 "objc-exp.y"
2145 { push_type (tp_reference); yyval.voidval = yyvsp[0].voidval; }
2149 #line 810 "objc-exp.y"
2150 { yyval.voidval = yyvsp[-1].voidval; }
2154 #line 812 "objc-exp.y"
2156 push_type_int (yyvsp[0].lval);
2157 push_type (tp_array);
2162 #line 817 "objc-exp.y"
2164 push_type_int (yyvsp[0].lval);
2165 push_type (tp_array);
2171 #line 824 "objc-exp.y"
2172 { push_type (tp_function); }
2176 #line 826 "objc-exp.y"
2177 { push_type (tp_function); }
2181 #line 830 "objc-exp.y"
2182 { yyval.lval = -1; }
2186 #line 832 "objc-exp.y"
2187 { yyval.lval = yyvsp[-1].typed_val_int.val; }
2191 #line 836 "objc-exp.y"
2192 { yyval.voidval = 0; }
2196 #line 838 "objc-exp.y"
2197 { xfree (yyvsp[-1].tvec); yyval.voidval = 0; }
2201 #line 854 "objc-exp.y"
2202 { yyval.tval = yyvsp[0].tsym.type; }
2206 #line 856 "objc-exp.y"
2208 if (yyvsp[0].class.type == NULL)
2209 error ("No symbol \"%s\" in current context.",
2210 copy_name(yyvsp[0].class.stoken));
2212 yyval.tval = yyvsp[0].class.type;
2217 #line 864 "objc-exp.y"
2218 { yyval.tval = parse_type->builtin_int; }
2222 #line 866 "objc-exp.y"
2223 { yyval.tval = parse_type->builtin_long; }
2227 #line 868 "objc-exp.y"
2228 { yyval.tval = parse_type->builtin_short; }
2232 #line 870 "objc-exp.y"
2233 { yyval.tval = parse_type->builtin_long; }
2237 #line 872 "objc-exp.y"
2238 { yyval.tval = parse_type->builtin_unsigned_long; }
2242 #line 874 "objc-exp.y"
2243 { yyval.tval = parse_type->builtin_long_long; }
2247 #line 876 "objc-exp.y"
2248 { yyval.tval = parse_type->builtin_long_long; }
2252 #line 878 "objc-exp.y"
2253 { yyval.tval = parse_type->builtin_unsigned_long_long; }
2257 #line 880 "objc-exp.y"
2258 { yyval.tval = parse_type->builtin_unsigned_long_long; }
2262 #line 882 "objc-exp.y"
2263 { yyval.tval = parse_type->builtin_short; }
2267 #line 884 "objc-exp.y"
2268 { yyval.tval = parse_type->builtin_unsigned_short; }
2272 #line 886 "objc-exp.y"
2273 { yyval.tval = parse_type->builtin_double; }
2277 #line 888 "objc-exp.y"
2278 { yyval.tval = parse_type->builtin_long_double; }
2282 #line 890 "objc-exp.y"
2283 { yyval.tval = lookup_struct (copy_name (yyvsp[0].sval),
2284 expression_context_block); }
2288 #line 893 "objc-exp.y"
2289 { yyval.tval = lookup_struct (copy_name (yyvsp[0].sval),
2290 expression_context_block); }
2294 #line 896 "objc-exp.y"
2295 { yyval.tval = lookup_union (copy_name (yyvsp[0].sval),
2296 expression_context_block); }
2300 #line 899 "objc-exp.y"
2301 { yyval.tval = lookup_enum (copy_name (yyvsp[0].sval),
2302 expression_context_block); }
2306 #line 902 "objc-exp.y"
2307 { yyval.tval = lookup_unsigned_typename (parse_language,
2309 TYPE_NAME(yyvsp[0].tsym.type)); }
2313 #line 906 "objc-exp.y"
2314 { yyval.tval = parse_type->builtin_unsigned_int; }
2318 #line 908 "objc-exp.y"
2319 { yyval.tval = lookup_signed_typename (parse_language,
2321 TYPE_NAME(yyvsp[0].tsym.type)); }
2325 #line 912 "objc-exp.y"
2326 { yyval.tval = parse_type->builtin_int; }
2330 #line 914 "objc-exp.y"
2331 { yyval.tval = lookup_template_type(copy_name(yyvsp[-3].sval), yyvsp[-1].tval,
2332 expression_context_block);
2337 #line 920 "objc-exp.y"
2338 { yyval.tval = yyvsp[0].tval; }
2342 #line 921 "objc-exp.y"
2343 { yyval.tval = yyvsp[0].tval; }
2347 #line 926 "objc-exp.y"
2349 yyval.tsym.stoken.ptr = "int";
2350 yyval.tsym.stoken.length = 3;
2351 yyval.tsym.type = parse_type->builtin_int;
2356 #line 932 "objc-exp.y"
2358 yyval.tsym.stoken.ptr = "long";
2359 yyval.tsym.stoken.length = 4;
2360 yyval.tsym.type = parse_type->builtin_long;
2365 #line 938 "objc-exp.y"
2367 yyval.tsym.stoken.ptr = "short";
2368 yyval.tsym.stoken.length = 5;
2369 yyval.tsym.type = parse_type->builtin_short;
2374 #line 947 "objc-exp.y"
2375 { yyval.tvec = (struct type **) xmalloc (sizeof (struct type *) * 2);
2376 yyval.ivec[0] = 1; /* Number of types in vector. */
2377 yyval.tvec[1] = yyvsp[0].tval;
2382 #line 952 "objc-exp.y"
2383 { int len = sizeof (struct type *) * (++(yyvsp[-2].ivec[0]) + 1);
2384 yyval.tvec = (struct type **) xrealloc ((char *) yyvsp[-2].tvec, len);
2385 yyval.tvec[yyval.ivec[0]] = yyvsp[0].tval;
2390 #line 958 "objc-exp.y"
2391 { yyval.sval = yyvsp[0].ssym.stoken; }
2395 #line 959 "objc-exp.y"
2396 { yyval.sval = yyvsp[0].ssym.stoken; }
2400 #line 960 "objc-exp.y"
2401 { yyval.sval = yyvsp[0].tsym.stoken; }
2405 #line 961 "objc-exp.y"
2406 { yyval.sval = yyvsp[0].class.stoken; }
2410 #line 962 "objc-exp.y"
2411 { yyval.sval = yyvsp[0].ssym.stoken; }
2417 /* Line 1000 of yacc.c. */
2418 #line 2419 "objc-exp.c.tmp"
2424 YY_STACK_PRINT (yyss, yyssp);
2429 /* Now `shift' the result of the reduction. Determine what state
2430 that goes to, based on the state we popped back to and the rule
2431 number reduced by. */
2435 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2436 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2437 yystate = yytable[yystate];
2439 yystate = yydefgoto[yyn - YYNTOKENS];
2444 /*------------------------------------.
2445 | yyerrlab -- here on detecting error |
2446 `------------------------------------*/
2448 /* If not already recovering from an error, report this error. */
2453 yyn = yypact[yystate];
2455 if (YYPACT_NINF < yyn && yyn < YYLAST)
2457 YYSIZE_T yysize = 0;
2458 int yytype = YYTRANSLATE (yychar);
2459 const char* yyprefix;
2463 /* Start YYX at -YYN if negative to avoid negative indexes in
2465 int yyxbegin = yyn < 0 ? -yyn : 0;
2467 /* Stay within bounds of both yycheck and yytname. */
2468 int yychecklim = YYLAST - yyn;
2469 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
2472 yyprefix = ", expecting ";
2473 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
2474 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
2476 yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]);
2484 yysize += (sizeof ("syntax error, unexpected ")
2485 + yystrlen (yytname[yytype]));
2486 yymsg = (char *) YYSTACK_ALLOC (yysize);
2489 char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
2490 yyp = yystpcpy (yyp, yytname[yytype]);
2494 yyprefix = ", expecting ";
2495 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
2496 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
2498 yyp = yystpcpy (yyp, yyprefix);
2499 yyp = yystpcpy (yyp, yytname[yyx]);
2504 YYSTACK_FREE (yymsg);
2507 yyerror ("syntax error; also virtual memory exhausted");
2510 #endif /* YYERROR_VERBOSE */
2511 yyerror ("syntax error");
2516 if (yyerrstatus == 3)
2518 /* If just tried and failed to reuse lookahead token after an
2519 error, discard it. */
2521 if (yychar <= YYEOF)
2523 /* If at end of input, pop the error token,
2524 then the rest of the stack, then return failure. */
2525 if (yychar == YYEOF)
2531 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
2532 yydestruct (yystos[*yyssp], yyvsp);
2537 YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
2538 yydestruct (yytoken, &yylval);
2544 /* Else will try to reuse lookahead token after shifting the error
2549 /*---------------------------------------------------.
2550 | yyerrorlab -- error raised explicitly by YYERROR. |
2551 `---------------------------------------------------*/
2555 /* Pacify GCC when the user code never invokes YYERROR and the label
2556 yyerrorlab therefore never appears in user code. */
2567 /*-------------------------------------------------------------.
2568 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2569 `-------------------------------------------------------------*/
2571 yyerrstatus = 3; /* Each real token shifted decrements this. */
2575 yyn = yypact[yystate];
2576 if (yyn != YYPACT_NINF)
2579 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2587 /* Pop the current state because it cannot handle the error token. */
2591 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
2592 yydestruct (yystos[yystate], yyvsp);
2595 YY_STACK_PRINT (yyss, yyssp);
2601 YYDPRINTF ((stderr, "Shifting error token, "));
2610 /*-------------------------------------.
2611 | yyacceptlab -- YYACCEPT comes here. |
2612 `-------------------------------------*/
2617 /*-----------------------------------.
2618 | yyabortlab -- YYABORT comes here. |
2619 `-----------------------------------*/
2625 /*----------------------------------------------.
2626 | yyoverflowlab -- parser overflow comes here. |
2627 `----------------------------------------------*/
2629 yyerror ("parser stack overflow");
2637 YYSTACK_FREE (yyss);
2643 #line 976 "objc-exp.y"
2646 /* Take care of parsing a number (anything that starts with a digit).
2647 Set yylval and return the token type; update lexptr. LEN is the
2648 number of characters in it. */
2650 /*** Needs some error checking for the float case. ***/
2653 parse_number (p, len, parsed_float, putithere)
2659 /* FIXME: Shouldn't these be unsigned? We don't deal with negative
2660 values here, and we do kind of silly things like cast to
2664 unsigned LONGEST un;
2668 int base = input_radix;
2671 /* Number of "L" suffixes encountered. */
2674 /* We have found a "L" or "U" suffix. */
2675 int found_suffix = 0;
2677 unsigned LONGEST high_bit;
2678 struct type *signed_type;
2679 struct type *unsigned_type;
2685 /* It's a float since it contains a point or an exponent. */
2687 sscanf (p, "%" DOUBLEST_SCAN_FORMAT "%c",
2688 &putithere->typed_val_float.dval, &c);
2690 /* See if it has `f' or `l' suffix (float or long double). */
2692 c = tolower (p[len - 1]);
2695 putithere->typed_val_float.type = parse_type->builtin_float;
2697 putithere->typed_val_float.type = parse_type->builtin_long_double;
2698 else if (isdigit (c) || c == '.')
2699 putithere->typed_val_float.type = parse_type->builtin_double;
2706 /* Handle base-switching prefixes 0x, 0t, 0d, and 0. */
2740 if (c >= 'A' && c <= 'Z')
2742 if (c != 'l' && c != 'u')
2744 if (c >= '0' && c <= '9')
2752 if (base > 10 && c >= 'a' && c <= 'f')
2756 n += i = c - 'a' + 10;
2769 return ERROR; /* Char not a digit. */
2772 return ERROR; /* Invalid digit in this base. */
2774 /* Portably test for overflow (only works for nonzero values, so
2775 make a second check for zero). FIXME: Can't we just make n
2776 and prevn unsigned and avoid this? */
2777 if (c != 'l' && c != 'u' && (prevn >= n) && n != 0)
2778 unsigned_p = 1; /* Try something unsigned. */
2780 /* Portably test for unsigned overflow.
2781 FIXME: This check is wrong; for example it doesn't find
2782 overflow on 0x123456789 when LONGEST is 32 bits. */
2783 if (c != 'l' && c != 'u' && n != 0)
2785 if ((unsigned_p && (unsigned LONGEST) prevn >= (unsigned LONGEST) n))
2786 error ("Numeric constant too large.");
2791 /* An integer constant is an int, a long, or a long long. An L
2792 suffix forces it to be long; an LL suffix forces it to be long
2793 long. If not forced to a larger size, it gets the first type of
2794 the above that it fits in. To figure out whether it fits, we
2795 shift it right and see whether anything remains. Note that we
2796 can't shift sizeof (LONGEST) * HOST_CHAR_BIT bits or more in one
2797 operation, because many compilers will warn about such a shift
2798 (which always produces a zero result). Sometimes gdbarch_int_bit
2799 or gdbarch_long_int will be that big, sometimes not. To deal with
2800 the case where it is we just always shift the value more than
2801 once, with fewer bits each time. */
2803 un = (unsigned LONGEST)n >> 2;
2805 && (un >> (gdbarch_int_bit (parse_gdbarch) - 2)) == 0)
2807 high_bit = ((unsigned LONGEST)1) << (gdbarch_int_bit (parse_gdbarch) - 1);
2809 /* A large decimal (not hex or octal) constant (between INT_MAX
2810 and UINT_MAX) is a long or unsigned long, according to ANSI,
2811 never an unsigned int, but this code treats it as unsigned
2812 int. This probably should be fixed. GCC gives a warning on
2815 unsigned_type = parse_type->builtin_unsigned_int;
2816 signed_type = parse_type->builtin_int;
2818 else if (long_p <= 1
2819 && (un >> (gdbarch_long_bit (parse_gdbarch) - 2)) == 0)
2821 high_bit = ((unsigned LONGEST)1) << (gdbarch_long_bit (parse_gdbarch) - 1);
2822 unsigned_type = parse_type->builtin_unsigned_long;
2823 signed_type = parse_type->builtin_long;
2827 high_bit = (((unsigned LONGEST)1)
2828 << (gdbarch_long_long_bit (parse_gdbarch) - 32 - 1)
2832 /* A long long does not fit in a LONGEST. */
2834 (unsigned LONGEST)1 << (sizeof (LONGEST) * HOST_CHAR_BIT - 1);
2835 unsigned_type = parse_type->builtin_unsigned_long_long;
2836 signed_type = parse_type->builtin_long_long;
2839 putithere->typed_val_int.val = n;
2841 /* If the high bit of the worked out type is set then this number
2842 has to be unsigned. */
2844 if (unsigned_p || (n & high_bit))
2846 putithere->typed_val_int.type = unsigned_type;
2850 putithere->typed_val_int.type = signed_type;
2860 enum exp_opcode opcode;
2863 static const struct token tokentab3[] =
2865 {">>=", ASSIGN_MODIFY, BINOP_RSH},
2866 {"<<=", ASSIGN_MODIFY, BINOP_LSH}
2869 static const struct token tokentab2[] =
2871 {"+=", ASSIGN_MODIFY, BINOP_ADD},
2872 {"-=", ASSIGN_MODIFY, BINOP_SUB},
2873 {"*=", ASSIGN_MODIFY, BINOP_MUL},
2874 {"/=", ASSIGN_MODIFY, BINOP_DIV},
2875 {"%=", ASSIGN_MODIFY, BINOP_REM},
2876 {"|=", ASSIGN_MODIFY, BINOP_BITWISE_IOR},
2877 {"&=", ASSIGN_MODIFY, BINOP_BITWISE_AND},
2878 {"^=", ASSIGN_MODIFY, BINOP_BITWISE_XOR},
2879 {"++", INCREMENT, BINOP_END},
2880 {"--", DECREMENT, BINOP_END},
2881 {"->", ARROW, BINOP_END},
2882 {"&&", ANDAND, BINOP_END},
2883 {"||", OROR, BINOP_END},
2884 {"::", COLONCOLON, BINOP_END},
2885 {"<<", LSH, BINOP_END},
2886 {">>", RSH, BINOP_END},
2887 {"==", EQUAL, BINOP_END},
2888 {"!=", NOTEQUAL, BINOP_END},
2889 {"<=", LEQ, BINOP_END},
2890 {">=", GEQ, BINOP_END}
2893 /* Read one token, getting characters through lexptr. */
2904 static char *tempbuf;
2905 static int tempbufsize;
2910 /* See if it is a special token of length 3. */
2911 for (i = 0; i < sizeof tokentab3 / sizeof tokentab3[0]; i++)
2912 if (strncmp (tokstart, tokentab3[i].operator, 3) == 0)
2915 yylval.opcode = tokentab3[i].opcode;
2916 return tokentab3[i].token;
2919 /* See if it is a special token of length 2. */
2920 for (i = 0; i < sizeof tokentab2 / sizeof tokentab2[0]; i++)
2921 if (strncmp (tokstart, tokentab2[i].operator, 2) == 0)
2924 yylval.opcode = tokentab2[i].opcode;
2925 return tokentab2[i].token;
2929 switch (tokchr = *tokstart)
2941 /* We either have a character constant ('0' or '\177' for
2942 example) or we have a quoted symbol reference ('foo(int,int)'
2943 in C++ for example). */
2947 c = parse_escape (parse_gdbarch, &lexptr);
2949 error ("Empty character constant.");
2951 yylval.typed_val_int.val = c;
2952 yylval.typed_val_int.type = parse_type->builtin_char;
2957 namelen = skip_quoted (tokstart) - tokstart;
2960 lexptr = tokstart + namelen;
2961 if (lexptr[-1] != '\'')
2962 error ("Unmatched single quote.");
2967 error ("Invalid character constant.");
2977 if (paren_depth == 0)
2984 if (comma_terminates && paren_depth == 0)
2990 /* Might be a floating point number. */
2991 if (lexptr[1] < '0' || lexptr[1] > '9')
2992 goto symbol; /* Nope, must be a symbol. */
2993 /* FALL THRU into number case. */
3006 /* It's a number. */
3007 int got_dot = 0, got_e = 0, toktype = FLOAT;
3008 /* Initialize toktype to anything other than ERROR. */
3010 int hex = input_radix > 10;
3011 int local_radix = input_radix;
3012 if (tokchr == '0' && (p[1] == 'x' || p[1] == 'X'))
3018 else if (tokchr == '0' && (p[1]=='t' || p[1]=='T' || p[1]=='d' || p[1]=='D'))
3027 /* This test includes !hex because 'e' is a valid hex digit
3028 and thus does not indicate a floating point number when
3029 the radix is hex. */
3031 if (!hex && (*p == 'e' || *p == 'E'))
3033 toktype = ERROR; /* Only one 'e' in a float. */
3036 /* This test does not include !hex, because a '.' always
3037 indicates a decimal floating point number regardless of
3041 toktype = ERROR; /* Only one '.' in a float. */
3044 else if (got_e && (p[-1] == 'e' || p[-1] == 'E') &&
3045 (*p == '-' || *p == '+'))
3046 /* This is the sign of the exponent, not the end of the
3049 /* Always take decimal digits; parse_number handles radix
3051 else if (*p >= '0' && *p <= '9')
3053 /* We will take letters only if hex is true, and only up
3054 to what the input radix would permit. FSF was content
3055 to rely on parse_number to validate; but it leaks. */
3056 else if (*p >= 'a' && *p <= 'z')
3058 if (!hex || *p >= ('a' + local_radix - 10))
3061 else if (*p >= 'A' && *p <= 'Z')
3063 if (!hex || *p >= ('A' + local_radix - 10))
3068 if (toktype != ERROR)
3069 toktype = parse_number (tokstart, p - tokstart,
3070 got_dot | got_e, &yylval);
3071 if (toktype == ERROR)
3073 char *err_copy = (char *) alloca (p - tokstart + 1);
3075 memcpy (err_copy, tokstart, p - tokstart);
3076 err_copy[p - tokstart] = 0;
3077 error ("Invalid number \"%s\".", err_copy);
3094 case '@': /* Moved out below. */
3110 if (strncmp(tokstart, "@selector", 9) == 0)
3112 tokptr = strchr(tokstart, '(');
3115 error ("Missing '(' in @selector(...)");
3118 tokptr++; /* Skip the '('. */
3120 /* Grow the static temp buffer if necessary, including
3121 allocating the first one on demand. */
3122 if (tempbufindex + 1 >= tempbufsize)
3124 tempbuf = (char *) xrealloc (tempbuf, tempbufsize += 64);
3126 tempbuf[tempbufindex++] = *tokptr++;
3127 } while ((*tokptr != ')') && (*tokptr != '\0'));
3128 if (*tokptr++ != ')')
3130 error ("Missing ')' in @selector(...)");
3132 tempbuf[tempbufindex] = '\0';
3133 yylval.sval.ptr = tempbuf;
3134 yylval.sval.length = tempbufindex;
3138 if (tokstart[1] != '"')
3143 /* ObjC NextStep NSString constant: fall thru and parse like
3149 /* Build the gdb internal form of the input string in tempbuf,
3150 translating any standard C escape forms seen. Note that the
3151 buffer is null byte terminated *only* for the convenience of
3152 debugging gdb itself and printing the buffer contents when
3153 the buffer contains no embedded nulls. Gdb does not depend
3154 upon the buffer being null byte terminated, it uses the
3155 length string instead. This allows gdb to handle C strings
3156 (as well as strings in other languages) with embedded null
3159 tokptr = ++tokstart;
3163 /* Grow the static temp buffer if necessary, including
3164 allocating the first one on demand. */
3165 if (tempbufindex + 1 >= tempbufsize)
3167 tempbuf = (char *) xrealloc (tempbuf, tempbufsize += 64);
3173 /* Do nothing, loop will terminate. */
3177 c = parse_escape (parse_gdbarch, &tokptr);
3182 tempbuf[tempbufindex++] = c;
3185 tempbuf[tempbufindex++] = *tokptr++;
3188 } while ((*tokptr != '"') && (*tokptr != '\0'));
3189 if (*tokptr++ != '"')
3191 error ("Unterminated string in expression.");
3193 tempbuf[tempbufindex] = '\0'; /* See note above. */
3194 yylval.sval.ptr = tempbuf;
3195 yylval.sval.length = tempbufindex;
3197 return (tokchr == '@' ? NSSTRING : STRING);
3200 if (!(tokchr == '_' || tokchr == '$' ||
3201 (tokchr >= 'a' && tokchr <= 'z') || (tokchr >= 'A' && tokchr <= 'Z')))
3202 /* We must have come across a bad character (e.g. ';'). */
3203 error ("Invalid character '%c' in expression.", c);
3205 /* It's a name. See how long it is. */
3207 for (c = tokstart[namelen];
3208 (c == '_' || c == '$' || (c >= '0' && c <= '9')
3209 || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '<');)
3214 while (tokstart[++i] && tokstart[i] != '>');
3215 if (tokstart[i] == '>')
3218 c = tokstart[++namelen];
3221 /* The token "if" terminates the expression and is NOT
3222 removed from the input stream. */
3223 if (namelen == 2 && tokstart[0] == 'i' && tokstart[1] == 'f')
3232 /* Catch specific keywords. Should be done with a data structure. */
3236 if (strncmp (tokstart, "unsigned", 8) == 0)
3238 if (parse_language->la_language == language_cplus
3239 && strncmp (tokstart, "template", 8) == 0)
3241 if (strncmp (tokstart, "volatile", 8) == 0)
3242 return VOLATILE_KEYWORD;
3245 if (strncmp (tokstart, "struct", 6) == 0)
3247 if (strncmp (tokstart, "signed", 6) == 0)
3248 return SIGNED_KEYWORD;
3249 if (strncmp (tokstart, "sizeof", 6) == 0)
3251 if (strncmp (tokstart, "double", 6) == 0)
3252 return DOUBLE_KEYWORD;
3255 if ((parse_language->la_language == language_cplus)
3256 && strncmp (tokstart, "class", 5) == 0)
3258 if (strncmp (tokstart, "union", 5) == 0)
3260 if (strncmp (tokstart, "short", 5) == 0)
3262 if (strncmp (tokstart, "const", 5) == 0)
3263 return CONST_KEYWORD;
3266 if (strncmp (tokstart, "enum", 4) == 0)
3268 if (strncmp (tokstart, "long", 4) == 0)
3272 if (strncmp (tokstart, "int", 3) == 0)
3279 yylval.sval.ptr = tokstart;
3280 yylval.sval.length = namelen;
3282 if (*tokstart == '$')
3284 write_dollar_variable (yylval.sval);
3288 /* Use token-type BLOCKNAME for symbols that happen to be defined as
3289 functions or symtabs. If this is not so, then ...
3290 Use token-type TYPENAME for symbols that happen to be defined
3291 currently as names of types; NAME for other symbols.
3292 The caller is not constrained to care about the distinction. */
3294 char *tmp = copy_name (yylval.sval);
3296 int is_a_field_of_this = 0, *need_this;
3299 if (parse_language->la_language == language_cplus ||
3300 parse_language->la_language == language_objc)
3301 need_this = &is_a_field_of_this;
3303 need_this = (int *) NULL;
3305 sym = lookup_symbol (tmp, expression_context_block,
3308 /* Call lookup_symtab, not lookup_partial_symtab, in case there
3309 are no psymtabs (coff, xcoff, or some future change to blow
3310 away the psymtabs once symbols are read). */
3311 if ((sym && SYMBOL_CLASS (sym) == LOC_BLOCK) ||
3312 lookup_symtab (tmp))
3314 yylval.ssym.sym = sym;
3315 yylval.ssym.is_a_field_of_this = is_a_field_of_this;
3318 if (sym && SYMBOL_CLASS (sym) == LOC_TYPEDEF)
3321 /* Despite the following flaw, we need to keep this code
3322 enabled. Because we can get called from
3323 check_stub_method, if we don't handle nested types then
3324 it screws many operations in any program which uses
3326 /* In "A::x", if x is a member function of A and there
3327 happens to be a type (nested or not, since the stabs
3328 don't make that distinction) named x, then this code
3329 incorrectly thinks we are dealing with nested types
3330 rather than a member function. */
3334 struct symbol *best_sym;
3336 /* Look ahead to detect nested types. This probably should
3337 be done in the grammar, but trying seemed to introduce a
3338 lot of shift/reduce and reduce/reduce conflicts. It's
3339 possible that it could be done, though. Or perhaps a
3340 non-grammar, but less ad hoc, approach would work well. */
3342 /* Since we do not currently have any way of distinguishing
3343 a nested type from a non-nested one (the stabs don't tell
3344 us whether a type is nested), we just ignore the
3351 /* Skip whitespace. */
3352 while (*p == ' ' || *p == '\t' || *p == '\n')
3354 if (*p == ':' && p[1] == ':')
3356 /* Skip the `::'. */
3358 /* Skip whitespace. */
3359 while (*p == ' ' || *p == '\t' || *p == '\n')
3362 while (*p == '_' || *p == '$' || (*p >= '0' && *p <= '9')
3363 || (*p >= 'a' && *p <= 'z')
3364 || (*p >= 'A' && *p <= 'Z'))
3368 struct symbol *cur_sym;
3369 /* As big as the whole rest of the expression,
3370 which is at least big enough. */
3371 char *ncopy = alloca (strlen (tmp) +
3372 strlen (namestart) + 3);
3376 memcpy (tmp1, tmp, strlen (tmp));
3377 tmp1 += strlen (tmp);
3378 memcpy (tmp1, "::", 2);
3380 memcpy (tmp1, namestart, p - namestart);
3381 tmp1[p - namestart] = '\0';
3382 cur_sym = lookup_symbol (ncopy,
3383 expression_context_block,
3384 VAR_DOMAIN, (int *) NULL);
3387 if (SYMBOL_CLASS (cur_sym) == LOC_TYPEDEF)
3405 yylval.tsym.type = SYMBOL_TYPE (best_sym);
3407 yylval.tsym.type = SYMBOL_TYPE (sym);
3412 = language_lookup_primitive_type_by_name (parse_language,
3413 parse_gdbarch, tmp);
3414 if (yylval.tsym.type != NULL)
3417 /* See if it's an ObjC classname. */
3420 CORE_ADDR Class = lookup_objc_class (parse_gdbarch, tmp);
3423 yylval.class.class = Class;
3424 if ((sym = lookup_struct_typedef (tmp,
3425 expression_context_block,
3427 yylval.class.type = SYMBOL_TYPE (sym);
3432 /* Input names that aren't symbols but ARE valid hex numbers,
3433 when the input radix permits them, can be names or numbers
3434 depending on the parse. Note we support radixes > 16 here. */
3436 ((tokstart[0] >= 'a' && tokstart[0] < 'a' + input_radix - 10) ||
3437 (tokstart[0] >= 'A' && tokstart[0] < 'A' + input_radix - 10)))
3439 YYSTYPE newlval; /* Its value is ignored. */
3440 hextype = parse_number (tokstart, namelen, 0, &newlval);
3443 yylval.ssym.sym = sym;
3444 yylval.ssym.is_a_field_of_this = is_a_field_of_this;
3449 /* Any other kind of symbol. */
3450 yylval.ssym.sym = sym;
3451 yylval.ssym.is_a_field_of_this = is_a_field_of_this;
3460 if (*lexptr == '\0')
3461 error("A %s near end of expression.", (msg ? msg : "error"));
3463 error ("A %s in expression, near `%s'.", (msg ? msg : "error"),