1 /* A Bison parser, made by GNU Bison 1.875. */
3 /* Skeleton parser for Yacc-like parsing with Bison,
4 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 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 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
271 # define YYSTYPE_IS_DECLARED 1
272 # define YYSTYPE_IS_TRIVIAL 1
277 /* Copy the second part of user declarations. */
278 #line 151 "objc-exp.y"
280 /* YYSTYPE gets defined by %union. */
282 parse_number PARAMS ((char *, int, int, YYSTYPE *));
285 /* Line 214 of yacc.c. */
287 #if ! defined (yyoverflow) || YYERROR_VERBOSE
289 /* The parser invokes alloca or xmalloc; define the necessary symbols. */
291 # if YYSTACK_USE_ALLOCA
292 # define YYSTACK_ALLOC alloca
294 # ifndef YYSTACK_USE_ALLOCA
295 # if defined (alloca) || defined (_ALLOCA_H)
296 # define YYSTACK_ALLOC alloca
299 # define YYSTACK_ALLOC __builtin_alloca
305 # ifdef YYSTACK_ALLOC
306 /* Pacify GCC's `empty if-body' warning. */
307 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
309 # if defined (__STDC__) || defined (__cplusplus)
310 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
311 # define YYSIZE_T size_t
313 # define YYSTACK_ALLOC xmalloc
314 # define YYSTACK_FREE free
316 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
319 #if (! defined (yyoverflow) \
320 && (! defined (__cplusplus) \
321 || (YYSTYPE_IS_TRIVIAL)))
323 /* A type that is properly aligned for any stack member. */
330 /* The size of the maximum gap between one aligned stack and the next. */
331 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
333 /* The size of an array large to enough to hold all stacks, each with
335 # define YYSTACK_BYTES(N) \
336 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
337 + YYSTACK_GAP_MAXIMUM)
339 /* Copy COUNT objects from FROM to TO. The source and destination do
343 # define YYCOPY(To, From, Count) \
344 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
346 # define YYCOPY(To, From, Count) \
349 register YYSIZE_T yyi; \
350 for (yyi = 0; yyi < (Count); yyi++) \
351 (To)[yyi] = (From)[yyi]; \
357 /* Relocate STACK from its old location to the new one. The
358 local variables YYSIZE and YYSTACKSIZE give the old and new number of
359 elements in the stack, and YYPTR gives the new location of the
360 stack. Advance YYPTR to a properly aligned location for the next
362 # define YYSTACK_RELOCATE(Stack) \
365 YYSIZE_T yynewbytes; \
366 YYCOPY (&yyptr->Stack, Stack, yysize); \
367 Stack = &yyptr->Stack; \
368 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
369 yyptr += yynewbytes / sizeof (*yyptr); \
375 #if defined (__STDC__) || defined (__cplusplus)
376 typedef signed char yysigned_char;
378 typedef short yysigned_char;
381 /* YYFINAL -- State number of the termination state. */
383 /* YYLAST -- Last index in YYTABLE. */
386 /* YYNTOKENS -- Number of terminals. */
388 /* YYNNTS -- Number of nonterminals. */
390 /* YYNRULES -- Number of rules. */
392 /* YYNRULES -- Number of states. */
393 #define YYNSTATES 239
395 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
397 #define YYMAXUTOK 298
399 #define YYTRANSLATE(YYX) \
400 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
402 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
403 static const unsigned char yytranslate[] =
405 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
406 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
407 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
408 2, 2, 2, 61, 2, 2, 2, 52, 38, 2,
409 58, 65, 50, 48, 30, 49, 56, 51, 2, 2,
410 2, 2, 2, 2, 2, 2, 2, 2, 64, 2,
411 41, 32, 42, 33, 47, 2, 2, 2, 2, 2,
412 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
413 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
414 2, 57, 2, 63, 37, 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, 66, 36, 67, 62, 2, 2, 2,
418 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
419 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
420 2, 2, 2, 2, 2, 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, 2, 2, 2, 2, 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, 2, 2, 2, 2, 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, 1, 2, 3, 4,
431 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
432 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
433 25, 26, 27, 28, 29, 31, 34, 35, 39, 40,
434 43, 44, 45, 46, 53, 54, 55, 59, 60
438 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
440 static const unsigned short yyprhs[] =
442 0, 0, 3, 5, 7, 9, 11, 15, 18, 21,
443 24, 27, 30, 33, 36, 39, 42, 45, 49, 53,
444 58, 62, 66, 71, 76, 77, 83, 84, 90, 91,
445 97, 99, 101, 103, 106, 110, 113, 116, 117, 123,
446 125, 126, 128, 132, 134, 138, 143, 148, 152, 156,
447 160, 164, 168, 172, 176, 180, 184, 188, 192, 196,
448 200, 204, 208, 212, 216, 220, 224, 228, 234, 238,
449 242, 244, 246, 248, 250, 252, 254, 259, 261, 263,
450 265, 269, 273, 277, 282, 284, 287, 289, 291, 294,
451 297, 300, 304, 308, 310, 313, 315, 318, 320, 324,
452 327, 329, 332, 334, 337, 341, 344, 348, 350, 354,
453 356, 358, 360, 362, 364, 367, 371, 374, 378, 382,
454 387, 390, 394, 396, 399, 402, 405, 408, 411, 414,
455 416, 419, 421, 427, 430, 433, 435, 437, 439, 441,
456 443, 447, 449, 451, 453, 455, 457, 459
459 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
460 static const yysigned_char yyrhs[] =
462 69, 0, -1, 71, -1, 70, -1, 91, -1, 72,
463 -1, 71, 30, 72, -1, 50, 72, -1, 38, 72,
464 -1, 49, 72, -1, 61, 72, -1, 62, 72, -1,
465 54, 72, -1, 53, 72, -1, 72, 54, -1, 72,
466 53, -1, 16, 72, -1, 72, 59, 95, -1, 72,
467 59, 85, -1, 72, 59, 50, 72, -1, 72, 56,
468 95, -1, 72, 56, 85, -1, 72, 56, 50, 72,
469 -1, 72, 57, 71, 63, -1, -1, 57, 9, 73,
470 76, 63, -1, -1, 57, 10, 74, 76, 63, -1,
471 -1, 57, 72, 75, 76, 63, -1, 95, -1, 77,
472 -1, 78, -1, 77, 78, -1, 95, 64, 72, -1,
473 64, 72, -1, 30, 72, -1, -1, 72, 58, 79,
474 81, 65, -1, 66, -1, -1, 72, -1, 81, 30,
475 72, -1, 67, -1, 80, 81, 82, -1, 80, 91,
476 82, 72, -1, 58, 91, 65, 72, -1, 58, 71,
477 65, -1, 72, 47, 72, -1, 72, 50, 72, -1,
478 72, 51, 72, -1, 72, 52, 72, -1, 72, 48,
479 72, -1, 72, 49, 72, -1, 72, 46, 72, -1,
480 72, 45, 72, -1, 72, 40, 72, -1, 72, 39,
481 72, -1, 72, 44, 72, -1, 72, 43, 72, -1,
482 72, 41, 72, -1, 72, 42, 72, -1, 72, 38,
483 72, -1, 72, 37, 72, -1, 72, 36, 72, -1,
484 72, 35, 72, -1, 72, 34, 72, -1, 72, 33,
485 72, 64, 72, -1, 72, 32, 72, -1, 72, 29,
486 72, -1, 3, -1, 11, -1, 4, -1, 84, -1,
487 28, -1, 7, -1, 16, 58, 91, 65, -1, 5,
488 -1, 6, -1, 60, -1, 83, 18, 95, -1, 83,
489 18, 95, -1, 92, 18, 95, -1, 92, 18, 62,
490 95, -1, 85, -1, 18, 95, -1, 96, -1, 92,
491 -1, 92, 25, -1, 92, 26, -1, 92, 87, -1,
492 92, 25, 87, -1, 92, 26, 87, -1, 50, -1,
493 50, 87, -1, 38, -1, 38, 87, -1, 88, -1,
494 58, 87, 65, -1, 88, 89, -1, 89, -1, 88,
495 90, -1, 90, -1, 57, 63, -1, 57, 3, 63,
496 -1, 58, 65, -1, 58, 94, 65, -1, 86, -1,
497 92, 18, 50, -1, 9, -1, 10, -1, 24, -1,
498 22, -1, 23, -1, 22, 24, -1, 17, 22, 24,
499 -1, 22, 22, -1, 22, 22, 24, -1, 17, 22,
500 22, -1, 17, 22, 22, 24, -1, 23, 24, -1,
501 17, 23, 24, -1, 27, -1, 22, 27, -1, 12,
502 95, -1, 13, 95, -1, 14, 95, -1, 15, 95,
503 -1, 17, 93, -1, 17, -1, 21, 93, -1, 21,
504 -1, 19, 95, 41, 91, 42, -1, 25, 92, -1,
505 26, 92, -1, 9, -1, 24, -1, 22, -1, 23,
506 -1, 91, -1, 94, 30, 91, -1, 8, -1, 60,
507 -1, 9, -1, 10, -1, 11, -1, 8, -1, 60,
511 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
512 static const unsigned short yyrline[] =
514 0, 231, 231, 232, 235, 242, 243, 248, 252, 256,
515 260, 264, 268, 272, 276, 280, 284, 288, 294, 301,
516 305, 312, 320, 324, 333, 332, 354, 353, 369, 368,
517 377, 379, 382, 383, 386, 388, 390, 397, 394, 404,
518 408, 411, 415, 419, 422, 429, 435, 441, 447, 451,
519 455, 459, 463, 467, 471, 475, 479, 483, 487, 491,
520 495, 499, 503, 507, 511, 515, 519, 523, 527, 531,
521 537, 544, 555, 562, 565, 569, 576, 584, 609, 617,
522 634, 645, 661, 674, 699, 700, 734, 793, 799, 800,
523 801, 803, 805, 809, 811, 813, 815, 817, 820, 822,
524 827, 834, 836, 840, 842, 846, 848, 860, 861, 866,
525 868, 876, 878, 880, 882, 884, 886, 888, 890, 892,
526 894, 896, 898, 900, 902, 905, 908, 911, 914, 916,
527 918, 920, 922, 929, 930, 933, 934, 940, 946, 955,
528 960, 967, 968, 969, 970, 971, 974, 975
532 #if YYDEBUG || YYERROR_VERBOSE
533 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
534 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
535 static const char *const yytname[] =
537 "$end", "error", "$undefined", "INT", "FLOAT", "STRING", "NSSTRING",
538 "SELECTOR", "NAME", "TYPENAME", "CLASSNAME", "NAME_OR_INT", "STRUCT",
539 "CLASS", "UNION", "ENUM", "SIZEOF", "UNSIGNED", "COLONCOLON",
540 "TEMPLATE", "ERROR", "SIGNED_KEYWORD", "LONG", "SHORT", "INT_KEYWORD",
541 "CONST_KEYWORD", "VOLATILE_KEYWORD", "DOUBLE_KEYWORD", "VARIABLE",
542 "ASSIGN_MODIFY", "','", "ABOVE_COMMA", "'='", "'?'", "OROR", "ANDAND",
543 "'|'", "'^'", "'&'", "NOTEQUAL", "EQUAL", "'<'", "'>'", "GEQ", "LEQ",
544 "RSH", "LSH", "'@'", "'+'", "'-'", "'*'", "'/'", "'%'", "DECREMENT",
545 "INCREMENT", "UNARY", "'.'", "'['", "'('", "ARROW", "BLOCKNAME", "'!'",
546 "'~'", "']'", "':'", "')'", "'{'", "'}'", "$accept", "start",
547 "type_exp", "exp1", "exp", "@1", "@2", "@3", "msglist", "msgarglist",
548 "msgarg", "@4", "lcurly", "arglist", "rcurly", "block", "variable",
549 "qualified_name", "ptype", "abs_decl", "direct_abs_decl", "array_mod",
550 "func_mod", "type", "typebase", "typename", "nonempty_typelist", "name",
551 "name_not_typename", 0
556 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
558 static const unsigned short yytoknum[] =
560 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
561 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
562 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
563 44, 285, 61, 63, 286, 287, 124, 94, 38, 288,
564 289, 60, 62, 290, 291, 292, 293, 64, 43, 45,
565 42, 47, 37, 294, 295, 296, 46, 91, 40, 297,
566 298, 33, 126, 93, 58, 41, 123, 125
570 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
571 static const unsigned char yyr1[] =
573 0, 68, 69, 69, 70, 71, 71, 72, 72, 72,
574 72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
575 72, 72, 72, 72, 73, 72, 74, 72, 75, 72,
576 76, 76, 77, 77, 78, 78, 78, 79, 72, 80,
577 81, 81, 81, 82, 72, 72, 72, 72, 72, 72,
578 72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
579 72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
580 72, 72, 72, 72, 72, 72, 72, 72, 72, 83,
581 83, 84, 85, 85, 84, 84, 84, 86, 86, 86,
582 86, 86, 86, 87, 87, 87, 87, 87, 88, 88,
583 88, 88, 88, 89, 89, 90, 90, 91, 91, 92,
584 92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
585 92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
586 92, 92, 92, 92, 92, 93, 93, 93, 93, 94,
587 94, 95, 95, 95, 95, 95, 96, 96
590 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
591 static const unsigned char yyr2[] =
593 0, 2, 1, 1, 1, 1, 3, 2, 2, 2,
594 2, 2, 2, 2, 2, 2, 2, 3, 3, 4,
595 3, 3, 4, 4, 0, 5, 0, 5, 0, 5,
596 1, 1, 1, 2, 3, 2, 2, 0, 5, 1,
597 0, 1, 3, 1, 3, 4, 4, 3, 3, 3,
598 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
599 3, 3, 3, 3, 3, 3, 3, 5, 3, 3,
600 1, 1, 1, 1, 1, 1, 4, 1, 1, 1,
601 3, 3, 3, 4, 1, 2, 1, 1, 2, 2,
602 2, 3, 3, 1, 2, 1, 2, 1, 3, 2,
603 1, 2, 1, 2, 3, 2, 3, 1, 3, 1,
604 1, 1, 1, 1, 2, 3, 2, 3, 3, 4,
605 2, 3, 1, 2, 2, 2, 2, 2, 2, 1,
606 2, 1, 5, 2, 2, 1, 1, 1, 1, 1,
607 3, 1, 1, 1, 1, 1, 1, 1
610 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
611 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
612 means the default is an error. */
613 static const unsigned char yydefact[] =
615 0, 70, 72, 77, 78, 75, 146, 109, 110, 71,
616 0, 0, 0, 0, 0, 129, 0, 0, 131, 112,
617 113, 111, 0, 0, 122, 74, 0, 0, 0, 0,
618 0, 0, 0, 147, 0, 0, 39, 0, 3, 2,
619 5, 40, 0, 73, 84, 107, 4, 87, 86, 141,
620 143, 144, 145, 142, 124, 125, 126, 127, 0, 16,
621 0, 135, 137, 138, 136, 128, 85, 0, 137, 138,
622 130, 116, 114, 123, 120, 133, 134, 8, 9, 7,
623 13, 12, 24, 26, 28, 0, 0, 10, 11, 1,
624 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
625 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
626 0, 0, 0, 15, 14, 0, 0, 37, 0, 41,
627 0, 0, 0, 0, 88, 89, 95, 93, 0, 0,
628 90, 97, 100, 102, 0, 0, 118, 115, 121, 0,
629 117, 0, 0, 0, 47, 0, 6, 69, 68, 0,
630 66, 65, 64, 63, 62, 57, 56, 60, 61, 59,
631 58, 55, 54, 48, 52, 53, 49, 50, 51, 143,
632 144, 0, 21, 20, 0, 40, 0, 18, 17, 0,
633 43, 44, 0, 81, 108, 0, 82, 91, 92, 96,
634 94, 0, 103, 105, 0, 139, 87, 0, 0, 99,
635 101, 76, 119, 0, 0, 0, 0, 31, 32, 30,
636 0, 0, 46, 0, 22, 23, 0, 19, 42, 45,
637 83, 104, 98, 0, 0, 106, 132, 36, 35, 25,
638 33, 0, 0, 27, 29, 67, 38, 140, 34
641 /* YYDEFGOTO[NTERM-NUM]. */
642 static const short yydefgoto[] =
644 -1, 37, 38, 85, 40, 141, 142, 143, 206, 207,
645 208, 175, 41, 120, 181, 42, 43, 44, 45, 130,
646 131, 132, 133, 195, 60, 65, 197, 209, 48
649 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
651 #define YYPACT_NINF -90
652 static const short yypact[] =
654 223, -90, -90, -90, -90, -90, -90, -90, -90, -90,
655 19, 19, 19, 19, 287, 195, 19, 19, 234, 82,
656 -9, -90, 307, 307, -90, -90, 223, 223, 223, 223,
657 223, 351, 223, 8, 223, 223, -90, 39, -90, 13,
658 542, 223, 32, -90, -90, -90, -90, 149, -90, -90,
659 -90, -90, -90, -90, -90, -90, -90, -90, 223, 212,
660 38, -90, 33, 45, -90, -90, -90, 30, -90, -90,
661 -90, 83, -90, -90, -90, -90, -90, 212, 212, 212,
662 212, 212, 107, 108, 542, -20, 66, 212, 212, -90,
663 223, 223, 223, 223, 223, 223, 223, 223, 223, 223,
664 223, 223, 223, 223, 223, 223, 223, 223, 223, 223,
665 223, 223, 223, -90, -90, 436, 223, -90, 480, 542,
666 -21, 65, 19, 202, 70, 70, 70, 70, -1, 132,
667 -90, 54, -90, -90, 68, 43, 110, -90, -90, 307,
668 -90, 113, 113, 113, -90, 223, 542, 542, 542, 509,
669 567, 591, 614, 636, 657, 676, 676, 691, 691, 691,
670 691, 334, 334, 703, 713, 713, 212, 212, 212, 107,
671 108, 223, -90, -90, 4, 223, 223, -90, -90, 223,
672 -90, -90, 223, 118, -90, 19, -90, -90, -90, -90,
673 -90, 74, -90, -90, 73, -90, 158, -17, 51, -90,
674 -90, 415, -90, 106, 223, 223, 87, 113, -90, 88,
675 97, 99, 212, 223, 212, -90, -16, 212, 542, 212,
676 -90, -90, -90, 114, 307, -90, -90, 542, 542, -90,
677 -90, 88, 223, -90, -90, 475, -90, -90, 542
680 /* YYPGOTO[NTERM-NUM]. */
681 static const short yypgoto[] =
683 -90, -90, -90, 3, -10, -90, -90, -90, -28, -90,
684 -44, -90, -90, -7, 50, -90, -90, -71, -90, -89,
685 -90, 47, 48, 1, 0, 163, -90, -5, -90
688 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
689 positive, shift that token. If negative, reduce the rule which
690 number is the opposite. If zero, do what YYDEFACT says.
691 If YYTABLE_NINF, syntax error. */
692 #define YYTABLE_NINF -111
693 static const short yytable[] =
695 47, 46, 191, 39, 59, 54, 55, 56, 57, 179,
696 90, 66, 67, 224, 179, 74, 77, 78, 79, 80,
697 81, 84, 75, 76, 87, 88, -79, 49, 50, 51,
698 52, 119, 47, 86, 90, 187, 188, 189, 190, 89,
699 194, 47, 121, 90, 172, 144, 180, 177, 225, 236,
700 122, 49, 50, 51, 52, 136, 135, 137, 47, 134,
701 7, 8, 192, 10, 11, 12, 13, 215, 15, 138,
702 17, 139, 18, 19, 20, 21, 22, 23, 24, 53,
703 146, 147, 148, 149, 150, 151, 152, 153, 154, 155,
704 156, 157, 158, 159, 160, 161, 162, 163, 164, 165,
705 166, 167, 168, 53, 71, 185, 72, 140, 126, 73,
706 173, 128, 198, 178, 210, 211, 193, 183, 186, 174,
707 127, 49, 50, 51, 52, -109, -110, 128, 129, 196,
708 186, 145, 180, 201, 202, 212, -80, 221, 222, 196,
709 203, 7, 8, 204, 10, 11, 12, 13, 226, 15,
710 229, 17, 232, 18, 19, 20, 21, 22, 23, 24,
711 233, 214, 234, 230, 184, 119, 217, 123, 216, 218,
712 126, 182, 219, 53, 124, 125, 223, 205, 199, 200,
713 220, 70, 127, 124, 125, 0, 0, 126, 0, 128,
714 129, 212, 0, 0, 227, 228, 126, 193, 196, 127,
715 0, 0, 231, 235, 61, 0, 128, 129, 127, 0,
716 49, 50, 51, 52, 0, 128, 129, 62, 63, 64,
717 0, 0, 238, 0, 196, 237, 1, 2, 3, 4,
718 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
719 15, 16, 17, 61, 18, 19, 20, 21, 22, 23,
720 24, 25, 184, 0, 0, 0, 68, 69, 64, 0,
721 0, 26, 53, 0, 185, 113, 114, 0, 115, 116,
722 117, 118, 27, 28, 0, 0, 29, 30, 0, 0,
723 31, 32, 0, 33, 34, 35, 0, 0, 0, 36,
724 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
725 11, 12, 13, 14, 15, 16, 17, 0, 18, 19,
726 20, 21, 22, 23, 24, 25, 7, 8, 0, 10,
727 11, 12, 13, 0, 15, 26, 17, 0, 18, 19,
728 20, 21, 22, 23, 24, 0, 27, 28, 0, 0,
729 29, 30, 0, 0, 31, 58, 0, 33, 34, 35,
730 0, 0, 0, 36, 1, 2, 3, 4, 5, 6,
731 82, 83, 9, 10, 11, 12, 13, 14, 15, 16,
732 17, 0, 18, 19, 20, 21, 22, 23, 24, 25,
733 0, 107, 108, 109, 110, 111, 112, 113, 114, 26,
734 115, 116, 117, 118, 0, 0, 0, 0, 0, 0,
735 27, 28, 0, 0, 29, 30, 0, 0, 31, 32,
736 0, 33, 34, 35, 0, 0, 0, 36, 1, 2,
737 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
738 13, 14, 15, 16, 17, 0, 18, 19, 20, 21,
739 22, 23, 24, 25, 49, 169, 170, 52, 10, 11,
740 12, 13, 0, 15, 0, 17, 0, 18, 19, 20,
741 21, 22, 23, 24, 0, 0, 0, 0, 29, 30,
742 0, 0, 31, 32, 0, 33, 34, 35, 0, 0,
743 0, 36, 0, 0, 0, 0, 171, 0, 49, 169,
744 170, 52, 10, 11, 12, 13, 53, 15, 0, 17,
745 0, 18, 19, 20, 21, 22, 23, 24, 93, 94,
746 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
747 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
748 176, 115, 116, 117, 118, 0, 0, 0, 91, 0,
749 53, 92, 93, 94, 95, 96, 97, 98, 99, 100,
750 101, 102, 103, 104, 105, 106, 107, 108, 109, 110,
751 111, 112, 113, 114, 0, 115, 116, 117, 118, 0,
752 0, 91, 0, 213, 92, 93, 94, 95, 96, 97,
753 98, 99, 100, 101, 102, 103, 104, 105, 106, 107,
754 108, 109, 110, 111, 112, 113, 114, 0, 115, 116,
755 117, 118, 95, 96, 97, 98, 99, 100, 101, 102,
756 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
757 113, 114, 0, 115, 116, 117, 118, 96, 97, 98,
758 99, 100, 101, 102, 103, 104, 105, 106, 107, 108,
759 109, 110, 111, 112, 113, 114, 0, 115, 116, 117,
760 118, 97, 98, 99, 100, 101, 102, 103, 104, 105,
761 106, 107, 108, 109, 110, 111, 112, 113, 114, 0,
762 115, 116, 117, 118, 98, 99, 100, 101, 102, 103,
763 104, 105, 106, 107, 108, 109, 110, 111, 112, 113,
764 114, 0, 115, 116, 117, 118, 99, 100, 101, 102,
765 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
766 113, 114, 0, 115, 116, 117, 118, 101, 102, 103,
767 104, 105, 106, 107, 108, 109, 110, 111, 112, 113,
768 114, 0, 115, 116, 117, 118, 105, 106, 107, 108,
769 109, 110, 111, 112, 113, 114, 0, 115, 116, 117,
770 118, 108, 109, 110, 111, 112, 113, 114, 0, 115,
771 116, 117, 118, 110, 111, 112, 113, 114, 0, 115,
775 static const short yycheck[] =
777 0, 0, 3, 0, 14, 10, 11, 12, 13, 30,
778 30, 16, 17, 30, 30, 24, 26, 27, 28, 29,
779 30, 31, 22, 23, 34, 35, 18, 8, 9, 10,
780 11, 41, 32, 32, 30, 124, 125, 126, 127, 0,
781 129, 41, 41, 30, 115, 65, 67, 118, 65, 65,
782 18, 8, 9, 10, 11, 22, 18, 24, 58, 58,
783 9, 10, 63, 12, 13, 14, 15, 63, 17, 24,
784 19, 41, 21, 22, 23, 24, 25, 26, 27, 60,
785 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,
786 100, 101, 102, 103, 104, 105, 106, 107, 108, 109,
787 110, 111, 112, 60, 22, 62, 24, 24, 38, 27,
788 115, 57, 58, 118, 142, 143, 65, 122, 123, 116,
789 50, 8, 9, 10, 11, 18, 18, 57, 58, 129,
790 135, 65, 67, 65, 24, 145, 18, 63, 65, 139,
791 139, 9, 10, 30, 12, 13, 14, 15, 42, 17,
792 63, 19, 64, 21, 22, 23, 24, 25, 26, 27,
793 63, 171, 63, 207, 50, 175, 176, 18, 175, 179,
794 38, 121, 182, 60, 25, 26, 18, 64, 131, 131,
795 185, 18, 50, 25, 26, -1, -1, 38, -1, 57,
796 58, 201, -1, -1, 204, 205, 38, 65, 198, 50,
797 -1, -1, 207, 213, 9, -1, 57, 58, 50, -1,
798 8, 9, 10, 11, -1, 57, 58, 22, 23, 24,
799 -1, -1, 232, -1, 224, 224, 3, 4, 5, 6,
800 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
801 17, 18, 19, 9, 21, 22, 23, 24, 25, 26,
802 27, 28, 50, -1, -1, -1, 22, 23, 24, -1,
803 -1, 38, 60, -1, 62, 53, 54, -1, 56, 57,
804 58, 59, 49, 50, -1, -1, 53, 54, -1, -1,
805 57, 58, -1, 60, 61, 62, -1, -1, -1, 66,
806 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
807 13, 14, 15, 16, 17, 18, 19, -1, 21, 22,
808 23, 24, 25, 26, 27, 28, 9, 10, -1, 12,
809 13, 14, 15, -1, 17, 38, 19, -1, 21, 22,
810 23, 24, 25, 26, 27, -1, 49, 50, -1, -1,
811 53, 54, -1, -1, 57, 58, -1, 60, 61, 62,
812 -1, -1, -1, 66, 3, 4, 5, 6, 7, 8,
813 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
814 19, -1, 21, 22, 23, 24, 25, 26, 27, 28,
815 -1, 47, 48, 49, 50, 51, 52, 53, 54, 38,
816 56, 57, 58, 59, -1, -1, -1, -1, -1, -1,
817 49, 50, -1, -1, 53, 54, -1, -1, 57, 58,
818 -1, 60, 61, 62, -1, -1, -1, 66, 3, 4,
819 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
820 15, 16, 17, 18, 19, -1, 21, 22, 23, 24,
821 25, 26, 27, 28, 8, 9, 10, 11, 12, 13,
822 14, 15, -1, 17, -1, 19, -1, 21, 22, 23,
823 24, 25, 26, 27, -1, -1, -1, -1, 53, 54,
824 -1, -1, 57, 58, -1, 60, 61, 62, -1, -1,
825 -1, 66, -1, -1, -1, -1, 50, -1, 8, 9,
826 10, 11, 12, 13, 14, 15, 60, 17, -1, 19,
827 -1, 21, 22, 23, 24, 25, 26, 27, 33, 34,
828 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
829 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
830 50, 56, 57, 58, 59, -1, -1, -1, 29, -1,
831 60, 32, 33, 34, 35, 36, 37, 38, 39, 40,
832 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
833 51, 52, 53, 54, -1, 56, 57, 58, 59, -1,
834 -1, 29, -1, 64, 32, 33, 34, 35, 36, 37,
835 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
836 48, 49, 50, 51, 52, 53, 54, -1, 56, 57,
837 58, 59, 35, 36, 37, 38, 39, 40, 41, 42,
838 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
839 53, 54, -1, 56, 57, 58, 59, 36, 37, 38,
840 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
841 49, 50, 51, 52, 53, 54, -1, 56, 57, 58,
842 59, 37, 38, 39, 40, 41, 42, 43, 44, 45,
843 46, 47, 48, 49, 50, 51, 52, 53, 54, -1,
844 56, 57, 58, 59, 38, 39, 40, 41, 42, 43,
845 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
846 54, -1, 56, 57, 58, 59, 39, 40, 41, 42,
847 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
848 53, 54, -1, 56, 57, 58, 59, 41, 42, 43,
849 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
850 54, -1, 56, 57, 58, 59, 45, 46, 47, 48,
851 49, 50, 51, 52, 53, 54, -1, 56, 57, 58,
852 59, 48, 49, 50, 51, 52, 53, 54, -1, 56,
853 57, 58, 59, 50, 51, 52, 53, 54, -1, 56,
857 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
858 symbol of state STATE-NUM. */
859 static const unsigned char yystos[] =
861 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
862 12, 13, 14, 15, 16, 17, 18, 19, 21, 22,
863 23, 24, 25, 26, 27, 28, 38, 49, 50, 53,
864 54, 57, 58, 60, 61, 62, 66, 69, 70, 71,
865 72, 80, 83, 84, 85, 86, 91, 92, 96, 8,
866 9, 10, 11, 60, 95, 95, 95, 95, 58, 72,
867 92, 9, 22, 23, 24, 93, 95, 95, 22, 23,
868 93, 22, 24, 27, 24, 92, 92, 72, 72, 72,
869 72, 72, 9, 10, 72, 71, 91, 72, 72, 0,
870 30, 29, 32, 33, 34, 35, 36, 37, 38, 39,
871 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
872 50, 51, 52, 53, 54, 56, 57, 58, 59, 72,
873 81, 91, 18, 18, 25, 26, 38, 50, 57, 58,
874 87, 88, 89, 90, 91, 18, 22, 24, 24, 41,
875 24, 73, 74, 75, 65, 65, 72, 72, 72, 72,
876 72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
877 72, 72, 72, 72, 72, 72, 72, 72, 72, 9,
878 10, 50, 85, 95, 71, 79, 50, 85, 95, 30,
879 67, 82, 82, 95, 50, 62, 95, 87, 87, 87,
880 87, 3, 63, 65, 87, 91, 92, 94, 58, 89,
881 90, 65, 24, 91, 30, 64, 76, 77, 78, 95,
882 76, 76, 72, 64, 72, 63, 81, 72, 72, 72,
883 95, 63, 65, 18, 30, 65, 42, 72, 72, 63,
884 78, 95, 64, 63, 63, 72, 65, 91, 72
887 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
888 # define YYSIZE_T __SIZE_TYPE__
890 #if ! defined (YYSIZE_T) && defined (size_t)
891 # define YYSIZE_T size_t
893 #if ! defined (YYSIZE_T)
894 # if defined (__STDC__) || defined (__cplusplus)
895 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
896 # define YYSIZE_T size_t
899 #if ! defined (YYSIZE_T)
900 # define YYSIZE_T unsigned int
903 #define yyerrok (yyerrstatus = 0)
904 #define yyclearin (yychar = YYEMPTY)
908 #define YYACCEPT goto yyacceptlab
909 #define YYABORT goto yyabortlab
910 #define YYERROR goto yyerrlab1
912 /* Like YYERROR except do call yyerror. This remains here temporarily
913 to ease the transition to the new meaning of YYERROR, for GCC.
914 Once GCC version 2 has supplanted version 1, this can go. */
916 #define YYFAIL goto yyerrlab
918 #define YYRECOVERING() (!!yyerrstatus)
920 #define YYBACKUP(Token, Value) \
922 if (yychar == YYEMPTY && yylen == 1) \
926 yytoken = YYTRANSLATE (yychar); \
932 yyerror ("syntax error: cannot back up");\
938 #define YYERRCODE 256
940 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
943 #ifndef YYLLOC_DEFAULT
944 # define YYLLOC_DEFAULT(Current, Rhs, N) \
945 Current.first_line = Rhs[1].first_line; \
946 Current.first_column = Rhs[1].first_column; \
947 Current.last_line = Rhs[N].last_line; \
948 Current.last_column = Rhs[N].last_column;
951 /* YYLEX -- calling `yylex' with the right arguments. */
954 # define YYLEX yylex (YYLEX_PARAM)
956 # define YYLEX yylex ()
959 /* Enable debugging if requested. */
963 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
964 # define YYFPRINTF fprintf
967 # define YYDPRINTF(Args) \
973 # define YYDSYMPRINT(Args) \
979 # define YYDSYMPRINTF(Title, Token, Value, Location) \
983 YYFPRINTF (stderr, "%s ", Title); \
984 yysymprint (stderr, \
986 YYFPRINTF (stderr, "\n"); \
990 /*------------------------------------------------------------------.
991 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
993 `------------------------------------------------------------------*/
995 #if defined (__STDC__) || defined (__cplusplus)
997 yy_stack_print (short *bottom, short *top)
1000 yy_stack_print (bottom, top)
1005 YYFPRINTF (stderr, "Stack now");
1006 for (/* Nothing. */; bottom <= top; ++bottom)
1007 YYFPRINTF (stderr, " %d", *bottom);
1008 YYFPRINTF (stderr, "\n");
1011 # define YY_STACK_PRINT(Bottom, Top) \
1014 yy_stack_print ((Bottom), (Top)); \
1018 /*------------------------------------------------.
1019 | Report that the YYRULE is going to be reduced. |
1020 `------------------------------------------------*/
1022 #if defined (__STDC__) || defined (__cplusplus)
1024 yy_reduce_print (int yyrule)
1027 yy_reduce_print (yyrule)
1032 unsigned int yylineno = yyrline[yyrule];
1033 YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
1034 yyrule - 1, yylineno);
1035 /* Print the symbols being reduced, and their result. */
1036 for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
1037 YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
1038 YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
1041 # define YY_REDUCE_PRINT(Rule) \
1044 yy_reduce_print (Rule); \
1047 /* Nonzero means print parse trace. It is left uninitialized so that
1048 multiple parsers can coexist. */
1050 #else /* !YYDEBUG */
1051 # define YYDPRINTF(Args)
1052 # define YYDSYMPRINT(Args)
1053 # define YYDSYMPRINTF(Title, Token, Value, Location)
1054 # define YY_STACK_PRINT(Bottom, Top)
1055 # define YY_REDUCE_PRINT(Rule)
1056 #endif /* !YYDEBUG */
1059 /* YYINITDEPTH -- initial size of the parser's stacks. */
1061 # define YYINITDEPTH 200
1064 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1065 if the built-in stack extension method is used).
1067 Do not make this value too large; the results are undefined if
1068 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
1069 evaluated with infinite-precision integer arithmetic. */
1076 # define YYMAXDEPTH 10000
1084 # if defined (__GLIBC__) && defined (_STRING_H)
1085 # define yystrlen strlen
1087 /* Return the length of YYSTR. */
1089 # if defined (__STDC__) || defined (__cplusplus)
1090 yystrlen (const char *yystr)
1096 register const char *yys = yystr;
1098 while (*yys++ != '\0')
1101 return yys - yystr - 1;
1107 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
1108 # define yystpcpy stpcpy
1110 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1113 # if defined (__STDC__) || defined (__cplusplus)
1114 yystpcpy (char *yydest, const char *yysrc)
1116 yystpcpy (yydest, yysrc)
1121 register char *yyd = yydest;
1122 register const char *yys = yysrc;
1124 while ((*yyd++ = *yys++) != '\0')
1132 #endif /* !YYERROR_VERBOSE */
1137 /*--------------------------------.
1138 | Print this symbol on YYOUTPUT. |
1139 `--------------------------------*/
1141 #if defined (__STDC__) || defined (__cplusplus)
1143 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
1146 yysymprint (yyoutput, yytype, yyvaluep)
1152 /* Pacify ``unused variable'' warnings. */
1155 if (yytype < YYNTOKENS)
1157 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1159 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1163 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1170 YYFPRINTF (yyoutput, ")");
1173 #endif /* ! YYDEBUG */
1174 /*-----------------------------------------------.
1175 | Release the memory associated to this symbol. |
1176 `-----------------------------------------------*/
1178 #if defined (__STDC__) || defined (__cplusplus)
1180 yydestruct (int yytype, YYSTYPE *yyvaluep)
1183 yydestruct (yytype, yyvaluep)
1188 /* Pacify ``unused variable'' warnings. */
1200 /* Prevent warnings from -Wmissing-prototypes. */
1202 #ifdef YYPARSE_PARAM
1203 # if defined (__STDC__) || defined (__cplusplus)
1204 int yyparse (void *YYPARSE_PARAM);
1208 #else /* ! YYPARSE_PARAM */
1209 #if defined (__STDC__) || defined (__cplusplus)
1214 #endif /* ! YYPARSE_PARAM */
1218 /* The lookahead symbol. */
1221 /* The semantic value of the lookahead symbol. */
1224 /* Number of syntax errors so far. */
1233 #ifdef YYPARSE_PARAM
1234 # if defined (__STDC__) || defined (__cplusplus)
1235 int yyparse (void *YYPARSE_PARAM)
1237 int yyparse (YYPARSE_PARAM)
1238 void *YYPARSE_PARAM;
1240 #else /* ! YYPARSE_PARAM */
1241 #if defined (__STDC__) || defined (__cplusplus)
1252 register int yystate;
1255 /* Number of tokens to shift before error messages enabled. */
1257 /* Lookahead token as an internal (translated) token number. */
1260 /* Three stacks and their tools:
1261 `yyss': related to states,
1262 `yyvs': related to semantic values,
1263 `yyls': related to locations.
1265 Refer to the stacks thru separate pointers, to allow yyoverflow
1266 to xreallocate them elsewhere. */
1268 /* The state stack. */
1269 short yyssa[YYINITDEPTH];
1270 short *yyss = yyssa;
1271 register short *yyssp;
1273 /* The semantic value stack. */
1274 YYSTYPE yyvsa[YYINITDEPTH];
1275 YYSTYPE *yyvs = yyvsa;
1276 register YYSTYPE *yyvsp;
1280 #define YYPOPSTACK (yyvsp--, yyssp--)
1282 YYSIZE_T yystacksize = YYINITDEPTH;
1284 /* The variables used to return semantic value and location from the
1289 /* When reducing, the number of symbols on the RHS of the reduced
1293 YYDPRINTF ((stderr, "Starting parse\n"));
1298 yychar = YYEMPTY; /* Cause a token to be read. */
1300 /* Initialize stack pointers.
1301 Waste one element of value and location stack
1302 so that they stay on the same level as the state stack.
1303 The wasted elements are never initialized. */
1310 /*------------------------------------------------------------.
1311 | yynewstate -- Push a new state, which is found in yystate. |
1312 `------------------------------------------------------------*/
1314 /* In all cases, when you get here, the value and location stacks
1315 have just been pushed. so pushing a state here evens the stacks.
1322 if (yyss + yystacksize - 1 <= yyssp)
1324 /* Get the current used size of the three stacks, in elements. */
1325 YYSIZE_T yysize = yyssp - yyss + 1;
1329 /* Give user a chance to xreallocate the stack. Use copies of
1330 these so that the &'s don't force the real ones into
1332 YYSTYPE *yyvs1 = yyvs;
1333 short *yyss1 = yyss;
1336 /* Each stack pointer address is followed by the size of the
1337 data in use in that stack, in bytes. This used to be a
1338 conditional around just the two extra args, but that might
1339 be undefined if yyoverflow is a macro. */
1340 yyoverflow ("parser stack overflow",
1341 &yyss1, yysize * sizeof (*yyssp),
1342 &yyvs1, yysize * sizeof (*yyvsp),
1349 #else /* no yyoverflow */
1350 # ifndef YYSTACK_RELOCATE
1353 /* Extend the stack our own way. */
1354 if (YYMAXDEPTH <= yystacksize)
1357 if (YYMAXDEPTH < yystacksize)
1358 yystacksize = YYMAXDEPTH;
1361 short *yyss1 = yyss;
1362 union yyalloc *yyptr =
1363 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1366 YYSTACK_RELOCATE (yyss);
1367 YYSTACK_RELOCATE (yyvs);
1369 # undef YYSTACK_RELOCATE
1371 YYSTACK_FREE (yyss1);
1374 #endif /* no yyoverflow */
1376 yyssp = yyss + yysize - 1;
1377 yyvsp = yyvs + yysize - 1;
1380 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1381 (unsigned long int) yystacksize));
1383 if (yyss + yystacksize - 1 <= yyssp)
1387 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1396 /* Do appropriate processing given the current state. */
1397 /* Read a lookahead token if we need one and don't already have one. */
1400 /* First try to decide what to do without reference to lookahead token. */
1402 yyn = yypact[yystate];
1403 if (yyn == YYPACT_NINF)
1406 /* Not known => get a lookahead token if don't already have one. */
1408 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1409 if (yychar == YYEMPTY)
1411 YYDPRINTF ((stderr, "Reading a token: "));
1415 if (yychar <= YYEOF)
1417 yychar = yytoken = YYEOF;
1418 YYDPRINTF ((stderr, "Now at end of input.\n"));
1422 yytoken = YYTRANSLATE (yychar);
1423 YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
1426 /* If the proper action on seeing token YYTOKEN is to reduce or to
1427 detect an error, take that action. */
1429 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1434 if (yyn == 0 || yyn == YYTABLE_NINF)
1443 /* Shift the lookahead token. */
1444 YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
1446 /* Discard the token being shifted unless it is eof. */
1447 if (yychar != YYEOF)
1453 /* Count tokens shifted since error; after three, turn off error
1462 /*-----------------------------------------------------------.
1463 | yydefault -- do the default action for the current state. |
1464 `-----------------------------------------------------------*/
1466 yyn = yydefact[yystate];
1472 /*-----------------------------.
1473 | yyreduce -- Do a reduction. |
1474 `-----------------------------*/
1476 /* yyn is the number of a rule to reduce with. */
1479 /* If YYLEN is nonzero, implement the default value of the action:
1482 Otherwise, the following line sets YYVAL to garbage.
1483 This behavior is undocumented and Bison
1484 users should not rely upon it. Assigning to YYVAL
1485 unconditionally makes the parser a bit smaller, and it avoids a
1486 GCC warning that YYVAL may be used uninitialized. */
1487 yyval = yyvsp[1-yylen];
1490 YY_REDUCE_PRINT (yyn);
1494 #line 236 "objc-exp.y"
1495 { write_exp_elt_opcode(OP_TYPE);
1496 write_exp_elt_type(yyvsp[0].tval);
1497 write_exp_elt_opcode(OP_TYPE);}
1501 #line 244 "objc-exp.y"
1502 { write_exp_elt_opcode (BINOP_COMMA); }
1506 #line 249 "objc-exp.y"
1507 { write_exp_elt_opcode (UNOP_IND); }
1511 #line 253 "objc-exp.y"
1512 { write_exp_elt_opcode (UNOP_ADDR); }
1516 #line 257 "objc-exp.y"
1517 { write_exp_elt_opcode (UNOP_NEG); }
1521 #line 261 "objc-exp.y"
1522 { write_exp_elt_opcode (UNOP_LOGICAL_NOT); }
1526 #line 265 "objc-exp.y"
1527 { write_exp_elt_opcode (UNOP_COMPLEMENT); }
1531 #line 269 "objc-exp.y"
1532 { write_exp_elt_opcode (UNOP_PREINCREMENT); }
1536 #line 273 "objc-exp.y"
1537 { write_exp_elt_opcode (UNOP_PREDECREMENT); }
1541 #line 277 "objc-exp.y"
1542 { write_exp_elt_opcode (UNOP_POSTINCREMENT); }
1546 #line 281 "objc-exp.y"
1547 { write_exp_elt_opcode (UNOP_POSTDECREMENT); }
1551 #line 285 "objc-exp.y"
1552 { write_exp_elt_opcode (UNOP_SIZEOF); }
1556 #line 289 "objc-exp.y"
1557 { write_exp_elt_opcode (STRUCTOP_PTR);
1558 write_exp_string (yyvsp[0].sval);
1559 write_exp_elt_opcode (STRUCTOP_PTR); }
1563 #line 295 "objc-exp.y"
1564 { /* exp->type::name becomes exp->*(&type::name) */
1565 /* Note: this doesn't work if name is a
1566 static member! FIXME */
1567 write_exp_elt_opcode (UNOP_ADDR);
1568 write_exp_elt_opcode (STRUCTOP_MPTR); }
1572 #line 302 "objc-exp.y"
1573 { write_exp_elt_opcode (STRUCTOP_MPTR); }
1577 #line 306 "objc-exp.y"
1578 { write_exp_elt_opcode (STRUCTOP_STRUCT);
1579 write_exp_string (yyvsp[0].sval);
1580 write_exp_elt_opcode (STRUCTOP_STRUCT); }
1584 #line 313 "objc-exp.y"
1585 { /* exp.type::name becomes exp.*(&type::name) */
1586 /* Note: this doesn't work if name is a
1587 static member! FIXME */
1588 write_exp_elt_opcode (UNOP_ADDR);
1589 write_exp_elt_opcode (STRUCTOP_MEMBER); }
1593 #line 321 "objc-exp.y"
1594 { write_exp_elt_opcode (STRUCTOP_MEMBER); }
1598 #line 325 "objc-exp.y"
1599 { write_exp_elt_opcode (BINOP_SUBSCRIPT); }
1603 #line 333 "objc-exp.y"
1607 class = lookup_objc_class (copy_name (yyvsp[0].tsym.stoken));
1609 error ("%s is not an ObjC Class",
1610 copy_name (yyvsp[0].tsym.stoken));
1611 write_exp_elt_opcode (OP_LONG);
1612 write_exp_elt_type (builtin_type_int);
1613 write_exp_elt_longcst ((LONGEST) class);
1614 write_exp_elt_opcode (OP_LONG);
1620 #line 347 "objc-exp.y"
1621 { write_exp_elt_opcode (OP_OBJC_MSGCALL);
1623 write_exp_elt_opcode (OP_OBJC_MSGCALL);
1628 #line 354 "objc-exp.y"
1630 write_exp_elt_opcode (OP_LONG);
1631 write_exp_elt_type (builtin_type_int);
1632 write_exp_elt_longcst ((LONGEST) yyvsp[0].class.class);
1633 write_exp_elt_opcode (OP_LONG);
1639 #line 362 "objc-exp.y"
1640 { write_exp_elt_opcode (OP_OBJC_MSGCALL);
1642 write_exp_elt_opcode (OP_OBJC_MSGCALL);
1647 #line 369 "objc-exp.y"
1648 { start_msglist(); }
1652 #line 371 "objc-exp.y"
1653 { write_exp_elt_opcode (OP_OBJC_MSGCALL);
1655 write_exp_elt_opcode (OP_OBJC_MSGCALL);
1660 #line 378 "objc-exp.y"
1661 { add_msglist(&yyvsp[0].sval, 0); }
1665 #line 387 "objc-exp.y"
1666 { add_msglist(&yyvsp[-2].sval, 1); }
1670 #line 389 "objc-exp.y"
1671 { add_msglist(0, 1); }
1675 #line 391 "objc-exp.y"
1676 { add_msglist(0, 0); }
1680 #line 397 "objc-exp.y"
1681 { start_arglist (); }
1685 #line 399 "objc-exp.y"
1686 { write_exp_elt_opcode (OP_FUNCALL);
1687 write_exp_elt_longcst ((LONGEST) end_arglist ());
1688 write_exp_elt_opcode (OP_FUNCALL); }
1692 #line 405 "objc-exp.y"
1693 { start_arglist (); }
1697 #line 412 "objc-exp.y"
1698 { arglist_len = 1; }
1702 #line 416 "objc-exp.y"
1707 #line 420 "objc-exp.y"
1708 { yyval.lval = end_arglist () - 1; }
1712 #line 423 "objc-exp.y"
1713 { write_exp_elt_opcode (OP_ARRAY);
1714 write_exp_elt_longcst ((LONGEST) 0);
1715 write_exp_elt_longcst ((LONGEST) yyvsp[0].lval);
1716 write_exp_elt_opcode (OP_ARRAY); }
1720 #line 430 "objc-exp.y"
1721 { write_exp_elt_opcode (UNOP_MEMVAL);
1722 write_exp_elt_type (yyvsp[-2].tval);
1723 write_exp_elt_opcode (UNOP_MEMVAL); }
1727 #line 436 "objc-exp.y"
1728 { write_exp_elt_opcode (UNOP_CAST);
1729 write_exp_elt_type (yyvsp[-2].tval);
1730 write_exp_elt_opcode (UNOP_CAST); }
1734 #line 442 "objc-exp.y"
1739 #line 448 "objc-exp.y"
1740 { write_exp_elt_opcode (BINOP_REPEAT); }
1744 #line 452 "objc-exp.y"
1745 { write_exp_elt_opcode (BINOP_MUL); }
1749 #line 456 "objc-exp.y"
1750 { write_exp_elt_opcode (BINOP_DIV); }
1754 #line 460 "objc-exp.y"
1755 { write_exp_elt_opcode (BINOP_REM); }
1759 #line 464 "objc-exp.y"
1760 { write_exp_elt_opcode (BINOP_ADD); }
1764 #line 468 "objc-exp.y"
1765 { write_exp_elt_opcode (BINOP_SUB); }
1769 #line 472 "objc-exp.y"
1770 { write_exp_elt_opcode (BINOP_LSH); }
1774 #line 476 "objc-exp.y"
1775 { write_exp_elt_opcode (BINOP_RSH); }
1779 #line 480 "objc-exp.y"
1780 { write_exp_elt_opcode (BINOP_EQUAL); }
1784 #line 484 "objc-exp.y"
1785 { write_exp_elt_opcode (BINOP_NOTEQUAL); }
1789 #line 488 "objc-exp.y"
1790 { write_exp_elt_opcode (BINOP_LEQ); }
1794 #line 492 "objc-exp.y"
1795 { write_exp_elt_opcode (BINOP_GEQ); }
1799 #line 496 "objc-exp.y"
1800 { write_exp_elt_opcode (BINOP_LESS); }
1804 #line 500 "objc-exp.y"
1805 { write_exp_elt_opcode (BINOP_GTR); }
1809 #line 504 "objc-exp.y"
1810 { write_exp_elt_opcode (BINOP_BITWISE_AND); }
1814 #line 508 "objc-exp.y"
1815 { write_exp_elt_opcode (BINOP_BITWISE_XOR); }
1819 #line 512 "objc-exp.y"
1820 { write_exp_elt_opcode (BINOP_BITWISE_IOR); }
1824 #line 516 "objc-exp.y"
1825 { write_exp_elt_opcode (BINOP_LOGICAL_AND); }
1829 #line 520 "objc-exp.y"
1830 { write_exp_elt_opcode (BINOP_LOGICAL_OR); }
1834 #line 524 "objc-exp.y"
1835 { write_exp_elt_opcode (TERNOP_COND); }
1839 #line 528 "objc-exp.y"
1840 { write_exp_elt_opcode (BINOP_ASSIGN); }
1844 #line 532 "objc-exp.y"
1845 { write_exp_elt_opcode (BINOP_ASSIGN_MODIFY);
1846 write_exp_elt_opcode (yyvsp[-1].opcode);
1847 write_exp_elt_opcode (BINOP_ASSIGN_MODIFY); }
1851 #line 538 "objc-exp.y"
1852 { write_exp_elt_opcode (OP_LONG);
1853 write_exp_elt_type (yyvsp[0].typed_val_int.type);
1854 write_exp_elt_longcst ((LONGEST)(yyvsp[0].typed_val_int.val));
1855 write_exp_elt_opcode (OP_LONG); }
1859 #line 545 "objc-exp.y"
1861 parse_number (yyvsp[0].ssym.stoken.ptr, yyvsp[0].ssym.stoken.length, 0, &val);
1862 write_exp_elt_opcode (OP_LONG);
1863 write_exp_elt_type (val.typed_val_int.type);
1864 write_exp_elt_longcst ((LONGEST)val.typed_val_int.val);
1865 write_exp_elt_opcode (OP_LONG);
1870 #line 556 "objc-exp.y"
1871 { write_exp_elt_opcode (OP_DOUBLE);
1872 write_exp_elt_type (yyvsp[0].typed_val_float.type);
1873 write_exp_elt_dblcst (yyvsp[0].typed_val_float.dval);
1874 write_exp_elt_opcode (OP_DOUBLE); }
1878 #line 570 "objc-exp.y"
1880 write_exp_elt_opcode (OP_OBJC_SELECTOR);
1881 write_exp_string (yyvsp[0].sval);
1882 write_exp_elt_opcode (OP_OBJC_SELECTOR); }
1886 #line 577 "objc-exp.y"
1887 { write_exp_elt_opcode (OP_LONG);
1888 write_exp_elt_type (builtin_type_int);
1889 CHECK_TYPEDEF (yyvsp[-1].tval);
1890 write_exp_elt_longcst ((LONGEST) TYPE_LENGTH (yyvsp[-1].tval));
1891 write_exp_elt_opcode (OP_LONG); }
1895 #line 585 "objc-exp.y"
1896 { /* C strings are converted into array
1897 constants with an explicit null byte
1898 added at the end. Thus the array upper
1899 bound is the string length. There is no
1900 such thing in C as a completely empty
1902 char *sp = yyvsp[0].sval.ptr; int count = yyvsp[0].sval.length;
1905 write_exp_elt_opcode (OP_LONG);
1906 write_exp_elt_type (builtin_type_char);
1907 write_exp_elt_longcst ((LONGEST)(*sp++));
1908 write_exp_elt_opcode (OP_LONG);
1910 write_exp_elt_opcode (OP_LONG);
1911 write_exp_elt_type (builtin_type_char);
1912 write_exp_elt_longcst ((LONGEST)'\0');
1913 write_exp_elt_opcode (OP_LONG);
1914 write_exp_elt_opcode (OP_ARRAY);
1915 write_exp_elt_longcst ((LONGEST) 0);
1916 write_exp_elt_longcst ((LONGEST) (yyvsp[0].sval.length));
1917 write_exp_elt_opcode (OP_ARRAY); }
1921 #line 612 "objc-exp.y"
1922 { write_exp_elt_opcode (OP_OBJC_NSSTRING);
1923 write_exp_string (yyvsp[0].sval);
1924 write_exp_elt_opcode (OP_OBJC_NSSTRING); }
1928 #line 618 "objc-exp.y"
1930 if (yyvsp[0].ssym.sym != 0)
1931 yyval.bval = SYMBOL_BLOCK_VALUE (yyvsp[0].ssym.sym);
1934 struct symtab *tem =
1935 lookup_symtab (copy_name (yyvsp[0].ssym.stoken));
1937 yyval.bval = BLOCKVECTOR_BLOCK (BLOCKVECTOR (tem), STATIC_BLOCK);
1939 error ("No file or function \"%s\".",
1940 copy_name (yyvsp[0].ssym.stoken));
1946 #line 635 "objc-exp.y"
1947 { struct symbol *tem
1948 = lookup_symbol (copy_name (yyvsp[0].sval), yyvsp[-2].bval,
1949 VAR_DOMAIN, (int *) NULL,
1950 (struct symtab **) NULL);
1951 if (!tem || SYMBOL_CLASS (tem) != LOC_BLOCK)
1952 error ("No function \"%s\" in specified context.",
1953 copy_name (yyvsp[0].sval));
1954 yyval.bval = SYMBOL_BLOCK_VALUE (tem); }
1958 #line 646 "objc-exp.y"
1959 { struct symbol *sym;
1960 sym = lookup_symbol (copy_name (yyvsp[0].sval), yyvsp[-2].bval,
1961 VAR_DOMAIN, (int *) NULL,
1962 (struct symtab **) NULL);
1964 error ("No symbol \"%s\" in specified context.",
1965 copy_name (yyvsp[0].sval));
1967 write_exp_elt_opcode (OP_VAR_VALUE);
1968 /* block_found is set by lookup_symbol. */
1969 write_exp_elt_block (block_found);
1970 write_exp_elt_sym (sym);
1971 write_exp_elt_opcode (OP_VAR_VALUE); }
1975 #line 662 "objc-exp.y"
1977 struct type *type = yyvsp[-2].tval;
1978 if (TYPE_CODE (type) != TYPE_CODE_STRUCT
1979 && TYPE_CODE (type) != TYPE_CODE_UNION)
1980 error ("`%s' is not defined as an aggregate type.",
1983 write_exp_elt_opcode (OP_SCOPE);
1984 write_exp_elt_type (type);
1985 write_exp_string (yyvsp[0].sval);
1986 write_exp_elt_opcode (OP_SCOPE);
1991 #line 675 "objc-exp.y"
1993 struct type *type = yyvsp[-3].tval;
1994 struct stoken tmp_token;
1995 if (TYPE_CODE (type) != TYPE_CODE_STRUCT
1996 && TYPE_CODE (type) != TYPE_CODE_UNION)
1997 error ("`%s' is not defined as an aggregate type.",
2000 if (!DEPRECATED_STREQ (type_name_no_tag (type), yyvsp[0].sval.ptr))
2001 error ("invalid destructor `%s::~%s'",
2002 type_name_no_tag (type), yyvsp[0].sval.ptr);
2004 tmp_token.ptr = (char*) alloca (yyvsp[0].sval.length + 2);
2005 tmp_token.length = yyvsp[0].sval.length + 1;
2006 tmp_token.ptr[0] = '~';
2007 memcpy (tmp_token.ptr+1, yyvsp[0].sval.ptr, yyvsp[0].sval.length);
2008 tmp_token.ptr[tmp_token.length] = 0;
2009 write_exp_elt_opcode (OP_SCOPE);
2010 write_exp_elt_type (type);
2011 write_exp_string (tmp_token);
2012 write_exp_elt_opcode (OP_SCOPE);
2017 #line 701 "objc-exp.y"
2019 char *name = copy_name (yyvsp[0].sval);
2021 struct minimal_symbol *msymbol;
2024 lookup_symbol (name, (const struct block *) NULL,
2025 VAR_DOMAIN, (int *) NULL,
2026 (struct symtab **) NULL);
2029 write_exp_elt_opcode (OP_VAR_VALUE);
2030 write_exp_elt_block (NULL);
2031 write_exp_elt_sym (sym);
2032 write_exp_elt_opcode (OP_VAR_VALUE);
2036 msymbol = lookup_minimal_symbol (name, NULL, NULL);
2037 if (msymbol != NULL)
2039 write_exp_msymbol (msymbol,
2040 lookup_function_type (builtin_type_int),
2044 if (!have_full_symbols () && !have_partial_symbols ())
2045 error ("No symbol table is loaded. Use the \"file\" command.");
2047 error ("No symbol \"%s\" in current context.", name);
2052 #line 735 "objc-exp.y"
2053 { struct symbol *sym = yyvsp[0].ssym.sym;
2057 if (symbol_read_needs_frame (sym))
2059 if (innermost_block == 0 ||
2060 contained_in (block_found,
2062 innermost_block = block_found;
2065 write_exp_elt_opcode (OP_VAR_VALUE);
2066 /* We want to use the selected frame, not
2067 another more inner frame which happens to
2068 be in the same block. */
2069 write_exp_elt_block (NULL);
2070 write_exp_elt_sym (sym);
2071 write_exp_elt_opcode (OP_VAR_VALUE);
2073 else if (yyvsp[0].ssym.is_a_field_of_this)
2075 /* C++/ObjC: it hangs off of `this'/'self'.
2076 Must not inadvertently convert from a
2077 method call to data ref. */
2078 if (innermost_block == 0 ||
2079 contained_in (block_found, innermost_block))
2080 innermost_block = block_found;
2081 write_exp_elt_opcode (OP_OBJC_SELF);
2082 write_exp_elt_opcode (OP_OBJC_SELF);
2083 write_exp_elt_opcode (STRUCTOP_PTR);
2084 write_exp_string (yyvsp[0].ssym.stoken);
2085 write_exp_elt_opcode (STRUCTOP_PTR);
2089 struct minimal_symbol *msymbol;
2090 char *arg = copy_name (yyvsp[0].ssym.stoken);
2093 lookup_minimal_symbol (arg, NULL, NULL);
2094 if (msymbol != NULL)
2096 write_exp_msymbol (msymbol,
2097 lookup_function_type (builtin_type_int),
2100 else if (!have_full_symbols () &&
2101 !have_partial_symbols ())
2102 error ("No symbol table is loaded. Use the \"file\" command.");
2104 error ("No symbol \"%s\" in current context.",
2105 copy_name (yyvsp[0].ssym.stoken));
2111 #line 802 "objc-exp.y"
2112 { yyval.tval = follow_types (yyvsp[-1].tval); }
2116 #line 804 "objc-exp.y"
2117 { yyval.tval = follow_types (yyvsp[-2].tval); }
2121 #line 806 "objc-exp.y"
2122 { yyval.tval = follow_types (yyvsp[-2].tval); }
2126 #line 810 "objc-exp.y"
2127 { push_type (tp_pointer); yyval.voidval = 0; }
2131 #line 812 "objc-exp.y"
2132 { push_type (tp_pointer); yyval.voidval = yyvsp[0].voidval; }
2136 #line 814 "objc-exp.y"
2137 { push_type (tp_reference); yyval.voidval = 0; }
2141 #line 816 "objc-exp.y"
2142 { push_type (tp_reference); yyval.voidval = yyvsp[0].voidval; }
2146 #line 821 "objc-exp.y"
2147 { yyval.voidval = yyvsp[-1].voidval; }
2151 #line 823 "objc-exp.y"
2153 push_type_int (yyvsp[0].lval);
2154 push_type (tp_array);
2159 #line 828 "objc-exp.y"
2161 push_type_int (yyvsp[0].lval);
2162 push_type (tp_array);
2168 #line 835 "objc-exp.y"
2169 { push_type (tp_function); }
2173 #line 837 "objc-exp.y"
2174 { push_type (tp_function); }
2178 #line 841 "objc-exp.y"
2179 { yyval.lval = -1; }
2183 #line 843 "objc-exp.y"
2184 { yyval.lval = yyvsp[-1].typed_val_int.val; }
2188 #line 847 "objc-exp.y"
2189 { yyval.voidval = 0; }
2193 #line 849 "objc-exp.y"
2194 { free (yyvsp[-1].tvec); yyval.voidval = 0; }
2198 #line 862 "objc-exp.y"
2199 { yyval.tval = lookup_member_type (builtin_type_int, yyvsp[-2].tval); }
2203 #line 867 "objc-exp.y"
2204 { yyval.tval = yyvsp[0].tsym.type; }
2208 #line 869 "objc-exp.y"
2210 if (yyvsp[0].class.type == NULL)
2211 error ("No symbol \"%s\" in current context.",
2212 copy_name(yyvsp[0].class.stoken));
2214 yyval.tval = yyvsp[0].class.type;
2219 #line 877 "objc-exp.y"
2220 { yyval.tval = builtin_type_int; }
2224 #line 879 "objc-exp.y"
2225 { yyval.tval = builtin_type_long; }
2229 #line 881 "objc-exp.y"
2230 { yyval.tval = builtin_type_short; }
2234 #line 883 "objc-exp.y"
2235 { yyval.tval = builtin_type_long; }
2239 #line 885 "objc-exp.y"
2240 { yyval.tval = builtin_type_unsigned_long; }
2244 #line 887 "objc-exp.y"
2245 { yyval.tval = builtin_type_long_long; }
2249 #line 889 "objc-exp.y"
2250 { yyval.tval = builtin_type_long_long; }
2254 #line 891 "objc-exp.y"
2255 { yyval.tval = builtin_type_unsigned_long_long; }
2259 #line 893 "objc-exp.y"
2260 { yyval.tval = builtin_type_unsigned_long_long; }
2264 #line 895 "objc-exp.y"
2265 { yyval.tval = builtin_type_short; }
2269 #line 897 "objc-exp.y"
2270 { yyval.tval = builtin_type_unsigned_short; }
2274 #line 899 "objc-exp.y"
2275 { yyval.tval = builtin_type_double; }
2279 #line 901 "objc-exp.y"
2280 { yyval.tval = builtin_type_long_double; }
2284 #line 903 "objc-exp.y"
2285 { yyval.tval = lookup_struct (copy_name (yyvsp[0].sval),
2286 expression_context_block); }
2290 #line 906 "objc-exp.y"
2291 { yyval.tval = lookup_struct (copy_name (yyvsp[0].sval),
2292 expression_context_block); }
2296 #line 909 "objc-exp.y"
2297 { yyval.tval = lookup_union (copy_name (yyvsp[0].sval),
2298 expression_context_block); }
2302 #line 912 "objc-exp.y"
2303 { yyval.tval = lookup_enum (copy_name (yyvsp[0].sval),
2304 expression_context_block); }
2308 #line 915 "objc-exp.y"
2309 { yyval.tval = lookup_unsigned_typename (TYPE_NAME(yyvsp[0].tsym.type)); }
2313 #line 917 "objc-exp.y"
2314 { yyval.tval = builtin_type_unsigned_int; }
2318 #line 919 "objc-exp.y"
2319 { yyval.tval = lookup_signed_typename (TYPE_NAME(yyvsp[0].tsym.type)); }
2323 #line 921 "objc-exp.y"
2324 { yyval.tval = builtin_type_int; }
2328 #line 923 "objc-exp.y"
2329 { yyval.tval = lookup_template_type(copy_name(yyvsp[-3].sval), yyvsp[-1].tval,
2330 expression_context_block);
2335 #line 929 "objc-exp.y"
2336 { yyval.tval = yyvsp[0].tval; }
2340 #line 930 "objc-exp.y"
2341 { yyval.tval = yyvsp[0].tval; }
2345 #line 935 "objc-exp.y"
2347 yyval.tsym.stoken.ptr = "int";
2348 yyval.tsym.stoken.length = 3;
2349 yyval.tsym.type = builtin_type_int;
2354 #line 941 "objc-exp.y"
2356 yyval.tsym.stoken.ptr = "long";
2357 yyval.tsym.stoken.length = 4;
2358 yyval.tsym.type = builtin_type_long;
2363 #line 947 "objc-exp.y"
2365 yyval.tsym.stoken.ptr = "short";
2366 yyval.tsym.stoken.length = 5;
2367 yyval.tsym.type = builtin_type_short;
2372 #line 956 "objc-exp.y"
2373 { yyval.tvec = (struct type **) xmalloc (sizeof (struct type *) * 2);
2374 yyval.ivec[0] = 1; /* Number of types in vector. */
2375 yyval.tvec[1] = yyvsp[0].tval;
2380 #line 961 "objc-exp.y"
2381 { int len = sizeof (struct type *) * (++(yyvsp[-2].ivec[0]) + 1);
2382 yyval.tvec = (struct type **) xrealloc ((char *) yyvsp[-2].tvec, len);
2383 yyval.tvec[yyval.ivec[0]] = yyvsp[0].tval;
2388 #line 967 "objc-exp.y"
2389 { yyval.sval = yyvsp[0].ssym.stoken; }
2393 #line 968 "objc-exp.y"
2394 { yyval.sval = yyvsp[0].ssym.stoken; }
2398 #line 969 "objc-exp.y"
2399 { yyval.sval = yyvsp[0].tsym.stoken; }
2403 #line 970 "objc-exp.y"
2404 { yyval.sval = yyvsp[0].class.stoken; }
2408 #line 971 "objc-exp.y"
2409 { yyval.sval = yyvsp[0].ssym.stoken; }
2415 /* Line 991 of yacc.c. */
2421 YY_STACK_PRINT (yyss, yyssp);
2426 /* Now `shift' the result of the reduction. Determine what state
2427 that goes to, based on the state we popped back to and the rule
2428 number reduced by. */
2432 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2433 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2434 yystate = yytable[yystate];
2436 yystate = yydefgoto[yyn - YYNTOKENS];
2441 /*------------------------------------.
2442 | yyerrlab -- here on detecting error |
2443 `------------------------------------*/
2445 /* If not already recovering from an error, report this error. */
2450 yyn = yypact[yystate];
2452 if (YYPACT_NINF < yyn && yyn < YYLAST)
2454 YYSIZE_T yysize = 0;
2455 int yytype = YYTRANSLATE (yychar);
2460 /* Start YYX at -YYN if negative to avoid negative indexes in
2462 for (yyx = yyn < 0 ? -yyn : 0;
2463 yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
2464 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
2465 yysize += yystrlen (yytname[yyx]) + 15, yycount++;
2466 yysize += yystrlen ("syntax error, unexpected ") + 1;
2467 yysize += yystrlen (yytname[yytype]);
2468 yymsg = (char *) YYSTACK_ALLOC (yysize);
2471 char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
2472 yyp = yystpcpy (yyp, yytname[yytype]);
2477 for (yyx = yyn < 0 ? -yyn : 0;
2478 yyx < (int) (sizeof (yytname) / sizeof (char *));
2480 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
2482 const char *yyq = ! yycount ? ", expecting " : " or ";
2483 yyp = yystpcpy (yyp, yyq);
2484 yyp = yystpcpy (yyp, yytname[yyx]);
2489 YYSTACK_FREE (yymsg);
2492 yyerror ("syntax error; also virtual memory exhausted");
2495 #endif /* YYERROR_VERBOSE */
2496 yyerror ("syntax error");
2501 if (yyerrstatus == 3)
2503 /* If just tried and failed to reuse lookahead token after an
2504 error, discard it. */
2506 /* Return failure if at end of input. */
2507 if (yychar == YYEOF)
2509 /* Pop the error token. */
2511 /* Pop the rest of the stack. */
2512 while (yyss < yyssp)
2514 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
2515 yydestruct (yystos[*yyssp], yyvsp);
2521 YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
2522 yydestruct (yytoken, &yylval);
2527 /* Else will try to reuse lookahead token after shifting the error
2532 /*----------------------------------------------------.
2533 | yyerrlab1 -- error raised explicitly by an action. |
2534 `----------------------------------------------------*/
2537 /* Suppress GCC warning that yyerrlab1 is unused when no action
2538 invokes YYERROR. MacOS 10.2.3's buggy "smart preprocessor"
2539 insists on the trailing semicolon. */
2540 #if defined (__GNUC_MINOR__) && 2093 <= (__GNUC__ * 1000 + __GNUC_MINOR__)
2541 __attribute__ ((__unused__));
2548 /*---------------------------------------------------------------.
2549 | yyerrlab2 -- pop states until the error token can be shifted. |
2550 `---------------------------------------------------------------*/
2552 yyerrstatus = 3; /* Each real token shifted decrements this. */
2556 yyn = yypact[yystate];
2557 if (yyn != YYPACT_NINF)
2560 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2568 /* Pop the current state because it cannot handle the error token. */
2572 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
2573 yydestruct (yystos[yystate], yyvsp);
2577 YY_STACK_PRINT (yyss, yyssp);
2583 YYDPRINTF ((stderr, "Shifting error token, "));
2592 /*-------------------------------------.
2593 | yyacceptlab -- YYACCEPT comes here. |
2594 `-------------------------------------*/
2599 /*-----------------------------------.
2600 | yyabortlab -- YYABORT comes here. |
2601 `-----------------------------------*/
2607 /*----------------------------------------------.
2608 | yyoverflowlab -- parser overflow comes here. |
2609 `----------------------------------------------*/
2611 yyerror ("parser stack overflow");
2619 YYSTACK_FREE (yyss);
2625 #line 985 "objc-exp.y"
2628 /* Take care of parsing a number (anything that starts with a digit).
2629 Set yylval and return the token type; update lexptr. LEN is the
2630 number of characters in it. */
2632 /*** Needs some error checking for the float case. ***/
2635 parse_number (p, len, parsed_float, putithere)
2641 /* FIXME: Shouldn't these be unsigned? We don't deal with negative
2642 values here, and we do kind of silly things like cast to
2646 unsigned LONGEST un;
2650 int base = input_radix;
2653 /* Number of "L" suffixes encountered. */
2656 /* We have found a "L" or "U" suffix. */
2657 int found_suffix = 0;
2659 unsigned LONGEST high_bit;
2660 struct type *signed_type;
2661 struct type *unsigned_type;
2667 /* It's a float since it contains a point or an exponent. */
2669 if (sizeof (putithere->typed_val_float.dval) <= sizeof (float))
2670 sscanf (p, "%g", (float *)&putithere->typed_val_float.dval);
2671 else if (sizeof (putithere->typed_val_float.dval) <= sizeof (double))
2672 sscanf (p, "%lg", (double *)&putithere->typed_val_float.dval);
2675 #ifdef PRINTF_HAS_LONG_DOUBLE
2676 sscanf (p, "%Lg", &putithere->typed_val_float.dval);
2678 /* Scan it into a double, then assign it to the long double.
2679 This at least wins with values representable in the range
2682 sscanf (p, "%lg", &temp);
2683 putithere->typed_val_float.dval = temp;
2687 /* See if it has `f' or `l' suffix (float or long double). */
2689 c = tolower (p[len - 1]);
2692 putithere->typed_val_float.type = builtin_type_float;
2694 putithere->typed_val_float.type = builtin_type_long_double;
2695 else if (isdigit (c) || c == '.')
2696 putithere->typed_val_float.type = builtin_type_double;
2703 /* Handle base-switching prefixes 0x, 0t, 0d, and 0. */
2737 if (c >= 'A' && c <= 'Z')
2739 if (c != 'l' && c != 'u')
2741 if (c >= '0' && c <= '9')
2749 if (base > 10 && c >= 'a' && c <= 'f')
2753 n += i = c - 'a' + 10;
2766 return ERROR; /* Char not a digit. */
2769 return ERROR; /* Invalid digit in this base. */
2771 /* Portably test for overflow (only works for nonzero values, so
2772 make a second check for zero). FIXME: Can't we just make n
2773 and prevn unsigned and avoid this? */
2774 if (c != 'l' && c != 'u' && (prevn >= n) && n != 0)
2775 unsigned_p = 1; /* Try something unsigned. */
2777 /* Portably test for unsigned overflow.
2778 FIXME: This check is wrong; for example it doesn't find
2779 overflow on 0x123456789 when LONGEST is 32 bits. */
2780 if (c != 'l' && c != 'u' && n != 0)
2782 if ((unsigned_p && (unsigned LONGEST) prevn >= (unsigned LONGEST) n))
2783 error ("Numeric constant too large.");
2788 /* An integer constant is an int, a long, or a long long. An L
2789 suffix forces it to be long; an LL suffix forces it to be long
2790 long. If not forced to a larger size, it gets the first type of
2791 the above that it fits in. To figure out whether it fits, we
2792 shift it right and see whether anything remains. Note that we
2793 can't shift sizeof (LONGEST) * HOST_CHAR_BIT bits or more in one
2794 operation, because many compilers will warn about such a shift
2795 (which always produces a zero result). Sometimes TARGET_INT_BIT
2796 or TARGET_LONG_BIT will be that big, sometimes not. To deal with
2797 the case where it is we just always shift the value more than
2798 once, with fewer bits each time. */
2800 un = (unsigned LONGEST)n >> 2;
2802 && (un >> (TARGET_INT_BIT - 2)) == 0)
2804 high_bit = ((unsigned LONGEST)1) << (TARGET_INT_BIT-1);
2806 /* A large decimal (not hex or octal) constant (between INT_MAX
2807 and UINT_MAX) is a long or unsigned long, according to ANSI,
2808 never an unsigned int, but this code treats it as unsigned
2809 int. This probably should be fixed. GCC gives a warning on
2812 unsigned_type = builtin_type_unsigned_int;
2813 signed_type = builtin_type_int;
2815 else if (long_p <= 1
2816 && (un >> (TARGET_LONG_BIT - 2)) == 0)
2818 high_bit = ((unsigned LONGEST)1) << (TARGET_LONG_BIT-1);
2819 unsigned_type = builtin_type_unsigned_long;
2820 signed_type = builtin_type_long;
2824 high_bit = (((unsigned LONGEST)1)
2825 << (TARGET_LONG_LONG_BIT - 32 - 1)
2829 /* A long long does not fit in a LONGEST. */
2831 (unsigned LONGEST)1 << (sizeof (LONGEST) * HOST_CHAR_BIT - 1);
2832 unsigned_type = builtin_type_unsigned_long_long;
2833 signed_type = builtin_type_long_long;
2836 putithere->typed_val_int.val = n;
2838 /* If the high bit of the worked out type is set then this number
2839 has to be unsigned. */
2841 if (unsigned_p || (n & high_bit))
2843 putithere->typed_val_int.type = unsigned_type;
2847 putithere->typed_val_int.type = signed_type;
2857 enum exp_opcode opcode;
2860 static const struct token tokentab3[] =
2862 {">>=", ASSIGN_MODIFY, BINOP_RSH},
2863 {"<<=", ASSIGN_MODIFY, BINOP_LSH}
2866 static const struct token tokentab2[] =
2868 {"+=", ASSIGN_MODIFY, BINOP_ADD},
2869 {"-=", ASSIGN_MODIFY, BINOP_SUB},
2870 {"*=", ASSIGN_MODIFY, BINOP_MUL},
2871 {"/=", ASSIGN_MODIFY, BINOP_DIV},
2872 {"%=", ASSIGN_MODIFY, BINOP_REM},
2873 {"|=", ASSIGN_MODIFY, BINOP_BITWISE_IOR},
2874 {"&=", ASSIGN_MODIFY, BINOP_BITWISE_AND},
2875 {"^=", ASSIGN_MODIFY, BINOP_BITWISE_XOR},
2876 {"++", INCREMENT, BINOP_END},
2877 {"--", DECREMENT, BINOP_END},
2878 {"->", ARROW, BINOP_END},
2879 {"&&", ANDAND, BINOP_END},
2880 {"||", OROR, BINOP_END},
2881 {"::", COLONCOLON, BINOP_END},
2882 {"<<", LSH, BINOP_END},
2883 {">>", RSH, BINOP_END},
2884 {"==", EQUAL, BINOP_END},
2885 {"!=", NOTEQUAL, BINOP_END},
2886 {"<=", LEQ, BINOP_END},
2887 {">=", GEQ, BINOP_END}
2890 /* Read one token, getting characters through lexptr. */
2901 static char *tempbuf;
2902 static int tempbufsize;
2907 /* See if it is a special token of length 3. */
2908 for (i = 0; i < sizeof tokentab3 / sizeof tokentab3[0]; i++)
2909 if (DEPRECATED_STREQN (tokstart, tokentab3[i].operator, 3))
2912 yylval.opcode = tokentab3[i].opcode;
2913 return tokentab3[i].token;
2916 /* See if it is a special token of length 2. */
2917 for (i = 0; i < sizeof tokentab2 / sizeof tokentab2[0]; i++)
2918 if (DEPRECATED_STREQN (tokstart, tokentab2[i].operator, 2))
2921 yylval.opcode = tokentab2[i].opcode;
2922 return tokentab2[i].token;
2926 switch (tokchr = *tokstart)
2938 /* We either have a character constant ('0' or '\177' for
2939 example) or we have a quoted symbol reference ('foo(int,int)'
2940 in C++ for example). */
2944 c = parse_escape (&lexptr);
2946 error ("Empty character constant.");
2948 yylval.typed_val_int.val = c;
2949 yylval.typed_val_int.type = builtin_type_char;
2954 namelen = skip_quoted (tokstart) - tokstart;
2957 lexptr = tokstart + namelen;
2958 if (lexptr[-1] != '\'')
2959 error ("Unmatched single quote.");
2964 error ("Invalid character constant.");
2974 if (paren_depth == 0)
2981 if (comma_terminates && paren_depth == 0)
2987 /* Might be a floating point number. */
2988 if (lexptr[1] < '0' || lexptr[1] > '9')
2989 goto symbol; /* Nope, must be a symbol. */
2990 /* FALL THRU into number case. */
3003 /* It's a number. */
3004 int got_dot = 0, got_e = 0, toktype = FLOAT;
3005 /* Initialize toktype to anything other than ERROR. */
3007 int hex = input_radix > 10;
3008 int local_radix = input_radix;
3009 if (tokchr == '0' && (p[1] == 'x' || p[1] == 'X'))
3015 else if (tokchr == '0' && (p[1]=='t' || p[1]=='T' || p[1]=='d' || p[1]=='D'))
3024 /* This test includes !hex because 'e' is a valid hex digit
3025 and thus does not indicate a floating point number when
3026 the radix is hex. */
3028 if (!hex && (*p == 'e' || *p == 'E'))
3030 toktype = ERROR; /* Only one 'e' in a float. */
3033 /* This test does not include !hex, because a '.' always
3034 indicates a decimal floating point number regardless of
3038 toktype = ERROR; /* Only one '.' in a float. */
3041 else if (got_e && (p[-1] == 'e' || p[-1] == 'E') &&
3042 (*p == '-' || *p == '+'))
3043 /* This is the sign of the exponent, not the end of the
3046 /* Always take decimal digits; parse_number handles radix
3048 else if (*p >= '0' && *p <= '9')
3050 /* We will take letters only if hex is true, and only up
3051 to what the input radix would permit. FSF was content
3052 to rely on parse_number to validate; but it leaks. */
3053 else if (*p >= 'a' && *p <= 'z')
3055 if (!hex || *p >= ('a' + local_radix - 10))
3058 else if (*p >= 'A' && *p <= 'Z')
3060 if (!hex || *p >= ('A' + local_radix - 10))
3065 if (toktype != ERROR)
3066 toktype = parse_number (tokstart, p - tokstart,
3067 got_dot | got_e, &yylval);
3068 if (toktype == ERROR)
3070 char *err_copy = (char *) alloca (p - tokstart + 1);
3072 memcpy (err_copy, tokstart, p - tokstart);
3073 err_copy[p - tokstart] = 0;
3074 error ("Invalid number \"%s\".", err_copy);
3091 case '@': /* Moved out below. */
3107 if (strncmp(tokstart, "@selector", 9) == 0)
3109 tokptr = strchr(tokstart, '(');
3112 error ("Missing '(' in @selector(...)");
3115 tokptr++; /* Skip the '('. */
3117 /* Grow the static temp buffer if necessary, including
3118 allocating the first one on demand. */
3119 if (tempbufindex + 1 >= tempbufsize)
3121 tempbuf = (char *) xrealloc (tempbuf, tempbufsize += 64);
3123 tempbuf[tempbufindex++] = *tokptr++;
3124 } while ((*tokptr != ')') && (*tokptr != '\0'));
3125 if (*tokptr++ != ')')
3127 error ("Missing ')' in @selector(...)");
3129 tempbuf[tempbufindex] = '\0';
3130 yylval.sval.ptr = tempbuf;
3131 yylval.sval.length = tempbufindex;
3135 if (tokstart[1] != '"')
3140 /* ObjC NextStep NSString constant: fall thru and parse like
3146 /* Build the gdb internal form of the input string in tempbuf,
3147 translating any standard C escape forms seen. Note that the
3148 buffer is null byte terminated *only* for the convenience of
3149 debugging gdb itself and printing the buffer contents when
3150 the buffer contains no embedded nulls. Gdb does not depend
3151 upon the buffer being null byte terminated, it uses the
3152 length string instead. This allows gdb to handle C strings
3153 (as well as strings in other languages) with embedded null
3156 tokptr = ++tokstart;
3160 /* Grow the static temp buffer if necessary, including
3161 allocating the first one on demand. */
3162 if (tempbufindex + 1 >= tempbufsize)
3164 tempbuf = (char *) xrealloc (tempbuf, tempbufsize += 64);
3170 /* Do nothing, loop will terminate. */
3174 c = parse_escape (&tokptr);
3179 tempbuf[tempbufindex++] = c;
3182 tempbuf[tempbufindex++] = *tokptr++;
3185 } while ((*tokptr != '"') && (*tokptr != '\0'));
3186 if (*tokptr++ != '"')
3188 error ("Unterminated string in expression.");
3190 tempbuf[tempbufindex] = '\0'; /* See note above. */
3191 yylval.sval.ptr = tempbuf;
3192 yylval.sval.length = tempbufindex;
3194 return (tokchr == '@' ? NSSTRING : STRING);
3197 if (!(tokchr == '_' || tokchr == '$' ||
3198 (tokchr >= 'a' && tokchr <= 'z') || (tokchr >= 'A' && tokchr <= 'Z')))
3199 /* We must have come across a bad character (e.g. ';'). */
3200 error ("Invalid character '%c' in expression.", c);
3202 /* It's a name. See how long it is. */
3204 for (c = tokstart[namelen];
3205 (c == '_' || c == '$' || (c >= '0' && c <= '9')
3206 || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '<');)
3211 while (tokstart[++i] && tokstart[i] != '>');
3212 if (tokstart[i] == '>')
3215 c = tokstart[++namelen];
3218 /* The token "if" terminates the expression and is NOT
3219 removed from the input stream. */
3220 if (namelen == 2 && tokstart[0] == 'i' && tokstart[1] == 'f')
3229 /* Catch specific keywords. Should be done with a data structure. */
3233 if (DEPRECATED_STREQN (tokstart, "unsigned", 8))
3235 if (current_language->la_language == language_cplus
3236 && strncmp (tokstart, "template", 8) == 0)
3238 if (DEPRECATED_STREQN (tokstart, "volatile", 8))
3239 return VOLATILE_KEYWORD;
3242 if (DEPRECATED_STREQN (tokstart, "struct", 6))
3244 if (DEPRECATED_STREQN (tokstart, "signed", 6))
3245 return SIGNED_KEYWORD;
3246 if (DEPRECATED_STREQN (tokstart, "sizeof", 6))
3248 if (DEPRECATED_STREQN (tokstart, "double", 6))
3249 return DOUBLE_KEYWORD;
3252 if ((current_language->la_language == language_cplus)
3253 && strncmp (tokstart, "class", 5) == 0)
3255 if (DEPRECATED_STREQN (tokstart, "union", 5))
3257 if (DEPRECATED_STREQN (tokstart, "short", 5))
3259 if (DEPRECATED_STREQN (tokstart, "const", 5))
3260 return CONST_KEYWORD;
3263 if (DEPRECATED_STREQN (tokstart, "enum", 4))
3265 if (DEPRECATED_STREQN (tokstart, "long", 4))
3269 if (DEPRECATED_STREQN (tokstart, "int", 3))
3276 yylval.sval.ptr = tokstart;
3277 yylval.sval.length = namelen;
3279 if (*tokstart == '$')
3281 write_dollar_variable (yylval.sval);
3285 /* Use token-type BLOCKNAME for symbols that happen to be defined as
3286 functions or symtabs. If this is not so, then ...
3287 Use token-type TYPENAME for symbols that happen to be defined
3288 currently as names of types; NAME for other symbols.
3289 The caller is not constrained to care about the distinction. */
3291 char *tmp = copy_name (yylval.sval);
3293 int is_a_field_of_this = 0, *need_this;
3296 if (current_language->la_language == language_cplus ||
3297 current_language->la_language == language_objc)
3298 need_this = &is_a_field_of_this;
3300 need_this = (int *) NULL;
3302 sym = lookup_symbol (tmp, expression_context_block,
3305 (struct symtab **) NULL);
3306 /* Call lookup_symtab, not lookup_partial_symtab, in case there
3307 are no psymtabs (coff, xcoff, or some future change to blow
3308 away the psymtabs once symbols are read). */
3309 if ((sym && SYMBOL_CLASS (sym) == LOC_BLOCK) ||
3310 lookup_symtab (tmp))
3312 yylval.ssym.sym = sym;
3313 yylval.ssym.is_a_field_of_this = is_a_field_of_this;
3316 if (sym && SYMBOL_CLASS (sym) == LOC_TYPEDEF)
3319 /* Despite the following flaw, we need to keep this code
3320 enabled. Because we can get called from
3321 check_stub_method, if we don't handle nested types then
3322 it screws many operations in any program which uses
3324 /* In "A::x", if x is a member function of A and there
3325 happens to be a type (nested or not, since the stabs
3326 don't make that distinction) named x, then this code
3327 incorrectly thinks we are dealing with nested types
3328 rather than a member function. */
3332 struct symbol *best_sym;
3334 /* Look ahead to detect nested types. This probably should
3335 be done in the grammar, but trying seemed to introduce a
3336 lot of shift/reduce and reduce/reduce conflicts. It's
3337 possible that it could be done, though. Or perhaps a
3338 non-grammar, but less ad hoc, approach would work well. */
3340 /* Since we do not currently have any way of distinguishing
3341 a nested type from a non-nested one (the stabs don't tell
3342 us whether a type is nested), we just ignore the
3349 /* Skip whitespace. */
3350 while (*p == ' ' || *p == '\t' || *p == '\n')
3352 if (*p == ':' && p[1] == ':')
3354 /* Skip the `::'. */
3356 /* Skip whitespace. */
3357 while (*p == ' ' || *p == '\t' || *p == '\n')
3360 while (*p == '_' || *p == '$' || (*p >= '0' && *p <= '9')
3361 || (*p >= 'a' && *p <= 'z')
3362 || (*p >= 'A' && *p <= 'Z'))
3366 struct symbol *cur_sym;
3367 /* As big as the whole rest of the expression,
3368 which is at least big enough. */
3369 char *ncopy = alloca (strlen (tmp) +
3370 strlen (namestart) + 3);
3374 memcpy (tmp1, tmp, strlen (tmp));
3375 tmp1 += strlen (tmp);
3376 memcpy (tmp1, "::", 2);
3378 memcpy (tmp1, namestart, p - namestart);
3379 tmp1[p - namestart] = '\0';
3380 cur_sym = lookup_symbol (ncopy,
3381 expression_context_block,
3382 VAR_DOMAIN, (int *) NULL,
3383 (struct symtab **) NULL);
3386 if (SYMBOL_CLASS (cur_sym) == LOC_TYPEDEF)
3404 yylval.tsym.type = SYMBOL_TYPE (best_sym);
3406 yylval.tsym.type = SYMBOL_TYPE (sym);
3410 if ((yylval.tsym.type = lookup_primitive_typename (tmp)) != 0)
3413 /* See if it's an ObjC classname. */
3416 CORE_ADDR Class = lookup_objc_class(tmp);
3419 yylval.class.class = Class;
3420 if ((sym = lookup_struct_typedef (tmp,
3421 expression_context_block,
3423 yylval.class.type = SYMBOL_TYPE (sym);
3428 /* Input names that aren't symbols but ARE valid hex numbers,
3429 when the input radix permits them, can be names or numbers
3430 depending on the parse. Note we support radixes > 16 here. */
3432 ((tokstart[0] >= 'a' && tokstart[0] < 'a' + input_radix - 10) ||
3433 (tokstart[0] >= 'A' && tokstart[0] < 'A' + input_radix - 10)))
3435 YYSTYPE newlval; /* Its value is ignored. */
3436 hextype = parse_number (tokstart, namelen, 0, &newlval);
3439 yylval.ssym.sym = sym;
3440 yylval.ssym.is_a_field_of_this = is_a_field_of_this;
3445 /* Any other kind of symbol. */
3446 yylval.ssym.sym = sym;
3447 yylval.ssym.is_a_field_of_this = is_a_field_of_this;
3456 if (*lexptr == '\0')
3457 error("A %s near end of expression.", (msg ? msg : "error"));
3459 error ("A %s in expression, near `%s'.", (msg ? msg : "error"),