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 37 "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 /* Remap normal yacc parser interface names (yyparse, yylex, yyerror,
167 etc), as well as gratuitiously global symbol names, so we can have
168 multiple yacc generated parsers in gdb. Note that these are only
169 the variables produced by yacc. If other parser generators (bison,
170 byacc, etc) produce additional global names that conflict at link
171 time, then those parser generators need to be fixed instead of
172 adding those names to this list. */
174 #define yymaxdepth objc_maxdepth
175 #define yyparse objc_parse
176 #define yylex objc_lex
177 #define yyerror objc_error
178 #define yylval objc_lval
179 #define yychar objc_char
180 #define yydebug objc_debug
181 #define yypact objc_pact
184 #define yydef objc_def
185 #define yychk objc_chk
186 #define yypgo objc_pgo
187 #define yyact objc_act
188 #define yyexca objc_exca
189 #define yyerrflag objc_errflag
190 #define yynerrs objc_nerrs
194 #define yy_yys objc_yys
195 #define yystate objc_state
196 #define yytmp objc_tmp
198 #define yy_yyv objc_yyv
199 #define yyval objc_val
200 #define yylloc objc_lloc
201 #define yyreds objc_reds /* With YYDEBUG defined */
202 #define yytoks objc_toks /* With YYDEBUG defined */
203 #define yyname objc_name /* With YYDEBUG defined */
204 #define yyrule objc_rule /* With YYDEBUG defined */
205 #define yylhs objc_yylhs
206 #define yylen objc_yylen
207 #define yydefred objc_yydefred
208 #define yydgoto objc_yydgoto
209 #define yysindex objc_yysindex
210 #define yyrindex objc_yyrindex
211 #define yygindex objc_yygindex
212 #define yytable objc_yytable
213 #define yycheck objc_yycheck
216 #define YYDEBUG 0 /* Default to no yydebug support. */
220 yyparse
PARAMS ((void));
223 yylex
PARAMS ((void));
226 yyerror
PARAMS ((char *));
230 /* Enabling traces. */
235 /* Enabling verbose error messages. */
236 #ifdef YYERROR_VERBOSE
237 # undef YYERROR_VERBOSE
238 # define YYERROR_VERBOSE 1
240 # define YYERROR_VERBOSE 0
243 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
244 #line 126 "objc-exp.y"
245 typedef union YYSTYPE
{
259 struct symtoken ssym
;
262 enum exp_opcode opcode
;
263 struct internalvar
*ivar
;
264 struct objc_class_str
class;
269 /* Line 191 of yacc.c. */
270 #line 271 "objc-exp.c.tmp"
271 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
272 # define YYSTYPE_IS_DECLARED 1
273 # define YYSTYPE_IS_TRIVIAL 1
278 /* Copy the second part of user declarations. */
279 #line 151 "objc-exp.y"
281 /* YYSTYPE gets defined by %union. */
283 parse_number
PARAMS ((char *, int, int, YYSTYPE
*));
286 /* Line 214 of yacc.c. */
287 #line 288 "objc-exp.c.tmp"
289 #if ! defined (yyoverflow) || YYERROR_VERBOSE
295 # define YYMALLOC xmalloc
298 /* The parser invokes alloca or xmalloc; define the necessary symbols. */
300 # ifdef YYSTACK_USE_ALLOCA
301 # if YYSTACK_USE_ALLOCA
302 # define YYSTACK_ALLOC alloca
305 # if defined (alloca) || defined (_ALLOCA_H)
306 # define YYSTACK_ALLOC alloca
309 # define YYSTACK_ALLOC __builtin_alloca
314 # ifdef YYSTACK_ALLOC
315 /* Pacify GCC's `empty if-body' warning. */
316 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
318 # if defined (__STDC__) || defined (__cplusplus)
319 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
320 # define YYSIZE_T size_t
322 # define YYSTACK_ALLOC YYMALLOC
323 # define YYSTACK_FREE YYFREE
325 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
328 #if (! defined (yyoverflow) \
329 && (! defined (__cplusplus) \
330 || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
332 /* A type that is properly aligned for any stack member. */
339 /* The size of the maximum gap between one aligned stack and the next. */
340 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
342 /* The size of an array large to enough to hold all stacks, each with
344 # define YYSTACK_BYTES(N) \
345 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
346 + YYSTACK_GAP_MAXIMUM)
348 /* Copy COUNT objects from FROM to TO. The source and destination do
351 # if defined (__GNUC__) && 1 < __GNUC__
352 # define YYCOPY(To, From, Count) \
353 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
355 # define YYCOPY(To, From, Count) \
358 register YYSIZE_T yyi; \
359 for (yyi = 0; yyi < (Count); yyi++) \
360 (To)[yyi] = (From)[yyi]; \
366 /* Relocate STACK from its old location to the new one. The
367 local variables YYSIZE and YYSTACKSIZE give the old and new number of
368 elements in the stack, and YYPTR gives the new location of the
369 stack. Advance YYPTR to a properly aligned location for the next
371 # define YYSTACK_RELOCATE(Stack) \
374 YYSIZE_T yynewbytes; \
375 YYCOPY (&yyptr->Stack, Stack, yysize); \
376 Stack = &yyptr->Stack; \
377 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
378 yyptr += yynewbytes / sizeof (*yyptr); \
384 #if defined (__STDC__) || defined (__cplusplus)
385 typedef signed char yysigned_char
;
387 typedef short yysigned_char
;
390 /* YYFINAL -- State number of the termination state. */
392 /* YYLAST -- Last index in YYTABLE. */
395 /* YYNTOKENS -- Number of terminals. */
397 /* YYNNTS -- Number of nonterminals. */
399 /* YYNRULES -- Number of rules. */
401 /* YYNRULES -- Number of states. */
402 #define YYNSTATES 239
404 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
406 #define YYMAXUTOK 298
408 #define YYTRANSLATE(YYX) \
409 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
411 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
412 static const unsigned char yytranslate
[] =
414 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
415 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
416 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
417 2, 2, 2, 61, 2, 2, 2, 52, 38, 2,
418 58, 65, 50, 48, 30, 49, 56, 51, 2, 2,
419 2, 2, 2, 2, 2, 2, 2, 2, 64, 2,
420 41, 32, 42, 33, 47, 2, 2, 2, 2, 2,
421 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
422 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
423 2, 57, 2, 63, 37, 2, 2, 2, 2, 2,
424 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
425 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
426 2, 2, 2, 66, 36, 67, 62, 2, 2, 2,
427 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
428 2, 2, 2, 2, 2, 2, 2, 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, 1, 2, 3, 4,
440 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
441 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
442 25, 26, 27, 28, 29, 31, 34, 35, 39, 40,
443 43, 44, 45, 46, 53, 54, 55, 59, 60
447 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
449 static const unsigned short yyprhs
[] =
451 0, 0, 3, 5, 7, 9, 11, 15, 18, 21,
452 24, 27, 30, 33, 36, 39, 42, 45, 49, 53,
453 58, 62, 66, 71, 76, 77, 83, 84, 90, 91,
454 97, 99, 101, 103, 106, 110, 113, 116, 117, 123,
455 125, 126, 128, 132, 134, 138, 143, 148, 152, 156,
456 160, 164, 168, 172, 176, 180, 184, 188, 192, 196,
457 200, 204, 208, 212, 216, 220, 224, 228, 234, 238,
458 242, 244, 246, 248, 250, 252, 254, 259, 261, 263,
459 265, 269, 273, 277, 282, 284, 287, 289, 291, 294,
460 297, 300, 304, 308, 310, 313, 315, 318, 320, 324,
461 327, 329, 332, 334, 337, 341, 344, 348, 350, 354,
462 356, 358, 360, 362, 364, 367, 371, 374, 378, 382,
463 387, 390, 394, 396, 399, 402, 405, 408, 411, 414,
464 416, 419, 421, 427, 430, 433, 435, 437, 439, 441,
465 443, 447, 449, 451, 453, 455, 457, 459
468 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
469 static const yysigned_char yyrhs
[] =
471 69, 0, -1, 71, -1, 70, -1, 91, -1, 72,
472 -1, 71, 30, 72, -1, 50, 72, -1, 38, 72,
473 -1, 49, 72, -1, 61, 72, -1, 62, 72, -1,
474 54, 72, -1, 53, 72, -1, 72, 54, -1, 72,
475 53, -1, 16, 72, -1, 72, 59, 95, -1, 72,
476 59, 85, -1, 72, 59, 50, 72, -1, 72, 56,
477 95, -1, 72, 56, 85, -1, 72, 56, 50, 72,
478 -1, 72, 57, 71, 63, -1, -1, 57, 9, 73,
479 76, 63, -1, -1, 57, 10, 74, 76, 63, -1,
480 -1, 57, 72, 75, 76, 63, -1, 95, -1, 77,
481 -1, 78, -1, 77, 78, -1, 95, 64, 72, -1,
482 64, 72, -1, 30, 72, -1, -1, 72, 58, 79,
483 81, 65, -1, 66, -1, -1, 72, -1, 81, 30,
484 72, -1, 67, -1, 80, 81, 82, -1, 80, 91,
485 82, 72, -1, 58, 91, 65, 72, -1, 58, 71,
486 65, -1, 72, 47, 72, -1, 72, 50, 72, -1,
487 72, 51, 72, -1, 72, 52, 72, -1, 72, 48,
488 72, -1, 72, 49, 72, -1, 72, 46, 72, -1,
489 72, 45, 72, -1, 72, 40, 72, -1, 72, 39,
490 72, -1, 72, 44, 72, -1, 72, 43, 72, -1,
491 72, 41, 72, -1, 72, 42, 72, -1, 72, 38,
492 72, -1, 72, 37, 72, -1, 72, 36, 72, -1,
493 72, 35, 72, -1, 72, 34, 72, -1, 72, 33,
494 72, 64, 72, -1, 72, 32, 72, -1, 72, 29,
495 72, -1, 3, -1, 11, -1, 4, -1, 84, -1,
496 28, -1, 7, -1, 16, 58, 91, 65, -1, 5,
497 -1, 6, -1, 60, -1, 83, 18, 95, -1, 83,
498 18, 95, -1, 92, 18, 95, -1, 92, 18, 62,
499 95, -1, 85, -1, 18, 95, -1, 96, -1, 92,
500 -1, 92, 25, -1, 92, 26, -1, 92, 87, -1,
501 92, 25, 87, -1, 92, 26, 87, -1, 50, -1,
502 50, 87, -1, 38, -1, 38, 87, -1, 88, -1,
503 58, 87, 65, -1, 88, 89, -1, 89, -1, 88,
504 90, -1, 90, -1, 57, 63, -1, 57, 3, 63,
505 -1, 58, 65, -1, 58, 94, 65, -1, 86, -1,
506 92, 18, 50, -1, 9, -1, 10, -1, 24, -1,
507 22, -1, 23, -1, 22, 24, -1, 17, 22, 24,
508 -1, 22, 22, -1, 22, 22, 24, -1, 17, 22,
509 22, -1, 17, 22, 22, 24, -1, 23, 24, -1,
510 17, 23, 24, -1, 27, -1, 22, 27, -1, 12,
511 95, -1, 13, 95, -1, 14, 95, -1, 15, 95,
512 -1, 17, 93, -1, 17, -1, 21, 93, -1, 21,
513 -1, 19, 95, 41, 91, 42, -1, 25, 92, -1,
514 26, 92, -1, 9, -1, 24, -1, 22, -1, 23,
515 -1, 91, -1, 94, 30, 91, -1, 8, -1, 60,
516 -1, 9, -1, 10, -1, 11, -1, 8, -1, 60,
520 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
521 static const unsigned short yyrline
[] =
523 0, 231, 231, 232, 235, 242, 243, 248, 252, 256,
524 260, 264, 268, 272, 276, 280, 284, 288, 294, 301,
525 305, 312, 320, 324, 333, 332, 354, 353, 369, 368,
526 377, 379, 382, 383, 386, 388, 390, 397, 394, 404,
527 408, 411, 415, 419, 422, 429, 435, 441, 447, 451,
528 455, 459, 463, 467, 471, 475, 479, 483, 487, 491,
529 495, 499, 503, 507, 511, 515, 519, 523, 527, 531,
530 537, 544, 555, 562, 565, 569, 576, 584, 609, 617,
531 634, 645, 661, 674, 699, 700, 734, 793, 799, 800,
532 801, 803, 805, 809, 811, 813, 815, 817, 820, 822,
533 827, 834, 836, 840, 842, 846, 848, 860, 861, 866,
534 868, 876, 878, 880, 882, 884, 886, 888, 890, 892,
535 894, 896, 898, 900, 902, 905, 908, 911, 914, 916,
536 918, 920, 922, 929, 930, 933, 934, 940, 946, 955,
537 960, 967, 968, 969, 970, 971, 974, 975
541 #if YYDEBUG || YYERROR_VERBOSE
542 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
543 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
544 static const char *const yytname
[] =
546 "$end", "error", "$undefined", "INT", "FLOAT", "STRING", "NSSTRING",
547 "SELECTOR", "NAME", "TYPENAME", "CLASSNAME", "NAME_OR_INT", "STRUCT",
548 "CLASS", "UNION", "ENUM", "SIZEOF", "UNSIGNED", "COLONCOLON", "TEMPLATE",
549 "ERROR", "SIGNED_KEYWORD", "LONG", "SHORT", "INT_KEYWORD",
550 "CONST_KEYWORD", "VOLATILE_KEYWORD", "DOUBLE_KEYWORD", "VARIABLE",
551 "ASSIGN_MODIFY", "','", "ABOVE_COMMA", "'='", "'?'", "OROR", "ANDAND",
552 "'|'", "'^'", "'&'", "NOTEQUAL", "EQUAL", "'<'", "'>'", "GEQ", "LEQ",
553 "RSH", "LSH", "'@'", "'+'", "'-'", "'*'", "'/'", "'%'", "DECREMENT",
554 "INCREMENT", "UNARY", "'.'", "'['", "'('", "ARROW", "BLOCKNAME", "'!'",
555 "'~'", "']'", "':'", "')'", "'{'", "'}'", "$accept", "start", "type_exp",
556 "exp1", "exp", "@1", "@2", "@3", "msglist", "msgarglist", "msgarg", "@4",
557 "lcurly", "arglist", "rcurly", "block", "variable", "qualified_name",
558 "ptype", "abs_decl", "direct_abs_decl", "array_mod", "func_mod", "type",
559 "typebase", "typename", "nonempty_typelist", "name", "name_not_typename", 0
564 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
566 static const unsigned short yytoknum
[] =
568 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
569 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
570 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
571 44, 285, 61, 63, 286, 287, 124, 94, 38, 288,
572 289, 60, 62, 290, 291, 292, 293, 64, 43, 45,
573 42, 47, 37, 294, 295, 296, 46, 91, 40, 297,
574 298, 33, 126, 93, 58, 41, 123, 125
578 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
579 static const unsigned char yyr1
[] =
581 0, 68, 69, 69, 70, 71, 71, 72, 72, 72,
582 72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
583 72, 72, 72, 72, 73, 72, 74, 72, 75, 72,
584 76, 76, 77, 77, 78, 78, 78, 79, 72, 80,
585 81, 81, 81, 82, 72, 72, 72, 72, 72, 72,
586 72, 72, 72, 72, 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, 83,
589 83, 84, 85, 85, 84, 84, 84, 86, 86, 86,
590 86, 86, 86, 87, 87, 87, 87, 87, 88, 88,
591 88, 88, 88, 89, 89, 90, 90, 91, 91, 92,
592 92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
593 92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
594 92, 92, 92, 92, 92, 93, 93, 93, 93, 94,
595 94, 95, 95, 95, 95, 95, 96, 96
598 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
599 static const unsigned char yyr2
[] =
601 0, 2, 1, 1, 1, 1, 3, 2, 2, 2,
602 2, 2, 2, 2, 2, 2, 2, 3, 3, 4,
603 3, 3, 4, 4, 0, 5, 0, 5, 0, 5,
604 1, 1, 1, 2, 3, 2, 2, 0, 5, 1,
605 0, 1, 3, 1, 3, 4, 4, 3, 3, 3,
606 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
607 3, 3, 3, 3, 3, 3, 3, 5, 3, 3,
608 1, 1, 1, 1, 1, 1, 4, 1, 1, 1,
609 3, 3, 3, 4, 1, 2, 1, 1, 2, 2,
610 2, 3, 3, 1, 2, 1, 2, 1, 3, 2,
611 1, 2, 1, 2, 3, 2, 3, 1, 3, 1,
612 1, 1, 1, 1, 2, 3, 2, 3, 3, 4,
613 2, 3, 1, 2, 2, 2, 2, 2, 2, 1,
614 2, 1, 5, 2, 2, 1, 1, 1, 1, 1,
615 3, 1, 1, 1, 1, 1, 1, 1
618 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
619 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
620 means the default is an error. */
621 static const unsigned char yydefact
[] =
623 0, 70, 72, 77, 78, 75, 146, 109, 110, 71,
624 0, 0, 0, 0, 0, 129, 0, 0, 131, 112,
625 113, 111, 0, 0, 122, 74, 0, 0, 0, 0,
626 0, 0, 0, 147, 0, 0, 39, 0, 3, 2,
627 5, 40, 0, 73, 84, 107, 4, 87, 86, 141,
628 143, 144, 145, 142, 124, 125, 126, 127, 0, 16,
629 0, 135, 137, 138, 136, 128, 85, 0, 137, 138,
630 130, 116, 114, 123, 120, 133, 134, 8, 9, 7,
631 13, 12, 24, 26, 28, 0, 0, 10, 11, 1,
632 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
633 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
634 0, 0, 0, 15, 14, 0, 0, 37, 0, 41,
635 0, 0, 0, 0, 88, 89, 95, 93, 0, 0,
636 90, 97, 100, 102, 0, 0, 118, 115, 121, 0,
637 117, 0, 0, 0, 47, 0, 6, 69, 68, 0,
638 66, 65, 64, 63, 62, 57, 56, 60, 61, 59,
639 58, 55, 54, 48, 52, 53, 49, 50, 51, 143,
640 144, 0, 21, 20, 0, 40, 0, 18, 17, 0,
641 43, 44, 0, 81, 108, 0, 82, 91, 92, 96,
642 94, 0, 103, 105, 0, 139, 87, 0, 0, 99,
643 101, 76, 119, 0, 0, 0, 0, 31, 32, 30,
644 0, 0, 46, 0, 22, 23, 0, 19, 42, 45,
645 83, 104, 98, 0, 0, 106, 132, 36, 35, 25,
646 33, 0, 0, 27, 29, 67, 38, 140, 34
649 /* YYDEFGOTO[NTERM-NUM]. */
650 static const short yydefgoto
[] =
652 -1, 37, 38, 85, 40, 141, 142, 143, 206, 207,
653 208, 175, 41, 120, 181, 42, 43, 44, 45, 130,
654 131, 132, 133, 195, 60, 65, 197, 209, 48
657 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
659 #define YYPACT_NINF -90
660 static const short yypact
[] =
662 223, -90, -90, -90, -90, -90, -90, -90, -90, -90,
663 19, 19, 19, 19, 287, 195, 19, 19, 234, 82,
664 -9, -90, 307, 307, -90, -90, 223, 223, 223, 223,
665 223, 351, 223, 8, 223, 223, -90, 39, -90, 13,
666 542, 223, 32, -90, -90, -90, -90, 149, -90, -90,
667 -90, -90, -90, -90, -90, -90, -90, -90, 223, 212,
668 38, -90, 33, 45, -90, -90, -90, 30, -90, -90,
669 -90, 83, -90, -90, -90, -90, -90, 212, 212, 212,
670 212, 212, 107, 108, 542, -20, 66, 212, 212, -90,
671 223, 223, 223, 223, 223, 223, 223, 223, 223, 223,
672 223, 223, 223, 223, 223, 223, 223, 223, 223, 223,
673 223, 223, 223, -90, -90, 436, 223, -90, 480, 542,
674 -21, 65, 19, 202, 70, 70, 70, 70, -1, 132,
675 -90, 54, -90, -90, 68, 43, 110, -90, -90, 307,
676 -90, 113, 113, 113, -90, 223, 542, 542, 542, 509,
677 567, 591, 614, 636, 657, 676, 676, 691, 691, 691,
678 691, 334, 334, 703, 713, 713, 212, 212, 212, 107,
679 108, 223, -90, -90, 4, 223, 223, -90, -90, 223,
680 -90, -90, 223, 118, -90, 19, -90, -90, -90, -90,
681 -90, 74, -90, -90, 73, -90, 158, -17, 51, -90,
682 -90, 415, -90, 106, 223, 223, 87, 113, -90, 88,
683 97, 99, 212, 223, 212, -90, -16, 212, 542, 212,
684 -90, -90, -90, 114, 307, -90, -90, 542, 542, -90,
685 -90, 88, 223, -90, -90, 475, -90, -90, 542
688 /* YYPGOTO[NTERM-NUM]. */
689 static const short yypgoto
[] =
691 -90, -90, -90, 3, -10, -90, -90, -90, -28, -90,
692 -44, -90, -90, -7, 50, -90, -90, -71, -90, -89,
693 -90, 47, 48, 1, 0, 163, -90, -5, -90
696 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
697 positive, shift that token. If negative, reduce the rule which
698 number is the opposite. If zero, do what YYDEFACT says.
699 If YYTABLE_NINF, syntax error. */
700 #define YYTABLE_NINF -111
701 static const short yytable
[] =
703 47, 46, 191, 39, 59, 54, 55, 56, 57, 179,
704 90, 66, 67, 224, 179, 74, 77, 78, 79, 80,
705 81, 84, 75, 76, 87, 88, -79, 49, 50, 51,
706 52, 119, 47, 86, 90, 187, 188, 189, 190, 89,
707 194, 47, 121, 90, 172, 144, 180, 177, 225, 236,
708 122, 49, 50, 51, 52, 136, 135, 137, 47, 134,
709 7, 8, 192, 10, 11, 12, 13, 215, 15, 138,
710 17, 139, 18, 19, 20, 21, 22, 23, 24, 53,
711 146, 147, 148, 149, 150, 151, 152, 153, 154, 155,
712 156, 157, 158, 159, 160, 161, 162, 163, 164, 165,
713 166, 167, 168, 53, 71, 185, 72, 140, 126, 73,
714 173, 128, 198, 178, 210, 211, 193, 183, 186, 174,
715 127, 49, 50, 51, 52, -109, -110, 128, 129, 196,
716 186, 145, 180, 201, 202, 212, -80, 221, 222, 196,
717 203, 7, 8, 204, 10, 11, 12, 13, 226, 15,
718 229, 17, 232, 18, 19, 20, 21, 22, 23, 24,
719 233, 214, 234, 230, 184, 119, 217, 123, 216, 218,
720 126, 182, 219, 53, 124, 125, 223, 205, 199, 200,
721 220, 70, 127, 124, 125, 0, 0, 126, 0, 128,
722 129, 212, 0, 0, 227, 228, 126, 193, 196, 127,
723 0, 0, 231, 235, 61, 0, 128, 129, 127, 0,
724 49, 50, 51, 52, 0, 128, 129, 62, 63, 64,
725 0, 0, 238, 0, 196, 237, 1, 2, 3, 4,
726 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
727 15, 16, 17, 61, 18, 19, 20, 21, 22, 23,
728 24, 25, 184, 0, 0, 0, 68, 69, 64, 0,
729 0, 26, 53, 0, 185, 113, 114, 0, 115, 116,
730 117, 118, 27, 28, 0, 0, 29, 30, 0, 0,
731 31, 32, 0, 33, 34, 35, 0, 0, 0, 36,
732 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
733 11, 12, 13, 14, 15, 16, 17, 0, 18, 19,
734 20, 21, 22, 23, 24, 25, 7, 8, 0, 10,
735 11, 12, 13, 0, 15, 26, 17, 0, 18, 19,
736 20, 21, 22, 23, 24, 0, 27, 28, 0, 0,
737 29, 30, 0, 0, 31, 58, 0, 33, 34, 35,
738 0, 0, 0, 36, 1, 2, 3, 4, 5, 6,
739 82, 83, 9, 10, 11, 12, 13, 14, 15, 16,
740 17, 0, 18, 19, 20, 21, 22, 23, 24, 25,
741 0, 107, 108, 109, 110, 111, 112, 113, 114, 26,
742 115, 116, 117, 118, 0, 0, 0, 0, 0, 0,
743 27, 28, 0, 0, 29, 30, 0, 0, 31, 32,
744 0, 33, 34, 35, 0, 0, 0, 36, 1, 2,
745 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
746 13, 14, 15, 16, 17, 0, 18, 19, 20, 21,
747 22, 23, 24, 25, 49, 169, 170, 52, 10, 11,
748 12, 13, 0, 15, 0, 17, 0, 18, 19, 20,
749 21, 22, 23, 24, 0, 0, 0, 0, 29, 30,
750 0, 0, 31, 32, 0, 33, 34, 35, 0, 0,
751 0, 36, 0, 0, 0, 0, 171, 0, 49, 169,
752 170, 52, 10, 11, 12, 13, 53, 15, 0, 17,
753 0, 18, 19, 20, 21, 22, 23, 24, 93, 94,
754 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
755 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
756 176, 115, 116, 117, 118, 0, 0, 0, 91, 0,
757 53, 92, 93, 94, 95, 96, 97, 98, 99, 100,
758 101, 102, 103, 104, 105, 106, 107, 108, 109, 110,
759 111, 112, 113, 114, 0, 115, 116, 117, 118, 0,
760 0, 91, 0, 213, 92, 93, 94, 95, 96, 97,
761 98, 99, 100, 101, 102, 103, 104, 105, 106, 107,
762 108, 109, 110, 111, 112, 113, 114, 0, 115, 116,
763 117, 118, 95, 96, 97, 98, 99, 100, 101, 102,
764 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
765 113, 114, 0, 115, 116, 117, 118, 96, 97, 98,
766 99, 100, 101, 102, 103, 104, 105, 106, 107, 108,
767 109, 110, 111, 112, 113, 114, 0, 115, 116, 117,
768 118, 97, 98, 99, 100, 101, 102, 103, 104, 105,
769 106, 107, 108, 109, 110, 111, 112, 113, 114, 0,
770 115, 116, 117, 118, 98, 99, 100, 101, 102, 103,
771 104, 105, 106, 107, 108, 109, 110, 111, 112, 113,
772 114, 0, 115, 116, 117, 118, 99, 100, 101, 102,
773 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
774 113, 114, 0, 115, 116, 117, 118, 101, 102, 103,
775 104, 105, 106, 107, 108, 109, 110, 111, 112, 113,
776 114, 0, 115, 116, 117, 118, 105, 106, 107, 108,
777 109, 110, 111, 112, 113, 114, 0, 115, 116, 117,
778 118, 108, 109, 110, 111, 112, 113, 114, 0, 115,
779 116, 117, 118, 110, 111, 112, 113, 114, 0, 115,
783 static const short yycheck
[] =
785 0, 0, 3, 0, 14, 10, 11, 12, 13, 30,
786 30, 16, 17, 30, 30, 24, 26, 27, 28, 29,
787 30, 31, 22, 23, 34, 35, 18, 8, 9, 10,
788 11, 41, 32, 32, 30, 124, 125, 126, 127, 0,
789 129, 41, 41, 30, 115, 65, 67, 118, 65, 65,
790 18, 8, 9, 10, 11, 22, 18, 24, 58, 58,
791 9, 10, 63, 12, 13, 14, 15, 63, 17, 24,
792 19, 41, 21, 22, 23, 24, 25, 26, 27, 60,
793 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,
794 100, 101, 102, 103, 104, 105, 106, 107, 108, 109,
795 110, 111, 112, 60, 22, 62, 24, 24, 38, 27,
796 115, 57, 58, 118, 142, 143, 65, 122, 123, 116,
797 50, 8, 9, 10, 11, 18, 18, 57, 58, 129,
798 135, 65, 67, 65, 24, 145, 18, 63, 65, 139,
799 139, 9, 10, 30, 12, 13, 14, 15, 42, 17,
800 63, 19, 64, 21, 22, 23, 24, 25, 26, 27,
801 63, 171, 63, 207, 50, 175, 176, 18, 175, 179,
802 38, 121, 182, 60, 25, 26, 18, 64, 131, 131,
803 185, 18, 50, 25, 26, -1, -1, 38, -1, 57,
804 58, 201, -1, -1, 204, 205, 38, 65, 198, 50,
805 -1, -1, 207, 213, 9, -1, 57, 58, 50, -1,
806 8, 9, 10, 11, -1, 57, 58, 22, 23, 24,
807 -1, -1, 232, -1, 224, 224, 3, 4, 5, 6,
808 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
809 17, 18, 19, 9, 21, 22, 23, 24, 25, 26,
810 27, 28, 50, -1, -1, -1, 22, 23, 24, -1,
811 -1, 38, 60, -1, 62, 53, 54, -1, 56, 57,
812 58, 59, 49, 50, -1, -1, 53, 54, -1, -1,
813 57, 58, -1, 60, 61, 62, -1, -1, -1, 66,
814 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
815 13, 14, 15, 16, 17, 18, 19, -1, 21, 22,
816 23, 24, 25, 26, 27, 28, 9, 10, -1, 12,
817 13, 14, 15, -1, 17, 38, 19, -1, 21, 22,
818 23, 24, 25, 26, 27, -1, 49, 50, -1, -1,
819 53, 54, -1, -1, 57, 58, -1, 60, 61, 62,
820 -1, -1, -1, 66, 3, 4, 5, 6, 7, 8,
821 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
822 19, -1, 21, 22, 23, 24, 25, 26, 27, 28,
823 -1, 47, 48, 49, 50, 51, 52, 53, 54, 38,
824 56, 57, 58, 59, -1, -1, -1, -1, -1, -1,
825 49, 50, -1, -1, 53, 54, -1, -1, 57, 58,
826 -1, 60, 61, 62, -1, -1, -1, 66, 3, 4,
827 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
828 15, 16, 17, 18, 19, -1, 21, 22, 23, 24,
829 25, 26, 27, 28, 8, 9, 10, 11, 12, 13,
830 14, 15, -1, 17, -1, 19, -1, 21, 22, 23,
831 24, 25, 26, 27, -1, -1, -1, -1, 53, 54,
832 -1, -1, 57, 58, -1, 60, 61, 62, -1, -1,
833 -1, 66, -1, -1, -1, -1, 50, -1, 8, 9,
834 10, 11, 12, 13, 14, 15, 60, 17, -1, 19,
835 -1, 21, 22, 23, 24, 25, 26, 27, 33, 34,
836 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
837 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
838 50, 56, 57, 58, 59, -1, -1, -1, 29, -1,
839 60, 32, 33, 34, 35, 36, 37, 38, 39, 40,
840 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
841 51, 52, 53, 54, -1, 56, 57, 58, 59, -1,
842 -1, 29, -1, 64, 32, 33, 34, 35, 36, 37,
843 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
844 48, 49, 50, 51, 52, 53, 54, -1, 56, 57,
845 58, 59, 35, 36, 37, 38, 39, 40, 41, 42,
846 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
847 53, 54, -1, 56, 57, 58, 59, 36, 37, 38,
848 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
849 49, 50, 51, 52, 53, 54, -1, 56, 57, 58,
850 59, 37, 38, 39, 40, 41, 42, 43, 44, 45,
851 46, 47, 48, 49, 50, 51, 52, 53, 54, -1,
852 56, 57, 58, 59, 38, 39, 40, 41, 42, 43,
853 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
854 54, -1, 56, 57, 58, 59, 39, 40, 41, 42,
855 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
856 53, 54, -1, 56, 57, 58, 59, 41, 42, 43,
857 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
858 54, -1, 56, 57, 58, 59, 45, 46, 47, 48,
859 49, 50, 51, 52, 53, 54, -1, 56, 57, 58,
860 59, 48, 49, 50, 51, 52, 53, 54, -1, 56,
861 57, 58, 59, 50, 51, 52, 53, 54, -1, 56,
865 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
866 symbol of state STATE-NUM. */
867 static const unsigned char yystos
[] =
869 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
870 12, 13, 14, 15, 16, 17, 18, 19, 21, 22,
871 23, 24, 25, 26, 27, 28, 38, 49, 50, 53,
872 54, 57, 58, 60, 61, 62, 66, 69, 70, 71,
873 72, 80, 83, 84, 85, 86, 91, 92, 96, 8,
874 9, 10, 11, 60, 95, 95, 95, 95, 58, 72,
875 92, 9, 22, 23, 24, 93, 95, 95, 22, 23,
876 93, 22, 24, 27, 24, 92, 92, 72, 72, 72,
877 72, 72, 9, 10, 72, 71, 91, 72, 72, 0,
878 30, 29, 32, 33, 34, 35, 36, 37, 38, 39,
879 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
880 50, 51, 52, 53, 54, 56, 57, 58, 59, 72,
881 81, 91, 18, 18, 25, 26, 38, 50, 57, 58,
882 87, 88, 89, 90, 91, 18, 22, 24, 24, 41,
883 24, 73, 74, 75, 65, 65, 72, 72, 72, 72,
884 72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
885 72, 72, 72, 72, 72, 72, 72, 72, 72, 9,
886 10, 50, 85, 95, 71, 79, 50, 85, 95, 30,
887 67, 82, 82, 95, 50, 62, 95, 87, 87, 87,
888 87, 3, 63, 65, 87, 91, 92, 94, 58, 89,
889 90, 65, 24, 91, 30, 64, 76, 77, 78, 95,
890 76, 76, 72, 64, 72, 63, 81, 72, 72, 72,
891 95, 63, 65, 18, 30, 65, 42, 72, 72, 63,
892 78, 95, 64, 63, 63, 72, 65, 91, 72
895 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
896 # define YYSIZE_T __SIZE_TYPE__
898 #if ! defined (YYSIZE_T) && defined (size_t)
899 # define YYSIZE_T size_t
901 #if ! defined (YYSIZE_T)
902 # if defined (__STDC__) || defined (__cplusplus)
903 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
904 # define YYSIZE_T size_t
907 #if ! defined (YYSIZE_T)
908 # define YYSIZE_T unsigned int
911 #define yyerrok (yyerrstatus = 0)
912 #define yyclearin (yychar = YYEMPTY)
916 #define YYACCEPT goto yyacceptlab
917 #define YYABORT goto yyabortlab
918 #define YYERROR goto yyerrorlab
921 /* Like YYERROR except do call yyerror. This remains here temporarily
922 to ease the transition to the new meaning of YYERROR, for GCC.
923 Once GCC version 2 has supplanted version 1, this can go. */
925 #define YYFAIL goto yyerrlab
927 #define YYRECOVERING() (!!yyerrstatus)
929 #define YYBACKUP(Token, Value) \
931 if (yychar == YYEMPTY && yylen == 1) \
935 yytoken = YYTRANSLATE (yychar); \
941 yyerror ("syntax error: cannot back up");\
947 #define YYERRCODE 256
949 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
952 #ifndef YYLLOC_DEFAULT
953 # define YYLLOC_DEFAULT(Current, Rhs, N) \
954 ((Current).first_line = (Rhs)[1].first_line, \
955 (Current).first_column = (Rhs)[1].first_column, \
956 (Current).last_line = (Rhs)[N].last_line, \
957 (Current).last_column = (Rhs)[N].last_column)
960 /* YYLEX -- calling `yylex' with the right arguments. */
963 # define YYLEX yylex (YYLEX_PARAM)
965 # define YYLEX yylex ()
968 /* Enable debugging if requested. */
972 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
973 # define YYFPRINTF fprintf
976 # define YYDPRINTF(Args) \
982 # define YYDSYMPRINT(Args) \
988 # define YYDSYMPRINTF(Title, Token, Value, Location) \
992 YYFPRINTF (stderr, "%s ", Title); \
993 yysymprint (stderr, \
995 YYFPRINTF (stderr, "\n"); \
999 /*------------------------------------------------------------------.
1000 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1002 `------------------------------------------------------------------*/
1004 #if defined (__STDC__) || defined (__cplusplus)
1006 yy_stack_print (short *bottom
, short *top
)
1009 yy_stack_print (bottom
, top
)
1014 YYFPRINTF (stderr
, "Stack now");
1015 for (/* Nothing. */; bottom
<= top
; ++bottom
)
1016 YYFPRINTF (stderr
, " %d", *bottom
);
1017 YYFPRINTF (stderr
, "\n");
1020 # define YY_STACK_PRINT(Bottom, Top) \
1023 yy_stack_print ((Bottom), (Top)); \
1027 /*------------------------------------------------.
1028 | Report that the YYRULE is going to be reduced. |
1029 `------------------------------------------------*/
1031 #if defined (__STDC__) || defined (__cplusplus)
1033 yy_reduce_print (int yyrule
)
1036 yy_reduce_print (yyrule
)
1041 unsigned int yylno
= yyrline
[yyrule
];
1042 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %u), ",
1044 /* Print the symbols being reduced, and their result. */
1045 for (yyi
= yyprhs
[yyrule
]; 0 <= yyrhs
[yyi
]; yyi
++)
1046 YYFPRINTF (stderr
, "%s ", yytname
[yyrhs
[yyi
]]);
1047 YYFPRINTF (stderr
, "-> %s\n", yytname
[yyr1
[yyrule
]]);
1050 # define YY_REDUCE_PRINT(Rule) \
1053 yy_reduce_print (Rule); \
1056 /* Nonzero means print parse trace. It is left uninitialized so that
1057 multiple parsers can coexist. */
1059 #else /* !YYDEBUG */
1060 # define YYDPRINTF(Args)
1061 # define YYDSYMPRINT(Args)
1062 # define YYDSYMPRINTF(Title, Token, Value, Location)
1063 # define YY_STACK_PRINT(Bottom, Top)
1064 # define YY_REDUCE_PRINT(Rule)
1065 #endif /* !YYDEBUG */
1068 /* YYINITDEPTH -- initial size of the parser's stacks. */
1070 # define YYINITDEPTH 200
1073 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1074 if the built-in stack extension method is used).
1076 Do not make this value too large; the results are undefined if
1077 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
1078 evaluated with infinite-precision integer arithmetic. */
1080 #if defined (YYMAXDEPTH) && YYMAXDEPTH == 0
1085 # define YYMAXDEPTH 10000
1093 # if defined (__GLIBC__) && defined (_STRING_H)
1094 # define yystrlen strlen
1096 /* Return the length of YYSTR. */
1098 # if defined (__STDC__) || defined (__cplusplus)
1099 yystrlen (const char *yystr
)
1105 register const char *yys
= yystr
;
1107 while (*yys
++ != '\0')
1110 return yys
- yystr
- 1;
1116 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
1117 # define yystpcpy stpcpy
1119 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1122 # if defined (__STDC__) || defined (__cplusplus)
1123 yystpcpy (char *yydest
, const char *yysrc
)
1125 yystpcpy (yydest
, yysrc
)
1130 register char *yyd
= yydest
;
1131 register const char *yys
= yysrc
;
1133 while ((*yyd
++ = *yys
++) != '\0')
1141 #endif /* !YYERROR_VERBOSE */
1146 /*--------------------------------.
1147 | Print this symbol on YYOUTPUT. |
1148 `--------------------------------*/
1150 #if defined (__STDC__) || defined (__cplusplus)
1152 yysymprint (FILE *yyoutput
, int yytype
, YYSTYPE
*yyvaluep
)
1155 yysymprint (yyoutput
, yytype
, yyvaluep
)
1161 /* Pacify ``unused variable'' warnings. */
1164 if (yytype
< YYNTOKENS
)
1166 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1168 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1172 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1179 YYFPRINTF (yyoutput
, ")");
1182 #endif /* ! YYDEBUG */
1183 /*-----------------------------------------------.
1184 | Release the memory associated to this symbol. |
1185 `-----------------------------------------------*/
1187 #if defined (__STDC__) || defined (__cplusplus)
1189 yydestruct (int yytype
, YYSTYPE
*yyvaluep
)
1192 yydestruct (yytype
, yyvaluep
)
1197 /* Pacify ``unused variable'' warnings. */
1209 /* Prevent warnings from -Wmissing-prototypes. */
1211 #ifdef YYPARSE_PARAM
1212 # if defined (__STDC__) || defined (__cplusplus)
1213 int yyparse (void *YYPARSE_PARAM
);
1217 #else /* ! YYPARSE_PARAM */
1218 #if defined (__STDC__) || defined (__cplusplus)
1223 #endif /* ! YYPARSE_PARAM */
1227 /* The lookahead symbol. */
1230 /* The semantic value of the lookahead symbol. */
1233 /* Number of syntax errors so far. */
1242 #ifdef YYPARSE_PARAM
1243 # if defined (__STDC__) || defined (__cplusplus)
1244 int yyparse (void *YYPARSE_PARAM
)
1246 int yyparse (YYPARSE_PARAM
)
1247 void *YYPARSE_PARAM
;
1249 #else /* ! YYPARSE_PARAM */
1250 #if defined (__STDC__) || defined (__cplusplus)
1261 register int yystate
;
1264 /* Number of tokens to shift before error messages enabled. */
1266 /* Lookahead token as an internal (translated) token number. */
1269 /* Three stacks and their tools:
1270 `yyss': related to states,
1271 `yyvs': related to semantic values,
1272 `yyls': related to locations.
1274 Refer to the stacks thru separate pointers, to allow yyoverflow
1275 to xreallocate them elsewhere. */
1277 /* The state stack. */
1278 short yyssa
[YYINITDEPTH
];
1279 short *yyss
= yyssa
;
1280 register short *yyssp
;
1282 /* The semantic value stack. */
1283 YYSTYPE yyvsa
[YYINITDEPTH
];
1284 YYSTYPE
*yyvs
= yyvsa
;
1285 register YYSTYPE
*yyvsp
;
1289 #define YYPOPSTACK (yyvsp--, yyssp--)
1291 YYSIZE_T yystacksize
= YYINITDEPTH
;
1293 /* The variables used to return semantic value and location from the
1298 /* When reducing, the number of symbols on the RHS of the reduced
1302 YYDPRINTF ((stderr
, "Starting parse\n"));
1307 yychar
= YYEMPTY
; /* Cause a token to be read. */
1309 /* Initialize stack pointers.
1310 Waste one element of value and location stack
1311 so that they stay on the same level as the state stack.
1312 The wasted elements are never initialized. */
1319 /*------------------------------------------------------------.
1320 | yynewstate -- Push a new state, which is found in yystate. |
1321 `------------------------------------------------------------*/
1323 /* In all cases, when you get here, the value and location stacks
1324 have just been pushed. so pushing a state here evens the stacks.
1331 if (yyss
+ yystacksize
- 1 <= yyssp
)
1333 /* Get the current used size of the three stacks, in elements. */
1334 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1338 /* Give user a chance to xreallocate the stack. Use copies of
1339 these so that the &'s don't force the real ones into
1341 YYSTYPE
*yyvs1
= yyvs
;
1342 short *yyss1
= yyss
;
1345 /* Each stack pointer address is followed by the size of the
1346 data in use in that stack, in bytes. This used to be a
1347 conditional around just the two extra args, but that might
1348 be undefined if yyoverflow is a macro. */
1349 yyoverflow ("parser stack overflow",
1350 &yyss1
, yysize
* sizeof (*yyssp
),
1351 &yyvs1
, yysize
* sizeof (*yyvsp
),
1358 #else /* no yyoverflow */
1359 # ifndef YYSTACK_RELOCATE
1362 /* Extend the stack our own way. */
1363 if (YYMAXDEPTH
<= yystacksize
)
1366 if (YYMAXDEPTH
< yystacksize
)
1367 yystacksize
= YYMAXDEPTH
;
1370 short *yyss1
= yyss
;
1371 union yyalloc
*yyptr
=
1372 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1375 YYSTACK_RELOCATE (yyss
);
1376 YYSTACK_RELOCATE (yyvs
);
1378 # undef YYSTACK_RELOCATE
1380 YYSTACK_FREE (yyss1
);
1383 #endif /* no yyoverflow */
1385 yyssp
= yyss
+ yysize
- 1;
1386 yyvsp
= yyvs
+ yysize
- 1;
1389 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1390 (unsigned long int) yystacksize
));
1392 if (yyss
+ yystacksize
- 1 <= yyssp
)
1396 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1405 /* Do appropriate processing given the current state. */
1406 /* Read a lookahead token if we need one and don't already have one. */
1409 /* First try to decide what to do without reference to lookahead token. */
1411 yyn
= yypact
[yystate
];
1412 if (yyn
== YYPACT_NINF
)
1415 /* Not known => get a lookahead token if don't already have one. */
1417 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1418 if (yychar
== YYEMPTY
)
1420 YYDPRINTF ((stderr
, "Reading a token: "));
1424 if (yychar
<= YYEOF
)
1426 yychar
= yytoken
= YYEOF
;
1427 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1431 yytoken
= YYTRANSLATE (yychar
);
1432 YYDSYMPRINTF ("Next token is", yytoken
, &yylval
, &yylloc
);
1435 /* If the proper action on seeing token YYTOKEN is to reduce or to
1436 detect an error, take that action. */
1438 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1443 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
1452 /* Shift the lookahead token. */
1453 YYDPRINTF ((stderr
, "Shifting token %s, ", yytname
[yytoken
]));
1455 /* Discard the token being shifted unless it is eof. */
1456 if (yychar
!= YYEOF
)
1462 /* Count tokens shifted since error; after three, turn off error
1471 /*-----------------------------------------------------------.
1472 | yydefault -- do the default action for the current state. |
1473 `-----------------------------------------------------------*/
1475 yyn
= yydefact
[yystate
];
1481 /*-----------------------------.
1482 | yyreduce -- Do a reduction. |
1483 `-----------------------------*/
1485 /* yyn is the number of a rule to reduce with. */
1488 /* If YYLEN is nonzero, implement the default value of the action:
1491 Otherwise, the following line sets YYVAL to garbage.
1492 This behavior is undocumented and Bison
1493 users should not rely upon it. Assigning to YYVAL
1494 unconditionally makes the parser a bit smaller, and it avoids a
1495 GCC warning that YYVAL may be used uninitialized. */
1496 yyval
= yyvsp
[1-yylen
];
1499 YY_REDUCE_PRINT (yyn
);
1503 #line 236 "objc-exp.y"
1504 { write_exp_elt_opcode(OP_TYPE
);
1505 write_exp_elt_type(yyvsp
[0].tval
);
1506 write_exp_elt_opcode(OP_TYPE
);}
1510 #line 244 "objc-exp.y"
1511 { write_exp_elt_opcode (BINOP_COMMA
); }
1515 #line 249 "objc-exp.y"
1516 { write_exp_elt_opcode (UNOP_IND
); }
1520 #line 253 "objc-exp.y"
1521 { write_exp_elt_opcode (UNOP_ADDR
); }
1525 #line 257 "objc-exp.y"
1526 { write_exp_elt_opcode (UNOP_NEG
); }
1530 #line 261 "objc-exp.y"
1531 { write_exp_elt_opcode (UNOP_LOGICAL_NOT
); }
1535 #line 265 "objc-exp.y"
1536 { write_exp_elt_opcode (UNOP_COMPLEMENT
); }
1540 #line 269 "objc-exp.y"
1541 { write_exp_elt_opcode (UNOP_PREINCREMENT
); }
1545 #line 273 "objc-exp.y"
1546 { write_exp_elt_opcode (UNOP_PREDECREMENT
); }
1550 #line 277 "objc-exp.y"
1551 { write_exp_elt_opcode (UNOP_POSTINCREMENT
); }
1555 #line 281 "objc-exp.y"
1556 { write_exp_elt_opcode (UNOP_POSTDECREMENT
); }
1560 #line 285 "objc-exp.y"
1561 { write_exp_elt_opcode (UNOP_SIZEOF
); }
1565 #line 289 "objc-exp.y"
1566 { write_exp_elt_opcode (STRUCTOP_PTR
);
1567 write_exp_string (yyvsp
[0].sval
);
1568 write_exp_elt_opcode (STRUCTOP_PTR
); }
1572 #line 295 "objc-exp.y"
1573 { /* exp->type::name becomes exp->*(&type::name) */
1574 /* Note: this doesn't work if name is a
1575 static member! FIXME */
1576 write_exp_elt_opcode (UNOP_ADDR
);
1577 write_exp_elt_opcode (STRUCTOP_MPTR
); }
1581 #line 302 "objc-exp.y"
1582 { write_exp_elt_opcode (STRUCTOP_MPTR
); }
1586 #line 306 "objc-exp.y"
1587 { write_exp_elt_opcode (STRUCTOP_STRUCT
);
1588 write_exp_string (yyvsp
[0].sval
);
1589 write_exp_elt_opcode (STRUCTOP_STRUCT
); }
1593 #line 313 "objc-exp.y"
1594 { /* exp.type::name becomes exp.*(&type::name) */
1595 /* Note: this doesn't work if name is a
1596 static member! FIXME */
1597 write_exp_elt_opcode (UNOP_ADDR
);
1598 write_exp_elt_opcode (STRUCTOP_MEMBER
); }
1602 #line 321 "objc-exp.y"
1603 { write_exp_elt_opcode (STRUCTOP_MEMBER
); }
1607 #line 325 "objc-exp.y"
1608 { write_exp_elt_opcode (BINOP_SUBSCRIPT
); }
1612 #line 333 "objc-exp.y"
1616 class = lookup_objc_class (copy_name (yyvsp
[0].tsym
.stoken
));
1618 error ("%s is not an ObjC Class",
1619 copy_name (yyvsp
[0].tsym
.stoken
));
1620 write_exp_elt_opcode (OP_LONG
);
1621 write_exp_elt_type (builtin_type_int
);
1622 write_exp_elt_longcst ((LONGEST
) class);
1623 write_exp_elt_opcode (OP_LONG
);
1629 #line 347 "objc-exp.y"
1630 { write_exp_elt_opcode (OP_OBJC_MSGCALL
);
1632 write_exp_elt_opcode (OP_OBJC_MSGCALL
);
1637 #line 354 "objc-exp.y"
1639 write_exp_elt_opcode (OP_LONG
);
1640 write_exp_elt_type (builtin_type_int
);
1641 write_exp_elt_longcst ((LONGEST
) yyvsp
[0].class.class);
1642 write_exp_elt_opcode (OP_LONG
);
1648 #line 362 "objc-exp.y"
1649 { write_exp_elt_opcode (OP_OBJC_MSGCALL
);
1651 write_exp_elt_opcode (OP_OBJC_MSGCALL
);
1656 #line 369 "objc-exp.y"
1657 { start_msglist(); }
1661 #line 371 "objc-exp.y"
1662 { write_exp_elt_opcode (OP_OBJC_MSGCALL
);
1664 write_exp_elt_opcode (OP_OBJC_MSGCALL
);
1669 #line 378 "objc-exp.y"
1670 { add_msglist(&yyvsp
[0].sval
, 0); }
1674 #line 387 "objc-exp.y"
1675 { add_msglist(&yyvsp
[-2].sval
, 1); }
1679 #line 389 "objc-exp.y"
1680 { add_msglist(0, 1); }
1684 #line 391 "objc-exp.y"
1685 { add_msglist(0, 0); }
1689 #line 397 "objc-exp.y"
1690 { start_arglist (); }
1694 #line 399 "objc-exp.y"
1695 { write_exp_elt_opcode (OP_FUNCALL
);
1696 write_exp_elt_longcst ((LONGEST
) end_arglist ());
1697 write_exp_elt_opcode (OP_FUNCALL
); }
1701 #line 405 "objc-exp.y"
1702 { start_arglist (); }
1706 #line 412 "objc-exp.y"
1707 { arglist_len
= 1; }
1711 #line 416 "objc-exp.y"
1716 #line 420 "objc-exp.y"
1717 { yyval
.lval
= end_arglist () - 1; }
1721 #line 423 "objc-exp.y"
1722 { write_exp_elt_opcode (OP_ARRAY
);
1723 write_exp_elt_longcst ((LONGEST
) 0);
1724 write_exp_elt_longcst ((LONGEST
) yyvsp
[0].lval
);
1725 write_exp_elt_opcode (OP_ARRAY
); }
1729 #line 430 "objc-exp.y"
1730 { write_exp_elt_opcode (UNOP_MEMVAL
);
1731 write_exp_elt_type (yyvsp
[-2].tval
);
1732 write_exp_elt_opcode (UNOP_MEMVAL
); }
1736 #line 436 "objc-exp.y"
1737 { write_exp_elt_opcode (UNOP_CAST
);
1738 write_exp_elt_type (yyvsp
[-2].tval
);
1739 write_exp_elt_opcode (UNOP_CAST
); }
1743 #line 442 "objc-exp.y"
1748 #line 448 "objc-exp.y"
1749 { write_exp_elt_opcode (BINOP_REPEAT
); }
1753 #line 452 "objc-exp.y"
1754 { write_exp_elt_opcode (BINOP_MUL
); }
1758 #line 456 "objc-exp.y"
1759 { write_exp_elt_opcode (BINOP_DIV
); }
1763 #line 460 "objc-exp.y"
1764 { write_exp_elt_opcode (BINOP_REM
); }
1768 #line 464 "objc-exp.y"
1769 { write_exp_elt_opcode (BINOP_ADD
); }
1773 #line 468 "objc-exp.y"
1774 { write_exp_elt_opcode (BINOP_SUB
); }
1778 #line 472 "objc-exp.y"
1779 { write_exp_elt_opcode (BINOP_LSH
); }
1783 #line 476 "objc-exp.y"
1784 { write_exp_elt_opcode (BINOP_RSH
); }
1788 #line 480 "objc-exp.y"
1789 { write_exp_elt_opcode (BINOP_EQUAL
); }
1793 #line 484 "objc-exp.y"
1794 { write_exp_elt_opcode (BINOP_NOTEQUAL
); }
1798 #line 488 "objc-exp.y"
1799 { write_exp_elt_opcode (BINOP_LEQ
); }
1803 #line 492 "objc-exp.y"
1804 { write_exp_elt_opcode (BINOP_GEQ
); }
1808 #line 496 "objc-exp.y"
1809 { write_exp_elt_opcode (BINOP_LESS
); }
1813 #line 500 "objc-exp.y"
1814 { write_exp_elt_opcode (BINOP_GTR
); }
1818 #line 504 "objc-exp.y"
1819 { write_exp_elt_opcode (BINOP_BITWISE_AND
); }
1823 #line 508 "objc-exp.y"
1824 { write_exp_elt_opcode (BINOP_BITWISE_XOR
); }
1828 #line 512 "objc-exp.y"
1829 { write_exp_elt_opcode (BINOP_BITWISE_IOR
); }
1833 #line 516 "objc-exp.y"
1834 { write_exp_elt_opcode (BINOP_LOGICAL_AND
); }
1838 #line 520 "objc-exp.y"
1839 { write_exp_elt_opcode (BINOP_LOGICAL_OR
); }
1843 #line 524 "objc-exp.y"
1844 { write_exp_elt_opcode (TERNOP_COND
); }
1848 #line 528 "objc-exp.y"
1849 { write_exp_elt_opcode (BINOP_ASSIGN
); }
1853 #line 532 "objc-exp.y"
1854 { write_exp_elt_opcode (BINOP_ASSIGN_MODIFY
);
1855 write_exp_elt_opcode (yyvsp
[-1].opcode
);
1856 write_exp_elt_opcode (BINOP_ASSIGN_MODIFY
); }
1860 #line 538 "objc-exp.y"
1861 { write_exp_elt_opcode (OP_LONG
);
1862 write_exp_elt_type (yyvsp
[0].typed_val_int
.type
);
1863 write_exp_elt_longcst ((LONGEST
)(yyvsp
[0].typed_val_int
.val
));
1864 write_exp_elt_opcode (OP_LONG
); }
1868 #line 545 "objc-exp.y"
1870 parse_number (yyvsp
[0].ssym
.stoken
.ptr
, yyvsp
[0].ssym
.stoken
.length
, 0, &val
);
1871 write_exp_elt_opcode (OP_LONG
);
1872 write_exp_elt_type (val
.typed_val_int
.type
);
1873 write_exp_elt_longcst ((LONGEST
)val
.typed_val_int
.val
);
1874 write_exp_elt_opcode (OP_LONG
);
1879 #line 556 "objc-exp.y"
1880 { write_exp_elt_opcode (OP_DOUBLE
);
1881 write_exp_elt_type (yyvsp
[0].typed_val_float
.type
);
1882 write_exp_elt_dblcst (yyvsp
[0].typed_val_float
.dval
);
1883 write_exp_elt_opcode (OP_DOUBLE
); }
1887 #line 570 "objc-exp.y"
1889 write_exp_elt_opcode (OP_OBJC_SELECTOR
);
1890 write_exp_string (yyvsp
[0].sval
);
1891 write_exp_elt_opcode (OP_OBJC_SELECTOR
); }
1895 #line 577 "objc-exp.y"
1896 { write_exp_elt_opcode (OP_LONG
);
1897 write_exp_elt_type (builtin_type_int
);
1898 CHECK_TYPEDEF (yyvsp
[-1].tval
);
1899 write_exp_elt_longcst ((LONGEST
) TYPE_LENGTH (yyvsp
[-1].tval
));
1900 write_exp_elt_opcode (OP_LONG
); }
1904 #line 585 "objc-exp.y"
1905 { /* C strings are converted into array
1906 constants with an explicit null byte
1907 added at the end. Thus the array upper
1908 bound is the string length. There is no
1909 such thing in C as a completely empty
1911 char *sp
= yyvsp
[0].sval
.ptr
; int count
= yyvsp
[0].sval
.length
;
1914 write_exp_elt_opcode (OP_LONG
);
1915 write_exp_elt_type (builtin_type_char
);
1916 write_exp_elt_longcst ((LONGEST
)(*sp
++));
1917 write_exp_elt_opcode (OP_LONG
);
1919 write_exp_elt_opcode (OP_LONG
);
1920 write_exp_elt_type (builtin_type_char
);
1921 write_exp_elt_longcst ((LONGEST
)'\0');
1922 write_exp_elt_opcode (OP_LONG
);
1923 write_exp_elt_opcode (OP_ARRAY
);
1924 write_exp_elt_longcst ((LONGEST
) 0);
1925 write_exp_elt_longcst ((LONGEST
) (yyvsp
[0].sval
.length
));
1926 write_exp_elt_opcode (OP_ARRAY
); }
1930 #line 612 "objc-exp.y"
1931 { write_exp_elt_opcode (OP_OBJC_NSSTRING
);
1932 write_exp_string (yyvsp
[0].sval
);
1933 write_exp_elt_opcode (OP_OBJC_NSSTRING
); }
1937 #line 618 "objc-exp.y"
1939 if (yyvsp
[0].ssym
.sym
!= 0)
1940 yyval
.bval
= SYMBOL_BLOCK_VALUE (yyvsp
[0].ssym
.sym
);
1943 struct symtab
*tem
=
1944 lookup_symtab (copy_name (yyvsp
[0].ssym
.stoken
));
1946 yyval
.bval
= BLOCKVECTOR_BLOCK (BLOCKVECTOR (tem
), STATIC_BLOCK
);
1948 error ("No file or function \"%s\".",
1949 copy_name (yyvsp
[0].ssym
.stoken
));
1955 #line 635 "objc-exp.y"
1956 { struct symbol
*tem
1957 = lookup_symbol (copy_name (yyvsp
[0].sval
), yyvsp
[-2].bval
,
1958 VAR_DOMAIN
, (int *) NULL
,
1959 (struct symtab
**) NULL
);
1960 if (!tem
|| SYMBOL_CLASS (tem
) != LOC_BLOCK
)
1961 error ("No function \"%s\" in specified context.",
1962 copy_name (yyvsp
[0].sval
));
1963 yyval
.bval
= SYMBOL_BLOCK_VALUE (tem
); }
1967 #line 646 "objc-exp.y"
1968 { struct symbol
*sym
;
1969 sym
= lookup_symbol (copy_name (yyvsp
[0].sval
), yyvsp
[-2].bval
,
1970 VAR_DOMAIN
, (int *) NULL
,
1971 (struct symtab
**) NULL
);
1973 error ("No symbol \"%s\" in specified context.",
1974 copy_name (yyvsp
[0].sval
));
1976 write_exp_elt_opcode (OP_VAR_VALUE
);
1977 /* block_found is set by lookup_symbol. */
1978 write_exp_elt_block (block_found
);
1979 write_exp_elt_sym (sym
);
1980 write_exp_elt_opcode (OP_VAR_VALUE
); }
1984 #line 662 "objc-exp.y"
1986 struct type
*type
= yyvsp
[-2].tval
;
1987 if (TYPE_CODE (type
) != TYPE_CODE_STRUCT
1988 && TYPE_CODE (type
) != TYPE_CODE_UNION
)
1989 error ("`%s' is not defined as an aggregate type.",
1992 write_exp_elt_opcode (OP_SCOPE
);
1993 write_exp_elt_type (type
);
1994 write_exp_string (yyvsp
[0].sval
);
1995 write_exp_elt_opcode (OP_SCOPE
);
2000 #line 675 "objc-exp.y"
2002 struct type
*type
= yyvsp
[-3].tval
;
2003 struct stoken tmp_token
;
2004 if (TYPE_CODE (type
) != TYPE_CODE_STRUCT
2005 && TYPE_CODE (type
) != TYPE_CODE_UNION
)
2006 error ("`%s' is not defined as an aggregate type.",
2009 if (!DEPRECATED_STREQ (type_name_no_tag (type
), yyvsp
[0].sval
.ptr
))
2010 error ("invalid destructor `%s::~%s'",
2011 type_name_no_tag (type
), yyvsp
[0].sval
.ptr
);
2013 tmp_token
.ptr
= (char*) alloca (yyvsp
[0].sval
.length
+ 2);
2014 tmp_token
.length
= yyvsp
[0].sval
.length
+ 1;
2015 tmp_token
.ptr
[0] = '~';
2016 memcpy (tmp_token
.ptr
+1, yyvsp
[0].sval
.ptr
, yyvsp
[0].sval
.length
);
2017 tmp_token
.ptr
[tmp_token
.length
] = 0;
2018 write_exp_elt_opcode (OP_SCOPE
);
2019 write_exp_elt_type (type
);
2020 write_exp_string (tmp_token
);
2021 write_exp_elt_opcode (OP_SCOPE
);
2026 #line 701 "objc-exp.y"
2028 char *name
= copy_name (yyvsp
[0].sval
);
2030 struct minimal_symbol
*msymbol
;
2033 lookup_symbol (name
, (const struct block
*) NULL
,
2034 VAR_DOMAIN
, (int *) NULL
,
2035 (struct symtab
**) NULL
);
2038 write_exp_elt_opcode (OP_VAR_VALUE
);
2039 write_exp_elt_block (NULL
);
2040 write_exp_elt_sym (sym
);
2041 write_exp_elt_opcode (OP_VAR_VALUE
);
2045 msymbol
= lookup_minimal_symbol (name
, NULL
, NULL
);
2046 if (msymbol
!= NULL
)
2048 write_exp_msymbol (msymbol
,
2049 lookup_function_type (builtin_type_int
),
2053 if (!have_full_symbols () && !have_partial_symbols ())
2054 error ("No symbol table is loaded. Use the \"file\" command.");
2056 error ("No symbol \"%s\" in current context.", name
);
2061 #line 735 "objc-exp.y"
2062 { struct symbol
*sym
= yyvsp
[0].ssym
.sym
;
2066 if (symbol_read_needs_frame (sym
))
2068 if (innermost_block
== 0 ||
2069 contained_in (block_found
,
2071 innermost_block
= block_found
;
2074 write_exp_elt_opcode (OP_VAR_VALUE
);
2075 /* We want to use the selected frame, not
2076 another more inner frame which happens to
2077 be in the same block. */
2078 write_exp_elt_block (NULL
);
2079 write_exp_elt_sym (sym
);
2080 write_exp_elt_opcode (OP_VAR_VALUE
);
2082 else if (yyvsp
[0].ssym
.is_a_field_of_this
)
2084 /* C++/ObjC: it hangs off of `this'/'self'.
2085 Must not inadvertently convert from a
2086 method call to data ref. */
2087 if (innermost_block
== 0 ||
2088 contained_in (block_found
, innermost_block
))
2089 innermost_block
= block_found
;
2090 write_exp_elt_opcode (OP_OBJC_SELF
);
2091 write_exp_elt_opcode (OP_OBJC_SELF
);
2092 write_exp_elt_opcode (STRUCTOP_PTR
);
2093 write_exp_string (yyvsp
[0].ssym
.stoken
);
2094 write_exp_elt_opcode (STRUCTOP_PTR
);
2098 struct minimal_symbol
*msymbol
;
2099 char *arg
= copy_name (yyvsp
[0].ssym
.stoken
);
2102 lookup_minimal_symbol (arg
, NULL
, NULL
);
2103 if (msymbol
!= NULL
)
2105 write_exp_msymbol (msymbol
,
2106 lookup_function_type (builtin_type_int
),
2109 else if (!have_full_symbols () &&
2110 !have_partial_symbols ())
2111 error ("No symbol table is loaded. Use the \"file\" command.");
2113 error ("No symbol \"%s\" in current context.",
2114 copy_name (yyvsp
[0].ssym
.stoken
));
2120 #line 802 "objc-exp.y"
2121 { yyval
.tval
= follow_types (yyvsp
[-1].tval
); }
2125 #line 804 "objc-exp.y"
2126 { yyval
.tval
= follow_types (yyvsp
[-2].tval
); }
2130 #line 806 "objc-exp.y"
2131 { yyval
.tval
= follow_types (yyvsp
[-2].tval
); }
2135 #line 810 "objc-exp.y"
2136 { push_type (tp_pointer
); yyval
.voidval
= 0; }
2140 #line 812 "objc-exp.y"
2141 { push_type (tp_pointer
); yyval
.voidval
= yyvsp
[0].voidval
; }
2145 #line 814 "objc-exp.y"
2146 { push_type (tp_reference
); yyval
.voidval
= 0; }
2150 #line 816 "objc-exp.y"
2151 { push_type (tp_reference
); yyval
.voidval
= yyvsp
[0].voidval
; }
2155 #line 821 "objc-exp.y"
2156 { yyval
.voidval
= yyvsp
[-1].voidval
; }
2160 #line 823 "objc-exp.y"
2162 push_type_int (yyvsp
[0].lval
);
2163 push_type (tp_array
);
2168 #line 828 "objc-exp.y"
2170 push_type_int (yyvsp
[0].lval
);
2171 push_type (tp_array
);
2177 #line 835 "objc-exp.y"
2178 { push_type (tp_function
); }
2182 #line 837 "objc-exp.y"
2183 { push_type (tp_function
); }
2187 #line 841 "objc-exp.y"
2188 { yyval
.lval
= -1; }
2192 #line 843 "objc-exp.y"
2193 { yyval
.lval
= yyvsp
[-1].typed_val_int
.val
; }
2197 #line 847 "objc-exp.y"
2198 { yyval
.voidval
= 0; }
2202 #line 849 "objc-exp.y"
2203 { free (yyvsp
[-1].tvec
); yyval
.voidval
= 0; }
2207 #line 862 "objc-exp.y"
2208 { yyval
.tval
= lookup_member_type (builtin_type_int
, yyvsp
[-2].tval
); }
2212 #line 867 "objc-exp.y"
2213 { yyval
.tval
= yyvsp
[0].tsym
.type
; }
2217 #line 869 "objc-exp.y"
2219 if (yyvsp
[0].class.type
== NULL
)
2220 error ("No symbol \"%s\" in current context.",
2221 copy_name(yyvsp
[0].class.stoken
));
2223 yyval
.tval
= yyvsp
[0].class.type
;
2228 #line 877 "objc-exp.y"
2229 { yyval
.tval
= builtin_type_int
; }
2233 #line 879 "objc-exp.y"
2234 { yyval
.tval
= builtin_type_long
; }
2238 #line 881 "objc-exp.y"
2239 { yyval
.tval
= builtin_type_short
; }
2243 #line 883 "objc-exp.y"
2244 { yyval
.tval
= builtin_type_long
; }
2248 #line 885 "objc-exp.y"
2249 { yyval
.tval
= builtin_type_unsigned_long
; }
2253 #line 887 "objc-exp.y"
2254 { yyval
.tval
= builtin_type_long_long
; }
2258 #line 889 "objc-exp.y"
2259 { yyval
.tval
= builtin_type_long_long
; }
2263 #line 891 "objc-exp.y"
2264 { yyval
.tval
= builtin_type_unsigned_long_long
; }
2268 #line 893 "objc-exp.y"
2269 { yyval
.tval
= builtin_type_unsigned_long_long
; }
2273 #line 895 "objc-exp.y"
2274 { yyval
.tval
= builtin_type_short
; }
2278 #line 897 "objc-exp.y"
2279 { yyval
.tval
= builtin_type_unsigned_short
; }
2283 #line 899 "objc-exp.y"
2284 { yyval
.tval
= builtin_type_double
; }
2288 #line 901 "objc-exp.y"
2289 { yyval
.tval
= builtin_type_long_double
; }
2293 #line 903 "objc-exp.y"
2294 { yyval
.tval
= lookup_struct (copy_name (yyvsp
[0].sval
),
2295 expression_context_block
); }
2299 #line 906 "objc-exp.y"
2300 { yyval
.tval
= lookup_struct (copy_name (yyvsp
[0].sval
),
2301 expression_context_block
); }
2305 #line 909 "objc-exp.y"
2306 { yyval
.tval
= lookup_union (copy_name (yyvsp
[0].sval
),
2307 expression_context_block
); }
2311 #line 912 "objc-exp.y"
2312 { yyval
.tval
= lookup_enum (copy_name (yyvsp
[0].sval
),
2313 expression_context_block
); }
2317 #line 915 "objc-exp.y"
2318 { yyval
.tval
= lookup_unsigned_typename (TYPE_NAME(yyvsp
[0].tsym
.type
)); }
2322 #line 917 "objc-exp.y"
2323 { yyval
.tval
= builtin_type_unsigned_int
; }
2327 #line 919 "objc-exp.y"
2328 { yyval
.tval
= lookup_signed_typename (TYPE_NAME(yyvsp
[0].tsym
.type
)); }
2332 #line 921 "objc-exp.y"
2333 { yyval
.tval
= builtin_type_int
; }
2337 #line 923 "objc-exp.y"
2338 { yyval
.tval
= lookup_template_type(copy_name(yyvsp
[-3].sval
), yyvsp
[-1].tval
,
2339 expression_context_block
);
2344 #line 929 "objc-exp.y"
2345 { yyval
.tval
= yyvsp
[0].tval
; }
2349 #line 930 "objc-exp.y"
2350 { yyval
.tval
= yyvsp
[0].tval
; }
2354 #line 935 "objc-exp.y"
2356 yyval
.tsym
.stoken
.ptr
= "int";
2357 yyval
.tsym
.stoken
.length
= 3;
2358 yyval
.tsym
.type
= builtin_type_int
;
2363 #line 941 "objc-exp.y"
2365 yyval
.tsym
.stoken
.ptr
= "long";
2366 yyval
.tsym
.stoken
.length
= 4;
2367 yyval
.tsym
.type
= builtin_type_long
;
2372 #line 947 "objc-exp.y"
2374 yyval
.tsym
.stoken
.ptr
= "short";
2375 yyval
.tsym
.stoken
.length
= 5;
2376 yyval
.tsym
.type
= builtin_type_short
;
2381 #line 956 "objc-exp.y"
2382 { yyval
.tvec
= (struct type
**) xmalloc (sizeof (struct type
*) * 2);
2383 yyval
.ivec
[0] = 1; /* Number of types in vector. */
2384 yyval
.tvec
[1] = yyvsp
[0].tval
;
2389 #line 961 "objc-exp.y"
2390 { int len
= sizeof (struct type
*) * (++(yyvsp
[-2].ivec
[0]) + 1);
2391 yyval
.tvec
= (struct type
**) xrealloc ((char *) yyvsp
[-2].tvec
, len
);
2392 yyval
.tvec
[yyval
.ivec
[0]] = yyvsp
[0].tval
;
2397 #line 967 "objc-exp.y"
2398 { yyval
.sval
= yyvsp
[0].ssym
.stoken
; }
2402 #line 968 "objc-exp.y"
2403 { yyval
.sval
= yyvsp
[0].ssym
.stoken
; }
2407 #line 969 "objc-exp.y"
2408 { yyval
.sval
= yyvsp
[0].tsym
.stoken
; }
2412 #line 970 "objc-exp.y"
2413 { yyval
.sval
= yyvsp
[0].class.stoken
; }
2417 #line 971 "objc-exp.y"
2418 { yyval
.sval
= yyvsp
[0].ssym
.stoken
; }
2424 /* Line 1000 of yacc.c. */
2425 #line 2426 "objc-exp.c.tmp"
2431 YY_STACK_PRINT (yyss
, yyssp
);
2436 /* Now `shift' the result of the reduction. Determine what state
2437 that goes to, based on the state we popped back to and the rule
2438 number reduced by. */
2442 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2443 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2444 yystate
= yytable
[yystate
];
2446 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2451 /*------------------------------------.
2452 | yyerrlab -- here on detecting error |
2453 `------------------------------------*/
2455 /* If not already recovering from an error, report this error. */
2460 yyn
= yypact
[yystate
];
2462 if (YYPACT_NINF
< yyn
&& yyn
< YYLAST
)
2464 YYSIZE_T yysize
= 0;
2465 int yytype
= YYTRANSLATE (yychar
);
2466 const char* yyprefix
;
2470 /* Start YYX at -YYN if negative to avoid negative indexes in
2472 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
2474 /* Stay within bounds of both yycheck and yytname. */
2475 int yychecklim
= YYLAST
- yyn
;
2476 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
2479 yyprefix
= ", expecting ";
2480 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
2481 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
2483 yysize
+= yystrlen (yyprefix
) + yystrlen (yytname
[yyx
]);
2491 yysize
+= (sizeof ("syntax error, unexpected ")
2492 + yystrlen (yytname
[yytype
]));
2493 yymsg
= (char *) YYSTACK_ALLOC (yysize
);
2496 char *yyp
= yystpcpy (yymsg
, "syntax error, unexpected ");
2497 yyp
= yystpcpy (yyp
, yytname
[yytype
]);
2501 yyprefix
= ", expecting ";
2502 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
2503 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
2505 yyp
= yystpcpy (yyp
, yyprefix
);
2506 yyp
= yystpcpy (yyp
, yytname
[yyx
]);
2511 YYSTACK_FREE (yymsg
);
2514 yyerror ("syntax error; also virtual memory exhausted");
2517 #endif /* YYERROR_VERBOSE */
2518 yyerror ("syntax error");
2523 if (yyerrstatus
== 3)
2525 /* If just tried and failed to reuse lookahead token after an
2526 error, discard it. */
2528 if (yychar
<= YYEOF
)
2530 /* If at end of input, pop the error token,
2531 then the rest of the stack, then return failure. */
2532 if (yychar
== YYEOF
)
2538 YYDSYMPRINTF ("Error: popping", yystos
[*yyssp
], yyvsp
, yylsp
);
2539 yydestruct (yystos
[*yyssp
], yyvsp
);
2544 YYDSYMPRINTF ("Error: discarding", yytoken
, &yylval
, &yylloc
);
2545 yydestruct (yytoken
, &yylval
);
2551 /* Else will try to reuse lookahead token after shifting the error
2556 /*---------------------------------------------------.
2557 | yyerrorlab -- error raised explicitly by YYERROR. |
2558 `---------------------------------------------------*/
2562 /* Pacify GCC when the user code never invokes YYERROR and the label
2563 yyerrorlab therefore never appears in user code. */
2574 /*-------------------------------------------------------------.
2575 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2576 `-------------------------------------------------------------*/
2578 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2582 yyn
= yypact
[yystate
];
2583 if (yyn
!= YYPACT_NINF
)
2586 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2594 /* Pop the current state because it cannot handle the error token. */
2598 YYDSYMPRINTF ("Error: popping", yystos
[*yyssp
], yyvsp
, yylsp
);
2599 yydestruct (yystos
[yystate
], yyvsp
);
2602 YY_STACK_PRINT (yyss
, yyssp
);
2608 YYDPRINTF ((stderr
, "Shifting error token, "));
2617 /*-------------------------------------.
2618 | yyacceptlab -- YYACCEPT comes here. |
2619 `-------------------------------------*/
2624 /*-----------------------------------.
2625 | yyabortlab -- YYABORT comes here. |
2626 `-----------------------------------*/
2632 /*----------------------------------------------.
2633 | yyoverflowlab -- parser overflow comes here. |
2634 `----------------------------------------------*/
2636 yyerror ("parser stack overflow");
2644 YYSTACK_FREE (yyss
);
2650 #line 985 "objc-exp.y"
2653 /* Take care of parsing a number (anything that starts with a digit).
2654 Set yylval and return the token type; update lexptr. LEN is the
2655 number of characters in it. */
2657 /*** Needs some error checking for the float case. ***/
2660 parse_number (p
, len
, parsed_float
, putithere
)
2666 /* FIXME: Shouldn't these be unsigned? We don't deal with negative
2667 values here, and we do kind of silly things like cast to
2671 unsigned LONGEST un
;
2675 int base
= input_radix
;
2678 /* Number of "L" suffixes encountered. */
2681 /* We have found a "L" or "U" suffix. */
2682 int found_suffix
= 0;
2684 unsigned LONGEST high_bit
;
2685 struct type
*signed_type
;
2686 struct type
*unsigned_type
;
2692 /* It's a float since it contains a point or an exponent. */
2694 sscanf (p
, DOUBLEST_SCAN_FORMAT
"%c",
2695 &putithere
->typed_val_float
.dval
, &c
);
2697 /* See if it has `f' or `l' suffix (float or long double). */
2699 c
= tolower (p
[len
- 1]);
2702 putithere
->typed_val_float
.type
= builtin_type_float
;
2704 putithere
->typed_val_float
.type
= builtin_type_long_double
;
2705 else if (isdigit (c
) || c
== '.')
2706 putithere
->typed_val_float
.type
= builtin_type_double
;
2713 /* Handle base-switching prefixes 0x, 0t, 0d, and 0. */
2747 if (c
>= 'A' && c
<= 'Z')
2749 if (c
!= 'l' && c
!= 'u')
2751 if (c
>= '0' && c
<= '9')
2759 if (base
> 10 && c
>= 'a' && c
<= 'f')
2763 n
+= i
= c
- 'a' + 10;
2776 return ERROR
; /* Char not a digit. */
2779 return ERROR
; /* Invalid digit in this base. */
2781 /* Portably test for overflow (only works for nonzero values, so
2782 make a second check for zero). FIXME: Can't we just make n
2783 and prevn unsigned and avoid this? */
2784 if (c
!= 'l' && c
!= 'u' && (prevn
>= n
) && n
!= 0)
2785 unsigned_p
= 1; /* Try something unsigned. */
2787 /* Portably test for unsigned overflow.
2788 FIXME: This check is wrong; for example it doesn't find
2789 overflow on 0x123456789 when LONGEST is 32 bits. */
2790 if (c
!= 'l' && c
!= 'u' && n
!= 0)
2792 if ((unsigned_p
&& (unsigned LONGEST
) prevn
>= (unsigned LONGEST
) n
))
2793 error ("Numeric constant too large.");
2798 /* An integer constant is an int, a long, or a long long. An L
2799 suffix forces it to be long; an LL suffix forces it to be long
2800 long. If not forced to a larger size, it gets the first type of
2801 the above that it fits in. To figure out whether it fits, we
2802 shift it right and see whether anything remains. Note that we
2803 can't shift sizeof (LONGEST) * HOST_CHAR_BIT bits or more in one
2804 operation, because many compilers will warn about such a shift
2805 (which always produces a zero result). Sometimes TARGET_INT_BIT
2806 or TARGET_LONG_BIT will be that big, sometimes not. To deal with
2807 the case where it is we just always shift the value more than
2808 once, with fewer bits each time. */
2810 un
= (unsigned LONGEST
)n
>> 2;
2812 && (un
>> (TARGET_INT_BIT
- 2)) == 0)
2814 high_bit
= ((unsigned LONGEST
)1) << (TARGET_INT_BIT
-1);
2816 /* A large decimal (not hex or octal) constant (between INT_MAX
2817 and UINT_MAX) is a long or unsigned long, according to ANSI,
2818 never an unsigned int, but this code treats it as unsigned
2819 int. This probably should be fixed. GCC gives a warning on
2822 unsigned_type
= builtin_type_unsigned_int
;
2823 signed_type
= builtin_type_int
;
2825 else if (long_p
<= 1
2826 && (un
>> (TARGET_LONG_BIT
- 2)) == 0)
2828 high_bit
= ((unsigned LONGEST
)1) << (TARGET_LONG_BIT
-1);
2829 unsigned_type
= builtin_type_unsigned_long
;
2830 signed_type
= builtin_type_long
;
2834 high_bit
= (((unsigned LONGEST
)1)
2835 << (TARGET_LONG_LONG_BIT
- 32 - 1)
2839 /* A long long does not fit in a LONGEST. */
2841 (unsigned LONGEST
)1 << (sizeof (LONGEST
) * HOST_CHAR_BIT
- 1);
2842 unsigned_type
= builtin_type_unsigned_long_long
;
2843 signed_type
= builtin_type_long_long
;
2846 putithere
->typed_val_int
.val
= n
;
2848 /* If the high bit of the worked out type is set then this number
2849 has to be unsigned. */
2851 if (unsigned_p
|| (n
& high_bit
))
2853 putithere
->typed_val_int
.type
= unsigned_type
;
2857 putithere
->typed_val_int
.type
= signed_type
;
2867 enum exp_opcode opcode
;
2870 static const struct token tokentab3
[] =
2872 {">>=", ASSIGN_MODIFY
, BINOP_RSH
},
2873 {"<<=", ASSIGN_MODIFY
, BINOP_LSH
}
2876 static const struct token tokentab2
[] =
2878 {"+=", ASSIGN_MODIFY
, BINOP_ADD
},
2879 {"-=", ASSIGN_MODIFY
, BINOP_SUB
},
2880 {"*=", ASSIGN_MODIFY
, BINOP_MUL
},
2881 {"/=", ASSIGN_MODIFY
, BINOP_DIV
},
2882 {"%=", ASSIGN_MODIFY
, BINOP_REM
},
2883 {"|=", ASSIGN_MODIFY
, BINOP_BITWISE_IOR
},
2884 {"&=", ASSIGN_MODIFY
, BINOP_BITWISE_AND
},
2885 {"^=", ASSIGN_MODIFY
, BINOP_BITWISE_XOR
},
2886 {"++", INCREMENT
, BINOP_END
},
2887 {"--", DECREMENT
, BINOP_END
},
2888 {"->", ARROW
, BINOP_END
},
2889 {"&&", ANDAND
, BINOP_END
},
2890 {"||", OROR
, BINOP_END
},
2891 {"::", COLONCOLON
, BINOP_END
},
2892 {"<<", LSH
, BINOP_END
},
2893 {">>", RSH
, BINOP_END
},
2894 {"==", EQUAL
, BINOP_END
},
2895 {"!=", NOTEQUAL
, BINOP_END
},
2896 {"<=", LEQ
, BINOP_END
},
2897 {">=", GEQ
, BINOP_END
}
2900 /* Read one token, getting characters through lexptr. */
2911 static char *tempbuf
;
2912 static int tempbufsize
;
2917 /* See if it is a special token of length 3. */
2918 for (i
= 0; i
< sizeof tokentab3
/ sizeof tokentab3
[0]; i
++)
2919 if (DEPRECATED_STREQN (tokstart
, tokentab3
[i
].operator, 3))
2922 yylval
.opcode
= tokentab3
[i
].opcode
;
2923 return tokentab3
[i
].token
;
2926 /* See if it is a special token of length 2. */
2927 for (i
= 0; i
< sizeof tokentab2
/ sizeof tokentab2
[0]; i
++)
2928 if (DEPRECATED_STREQN (tokstart
, tokentab2
[i
].operator, 2))
2931 yylval
.opcode
= tokentab2
[i
].opcode
;
2932 return tokentab2
[i
].token
;
2936 switch (tokchr
= *tokstart
)
2948 /* We either have a character constant ('0' or '\177' for
2949 example) or we have a quoted symbol reference ('foo(int,int)'
2950 in C++ for example). */
2954 c
= parse_escape (&lexptr
);
2956 error ("Empty character constant.");
2958 yylval
.typed_val_int
.val
= c
;
2959 yylval
.typed_val_int
.type
= builtin_type_char
;
2964 namelen
= skip_quoted (tokstart
) - tokstart
;
2967 lexptr
= tokstart
+ namelen
;
2968 if (lexptr
[-1] != '\'')
2969 error ("Unmatched single quote.");
2974 error ("Invalid character constant.");
2984 if (paren_depth
== 0)
2991 if (comma_terminates
&& paren_depth
== 0)
2997 /* Might be a floating point number. */
2998 if (lexptr
[1] < '0' || lexptr
[1] > '9')
2999 goto symbol
; /* Nope, must be a symbol. */
3000 /* FALL THRU into number case. */
3013 /* It's a number. */
3014 int got_dot
= 0, got_e
= 0, toktype
= FLOAT
;
3015 /* Initialize toktype to anything other than ERROR. */
3017 int hex
= input_radix
> 10;
3018 int local_radix
= input_radix
;
3019 if (tokchr
== '0' && (p
[1] == 'x' || p
[1] == 'X'))
3025 else if (tokchr
== '0' && (p
[1]=='t' || p
[1]=='T' || p
[1]=='d' || p
[1]=='D'))
3034 /* This test includes !hex because 'e' is a valid hex digit
3035 and thus does not indicate a floating point number when
3036 the radix is hex. */
3038 if (!hex
&& (*p
== 'e' || *p
== 'E'))
3040 toktype
= ERROR
; /* Only one 'e' in a float. */
3043 /* This test does not include !hex, because a '.' always
3044 indicates a decimal floating point number regardless of
3048 toktype
= ERROR
; /* Only one '.' in a float. */
3051 else if (got_e
&& (p
[-1] == 'e' || p
[-1] == 'E') &&
3052 (*p
== '-' || *p
== '+'))
3053 /* This is the sign of the exponent, not the end of the
3056 /* Always take decimal digits; parse_number handles radix
3058 else if (*p
>= '0' && *p
<= '9')
3060 /* We will take letters only if hex is true, and only up
3061 to what the input radix would permit. FSF was content
3062 to rely on parse_number to validate; but it leaks. */
3063 else if (*p
>= 'a' && *p
<= 'z')
3065 if (!hex
|| *p
>= ('a' + local_radix
- 10))
3068 else if (*p
>= 'A' && *p
<= 'Z')
3070 if (!hex
|| *p
>= ('A' + local_radix
- 10))
3075 if (toktype
!= ERROR
)
3076 toktype
= parse_number (tokstart
, p
- tokstart
,
3077 got_dot
| got_e
, &yylval
);
3078 if (toktype
== ERROR
)
3080 char *err_copy
= (char *) alloca (p
- tokstart
+ 1);
3082 memcpy (err_copy
, tokstart
, p
- tokstart
);
3083 err_copy
[p
- tokstart
] = 0;
3084 error ("Invalid number \"%s\".", err_copy
);
3101 case '@': /* Moved out below. */
3117 if (strncmp(tokstart
, "@selector", 9) == 0)
3119 tokptr
= strchr(tokstart
, '(');
3122 error ("Missing '(' in @selector(...)");
3125 tokptr
++; /* Skip the '('. */
3127 /* Grow the static temp buffer if necessary, including
3128 allocating the first one on demand. */
3129 if (tempbufindex
+ 1 >= tempbufsize
)
3131 tempbuf
= (char *) xrealloc (tempbuf
, tempbufsize
+= 64);
3133 tempbuf
[tempbufindex
++] = *tokptr
++;
3134 } while ((*tokptr
!= ')') && (*tokptr
!= '\0'));
3135 if (*tokptr
++ != ')')
3137 error ("Missing ')' in @selector(...)");
3139 tempbuf
[tempbufindex
] = '\0';
3140 yylval
.sval
.ptr
= tempbuf
;
3141 yylval
.sval
.length
= tempbufindex
;
3145 if (tokstart
[1] != '"')
3150 /* ObjC NextStep NSString constant: fall thru and parse like
3156 /* Build the gdb internal form of the input string in tempbuf,
3157 translating any standard C escape forms seen. Note that the
3158 buffer is null byte terminated *only* for the convenience of
3159 debugging gdb itself and printing the buffer contents when
3160 the buffer contains no embedded nulls. Gdb does not depend
3161 upon the buffer being null byte terminated, it uses the
3162 length string instead. This allows gdb to handle C strings
3163 (as well as strings in other languages) with embedded null
3166 tokptr
= ++tokstart
;
3170 /* Grow the static temp buffer if necessary, including
3171 allocating the first one on demand. */
3172 if (tempbufindex
+ 1 >= tempbufsize
)
3174 tempbuf
= (char *) xrealloc (tempbuf
, tempbufsize
+= 64);
3180 /* Do nothing, loop will terminate. */
3184 c
= parse_escape (&tokptr
);
3189 tempbuf
[tempbufindex
++] = c
;
3192 tempbuf
[tempbufindex
++] = *tokptr
++;
3195 } while ((*tokptr
!= '"') && (*tokptr
!= '\0'));
3196 if (*tokptr
++ != '"')
3198 error ("Unterminated string in expression.");
3200 tempbuf
[tempbufindex
] = '\0'; /* See note above. */
3201 yylval
.sval
.ptr
= tempbuf
;
3202 yylval
.sval
.length
= tempbufindex
;
3204 return (tokchr
== '@' ? NSSTRING
: STRING
);
3207 if (!(tokchr
== '_' || tokchr
== '$' ||
3208 (tokchr
>= 'a' && tokchr
<= 'z') || (tokchr
>= 'A' && tokchr
<= 'Z')))
3209 /* We must have come across a bad character (e.g. ';'). */
3210 error ("Invalid character '%c' in expression.", c
);
3212 /* It's a name. See how long it is. */
3214 for (c
= tokstart
[namelen
];
3215 (c
== '_' || c
== '$' || (c
>= '0' && c
<= '9')
3216 || (c
>= 'a' && c
<= 'z') || (c
>= 'A' && c
<= 'Z') || c
== '<');)
3221 while (tokstart
[++i
] && tokstart
[i
] != '>');
3222 if (tokstart
[i
] == '>')
3225 c
= tokstart
[++namelen
];
3228 /* The token "if" terminates the expression and is NOT
3229 removed from the input stream. */
3230 if (namelen
== 2 && tokstart
[0] == 'i' && tokstart
[1] == 'f')
3239 /* Catch specific keywords. Should be done with a data structure. */
3243 if (DEPRECATED_STREQN (tokstart
, "unsigned", 8))
3245 if (current_language
->la_language
== language_cplus
3246 && strncmp (tokstart
, "template", 8) == 0)
3248 if (DEPRECATED_STREQN (tokstart
, "volatile", 8))
3249 return VOLATILE_KEYWORD
;
3252 if (DEPRECATED_STREQN (tokstart
, "struct", 6))
3254 if (DEPRECATED_STREQN (tokstart
, "signed", 6))
3255 return SIGNED_KEYWORD
;
3256 if (DEPRECATED_STREQN (tokstart
, "sizeof", 6))
3258 if (DEPRECATED_STREQN (tokstart
, "double", 6))
3259 return DOUBLE_KEYWORD
;
3262 if ((current_language
->la_language
== language_cplus
)
3263 && strncmp (tokstart
, "class", 5) == 0)
3265 if (DEPRECATED_STREQN (tokstart
, "union", 5))
3267 if (DEPRECATED_STREQN (tokstart
, "short", 5))
3269 if (DEPRECATED_STREQN (tokstart
, "const", 5))
3270 return CONST_KEYWORD
;
3273 if (DEPRECATED_STREQN (tokstart
, "enum", 4))
3275 if (DEPRECATED_STREQN (tokstart
, "long", 4))
3279 if (DEPRECATED_STREQN (tokstart
, "int", 3))
3286 yylval
.sval
.ptr
= tokstart
;
3287 yylval
.sval
.length
= namelen
;
3289 if (*tokstart
== '$')
3291 write_dollar_variable (yylval
.sval
);
3295 /* Use token-type BLOCKNAME for symbols that happen to be defined as
3296 functions or symtabs. If this is not so, then ...
3297 Use token-type TYPENAME for symbols that happen to be defined
3298 currently as names of types; NAME for other symbols.
3299 The caller is not constrained to care about the distinction. */
3301 char *tmp
= copy_name (yylval
.sval
);
3303 int is_a_field_of_this
= 0, *need_this
;
3306 if (current_language
->la_language
== language_cplus
||
3307 current_language
->la_language
== language_objc
)
3308 need_this
= &is_a_field_of_this
;
3310 need_this
= (int *) NULL
;
3312 sym
= lookup_symbol (tmp
, expression_context_block
,
3315 (struct symtab
**) NULL
);
3316 /* Call lookup_symtab, not lookup_partial_symtab, in case there
3317 are no psymtabs (coff, xcoff, or some future change to blow
3318 away the psymtabs once symbols are read). */
3319 if ((sym
&& SYMBOL_CLASS (sym
) == LOC_BLOCK
) ||
3320 lookup_symtab (tmp
))
3322 yylval
.ssym
.sym
= sym
;
3323 yylval
.ssym
.is_a_field_of_this
= is_a_field_of_this
;
3326 if (sym
&& SYMBOL_CLASS (sym
) == LOC_TYPEDEF
)
3329 /* Despite the following flaw, we need to keep this code
3330 enabled. Because we can get called from
3331 check_stub_method, if we don't handle nested types then
3332 it screws many operations in any program which uses
3334 /* In "A::x", if x is a member function of A and there
3335 happens to be a type (nested or not, since the stabs
3336 don't make that distinction) named x, then this code
3337 incorrectly thinks we are dealing with nested types
3338 rather than a member function. */
3342 struct symbol
*best_sym
;
3344 /* Look ahead to detect nested types. This probably should
3345 be done in the grammar, but trying seemed to introduce a
3346 lot of shift/reduce and reduce/reduce conflicts. It's
3347 possible that it could be done, though. Or perhaps a
3348 non-grammar, but less ad hoc, approach would work well. */
3350 /* Since we do not currently have any way of distinguishing
3351 a nested type from a non-nested one (the stabs don't tell
3352 us whether a type is nested), we just ignore the
3359 /* Skip whitespace. */
3360 while (*p
== ' ' || *p
== '\t' || *p
== '\n')
3362 if (*p
== ':' && p
[1] == ':')
3364 /* Skip the `::'. */
3366 /* Skip whitespace. */
3367 while (*p
== ' ' || *p
== '\t' || *p
== '\n')
3370 while (*p
== '_' || *p
== '$' || (*p
>= '0' && *p
<= '9')
3371 || (*p
>= 'a' && *p
<= 'z')
3372 || (*p
>= 'A' && *p
<= 'Z'))
3376 struct symbol
*cur_sym
;
3377 /* As big as the whole rest of the expression,
3378 which is at least big enough. */
3379 char *ncopy
= alloca (strlen (tmp
) +
3380 strlen (namestart
) + 3);
3384 memcpy (tmp1
, tmp
, strlen (tmp
));
3385 tmp1
+= strlen (tmp
);
3386 memcpy (tmp1
, "::", 2);
3388 memcpy (tmp1
, namestart
, p
- namestart
);
3389 tmp1
[p
- namestart
] = '\0';
3390 cur_sym
= lookup_symbol (ncopy
,
3391 expression_context_block
,
3392 VAR_DOMAIN
, (int *) NULL
,
3393 (struct symtab
**) NULL
);
3396 if (SYMBOL_CLASS (cur_sym
) == LOC_TYPEDEF
)
3414 yylval
.tsym
.type
= SYMBOL_TYPE (best_sym
);
3416 yylval
.tsym
.type
= SYMBOL_TYPE (sym
);
3421 = language_lookup_primitive_type_by_name (current_language
,
3422 current_gdbarch
, tmp
);
3423 if (yylval
.tsym
.type
!= NULL
)
3426 /* See if it's an ObjC classname. */
3429 CORE_ADDR Class
= lookup_objc_class(tmp
);
3432 yylval
.class.class = Class
;
3433 if ((sym
= lookup_struct_typedef (tmp
,
3434 expression_context_block
,
3436 yylval
.class.type
= SYMBOL_TYPE (sym
);
3441 /* Input names that aren't symbols but ARE valid hex numbers,
3442 when the input radix permits them, can be names or numbers
3443 depending on the parse. Note we support radixes > 16 here. */
3445 ((tokstart
[0] >= 'a' && tokstart
[0] < 'a' + input_radix
- 10) ||
3446 (tokstart
[0] >= 'A' && tokstart
[0] < 'A' + input_radix
- 10)))
3448 YYSTYPE newlval
; /* Its value is ignored. */
3449 hextype
= parse_number (tokstart
, namelen
, 0, &newlval
);
3452 yylval
.ssym
.sym
= sym
;
3453 yylval
.ssym
.is_a_field_of_this
= is_a_field_of_this
;
3458 /* Any other kind of symbol. */
3459 yylval
.ssym
.sym
= sym
;
3460 yylval
.ssym
.is_a_field_of_this
= is_a_field_of_this
;
3469 if (*lexptr
== '\0')
3470 error("A %s near end of expression.", (msg
? msg
: "error"));
3472 error ("A %s in expression, near `%s'.", (msg
? msg
: "error"),