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
76 VOLATILE_KEYWORD
= 278,
104 #define NAME_OR_INT 263
111 #define COLONCOLON 270
114 #define SIGNED_KEYWORD 273
117 #define INT_KEYWORD 276
118 #define CONST_KEYWORD 277
119 #define VOLATILE_KEYWORD 278
120 #define DOUBLE_KEYWORD 279
122 #define ASSIGN_MODIFY 281
123 #define TRUEKEYWORD 282
124 #define FALSEKEYWORD 283
125 #define ABOVE_COMMA 284
134 #define DECREMENT 293
135 #define INCREMENT 294
138 #define BLOCKNAME 297
144 /* Copy the first part of user declarations. */
149 #include "gdb_string.h"
151 #include "expression.h"
153 #include "parser-defs.h"
154 #include "language.h"
156 #include "bfd.h" /* Required by objfiles.h. */
157 #include "symfile.h" /* Required by objfiles.h. */
158 #include "objfiles.h" /* For have_full_symbols and have_partial_symbols */
161 #include "cp-support.h"
163 /* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc),
164 as well as gratuitiously global symbol names, so we can have multiple
165 yacc generated parsers in gdb. Note that these are only the variables
166 produced by yacc. If other parser generators (bison, byacc, etc) produce
167 additional global names that conflict at link time, then those parser
168 generators need to be fixed instead of adding those names to this list. */
170 #define yymaxdepth c_maxdepth
171 #define yyparse c_parse
173 #define yyerror c_error
174 #define yylval c_lval
175 #define yychar c_char
176 #define yydebug c_debug
177 #define yypact c_pact
184 #define yyexca c_exca
185 #define yyerrflag c_errflag
186 #define yynerrs c_nerrs
191 #define yystate c_state
196 #define yylloc c_lloc
197 #define yyreds c_reds /* With YYDEBUG defined */
198 #define yytoks c_toks /* With YYDEBUG defined */
199 #define yyname c_name /* With YYDEBUG defined */
200 #define yyrule c_rule /* With YYDEBUG defined */
201 #define yylhs c_yylhs
202 #define yylen c_yylen
203 #define yydefred c_yydefred
204 #define yydgoto c_yydgoto
205 #define yysindex c_yysindex
206 #define yyrindex c_yyrindex
207 #define yygindex c_yygindex
208 #define yytable c_yytable
209 #define yycheck c_yycheck
212 #define YYDEBUG 1 /* Default to yydebug support */
215 #define YYFPRINTF parser_fprintf
219 static int yylex (void);
221 void yyerror (char *);
225 /* Enabling traces. */
230 /* Enabling verbose error messages. */
231 #ifdef YYERROR_VERBOSE
232 # undef YYERROR_VERBOSE
233 # define YYERROR_VERBOSE 1
235 # define YYERROR_VERBOSE 0
238 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
240 typedef union YYSTYPE
{
254 struct symtoken ssym
;
257 enum exp_opcode opcode
;
258 struct internalvar
*ivar
;
263 /* Line 191 of yacc.c. */
264 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
265 # define YYSTYPE_IS_DECLARED 1
266 # define YYSTYPE_IS_TRIVIAL 1
271 /* Copy the second part of user declarations. */
274 /* YYSTYPE gets defined by %union */
275 static int parse_number (char *, int, int, YYSTYPE
*);
278 /* Line 214 of yacc.c. */
280 #if ! defined (yyoverflow) || YYERROR_VERBOSE
282 /* The parser invokes alloca or xmalloc; define the necessary symbols. */
284 # if YYSTACK_USE_ALLOCA
285 # define YYSTACK_ALLOC alloca
287 # ifndef YYSTACK_USE_ALLOCA
288 # if defined (alloca) || defined (_ALLOCA_H)
289 # define YYSTACK_ALLOC alloca
292 # define YYSTACK_ALLOC __builtin_alloca
298 # ifdef YYSTACK_ALLOC
299 /* Pacify GCC's `empty if-body' warning. */
300 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
302 # if defined (__STDC__) || defined (__cplusplus)
303 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
304 # define YYSIZE_T size_t
306 # define YYSTACK_ALLOC xmalloc
307 # define YYSTACK_FREE free
309 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
312 #if (! defined (yyoverflow) \
313 && (! defined (__cplusplus) \
314 || (YYSTYPE_IS_TRIVIAL)))
316 /* A type that is properly aligned for any stack member. */
323 /* The size of the maximum gap between one aligned stack and the next. */
324 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
326 /* The size of an array large to enough to hold all stacks, each with
328 # define YYSTACK_BYTES(N) \
329 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
330 + YYSTACK_GAP_MAXIMUM)
332 /* Copy COUNT objects from FROM to TO. The source and destination do
336 # define YYCOPY(To, From, Count) \
337 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
339 # define YYCOPY(To, From, Count) \
342 register YYSIZE_T yyi; \
343 for (yyi = 0; yyi < (Count); yyi++) \
344 (To)[yyi] = (From)[yyi]; \
350 /* Relocate STACK from its old location to the new one. The
351 local variables YYSIZE and YYSTACKSIZE give the old and new number of
352 elements in the stack, and YYPTR gives the new location of the
353 stack. Advance YYPTR to a properly aligned location for the next
355 # define YYSTACK_RELOCATE(Stack) \
358 YYSIZE_T yynewbytes; \
359 YYCOPY (&yyptr->Stack, Stack, yysize); \
360 Stack = &yyptr->Stack; \
361 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
362 yyptr += yynewbytes / sizeof (*yyptr); \
368 #if defined (__STDC__) || defined (__cplusplus)
369 typedef signed char yysigned_char
;
371 typedef short yysigned_char
;
374 /* YYFINAL -- State number of the termination state. */
376 /* YYLAST -- Last index in YYTABLE. */
379 /* YYNTOKENS -- Number of terminals. */
381 /* YYNNTS -- Number of nonterminals. */
383 /* YYNRULES -- Number of rules. */
385 /* YYNRULES -- Number of states. */
386 #define YYNSTATES 242
388 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
390 #define YYMAXUTOK 298
392 #define YYTRANSLATE(YYX) \
393 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
395 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
396 static const unsigned char yytranslate
[] =
398 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
399 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
400 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
401 2, 2, 2, 61, 2, 2, 2, 51, 37, 2,
402 57, 64, 49, 47, 29, 48, 55, 50, 2, 2,
403 2, 2, 2, 2, 2, 2, 2, 2, 67, 2,
404 40, 31, 41, 32, 46, 2, 2, 2, 2, 2,
405 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
406 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
407 2, 56, 2, 63, 36, 2, 2, 2, 2, 2,
408 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
409 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
410 2, 2, 2, 65, 35, 66, 62, 2, 2, 2,
411 2, 2, 2, 2, 2, 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, 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, 2, 2, 2, 2, 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, 1, 2, 3, 4,
424 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
425 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
426 25, 26, 27, 28, 30, 33, 34, 38, 39, 42,
427 43, 44, 45, 52, 53, 54, 58, 59, 60
431 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
433 static const unsigned short yyprhs
[] =
435 0, 0, 3, 5, 7, 9, 11, 15, 18, 21,
436 24, 27, 30, 33, 36, 39, 42, 45, 49, 53,
437 58, 62, 66, 71, 76, 77, 83, 85, 86, 88,
438 92, 94, 98, 103, 108, 112, 116, 120, 124, 128,
439 132, 136, 140, 144, 148, 152, 156, 160, 164, 168,
440 172, 176, 180, 184, 188, 194, 198, 202, 204, 206,
441 208, 210, 212, 217, 219, 221, 223, 225, 227, 231,
442 235, 239, 244, 246, 249, 251, 254, 256, 257, 261,
443 263, 265, 267, 268, 270, 273, 275, 278, 280, 284,
444 287, 289, 292, 294, 297, 301, 304, 308, 310, 314,
445 316, 318, 320, 322, 325, 329, 332, 336, 340, 344,
446 347, 350, 354, 359, 363, 367, 372, 376, 381, 385,
447 390, 393, 397, 400, 404, 407, 411, 413, 416, 419,
448 422, 425, 428, 431, 433, 436, 438, 444, 447, 450,
449 452, 456, 458, 460, 462, 464, 466, 470, 472, 477,
450 480, 483, 485, 487, 489, 491, 493, 495, 497, 499
453 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
454 static const yysigned_char yyrhs
[] =
456 69, 0, -1, 71, -1, 70, -1, 89, -1, 72,
457 -1, 71, 29, 72, -1, 49, 72, -1, 37, 72,
458 -1, 48, 72, -1, 61, 72, -1, 62, 72, -1,
459 53, 72, -1, 52, 72, -1, 72, 53, -1, 72,
460 52, -1, 13, 72, -1, 72, 58, 97, -1, 72,
461 58, 79, -1, 72, 58, 49, 72, -1, 72, 55,
462 97, -1, 72, 55, 79, -1, 72, 55, 49, 72,
463 -1, 72, 56, 71, 63, -1, -1, 72, 57, 73,
464 75, 64, -1, 65, -1, -1, 72, -1, 75, 29,
465 72, -1, 66, -1, 74, 75, 76, -1, 74, 89,
466 76, 72, -1, 57, 89, 64, 72, -1, 57, 71,
467 64, -1, 72, 46, 72, -1, 72, 49, 72, -1,
468 72, 50, 72, -1, 72, 51, 72, -1, 72, 47,
469 72, -1, 72, 48, 72, -1, 72, 45, 72, -1,
470 72, 44, 72, -1, 72, 39, 72, -1, 72, 38,
471 72, -1, 72, 43, 72, -1, 72, 42, 72, -1,
472 72, 40, 72, -1, 72, 41, 72, -1, 72, 37,
473 72, -1, 72, 36, 72, -1, 72, 35, 72, -1,
474 72, 34, 72, -1, 72, 33, 72, -1, 72, 32,
475 72, 67, 72, -1, 72, 31, 72, -1, 72, 26,
476 72, -1, 3, -1, 8, -1, 4, -1, 78, -1,
477 25, -1, 13, 57, 89, 64, -1, 5, -1, 27,
478 -1, 28, -1, 59, -1, 60, -1, 77, 15, 97,
479 -1, 77, 15, 97, -1, 90, 15, 97, -1, 90,
480 15, 62, 97, -1, 79, -1, 15, 97, -1, 98,
481 -1, 46, 6, -1, 96, -1, -1, 81, 80, 81,
482 -1, 82, -1, 96, -1, 83, -1, -1, 49, -1,
483 49, 85, -1, 37, -1, 37, 85, -1, 86, -1,
484 57, 85, 64, -1, 86, 87, -1, 87, -1, 86,
485 88, -1, 88, -1, 56, 63, -1, 56, 3, 63,
486 -1, 57, 64, -1, 57, 93, 64, -1, 94, -1,
487 90, 15, 49, -1, 7, -1, 21, -1, 19, -1,
488 20, -1, 19, 21, -1, 19, 18, 21, -1, 19,
489 18, -1, 18, 19, 21, -1, 14, 19, 21, -1,
490 19, 14, 21, -1, 19, 14, -1, 19, 19, -1,
491 19, 19, 21, -1, 19, 19, 18, 21, -1, 19,
492 19, 18, -1, 18, 19, 19, -1, 18, 19, 19,
493 21, -1, 14, 19, 19, -1, 14, 19, 19, 21,
494 -1, 19, 19, 14, -1, 19, 19, 14, 21, -1,
495 20, 21, -1, 20, 18, 21, -1, 20, 18, -1,
496 14, 20, 21, -1, 20, 14, -1, 20, 14, 21,
497 -1, 24, -1, 19, 24, -1, 9, 97, -1, 10,
498 97, -1, 11, 97, -1, 12, 97, -1, 14, 92,
499 -1, 14, -1, 18, 92, -1, 18, -1, 16, 97,
500 40, 89, 41, -1, 83, 90, -1, 90, 83, -1,
501 91, -1, 90, 15, 97, -1, 7, -1, 21, -1,
502 19, -1, 20, -1, 89, -1, 93, 29, 89, -1,
503 90, -1, 94, 84, 85, 84, -1, 22, 23, -1,
504 23, 22, -1, 95, -1, 22, -1, 23, -1, 6,
505 -1, 59, -1, 7, -1, 8, -1, 6, -1, 59,
509 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
510 static const unsigned short yyrline
[] =
512 0, 230, 230, 231, 234, 241, 242, 247, 251, 255,
513 259, 263, 267, 271, 275, 279, 283, 287, 293, 301,
514 305, 311, 319, 323, 330, 327, 337, 341, 344, 348,
515 352, 355, 362, 368, 374, 380, 384, 388, 392, 396,
516 400, 404, 408, 412, 416, 420, 424, 428, 432, 436,
517 440, 444, 448, 452, 456, 460, 464, 470, 477, 488,
518 495, 498, 502, 510, 535, 542, 551, 559, 565, 576,
519 592, 606, 631, 632, 666, 723, 729, 730, 733, 736,
520 737, 741, 742, 745, 747, 749, 751, 753, 756, 758,
521 763, 770, 772, 776, 778, 782, 784, 796, 797, 802,
522 804, 806, 808, 810, 812, 814, 816, 818, 820, 822,
523 824, 826, 828, 830, 832, 834, 836, 838, 840, 842,
524 844, 846, 848, 850, 852, 854, 856, 858, 860, 863,
525 866, 869, 872, 874, 876, 878, 883, 887, 889, 891,
526 939, 964, 965, 971, 977, 986, 991, 998, 999, 1003,
527 1004, 1007, 1011, 1013, 1017, 1018, 1019, 1020, 1023, 1024
531 #if YYDEBUG || YYERROR_VERBOSE
532 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
533 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
534 static const char *const yytname
[] =
536 "$end", "error", "$undefined", "INT", "FLOAT", "STRING", "NAME",
537 "TYPENAME", "NAME_OR_INT", "STRUCT", "CLASS", "UNION", "ENUM", "SIZEOF",
538 "UNSIGNED", "COLONCOLON", "TEMPLATE", "ERROR", "SIGNED_KEYWORD", "LONG",
539 "SHORT", "INT_KEYWORD", "CONST_KEYWORD", "VOLATILE_KEYWORD",
540 "DOUBLE_KEYWORD", "VARIABLE", "ASSIGN_MODIFY", "TRUEKEYWORD",
541 "FALSEKEYWORD", "','", "ABOVE_COMMA", "'='", "'?'", "OROR", "ANDAND",
542 "'|'", "'^'", "'&'", "NOTEQUAL", "EQUAL", "'<'", "'>'", "GEQ", "LEQ",
543 "RSH", "LSH", "'@'", "'+'", "'-'", "'*'", "'/'", "'%'", "DECREMENT",
544 "INCREMENT", "UNARY", "'.'", "'['", "'('", "ARROW", "BLOCKNAME",
545 "FILENAME", "'!'", "'~'", "']'", "')'", "'{'", "'}'", "':'", "$accept",
546 "start", "type_exp", "exp1", "exp", "@1", "lcurly", "arglist", "rcurly",
547 "block", "variable", "qualified_name", "space_identifier",
548 "const_or_volatile", "cv_with_space_id",
549 "const_or_volatile_or_space_identifier_noopt",
550 "const_or_volatile_or_space_identifier", "abs_decl", "direct_abs_decl",
551 "array_mod", "func_mod", "type", "typebase", "qualified_type",
552 "typename", "nonempty_typelist", "ptype", "const_and_volatile",
553 "const_or_volatile_noopt", "name", "name_not_typename", 0
558 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
560 static const unsigned short yytoknum
[] =
562 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
563 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
564 275, 276, 277, 278, 279, 280, 281, 282, 283, 44,
565 284, 61, 63, 285, 286, 124, 94, 38, 287, 288,
566 60, 62, 289, 290, 291, 292, 64, 43, 45, 42,
567 47, 37, 293, 294, 295, 46, 91, 40, 296, 297,
568 298, 33, 126, 93, 41, 123, 125, 58
572 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
573 static const unsigned char yyr1
[] =
575 0, 68, 69, 69, 70, 71, 71, 72, 72, 72,
576 72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
577 72, 72, 72, 72, 73, 72, 74, 75, 75, 75,
578 76, 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, 72,
581 72, 72, 72, 72, 72, 72, 77, 77, 77, 78,
582 79, 79, 78, 78, 78, 80, 81, 81, 82, 83,
583 83, 84, 84, 85, 85, 85, 85, 85, 86, 86,
584 86, 86, 86, 87, 87, 88, 88, 89, 89, 90,
585 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
586 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
587 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
588 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
589 91, 92, 92, 92, 92, 93, 93, 94, 94, 95,
590 95, 96, 96, 96, 97, 97, 97, 97, 98, 98
593 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
594 static const unsigned char yyr2
[] =
596 0, 2, 1, 1, 1, 1, 3, 2, 2, 2,
597 2, 2, 2, 2, 2, 2, 2, 3, 3, 4,
598 3, 3, 4, 4, 0, 5, 1, 0, 1, 3,
599 1, 3, 4, 4, 3, 3, 3, 3, 3, 3,
600 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
601 3, 3, 3, 3, 5, 3, 3, 1, 1, 1,
602 1, 1, 4, 1, 1, 1, 1, 1, 3, 3,
603 3, 4, 1, 2, 1, 2, 1, 0, 3, 1,
604 1, 1, 0, 1, 2, 1, 2, 1, 3, 2,
605 1, 2, 1, 2, 3, 2, 3, 1, 3, 1,
606 1, 1, 1, 2, 3, 2, 3, 3, 3, 2,
607 2, 3, 4, 3, 3, 4, 3, 4, 3, 4,
608 2, 3, 2, 3, 2, 3, 1, 2, 2, 2,
609 2, 2, 2, 1, 2, 1, 5, 2, 2, 1,
610 3, 1, 1, 1, 1, 1, 3, 1, 4, 2,
611 2, 1, 1, 1, 1, 1, 1, 1, 1, 1
614 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
615 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
616 means the default is an error. */
617 static const unsigned char yydefact
[] =
619 77, 57, 59, 63, 158, 99, 58, 0, 0, 0,
620 0, 77, 133, 0, 0, 135, 101, 102, 100, 152,
621 153, 126, 61, 64, 65, 77, 77, 77, 77, 77,
622 77, 159, 67, 77, 77, 26, 0, 3, 2, 5,
623 27, 0, 60, 72, 0, 79, 77, 4, 147, 139,
624 97, 151, 80, 74, 154, 156, 157, 155, 128, 129,
625 130, 131, 77, 16, 77, 141, 143, 144, 142, 132,
626 73, 0, 143, 144, 134, 109, 105, 110, 103, 127,
627 124, 122, 120, 149, 150, 8, 9, 7, 13, 12,
628 0, 0, 10, 11, 1, 77, 77, 77, 77, 77,
629 77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
630 77, 77, 77, 77, 77, 77, 77, 77, 15, 14,
631 77, 77, 24, 77, 28, 0, 0, 0, 0, 77,
632 137, 0, 138, 81, 0, 0, 0, 116, 107, 123,
633 77, 114, 106, 108, 104, 118, 113, 111, 125, 121,
634 34, 77, 6, 56, 55, 0, 53, 52, 51, 50,
635 49, 44, 43, 47, 48, 46, 45, 42, 41, 35,
636 39, 40, 36, 37, 38, 156, 77, 21, 20, 0,
637 27, 77, 18, 17, 77, 30, 31, 77, 69, 75,
638 78, 76, 0, 98, 0, 70, 85, 83, 0, 77,
639 82, 87, 90, 92, 62, 117, 0, 147, 115, 119,
640 112, 33, 77, 22, 23, 0, 19, 29, 32, 140,
641 71, 86, 84, 0, 93, 95, 0, 145, 0, 148,
642 77, 89, 91, 136, 0, 54, 25, 94, 88, 77,
646 /* YYDEFGOTO[NTERM-NUM]. */
647 static const short yydefgoto
[] =
649 -1, 36, 37, 90, 39, 180, 40, 125, 186, 41,
650 42, 43, 129, 44, 45, 46, 134, 200, 201, 202,
651 203, 227, 64, 49, 69, 228, 50, 51, 52, 195,
655 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
657 #define YYPACT_NINF -101
658 static const short yypact
[] =
660 320, -101, -101, -101, -101, -101, -101, 30, 30, 30,
661 30, 383, 45, 30, 30, 200, 152, 36, -101, -11,
662 17, -101, -101, -101, -101, 320, 320, 320, 320, 320,
663 320, 29, -101, 320, 320, -101, 84, -101, 39, 597,
664 257, 56, -101, -101, 57, -101, 172, -101, 68, -101,
665 55, -101, 67, -101, -101, -101, -101, -101, -101, -101,
666 -101, -101, 320, 460, 87, -101, 40, 95, -101, -101,
667 -101, 99, 190, -101, -101, 156, 159, 223, -101, -101,
668 164, 176, -101, -101, -101, 460, 460, 460, 460, 460,
669 -15, 158, 460, 460, -101, 320, 320, 320, 320, 320,
670 320, 320, 320, 320, 320, 320, 320, 320, 320, 320,
671 320, 320, 320, 320, 320, 320, 320, 320, -101, -101,
672 194, 320, -101, 531, 597, -19, 160, 30, 218, -1,
673 71, 20, -101, -101, -14, 171, 26, 215, -101, -101,
674 172, 217, -101, -101, -101, 221, 224, -101, -101, -101,
675 -101, 320, 597, 597, 597, 560, 622, 646, 669, 691,
676 712, 731, 731, 746, 746, 746, 746, 240, 240, 303,
677 366, 366, 460, 460, 460, 83, 320, -101, -101, -18,
678 257, 320, -101, -101, 320, -101, -101, 320, 231, -101,
679 -101, -101, 30, -101, 30, 210, 118, 63, 4, 472,
680 2, 112, -101, -101, 446, -101, 206, 85, -101, -101,
681 -101, 460, 320, 460, -101, -13, 460, 597, 460, -101,
682 -101, -101, -101, 185, -101, -101, 186, -101, -9, -101,
683 114, -101, -101, -101, 11, 526, -101, -101, -101, 172,
687 /* YYPGOTO[NTERM-NUM]. */
688 static const short yypgoto
[] =
690 -101, -101, -101, 6, 47, -101, -101, 69, 126, -101,
691 -101, -67, -101, 125, -101, -35, 58, -100, -101, 54,
692 73, 1, 0, -101, 241, -101, -101, -101, 128, -5,
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 -141
701 static const short yytable
[] =
703 48, 47, 58, 59, 60, 61, 38, 223, 70, 71,
704 184, 95, 83, 132, 95, 133, 184, 54, 55, 56,
705 239, 19, 20, 196, 19, 20, 54, 55, 56, 132,
706 48, 91, 54, 55, 56, 197, 54, 55, 56, 84,
707 48, 126, 198, 199, -66, 214, 130, 185, -77, 150,
708 80, 236, 65, 177, 81, 240, 182, 82, 63, 137,
709 193, 138, 48, 135, 66, 67, 68, 224, 95, 193,
710 57, 127, 85, 86, 87, 88, 89, 19, 20, 57,
711 92, 93, 194, 131, 94, 57, 192, 124, 194, 57,
712 19, 20, -82, 19, 20, 132, 221, 222, -99, 226,
713 234, -77, 136, 128, -82, -99, -99, 19, 20, 19,
714 20, -82, -82, -76, -77, 178, 139, -77, 183, 198,
715 199, 5, 188, 7, 8, 9, 10, 179, 12, -99,
716 14, -77, 15, 16, 17, 18, 19, 20, 21, 140,
717 207, 206, 152, 153, 154, 155, 156, 157, 158, 159,
718 160, 161, 162, 163, 164, 165, 166, 167, 168, 169,
719 170, 171, 172, 173, 174, 133, 75, 197, 198, 230,
720 76, 77, 132, 78, 198, 199, 79, 143, 225, 5,
721 144, 7, 8, 9, 10, 148, 12, 219, 14, 220,
722 15, 16, 17, 18, 19, 20, 21, 149, 211, 207,
723 54, 175, 56, 7, 8, 9, 10, 65, 12, 141,
724 14, 142, 15, 16, 17, 18, 19, 20, 21, 72,
725 73, 68, 151, 213, 189, -140, 185, 124, 216, 219,
726 207, 217, -140, -140, 218, 204, 205, 145, 208, 207,
727 241, 146, 209, 176, 147, 210, -68, 233, 237, 215,
728 238, 211, 187, 57, 190, 231, 74, 191, 229, 235,
729 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
730 11, 12, 13, 14, 232, 15, 16, 17, 18, 19,
731 20, 21, 22, 0, 23, 24, 112, 113, 114, 115,
732 116, 117, 118, 119, 25, 120, 121, 122, 123, 0,
733 0, 0, 0, -77, 0, 26, 27, 0, 0, 28,
734 29, 0, 0, 0, 30, 0, 31, 32, 33, 34,
735 0, 0, 35, 1, 2, 3, 4, 5, 6, 7,
736 8, 9, 10, 11, 12, 13, 14, 0, 15, 16,
737 17, 18, 19, 20, 21, 22, 0, 23, 24, 0,
738 113, 114, 115, 116, 117, 118, 119, 25, 120, 121,
739 122, 123, 0, 0, 0, 0, 0, 0, 26, 27,
740 0, 0, 28, 29, 0, 0, 0, 30, 0, 31,
741 32, 33, 34, 0, 0, 35, 1, 2, 3, 4,
742 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
743 0, 15, 16, 17, 18, 19, 20, 21, 22, 0,
744 23, 24, 0, 0, 0, 115, 116, 117, 118, 119,
745 25, 120, 121, 122, 123, 0, 0, 0, 0, 0,
746 0, 26, 27, 0, 0, 28, 29, 0, 0, 0,
747 62, 0, 31, 32, 33, 34, 0, 0, 35, 1,
748 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
749 12, 13, 14, 0, 15, 16, 17, 18, 19, 20,
750 21, 22, 0, 23, 24, 0, 0, 0, 0, 5,
751 0, 7, 8, 9, 10, 0, 12, 0, 14, 0,
752 15, 16, 17, 18, 19, 20, 21, 0, 28, 29,
753 0, 0, 0, 30, 0, 31, 32, 33, 34, 196,
754 0, 35, 118, 119, 0, 120, 121, 122, 123, 0,
755 0, 197, 0, 0, 0, 0, 0, 0, 198, 199,
756 0, 0, 0, 0, 0, 0, 225, 54, 175, 56,
757 7, 8, 9, 10, 0, 12, 0, 14, 0, 15,
758 16, 17, 18, 19, 20, 21, 0, 0, 98, 99,
759 100, 101, 102, 103, 104, 105, 106, 107, 108, 109,
760 110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
761 181, 120, 121, 122, 123, 0, 96, 0, 0, 0,
762 57, 97, 98, 99, 100, 101, 102, 103, 104, 105,
763 106, 107, 108, 109, 110, 111, 112, 113, 114, 115,
764 116, 117, 118, 119, 0, 120, 121, 122, 123, 0,
765 0, 0, 0, 96, 0, 0, 0, 212, 97, 98,
766 99, 100, 101, 102, 103, 104, 105, 106, 107, 108,
767 109, 110, 111, 112, 113, 114, 115, 116, 117, 118,
768 119, 0, 120, 121, 122, 123, 100, 101, 102, 103,
769 104, 105, 106, 107, 108, 109, 110, 111, 112, 113,
770 114, 115, 116, 117, 118, 119, 0, 120, 121, 122,
771 123, 101, 102, 103, 104, 105, 106, 107, 108, 109,
772 110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
773 0, 120, 121, 122, 123, 102, 103, 104, 105, 106,
774 107, 108, 109, 110, 111, 112, 113, 114, 115, 116,
775 117, 118, 119, 0, 120, 121, 122, 123, 103, 104,
776 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
777 115, 116, 117, 118, 119, 0, 120, 121, 122, 123,
778 104, 105, 106, 107, 108, 109, 110, 111, 112, 113,
779 114, 115, 116, 117, 118, 119, 0, 120, 121, 122,
780 123, 106, 107, 108, 109, 110, 111, 112, 113, 114,
781 115, 116, 117, 118, 119, 0, 120, 121, 122, 123,
782 110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
783 0, 120, 121, 122, 123
786 static const short yycheck
[] =
788 0, 0, 7, 8, 9, 10, 0, 3, 13, 14,
789 29, 29, 23, 48, 29, 50, 29, 6, 7, 8,
790 29, 22, 23, 37, 22, 23, 6, 7, 8, 64,
791 30, 30, 6, 7, 8, 49, 6, 7, 8, 22,
792 40, 40, 56, 57, 15, 63, 46, 66, 46, 64,
793 14, 64, 7, 120, 18, 64, 123, 21, 11, 19,
794 49, 21, 62, 62, 19, 20, 21, 63, 29, 49,
795 59, 15, 25, 26, 27, 28, 29, 22, 23, 59,
796 33, 34, 62, 15, 0, 59, 15, 40, 62, 59,
797 22, 23, 37, 22, 23, 130, 196, 197, 15, 199,
798 15, 46, 15, 46, 49, 22, 23, 22, 23, 22,
799 23, 56, 57, 46, 46, 120, 21, 46, 123, 56,
800 57, 7, 127, 9, 10, 11, 12, 121, 14, 46,
801 16, 46, 18, 19, 20, 21, 22, 23, 24, 40,
802 140, 140, 95, 96, 97, 98, 99, 100, 101, 102,
803 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
804 113, 114, 115, 116, 117, 200, 14, 49, 56, 57,
805 18, 19, 207, 21, 56, 57, 24, 21, 64, 7,
806 21, 9, 10, 11, 12, 21, 14, 192, 16, 194,
807 18, 19, 20, 21, 22, 23, 24, 21, 151, 199,
808 6, 7, 8, 9, 10, 11, 12, 7, 14, 19,
809 16, 21, 18, 19, 20, 21, 22, 23, 24, 19,
810 20, 21, 64, 176, 6, 15, 66, 180, 181, 234,
811 230, 184, 22, 23, 187, 64, 21, 14, 21, 239,
812 239, 18, 21, 49, 21, 21, 15, 41, 63, 180,
813 64, 204, 126, 59, 129, 201, 15, 129, 200, 212,
814 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
815 13, 14, 15, 16, 201, 18, 19, 20, 21, 22,
816 23, 24, 25, -1, 27, 28, 46, 47, 48, 49,
817 50, 51, 52, 53, 37, 55, 56, 57, 58, -1,
818 -1, -1, -1, 46, -1, 48, 49, -1, -1, 52,
819 53, -1, -1, -1, 57, -1, 59, 60, 61, 62,
820 -1, -1, 65, 3, 4, 5, 6, 7, 8, 9,
821 10, 11, 12, 13, 14, 15, 16, -1, 18, 19,
822 20, 21, 22, 23, 24, 25, -1, 27, 28, -1,
823 47, 48, 49, 50, 51, 52, 53, 37, 55, 56,
824 57, 58, -1, -1, -1, -1, -1, -1, 48, 49,
825 -1, -1, 52, 53, -1, -1, -1, 57, -1, 59,
826 60, 61, 62, -1, -1, 65, 3, 4, 5, 6,
827 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
828 -1, 18, 19, 20, 21, 22, 23, 24, 25, -1,
829 27, 28, -1, -1, -1, 49, 50, 51, 52, 53,
830 37, 55, 56, 57, 58, -1, -1, -1, -1, -1,
831 -1, 48, 49, -1, -1, 52, 53, -1, -1, -1,
832 57, -1, 59, 60, 61, 62, -1, -1, 65, 3,
833 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
834 14, 15, 16, -1, 18, 19, 20, 21, 22, 23,
835 24, 25, -1, 27, 28, -1, -1, -1, -1, 7,
836 -1, 9, 10, 11, 12, -1, 14, -1, 16, -1,
837 18, 19, 20, 21, 22, 23, 24, -1, 52, 53,
838 -1, -1, -1, 57, -1, 59, 60, 61, 62, 37,
839 -1, 65, 52, 53, -1, 55, 56, 57, 58, -1,
840 -1, 49, -1, -1, -1, -1, -1, -1, 56, 57,
841 -1, -1, -1, -1, -1, -1, 64, 6, 7, 8,
842 9, 10, 11, 12, -1, 14, -1, 16, -1, 18,
843 19, 20, 21, 22, 23, 24, -1, -1, 32, 33,
844 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
845 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
846 49, 55, 56, 57, 58, -1, 26, -1, -1, -1,
847 59, 31, 32, 33, 34, 35, 36, 37, 38, 39,
848 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
849 50, 51, 52, 53, -1, 55, 56, 57, 58, -1,
850 -1, -1, -1, 26, -1, -1, -1, 67, 31, 32,
851 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
852 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
853 53, -1, 55, 56, 57, 58, 34, 35, 36, 37,
854 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
855 48, 49, 50, 51, 52, 53, -1, 55, 56, 57,
856 58, 35, 36, 37, 38, 39, 40, 41, 42, 43,
857 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
858 -1, 55, 56, 57, 58, 36, 37, 38, 39, 40,
859 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
860 51, 52, 53, -1, 55, 56, 57, 58, 37, 38,
861 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
862 49, 50, 51, 52, 53, -1, 55, 56, 57, 58,
863 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
864 48, 49, 50, 51, 52, 53, -1, 55, 56, 57,
865 58, 40, 41, 42, 43, 44, 45, 46, 47, 48,
866 49, 50, 51, 52, 53, -1, 55, 56, 57, 58,
867 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
871 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
872 symbol of state STATE-NUM. */
873 static const unsigned char yystos
[] =
875 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
876 12, 13, 14, 15, 16, 18, 19, 20, 21, 22,
877 23, 24, 25, 27, 28, 37, 48, 49, 52, 53,
878 57, 59, 60, 61, 62, 65, 69, 70, 71, 72,
879 74, 77, 78, 79, 81, 82, 83, 89, 90, 91,
880 94, 95, 96, 98, 6, 7, 8, 59, 97, 97,
881 97, 97, 57, 72, 90, 7, 19, 20, 21, 92,
882 97, 97, 19, 20, 92, 14, 18, 19, 21, 24,
883 14, 18, 21, 23, 22, 72, 72, 72, 72, 72,
884 71, 89, 72, 72, 0, 29, 26, 31, 32, 33,
885 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
886 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
887 55, 56, 57, 58, 72, 75, 89, 15, 46, 80,
888 90, 15, 83, 83, 84, 89, 15, 19, 21, 21,
889 40, 19, 21, 21, 21, 14, 18, 21, 21, 21,
890 64, 64, 72, 72, 72, 72, 72, 72, 72, 72,
891 72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
892 72, 72, 72, 72, 72, 7, 49, 79, 97, 71,
893 73, 49, 79, 97, 29, 66, 76, 76, 97, 6,
894 81, 96, 15, 49, 62, 97, 37, 49, 56, 57,
895 85, 86, 87, 88, 64, 21, 89, 90, 21, 21,
896 21, 72, 67, 72, 63, 75, 72, 72, 72, 97,
897 97, 85, 85, 3, 63, 64, 85, 89, 93, 84,
898 57, 87, 88, 41, 15, 72, 64, 63, 64, 29,
902 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
903 # define YYSIZE_T __SIZE_TYPE__
905 #if ! defined (YYSIZE_T) && defined (size_t)
906 # define YYSIZE_T size_t
908 #if ! defined (YYSIZE_T)
909 # if defined (__STDC__) || defined (__cplusplus)
910 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
911 # define YYSIZE_T size_t
914 #if ! defined (YYSIZE_T)
915 # define YYSIZE_T unsigned int
918 #define yyerrok (yyerrstatus = 0)
919 #define yyclearin (yychar = YYEMPTY)
923 #define YYACCEPT goto yyacceptlab
924 #define YYABORT goto yyabortlab
925 #define YYERROR goto yyerrlab1
927 /* Like YYERROR except do call yyerror. This remains here temporarily
928 to ease the transition to the new meaning of YYERROR, for GCC.
929 Once GCC version 2 has supplanted version 1, this can go. */
931 #define YYFAIL goto yyerrlab
933 #define YYRECOVERING() (!!yyerrstatus)
935 #define YYBACKUP(Token, Value) \
937 if (yychar == YYEMPTY && yylen == 1) \
941 yytoken = YYTRANSLATE (yychar); \
947 yyerror ("syntax error: cannot back up");\
953 #define YYERRCODE 256
955 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
958 #ifndef YYLLOC_DEFAULT
959 # define YYLLOC_DEFAULT(Current, Rhs, N) \
960 Current.first_line = Rhs[1].first_line; \
961 Current.first_column = Rhs[1].first_column; \
962 Current.last_line = Rhs[N].last_line; \
963 Current.last_column = Rhs[N].last_column;
966 /* YYLEX -- calling `yylex' with the right arguments. */
969 # define YYLEX yylex (YYLEX_PARAM)
971 # define YYLEX yylex ()
974 /* Enable debugging if requested. */
978 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
979 # define YYFPRINTF fprintf
982 # define YYDPRINTF(Args) \
988 # define YYDSYMPRINT(Args) \
994 # define YYDSYMPRINTF(Title, Token, Value, Location) \
998 YYFPRINTF (stderr, "%s ", Title); \
999 yysymprint (stderr, \
1001 YYFPRINTF (stderr, "\n"); \
1005 /*------------------------------------------------------------------.
1006 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1008 `------------------------------------------------------------------*/
1010 #if defined (__STDC__) || defined (__cplusplus)
1012 yy_stack_print (short *bottom
, short *top
)
1015 yy_stack_print (bottom
, top
)
1020 YYFPRINTF (stderr
, "Stack now");
1021 for (/* Nothing. */; bottom
<= top
; ++bottom
)
1022 YYFPRINTF (stderr
, " %d", *bottom
);
1023 YYFPRINTF (stderr
, "\n");
1026 # define YY_STACK_PRINT(Bottom, Top) \
1029 yy_stack_print ((Bottom), (Top)); \
1033 /*------------------------------------------------.
1034 | Report that the YYRULE is going to be reduced. |
1035 `------------------------------------------------*/
1037 #if defined (__STDC__) || defined (__cplusplus)
1039 yy_reduce_print (int yyrule
)
1042 yy_reduce_print (yyrule
)
1047 unsigned int yylineno
= yyrline
[yyrule
];
1048 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %u), ",
1049 yyrule
- 1, yylineno
);
1050 /* Print the symbols being reduced, and their result. */
1051 for (yyi
= yyprhs
[yyrule
]; 0 <= yyrhs
[yyi
]; yyi
++)
1052 YYFPRINTF (stderr
, "%s ", yytname
[yyrhs
[yyi
]]);
1053 YYFPRINTF (stderr
, "-> %s\n", yytname
[yyr1
[yyrule
]]);
1056 # define YY_REDUCE_PRINT(Rule) \
1059 yy_reduce_print (Rule); \
1062 /* Nonzero means print parse trace. It is left uninitialized so that
1063 multiple parsers can coexist. */
1065 #else /* !YYDEBUG */
1066 # define YYDPRINTF(Args)
1067 # define YYDSYMPRINT(Args)
1068 # define YYDSYMPRINTF(Title, Token, Value, Location)
1069 # define YY_STACK_PRINT(Bottom, Top)
1070 # define YY_REDUCE_PRINT(Rule)
1071 #endif /* !YYDEBUG */
1074 /* YYINITDEPTH -- initial size of the parser's stacks. */
1076 # define YYINITDEPTH 200
1079 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1080 if the built-in stack extension method is used).
1082 Do not make this value too large; the results are undefined if
1083 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
1084 evaluated with infinite-precision integer arithmetic. */
1091 # define YYMAXDEPTH 10000
1099 # if defined (__GLIBC__) && defined (_STRING_H)
1100 # define yystrlen strlen
1102 /* Return the length of YYSTR. */
1104 # if defined (__STDC__) || defined (__cplusplus)
1105 yystrlen (const char *yystr
)
1111 register const char *yys
= yystr
;
1113 while (*yys
++ != '\0')
1116 return yys
- yystr
- 1;
1122 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
1123 # define yystpcpy stpcpy
1125 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1128 # if defined (__STDC__) || defined (__cplusplus)
1129 yystpcpy (char *yydest
, const char *yysrc
)
1131 yystpcpy (yydest
, yysrc
)
1136 register char *yyd
= yydest
;
1137 register const char *yys
= yysrc
;
1139 while ((*yyd
++ = *yys
++) != '\0')
1147 #endif /* !YYERROR_VERBOSE */
1152 /*--------------------------------.
1153 | Print this symbol on YYOUTPUT. |
1154 `--------------------------------*/
1156 #if defined (__STDC__) || defined (__cplusplus)
1158 yysymprint (FILE *yyoutput
, int yytype
, YYSTYPE
*yyvaluep
)
1161 yysymprint (yyoutput
, yytype
, yyvaluep
)
1167 /* Pacify ``unused variable'' warnings. */
1170 if (yytype
< YYNTOKENS
)
1172 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1174 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1178 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1185 YYFPRINTF (yyoutput
, ")");
1188 #endif /* ! YYDEBUG */
1189 /*-----------------------------------------------.
1190 | Release the memory associated to this symbol. |
1191 `-----------------------------------------------*/
1193 #if defined (__STDC__) || defined (__cplusplus)
1195 yydestruct (int yytype
, YYSTYPE
*yyvaluep
)
1198 yydestruct (yytype
, yyvaluep
)
1203 /* Pacify ``unused variable'' warnings. */
1215 /* Prevent warnings from -Wmissing-prototypes. */
1217 #ifdef YYPARSE_PARAM
1218 # if defined (__STDC__) || defined (__cplusplus)
1219 int yyparse (void *YYPARSE_PARAM
);
1223 #else /* ! YYPARSE_PARAM */
1224 #if defined (__STDC__) || defined (__cplusplus)
1229 #endif /* ! YYPARSE_PARAM */
1233 /* The lookahead symbol. */
1236 /* The semantic value of the lookahead symbol. */
1239 /* Number of syntax errors so far. */
1248 #ifdef YYPARSE_PARAM
1249 # if defined (__STDC__) || defined (__cplusplus)
1250 int yyparse (void *YYPARSE_PARAM
)
1252 int yyparse (YYPARSE_PARAM
)
1253 void *YYPARSE_PARAM
;
1255 #else /* ! YYPARSE_PARAM */
1256 #if defined (__STDC__) || defined (__cplusplus)
1267 register int yystate
;
1270 /* Number of tokens to shift before error messages enabled. */
1272 /* Lookahead token as an internal (translated) token number. */
1275 /* Three stacks and their tools:
1276 `yyss': related to states,
1277 `yyvs': related to semantic values,
1278 `yyls': related to locations.
1280 Refer to the stacks thru separate pointers, to allow yyoverflow
1281 to xreallocate them elsewhere. */
1283 /* The state stack. */
1284 short yyssa
[YYINITDEPTH
];
1285 short *yyss
= yyssa
;
1286 register short *yyssp
;
1288 /* The semantic value stack. */
1289 YYSTYPE yyvsa
[YYINITDEPTH
];
1290 YYSTYPE
*yyvs
= yyvsa
;
1291 register YYSTYPE
*yyvsp
;
1295 #define YYPOPSTACK (yyvsp--, yyssp--)
1297 YYSIZE_T yystacksize
= YYINITDEPTH
;
1299 /* The variables used to return semantic value and location from the
1304 /* When reducing, the number of symbols on the RHS of the reduced
1308 YYDPRINTF ((stderr
, "Starting parse\n"));
1313 yychar
= YYEMPTY
; /* Cause a token to be read. */
1315 /* Initialize stack pointers.
1316 Waste one element of value and location stack
1317 so that they stay on the same level as the state stack.
1318 The wasted elements are never initialized. */
1325 /*------------------------------------------------------------.
1326 | yynewstate -- Push a new state, which is found in yystate. |
1327 `------------------------------------------------------------*/
1329 /* In all cases, when you get here, the value and location stacks
1330 have just been pushed. so pushing a state here evens the stacks.
1337 if (yyss
+ yystacksize
- 1 <= yyssp
)
1339 /* Get the current used size of the three stacks, in elements. */
1340 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1344 /* Give user a chance to xreallocate the stack. Use copies of
1345 these so that the &'s don't force the real ones into
1347 YYSTYPE
*yyvs1
= yyvs
;
1348 short *yyss1
= yyss
;
1351 /* Each stack pointer address is followed by the size of the
1352 data in use in that stack, in bytes. This used to be a
1353 conditional around just the two extra args, but that might
1354 be undefined if yyoverflow is a macro. */
1355 yyoverflow ("parser stack overflow",
1356 &yyss1
, yysize
* sizeof (*yyssp
),
1357 &yyvs1
, yysize
* sizeof (*yyvsp
),
1364 #else /* no yyoverflow */
1365 # ifndef YYSTACK_RELOCATE
1368 /* Extend the stack our own way. */
1369 if (YYMAXDEPTH
<= yystacksize
)
1372 if (YYMAXDEPTH
< yystacksize
)
1373 yystacksize
= YYMAXDEPTH
;
1376 short *yyss1
= yyss
;
1377 union yyalloc
*yyptr
=
1378 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1381 YYSTACK_RELOCATE (yyss
);
1382 YYSTACK_RELOCATE (yyvs
);
1384 # undef YYSTACK_RELOCATE
1386 YYSTACK_FREE (yyss1
);
1389 #endif /* no yyoverflow */
1391 yyssp
= yyss
+ yysize
- 1;
1392 yyvsp
= yyvs
+ yysize
- 1;
1395 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1396 (unsigned long int) yystacksize
));
1398 if (yyss
+ yystacksize
- 1 <= yyssp
)
1402 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1411 /* Do appropriate processing given the current state. */
1412 /* Read a lookahead token if we need one and don't already have one. */
1415 /* First try to decide what to do without reference to lookahead token. */
1417 yyn
= yypact
[yystate
];
1418 if (yyn
== YYPACT_NINF
)
1421 /* Not known => get a lookahead token if don't already have one. */
1423 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1424 if (yychar
== YYEMPTY
)
1426 YYDPRINTF ((stderr
, "Reading a token: "));
1430 if (yychar
<= YYEOF
)
1432 yychar
= yytoken
= YYEOF
;
1433 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1437 yytoken
= YYTRANSLATE (yychar
);
1438 YYDSYMPRINTF ("Next token is", yytoken
, &yylval
, &yylloc
);
1441 /* If the proper action on seeing token YYTOKEN is to reduce or to
1442 detect an error, take that action. */
1444 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1449 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
1458 /* Shift the lookahead token. */
1459 YYDPRINTF ((stderr
, "Shifting token %s, ", yytname
[yytoken
]));
1461 /* Discard the token being shifted unless it is eof. */
1462 if (yychar
!= YYEOF
)
1468 /* Count tokens shifted since error; after three, turn off error
1477 /*-----------------------------------------------------------.
1478 | yydefault -- do the default action for the current state. |
1479 `-----------------------------------------------------------*/
1481 yyn
= yydefact
[yystate
];
1487 /*-----------------------------.
1488 | yyreduce -- Do a reduction. |
1489 `-----------------------------*/
1491 /* yyn is the number of a rule to reduce with. */
1494 /* If YYLEN is nonzero, implement the default value of the action:
1497 Otherwise, the following line sets YYVAL to garbage.
1498 This behavior is undocumented and Bison
1499 users should not rely upon it. Assigning to YYVAL
1500 unconditionally makes the parser a bit smaller, and it avoids a
1501 GCC warning that YYVAL may be used uninitialized. */
1502 yyval
= yyvsp
[1-yylen
];
1505 YY_REDUCE_PRINT (yyn
);
1510 { write_exp_elt_opcode(OP_TYPE
);
1511 write_exp_elt_type(yyvsp
[0].tval
);
1512 write_exp_elt_opcode(OP_TYPE
);}
1517 { write_exp_elt_opcode (BINOP_COMMA
); }
1522 { write_exp_elt_opcode (UNOP_IND
); }
1527 { write_exp_elt_opcode (UNOP_ADDR
); }
1532 { write_exp_elt_opcode (UNOP_NEG
); }
1537 { write_exp_elt_opcode (UNOP_LOGICAL_NOT
); }
1542 { write_exp_elt_opcode (UNOP_COMPLEMENT
); }
1547 { write_exp_elt_opcode (UNOP_PREINCREMENT
); }
1552 { write_exp_elt_opcode (UNOP_PREDECREMENT
); }
1557 { write_exp_elt_opcode (UNOP_POSTINCREMENT
); }
1562 { write_exp_elt_opcode (UNOP_POSTDECREMENT
); }
1567 { write_exp_elt_opcode (UNOP_SIZEOF
); }
1572 { write_exp_elt_opcode (STRUCTOP_PTR
);
1573 write_exp_string (yyvsp
[0].sval
);
1574 write_exp_elt_opcode (STRUCTOP_PTR
); }
1579 { /* exp->type::name becomes exp->*(&type::name) */
1580 /* Note: this doesn't work if name is a
1581 static member! FIXME */
1582 write_exp_elt_opcode (UNOP_ADDR
);
1583 write_exp_elt_opcode (STRUCTOP_MPTR
); }
1588 { write_exp_elt_opcode (STRUCTOP_MPTR
); }
1593 { write_exp_elt_opcode (STRUCTOP_STRUCT
);
1594 write_exp_string (yyvsp
[0].sval
);
1595 write_exp_elt_opcode (STRUCTOP_STRUCT
); }
1600 { /* exp.type::name becomes exp.*(&type::name) */
1601 /* Note: this doesn't work if name is a
1602 static member! FIXME */
1603 write_exp_elt_opcode (UNOP_ADDR
);
1604 write_exp_elt_opcode (STRUCTOP_MEMBER
); }
1609 { write_exp_elt_opcode (STRUCTOP_MEMBER
); }
1614 { write_exp_elt_opcode (BINOP_SUBSCRIPT
); }
1619 { start_arglist (); }
1624 { write_exp_elt_opcode (OP_FUNCALL
);
1625 write_exp_elt_longcst ((LONGEST
) end_arglist ());
1626 write_exp_elt_opcode (OP_FUNCALL
); }
1631 { start_arglist (); }
1636 { arglist_len
= 1; }
1646 { yyval
.lval
= end_arglist () - 1; }
1651 { write_exp_elt_opcode (OP_ARRAY
);
1652 write_exp_elt_longcst ((LONGEST
) 0);
1653 write_exp_elt_longcst ((LONGEST
) yyvsp
[0].lval
);
1654 write_exp_elt_opcode (OP_ARRAY
); }
1659 { write_exp_elt_opcode (UNOP_MEMVAL
);
1660 write_exp_elt_type (yyvsp
[-2].tval
);
1661 write_exp_elt_opcode (UNOP_MEMVAL
); }
1666 { write_exp_elt_opcode (UNOP_CAST
);
1667 write_exp_elt_type (yyvsp
[-2].tval
);
1668 write_exp_elt_opcode (UNOP_CAST
); }
1678 { write_exp_elt_opcode (BINOP_REPEAT
); }
1683 { write_exp_elt_opcode (BINOP_MUL
); }
1688 { write_exp_elt_opcode (BINOP_DIV
); }
1693 { write_exp_elt_opcode (BINOP_REM
); }
1698 { write_exp_elt_opcode (BINOP_ADD
); }
1703 { write_exp_elt_opcode (BINOP_SUB
); }
1708 { write_exp_elt_opcode (BINOP_LSH
); }
1713 { write_exp_elt_opcode (BINOP_RSH
); }
1718 { write_exp_elt_opcode (BINOP_EQUAL
); }
1723 { write_exp_elt_opcode (BINOP_NOTEQUAL
); }
1728 { write_exp_elt_opcode (BINOP_LEQ
); }
1733 { write_exp_elt_opcode (BINOP_GEQ
); }
1738 { write_exp_elt_opcode (BINOP_LESS
); }
1743 { write_exp_elt_opcode (BINOP_GTR
); }
1748 { write_exp_elt_opcode (BINOP_BITWISE_AND
); }
1753 { write_exp_elt_opcode (BINOP_BITWISE_XOR
); }
1758 { write_exp_elt_opcode (BINOP_BITWISE_IOR
); }
1763 { write_exp_elt_opcode (BINOP_LOGICAL_AND
); }
1768 { write_exp_elt_opcode (BINOP_LOGICAL_OR
); }
1773 { write_exp_elt_opcode (TERNOP_COND
); }
1778 { write_exp_elt_opcode (BINOP_ASSIGN
); }
1783 { write_exp_elt_opcode (BINOP_ASSIGN_MODIFY
);
1784 write_exp_elt_opcode (yyvsp
[-1].opcode
);
1785 write_exp_elt_opcode (BINOP_ASSIGN_MODIFY
); }
1790 { write_exp_elt_opcode (OP_LONG
);
1791 write_exp_elt_type (yyvsp
[0].typed_val_int
.type
);
1792 write_exp_elt_longcst ((LONGEST
)(yyvsp
[0].typed_val_int
.val
));
1793 write_exp_elt_opcode (OP_LONG
); }
1799 parse_number (yyvsp
[0].ssym
.stoken
.ptr
, yyvsp
[0].ssym
.stoken
.length
, 0, &val
);
1800 write_exp_elt_opcode (OP_LONG
);
1801 write_exp_elt_type (val
.typed_val_int
.type
);
1802 write_exp_elt_longcst ((LONGEST
)val
.typed_val_int
.val
);
1803 write_exp_elt_opcode (OP_LONG
);
1809 { write_exp_elt_opcode (OP_DOUBLE
);
1810 write_exp_elt_type (yyvsp
[0].typed_val_float
.type
);
1811 write_exp_elt_dblcst (yyvsp
[0].typed_val_float
.dval
);
1812 write_exp_elt_opcode (OP_DOUBLE
); }
1817 { write_exp_elt_opcode (OP_LONG
);
1818 write_exp_elt_type (builtin_type_int
);
1819 CHECK_TYPEDEF (yyvsp
[-1].tval
);
1820 write_exp_elt_longcst ((LONGEST
) TYPE_LENGTH (yyvsp
[-1].tval
));
1821 write_exp_elt_opcode (OP_LONG
); }
1826 { /* C strings are converted into array constants with
1827 an explicit null byte added at the end. Thus
1828 the array upper bound is the string length.
1829 There is no such thing in C as a completely empty
1831 char *sp
= yyvsp
[0].sval
.ptr
; int count
= yyvsp
[0].sval
.length
;
1834 write_exp_elt_opcode (OP_LONG
);
1835 write_exp_elt_type (builtin_type_char
);
1836 write_exp_elt_longcst ((LONGEST
)(*sp
++));
1837 write_exp_elt_opcode (OP_LONG
);
1839 write_exp_elt_opcode (OP_LONG
);
1840 write_exp_elt_type (builtin_type_char
);
1841 write_exp_elt_longcst ((LONGEST
)'\0');
1842 write_exp_elt_opcode (OP_LONG
);
1843 write_exp_elt_opcode (OP_ARRAY
);
1844 write_exp_elt_longcst ((LONGEST
) 0);
1845 write_exp_elt_longcst ((LONGEST
) (yyvsp
[0].sval
.length
));
1846 write_exp_elt_opcode (OP_ARRAY
); }
1851 { write_exp_elt_opcode (OP_LONG
);
1852 write_exp_elt_type (builtin_type_bool
);
1853 write_exp_elt_longcst ((LONGEST
) 1);
1854 write_exp_elt_opcode (OP_LONG
); }
1859 { write_exp_elt_opcode (OP_LONG
);
1860 write_exp_elt_type (builtin_type_bool
);
1861 write_exp_elt_longcst ((LONGEST
) 0);
1862 write_exp_elt_opcode (OP_LONG
); }
1868 if (yyvsp
[0].ssym
.sym
)
1869 yyval
.bval
= SYMBOL_BLOCK_VALUE (yyvsp
[0].ssym
.sym
);
1871 error ("No file or function \"%s\".",
1872 copy_name (yyvsp
[0].ssym
.stoken
));
1879 yyval
.bval
= yyvsp
[0].bval
;
1885 { struct symbol
*tem
1886 = lookup_symbol (copy_name (yyvsp
[0].sval
), yyvsp
[-2].bval
,
1887 VAR_DOMAIN
, (int *) NULL
,
1888 (struct symtab
**) NULL
);
1889 if (!tem
|| SYMBOL_CLASS (tem
) != LOC_BLOCK
)
1890 error ("No function \"%s\" in specified context.",
1891 copy_name (yyvsp
[0].sval
));
1892 yyval
.bval
= SYMBOL_BLOCK_VALUE (tem
); }
1897 { struct symbol
*sym
;
1898 sym
= lookup_symbol (copy_name (yyvsp
[0].sval
), yyvsp
[-2].bval
,
1899 VAR_DOMAIN
, (int *) NULL
,
1900 (struct symtab
**) NULL
);
1902 error ("No symbol \"%s\" in specified context.",
1903 copy_name (yyvsp
[0].sval
));
1905 write_exp_elt_opcode (OP_VAR_VALUE
);
1906 /* block_found is set by lookup_symbol. */
1907 write_exp_elt_block (block_found
);
1908 write_exp_elt_sym (sym
);
1909 write_exp_elt_opcode (OP_VAR_VALUE
); }
1915 struct type
*type
= yyvsp
[-2].tval
;
1916 if (TYPE_CODE (type
) != TYPE_CODE_STRUCT
1917 && TYPE_CODE (type
) != TYPE_CODE_UNION
1918 && TYPE_CODE (type
) != TYPE_CODE_NAMESPACE
)
1919 error ("`%s' is not defined as an aggregate type.",
1922 write_exp_elt_opcode (OP_SCOPE
);
1923 write_exp_elt_type (type
);
1924 write_exp_string (yyvsp
[0].sval
);
1925 write_exp_elt_opcode (OP_SCOPE
);
1932 struct type
*type
= yyvsp
[-3].tval
;
1933 struct stoken tmp_token
;
1934 if (TYPE_CODE (type
) != TYPE_CODE_STRUCT
1935 && TYPE_CODE (type
) != TYPE_CODE_UNION
1936 && TYPE_CODE (type
) != TYPE_CODE_NAMESPACE
)
1937 error ("`%s' is not defined as an aggregate type.",
1940 tmp_token
.ptr
= (char*) alloca (yyvsp
[0].sval
.length
+ 2);
1941 tmp_token
.length
= yyvsp
[0].sval
.length
+ 1;
1942 tmp_token
.ptr
[0] = '~';
1943 memcpy (tmp_token
.ptr
+1, yyvsp
[0].sval
.ptr
, yyvsp
[0].sval
.length
);
1944 tmp_token
.ptr
[tmp_token
.length
] = 0;
1946 /* Check for valid destructor name. */
1947 destructor_name_p (tmp_token
.ptr
, type
);
1948 write_exp_elt_opcode (OP_SCOPE
);
1949 write_exp_elt_type (type
);
1950 write_exp_string (tmp_token
);
1951 write_exp_elt_opcode (OP_SCOPE
);
1958 char *name
= copy_name (yyvsp
[0].sval
);
1960 struct minimal_symbol
*msymbol
;
1963 lookup_symbol (name
, (const struct block
*) NULL
,
1964 VAR_DOMAIN
, (int *) NULL
,
1965 (struct symtab
**) NULL
);
1968 write_exp_elt_opcode (OP_VAR_VALUE
);
1969 write_exp_elt_block (NULL
);
1970 write_exp_elt_sym (sym
);
1971 write_exp_elt_opcode (OP_VAR_VALUE
);
1975 msymbol
= lookup_minimal_symbol (name
, NULL
, NULL
);
1976 if (msymbol
!= NULL
)
1978 write_exp_msymbol (msymbol
,
1979 lookup_function_type (builtin_type_int
),
1983 if (!have_full_symbols () && !have_partial_symbols ())
1984 error ("No symbol table is loaded. Use the \"file\" command.");
1986 error ("No symbol \"%s\" in current context.", name
);
1992 { struct symbol
*sym
= yyvsp
[0].ssym
.sym
;
1996 if (symbol_read_needs_frame (sym
))
1998 if (innermost_block
== 0 ||
1999 contained_in (block_found
,
2001 innermost_block
= block_found
;
2004 write_exp_elt_opcode (OP_VAR_VALUE
);
2005 /* We want to use the selected frame, not
2006 another more inner frame which happens to
2007 be in the same block. */
2008 write_exp_elt_block (NULL
);
2009 write_exp_elt_sym (sym
);
2010 write_exp_elt_opcode (OP_VAR_VALUE
);
2012 else if (yyvsp
[0].ssym
.is_a_field_of_this
)
2014 /* C++: it hangs off of `this'. Must
2015 not inadvertently convert from a method call
2017 if (innermost_block
== 0 ||
2018 contained_in (block_found
, innermost_block
))
2019 innermost_block
= block_found
;
2020 write_exp_elt_opcode (OP_THIS
);
2021 write_exp_elt_opcode (OP_THIS
);
2022 write_exp_elt_opcode (STRUCTOP_PTR
);
2023 write_exp_string (yyvsp
[0].ssym
.stoken
);
2024 write_exp_elt_opcode (STRUCTOP_PTR
);
2028 struct minimal_symbol
*msymbol
;
2029 char *arg
= copy_name (yyvsp
[0].ssym
.stoken
);
2032 lookup_minimal_symbol (arg
, NULL
, NULL
);
2033 if (msymbol
!= NULL
)
2035 write_exp_msymbol (msymbol
,
2036 lookup_function_type (builtin_type_int
),
2039 else if (!have_full_symbols () && !have_partial_symbols ())
2040 error ("No symbol table is loaded. Use the \"file\" command.");
2042 error ("No symbol \"%s\" in current context.",
2043 copy_name (yyvsp
[0].ssym
.stoken
));
2050 { push_type_address_space (copy_name (yyvsp
[0].ssym
.stoken
));
2051 push_type (tp_space_identifier
);
2057 { push_type (tp_pointer
); yyval
.voidval
= 0; }
2062 { push_type (tp_pointer
); yyval
.voidval
= yyvsp
[0].voidval
; }
2067 { push_type (tp_reference
); yyval
.voidval
= 0; }
2072 { push_type (tp_reference
); yyval
.voidval
= yyvsp
[0].voidval
; }
2077 { yyval
.voidval
= yyvsp
[-1].voidval
; }
2083 push_type_int (yyvsp
[0].lval
);
2084 push_type (tp_array
);
2091 push_type_int (yyvsp
[0].lval
);
2092 push_type (tp_array
);
2099 { push_type (tp_function
); }
2104 { push_type (tp_function
); }
2109 { yyval
.lval
= -1; }
2114 { yyval
.lval
= yyvsp
[-1].typed_val_int
.val
; }
2119 { yyval
.voidval
= 0; }
2124 { free (yyvsp
[-1].tvec
); yyval
.voidval
= 0; }
2129 { yyval
.tval
= lookup_member_type (builtin_type_int
, yyvsp
[-2].tval
); }
2134 { yyval
.tval
= yyvsp
[0].tsym
.type
; }
2139 { yyval
.tval
= builtin_type_int
; }
2144 { yyval
.tval
= builtin_type_long
; }
2149 { yyval
.tval
= builtin_type_short
; }
2154 { yyval
.tval
= builtin_type_long
; }
2159 { yyval
.tval
= builtin_type_long
; }
2164 { yyval
.tval
= builtin_type_long
; }
2169 { yyval
.tval
= builtin_type_long
; }
2174 { yyval
.tval
= builtin_type_unsigned_long
; }
2179 { yyval
.tval
= builtin_type_unsigned_long
; }
2184 { yyval
.tval
= builtin_type_unsigned_long
; }
2189 { yyval
.tval
= builtin_type_long_long
; }
2194 { yyval
.tval
= builtin_type_long_long
; }
2199 { yyval
.tval
= builtin_type_long_long
; }
2204 { yyval
.tval
= builtin_type_long_long
; }
2209 { yyval
.tval
= builtin_type_long_long
; }
2214 { yyval
.tval
= builtin_type_long_long
; }
2219 { yyval
.tval
= builtin_type_unsigned_long_long
; }
2224 { yyval
.tval
= builtin_type_unsigned_long_long
; }
2229 { yyval
.tval
= builtin_type_unsigned_long_long
; }
2234 { yyval
.tval
= builtin_type_unsigned_long_long
; }
2239 { yyval
.tval
= builtin_type_short
; }
2244 { yyval
.tval
= builtin_type_short
; }
2249 { yyval
.tval
= builtin_type_short
; }
2254 { yyval
.tval
= builtin_type_unsigned_short
; }
2259 { yyval
.tval
= builtin_type_unsigned_short
; }
2264 { yyval
.tval
= builtin_type_unsigned_short
; }
2269 { yyval
.tval
= builtin_type_double
; }
2274 { yyval
.tval
= builtin_type_long_double
; }
2279 { yyval
.tval
= lookup_struct (copy_name (yyvsp
[0].sval
),
2280 expression_context_block
); }
2285 { yyval
.tval
= lookup_struct (copy_name (yyvsp
[0].sval
),
2286 expression_context_block
); }
2291 { yyval
.tval
= lookup_union (copy_name (yyvsp
[0].sval
),
2292 expression_context_block
); }
2297 { yyval
.tval
= lookup_enum (copy_name (yyvsp
[0].sval
),
2298 expression_context_block
); }
2303 { yyval
.tval
= lookup_unsigned_typename (TYPE_NAME(yyvsp
[0].tsym
.type
)); }
2308 { yyval
.tval
= builtin_type_unsigned_int
; }
2313 { yyval
.tval
= lookup_signed_typename (TYPE_NAME(yyvsp
[0].tsym
.type
)); }
2318 { yyval
.tval
= builtin_type_int
; }
2323 { yyval
.tval
= lookup_template_type(copy_name(yyvsp
[-3].sval
), yyvsp
[-1].tval
,
2324 expression_context_block
);
2330 { yyval
.tval
= follow_types (yyvsp
[0].tval
); }
2335 { yyval
.tval
= follow_types (yyvsp
[-1].tval
); }
2341 struct type
*type
= yyvsp
[-2].tval
;
2342 struct type
*new_type
;
2343 char *ncopy
= alloca (yyvsp
[0].sval
.length
+ 1);
2345 memcpy (ncopy
, yyvsp
[0].sval
.ptr
, yyvsp
[0].sval
.length
);
2346 ncopy
[yyvsp
[0].sval
.length
] = '\0';
2348 if (TYPE_CODE (type
) != TYPE_CODE_STRUCT
2349 && TYPE_CODE (type
) != TYPE_CODE_UNION
2350 && TYPE_CODE (type
) != TYPE_CODE_NAMESPACE
)
2351 error ("`%s' is not defined as an aggregate type.",
2354 new_type
= cp_lookup_nested_type (type
, ncopy
,
2355 expression_context_block
);
2356 if (new_type
== NULL
)
2357 error ("No type \"%s\" within class or namespace \"%s\".",
2358 ncopy
, TYPE_NAME (type
));
2360 yyval
.tval
= new_type
;
2367 yyval
.tsym
.stoken
.ptr
= "int";
2368 yyval
.tsym
.stoken
.length
= 3;
2369 yyval
.tsym
.type
= builtin_type_int
;
2376 yyval
.tsym
.stoken
.ptr
= "long";
2377 yyval
.tsym
.stoken
.length
= 4;
2378 yyval
.tsym
.type
= builtin_type_long
;
2385 yyval
.tsym
.stoken
.ptr
= "short";
2386 yyval
.tsym
.stoken
.length
= 5;
2387 yyval
.tsym
.type
= builtin_type_short
;
2393 { yyval
.tvec
= (struct type
**) xmalloc (sizeof (struct type
*) * 2);
2394 yyval
.ivec
[0] = 1; /* Number of types in vector */
2395 yyval
.tvec
[1] = yyvsp
[0].tval
;
2401 { int len
= sizeof (struct type
*) * (++(yyvsp
[-2].ivec
[0]) + 1);
2402 yyval
.tvec
= (struct type
**) xrealloc ((char *) yyvsp
[-2].tvec
, len
);
2403 yyval
.tvec
[yyval
.ivec
[0]] = yyvsp
[0].tval
;
2408 #line 1000 "c-exp.y"
2409 { yyval
.tval
= follow_types (yyvsp
[-3].tval
); }
2413 #line 1008 "c-exp.y"
2414 { push_type (tp_const
);
2415 push_type (tp_volatile
);
2420 #line 1012 "c-exp.y"
2421 { push_type (tp_const
); }
2425 #line 1014 "c-exp.y"
2426 { push_type (tp_volatile
); }
2430 #line 1017 "c-exp.y"
2431 { yyval
.sval
= yyvsp
[0].ssym
.stoken
; }
2435 #line 1018 "c-exp.y"
2436 { yyval
.sval
= yyvsp
[0].ssym
.stoken
; }
2440 #line 1019 "c-exp.y"
2441 { yyval
.sval
= yyvsp
[0].tsym
.stoken
; }
2445 #line 1020 "c-exp.y"
2446 { yyval
.sval
= yyvsp
[0].ssym
.stoken
; }
2452 /* Line 991 of yacc.c. */
2458 YY_STACK_PRINT (yyss
, yyssp
);
2463 /* Now `shift' the result of the reduction. Determine what state
2464 that goes to, based on the state we popped back to and the rule
2465 number reduced by. */
2469 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2470 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2471 yystate
= yytable
[yystate
];
2473 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2478 /*------------------------------------.
2479 | yyerrlab -- here on detecting error |
2480 `------------------------------------*/
2482 /* If not already recovering from an error, report this error. */
2487 yyn
= yypact
[yystate
];
2489 if (YYPACT_NINF
< yyn
&& yyn
< YYLAST
)
2491 YYSIZE_T yysize
= 0;
2492 int yytype
= YYTRANSLATE (yychar
);
2497 /* Start YYX at -YYN if negative to avoid negative indexes in
2499 for (yyx
= yyn
< 0 ? -yyn
: 0;
2500 yyx
< (int) (sizeof (yytname
) / sizeof (char *)); yyx
++)
2501 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
2502 yysize
+= yystrlen (yytname
[yyx
]) + 15, yycount
++;
2503 yysize
+= yystrlen ("syntax error, unexpected ") + 1;
2504 yysize
+= yystrlen (yytname
[yytype
]);
2505 yymsg
= (char *) YYSTACK_ALLOC (yysize
);
2508 char *yyp
= yystpcpy (yymsg
, "syntax error, unexpected ");
2509 yyp
= yystpcpy (yyp
, yytname
[yytype
]);
2514 for (yyx
= yyn
< 0 ? -yyn
: 0;
2515 yyx
< (int) (sizeof (yytname
) / sizeof (char *));
2517 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
2519 const char *yyq
= ! yycount
? ", expecting " : " or ";
2520 yyp
= yystpcpy (yyp
, yyq
);
2521 yyp
= yystpcpy (yyp
, yytname
[yyx
]);
2526 YYSTACK_FREE (yymsg
);
2529 yyerror ("syntax error; also virtual memory exhausted");
2532 #endif /* YYERROR_VERBOSE */
2533 yyerror ("syntax error");
2538 if (yyerrstatus
== 3)
2540 /* If just tried and failed to reuse lookahead token after an
2541 error, discard it. */
2543 /* Return failure if at end of input. */
2544 if (yychar
== YYEOF
)
2546 /* Pop the error token. */
2548 /* Pop the rest of the stack. */
2549 while (yyss
< yyssp
)
2551 YYDSYMPRINTF ("Error: popping", yystos
[*yyssp
], yyvsp
, yylsp
);
2552 yydestruct (yystos
[*yyssp
], yyvsp
);
2558 YYDSYMPRINTF ("Error: discarding", yytoken
, &yylval
, &yylloc
);
2559 yydestruct (yytoken
, &yylval
);
2564 /* Else will try to reuse lookahead token after shifting the error
2569 /*----------------------------------------------------.
2570 | yyerrlab1 -- error raised explicitly by an action. |
2571 `----------------------------------------------------*/
2574 /* Suppress GCC warning that yyerrlab1 is unused when no action
2575 invokes YYERROR. MacOS 10.2.3's buggy "smart preprocessor"
2576 insists on the trailing semicolon. */
2577 #if defined (__GNUC_MINOR__) && 2093 <= (__GNUC__ * 1000 + __GNUC_MINOR__)
2578 __attribute__ ((__unused__
));
2585 /*---------------------------------------------------------------.
2586 | yyerrlab2 -- pop states until the error token can be shifted. |
2587 `---------------------------------------------------------------*/
2589 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2593 yyn
= yypact
[yystate
];
2594 if (yyn
!= YYPACT_NINF
)
2597 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2605 /* Pop the current state because it cannot handle the error token. */
2609 YYDSYMPRINTF ("Error: popping", yystos
[*yyssp
], yyvsp
, yylsp
);
2610 yydestruct (yystos
[yystate
], yyvsp
);
2614 YY_STACK_PRINT (yyss
, yyssp
);
2620 YYDPRINTF ((stderr
, "Shifting error token, "));
2629 /*-------------------------------------.
2630 | yyacceptlab -- YYACCEPT comes here. |
2631 `-------------------------------------*/
2636 /*-----------------------------------.
2637 | yyabortlab -- YYABORT comes here. |
2638 `-----------------------------------*/
2644 /*----------------------------------------------.
2645 | yyoverflowlab -- parser overflow comes here. |
2646 `----------------------------------------------*/
2648 yyerror ("parser stack overflow");
2656 YYSTACK_FREE (yyss
);
2662 #line 1034 "c-exp.y"
2665 /* Take care of parsing a number (anything that starts with a digit).
2666 Set yylval and return the token type; update lexptr.
2667 LEN is the number of characters in it. */
2669 /*** Needs some error checking for the float case ***/
2672 parse_number (p
, len
, parsed_float
, putithere
)
2678 /* FIXME: Shouldn't these be unsigned? We don't deal with negative values
2679 here, and we do kind of silly things like cast to unsigned. */
2686 int base
= input_radix
;
2689 /* Number of "L" suffixes encountered. */
2692 /* We have found a "L" or "U" suffix. */
2693 int found_suffix
= 0;
2696 struct type
*signed_type
;
2697 struct type
*unsigned_type
;
2701 /* It's a float since it contains a point or an exponent. */
2703 int num
= 0; /* number of tokens scanned by scanf */
2704 char saved_char
= p
[len
];
2706 p
[len
] = 0; /* null-terminate the token */
2707 if (sizeof (putithere
->typed_val_float
.dval
) <= sizeof (float))
2708 num
= sscanf (p
, "%g%c", (float *) &putithere
->typed_val_float
.dval
,&c
);
2709 else if (sizeof (putithere
->typed_val_float
.dval
) <= sizeof (double))
2710 num
= sscanf (p
, "%lg%c", (double *) &putithere
->typed_val_float
.dval
,&c
);
2713 #ifdef SCANF_HAS_LONG_DOUBLE
2714 num
= sscanf (p
, "%Lg%c", &putithere
->typed_val_float
.dval
,&c
);
2716 /* Scan it into a double, then assign it to the long double.
2717 This at least wins with values representable in the range
2720 num
= sscanf (p
, "%lg%c", &temp
,&c
);
2721 putithere
->typed_val_float
.dval
= temp
;
2724 p
[len
] = saved_char
; /* restore the input stream */
2725 if (num
!= 1) /* check scanf found ONLY a float ... */
2727 /* See if it has `f' or `l' suffix (float or long double). */
2729 c
= tolower (p
[len
- 1]);
2732 putithere
->typed_val_float
.type
= builtin_type_float
;
2734 putithere
->typed_val_float
.type
= builtin_type_long_double
;
2735 else if (isdigit (c
) || c
== '.')
2736 putithere
->typed_val_float
.type
= builtin_type_double
;
2743 /* Handle base-switching prefixes 0x, 0t, 0d, 0 */
2777 if (c
>= 'A' && c
<= 'Z')
2779 if (c
!= 'l' && c
!= 'u')
2781 if (c
>= '0' && c
<= '9')
2789 if (base
> 10 && c
>= 'a' && c
<= 'f')
2793 n
+= i
= c
- 'a' + 10;
2806 return ERROR
; /* Char not a digit */
2809 return ERROR
; /* Invalid digit in this base */
2811 /* Portably test for overflow (only works for nonzero values, so make
2812 a second check for zero). FIXME: Can't we just make n and prevn
2813 unsigned and avoid this? */
2814 if (c
!= 'l' && c
!= 'u' && (prevn
>= n
) && n
!= 0)
2815 unsigned_p
= 1; /* Try something unsigned */
2817 /* Portably test for unsigned overflow.
2818 FIXME: This check is wrong; for example it doesn't find overflow
2819 on 0x123456789 when LONGEST is 32 bits. */
2820 if (c
!= 'l' && c
!= 'u' && n
!= 0)
2822 if ((unsigned_p
&& (ULONGEST
) prevn
>= (ULONGEST
) n
))
2823 error ("Numeric constant too large.");
2828 /* An integer constant is an int, a long, or a long long. An L
2829 suffix forces it to be long; an LL suffix forces it to be long
2830 long. If not forced to a larger size, it gets the first type of
2831 the above that it fits in. To figure out whether it fits, we
2832 shift it right and see whether anything remains. Note that we
2833 can't shift sizeof (LONGEST) * HOST_CHAR_BIT bits or more in one
2834 operation, because many compilers will warn about such a shift
2835 (which always produces a zero result). Sometimes TARGET_INT_BIT
2836 or TARGET_LONG_BIT will be that big, sometimes not. To deal with
2837 the case where it is we just always shift the value more than
2838 once, with fewer bits each time. */
2840 un
= (ULONGEST
)n
>> 2;
2842 && (un
>> (TARGET_INT_BIT
- 2)) == 0)
2844 high_bit
= ((ULONGEST
)1) << (TARGET_INT_BIT
-1);
2846 /* A large decimal (not hex or octal) constant (between INT_MAX
2847 and UINT_MAX) is a long or unsigned long, according to ANSI,
2848 never an unsigned int, but this code treats it as unsigned
2849 int. This probably should be fixed. GCC gives a warning on
2852 unsigned_type
= builtin_type_unsigned_int
;
2853 signed_type
= builtin_type_int
;
2855 else if (long_p
<= 1
2856 && (un
>> (TARGET_LONG_BIT
- 2)) == 0)
2858 high_bit
= ((ULONGEST
)1) << (TARGET_LONG_BIT
-1);
2859 unsigned_type
= builtin_type_unsigned_long
;
2860 signed_type
= builtin_type_long
;
2865 if (sizeof (ULONGEST
) * HOST_CHAR_BIT
< TARGET_LONG_LONG_BIT
)
2866 /* A long long does not fit in a LONGEST. */
2867 shift
= (sizeof (ULONGEST
) * HOST_CHAR_BIT
- 1);
2869 shift
= (TARGET_LONG_LONG_BIT
- 1);
2870 high_bit
= (ULONGEST
) 1 << shift
;
2871 unsigned_type
= builtin_type_unsigned_long_long
;
2872 signed_type
= builtin_type_long_long
;
2875 putithere
->typed_val_int
.val
= n
;
2877 /* If the high bit of the worked out type is set then this number
2878 has to be unsigned. */
2880 if (unsigned_p
|| (n
& high_bit
))
2882 putithere
->typed_val_int
.type
= unsigned_type
;
2886 putithere
->typed_val_int
.type
= signed_type
;
2896 enum exp_opcode opcode
;
2899 static const struct token tokentab3
[] =
2901 {">>=", ASSIGN_MODIFY
, BINOP_RSH
},
2902 {"<<=", ASSIGN_MODIFY
, BINOP_LSH
}
2905 static const struct token tokentab2
[] =
2907 {"+=", ASSIGN_MODIFY
, BINOP_ADD
},
2908 {"-=", ASSIGN_MODIFY
, BINOP_SUB
},
2909 {"*=", ASSIGN_MODIFY
, BINOP_MUL
},
2910 {"/=", ASSIGN_MODIFY
, BINOP_DIV
},
2911 {"%=", ASSIGN_MODIFY
, BINOP_REM
},
2912 {"|=", ASSIGN_MODIFY
, BINOP_BITWISE_IOR
},
2913 {"&=", ASSIGN_MODIFY
, BINOP_BITWISE_AND
},
2914 {"^=", ASSIGN_MODIFY
, BINOP_BITWISE_XOR
},
2915 {"++", INCREMENT
, BINOP_END
},
2916 {"--", DECREMENT
, BINOP_END
},
2917 {"->", ARROW
, BINOP_END
},
2918 {"&&", ANDAND
, BINOP_END
},
2919 {"||", OROR
, BINOP_END
},
2920 {"::", COLONCOLON
, BINOP_END
},
2921 {"<<", LSH
, BINOP_END
},
2922 {">>", RSH
, BINOP_END
},
2923 {"==", EQUAL
, BINOP_END
},
2924 {"!=", NOTEQUAL
, BINOP_END
},
2925 {"<=", LEQ
, BINOP_END
},
2926 {">=", GEQ
, BINOP_END
}
2929 /* Read one token, getting characters through lexptr. */
2940 static char *tempbuf
;
2941 static int tempbufsize
;
2942 struct symbol
* sym_class
= NULL
;
2943 char * token_string
= NULL
;
2944 int class_prefix
= 0;
2949 /* Check if this is a macro invocation that we need to expand. */
2950 if (! scanning_macro_expansion ())
2952 char *expanded
= macro_expand_next (&lexptr
,
2953 expression_macro_lookup_func
,
2954 expression_macro_lookup_baton
);
2957 scan_macro_expansion (expanded
);
2960 prev_lexptr
= lexptr
;
2964 /* See if it is a special token of length 3. */
2965 for (i
= 0; i
< sizeof tokentab3
/ sizeof tokentab3
[0]; i
++)
2966 if (strncmp (tokstart
, tokentab3
[i
].operator, 3) == 0)
2969 yylval
.opcode
= tokentab3
[i
].opcode
;
2970 return tokentab3
[i
].token
;
2973 /* See if it is a special token of length 2. */
2974 for (i
= 0; i
< sizeof tokentab2
/ sizeof tokentab2
[0]; i
++)
2975 if (strncmp (tokstart
, tokentab2
[i
].operator, 2) == 0)
2978 yylval
.opcode
= tokentab2
[i
].opcode
;
2979 return tokentab2
[i
].token
;
2982 switch (c
= *tokstart
)
2985 /* If we were just scanning the result of a macro expansion,
2986 then we need to resume scanning the original text.
2987 Otherwise, we were already scanning the original text, and
2988 we're really done. */
2989 if (scanning_macro_expansion ())
2991 finished_macro_expansion ();
3004 /* We either have a character constant ('0' or '\177' for example)
3005 or we have a quoted symbol reference ('foo(int,int)' in C++
3010 c
= parse_escape (&lexptr
);
3012 error ("Empty character constant.");
3013 else if (! host_char_to_target (c
, &c
))
3015 int toklen
= lexptr
- tokstart
+ 1;
3016 char *tok
= alloca (toklen
+ 1);
3017 memcpy (tok
, tokstart
, toklen
);
3019 error ("There is no character corresponding to %s in the target "
3020 "character set `%s'.", tok
, target_charset ());
3023 yylval
.typed_val_int
.val
= c
;
3024 yylval
.typed_val_int
.type
= builtin_type_char
;
3029 namelen
= skip_quoted (tokstart
) - tokstart
;
3032 lexptr
= tokstart
+ namelen
;
3034 if (lexptr
[-1] != '\'')
3035 error ("Unmatched single quote.");
3040 error ("Invalid character constant.");
3050 if (paren_depth
== 0)
3057 if (comma_terminates
3059 && ! scanning_macro_expansion ())
3065 /* Might be a floating point number. */
3066 if (lexptr
[1] < '0' || lexptr
[1] > '9')
3067 goto symbol
; /* Nope, must be a symbol. */
3068 /* FALL THRU into number case. */
3081 /* It's a number. */
3082 int got_dot
= 0, got_e
= 0, toktype
;
3084 int hex
= input_radix
> 10;
3086 if (c
== '0' && (p
[1] == 'x' || p
[1] == 'X'))
3091 else if (c
== '0' && (p
[1]=='t' || p
[1]=='T' || p
[1]=='d' || p
[1]=='D'))
3099 /* This test includes !hex because 'e' is a valid hex digit
3100 and thus does not indicate a floating point number when
3101 the radix is hex. */
3102 if (!hex
&& !got_e
&& (*p
== 'e' || *p
== 'E'))
3103 got_dot
= got_e
= 1;
3104 /* This test does not include !hex, because a '.' always indicates
3105 a decimal floating point number regardless of the radix. */
3106 else if (!got_dot
&& *p
== '.')
3108 else if (got_e
&& (p
[-1] == 'e' || p
[-1] == 'E')
3109 && (*p
== '-' || *p
== '+'))
3110 /* This is the sign of the exponent, not the end of the
3113 /* We will take any letters or digits. parse_number will
3114 complain if past the radix, or if L or U are not final. */
3115 else if ((*p
< '0' || *p
> '9')
3116 && ((*p
< 'a' || *p
> 'z')
3117 && (*p
< 'A' || *p
> 'Z')))
3120 toktype
= parse_number (tokstart
, p
- tokstart
, got_dot
|got_e
, &yylval
);
3121 if (toktype
== ERROR
)
3123 char *err_copy
= (char *) alloca (p
- tokstart
+ 1);
3125 memcpy (err_copy
, tokstart
, p
- tokstart
);
3126 err_copy
[p
- tokstart
] = 0;
3127 error ("Invalid number \"%s\".", err_copy
);
3159 /* Build the gdb internal form of the input string in tempbuf,
3160 translating any standard C escape forms seen. Note that the
3161 buffer is null byte terminated *only* for the convenience of
3162 debugging gdb itself and printing the buffer contents when
3163 the buffer contains no embedded nulls. Gdb does not depend
3164 upon the buffer being null byte terminated, it uses the length
3165 string instead. This allows gdb to handle C strings (as well
3166 as strings in other languages) with embedded null bytes */
3168 tokptr
= ++tokstart
;
3172 char *char_start_pos
= tokptr
;
3174 /* Grow the static temp buffer if necessary, including allocating
3175 the first one on demand. */
3176 if (tempbufindex
+ 1 >= tempbufsize
)
3178 tempbuf
= (char *) xrealloc (tempbuf
, tempbufsize
+= 64);
3184 /* Do nothing, loop will terminate. */
3188 c
= parse_escape (&tokptr
);
3193 tempbuf
[tempbufindex
++] = c
;
3197 if (! host_char_to_target (c
, &c
))
3199 int len
= tokptr
- char_start_pos
;
3200 char *copy
= alloca (len
+ 1);
3201 memcpy (copy
, char_start_pos
, len
);
3204 error ("There is no character corresponding to `%s' "
3205 "in the target character set `%s'.",
3206 copy
, target_charset ());
3208 tempbuf
[tempbufindex
++] = c
;
3211 } while ((*tokptr
!= '"') && (*tokptr
!= '\0'));
3212 if (*tokptr
++ != '"')
3214 error ("Unterminated string in expression.");
3216 tempbuf
[tempbufindex
] = '\0'; /* See note above */
3217 yylval
.sval
.ptr
= tempbuf
;
3218 yylval
.sval
.length
= tempbufindex
;
3223 if (!(c
== '_' || c
== '$'
3224 || (c
>= 'a' && c
<= 'z') || (c
>= 'A' && c
<= 'Z')))
3225 /* We must have come across a bad character (e.g. ';'). */
3226 error ("Invalid character '%c' in expression.", c
);
3228 /* It's a name. See how long it is. */
3230 for (c
= tokstart
[namelen
];
3231 (c
== '_' || c
== '$' || (c
>= '0' && c
<= '9')
3232 || (c
>= 'a' && c
<= 'z') || (c
>= 'A' && c
<= 'Z') || c
== '<');)
3234 /* Template parameter lists are part of the name.
3235 FIXME: This mishandles `print $a<4&&$a>3'. */
3239 /* Scan ahead to get rest of the template specification. Note
3240 that we look ahead only when the '<' adjoins non-whitespace
3241 characters; for comparison expressions, e.g. "a < b > c",
3242 there must be spaces before the '<', etc. */
3244 char * p
= find_template_name_end (tokstart
+ namelen
);
3246 namelen
= p
- tokstart
;
3249 c
= tokstart
[++namelen
];
3252 /* The token "if" terminates the expression and is NOT removed from
3253 the input stream. It doesn't count if it appears in the
3254 expansion of a macro. */
3256 && tokstart
[0] == 'i'
3257 && tokstart
[1] == 'f'
3258 && ! scanning_macro_expansion ())
3267 /* Catch specific keywords. Should be done with a data structure. */
3271 if (strncmp (tokstart
, "unsigned", 8) == 0)
3273 if (current_language
->la_language
== language_cplus
3274 && strncmp (tokstart
, "template", 8) == 0)
3276 if (strncmp (tokstart
, "volatile", 8) == 0)
3277 return VOLATILE_KEYWORD
;
3280 if (strncmp (tokstart
, "struct", 6) == 0)
3282 if (strncmp (tokstart
, "signed", 6) == 0)
3283 return SIGNED_KEYWORD
;
3284 if (strncmp (tokstart
, "sizeof", 6) == 0)
3286 if (strncmp (tokstart
, "double", 6) == 0)
3287 return DOUBLE_KEYWORD
;
3290 if (current_language
->la_language
== language_cplus
)
3292 if (strncmp (tokstart
, "false", 5) == 0)
3293 return FALSEKEYWORD
;
3294 if (strncmp (tokstart
, "class", 5) == 0)
3297 if (strncmp (tokstart
, "union", 5) == 0)
3299 if (strncmp (tokstart
, "short", 5) == 0)
3301 if (strncmp (tokstart
, "const", 5) == 0)
3302 return CONST_KEYWORD
;
3305 if (strncmp (tokstart
, "enum", 4) == 0)
3307 if (strncmp (tokstart
, "long", 4) == 0)
3309 if (current_language
->la_language
== language_cplus
)
3311 if (strncmp (tokstart
, "true", 4) == 0)
3316 if (strncmp (tokstart
, "int", 3) == 0)
3323 yylval
.sval
.ptr
= tokstart
;
3324 yylval
.sval
.length
= namelen
;
3326 if (*tokstart
== '$')
3328 write_dollar_variable (yylval
.sval
);
3332 /* Look ahead and see if we can consume more of the input
3333 string to get a reasonable class/namespace spec or a
3334 fully-qualified name. This is a kludge to get around the
3335 HP aCC compiler's generation of symbol names with embedded
3336 colons for namespace and nested classes. */
3338 /* NOTE: carlton/2003-09-24: I don't entirely understand the
3339 HP-specific code, either here or in linespec. Having said that,
3340 I suspect that we're actually moving towards their model: we want
3341 symbols whose names are fully qualified, which matches the
3342 description above. */
3345 /* Only do it if not inside single quotes */
3346 sym_class
= parse_nested_classes_for_hpacc (yylval
.sval
.ptr
, yylval
.sval
.length
,
3347 &token_string
, &class_prefix
, &lexptr
);
3350 /* Replace the current token with the bigger one we found */
3351 yylval
.sval
.ptr
= token_string
;
3352 yylval
.sval
.length
= strlen (token_string
);
3356 /* Use token-type BLOCKNAME for symbols that happen to be defined as
3357 functions or symtabs. If this is not so, then ...
3358 Use token-type TYPENAME for symbols that happen to be defined
3359 currently as names of types; NAME for other symbols.
3360 The caller is not constrained to care about the distinction. */
3362 char *tmp
= copy_name (yylval
.sval
);
3364 int is_a_field_of_this
= 0;
3367 sym
= lookup_symbol (tmp
, expression_context_block
,
3369 current_language
->la_language
== language_cplus
3370 ? &is_a_field_of_this
: (int *) NULL
,
3371 (struct symtab
**) NULL
);
3372 /* Call lookup_symtab, not lookup_partial_symtab, in case there are
3373 no psymtabs (coff, xcoff, or some future change to blow away the
3374 psymtabs once once symbols are read). */
3375 if (sym
&& SYMBOL_CLASS (sym
) == LOC_BLOCK
)
3377 yylval
.ssym
.sym
= sym
;
3378 yylval
.ssym
.is_a_field_of_this
= is_a_field_of_this
;
3382 { /* See if it's a file name. */
3383 struct symtab
*symtab
;
3385 symtab
= lookup_symtab (tmp
);
3389 yylval
.bval
= BLOCKVECTOR_BLOCK (BLOCKVECTOR (symtab
), STATIC_BLOCK
);
3394 if (sym
&& SYMBOL_CLASS (sym
) == LOC_TYPEDEF
)
3396 /* NOTE: carlton/2003-09-25: There used to be code here to
3397 handle nested types. It didn't work very well. See the
3398 comment before qualified_type for more info. */
3399 yylval
.tsym
.type
= SYMBOL_TYPE (sym
);
3402 if ((yylval
.tsym
.type
= lookup_primitive_typename (tmp
)) != 0)
3405 /* Input names that aren't symbols but ARE valid hex numbers,
3406 when the input radix permits them, can be names or numbers
3407 depending on the parse. Note we support radixes > 16 here. */
3409 ((tokstart
[0] >= 'a' && tokstart
[0] < 'a' + input_radix
- 10) ||
3410 (tokstart
[0] >= 'A' && tokstart
[0] < 'A' + input_radix
- 10)))
3412 YYSTYPE newlval
; /* Its value is ignored. */
3413 hextype
= parse_number (tokstart
, namelen
, 0, &newlval
);
3416 yylval
.ssym
.sym
= sym
;
3417 yylval
.ssym
.is_a_field_of_this
= is_a_field_of_this
;
3422 /* Any other kind of symbol */
3423 yylval
.ssym
.sym
= sym
;
3424 yylval
.ssym
.is_a_field_of_this
= is_a_field_of_this
;
3434 lexptr
= prev_lexptr
;
3436 error ("A %s in expression, near `%s'.", (msg
? msg
: "error"), lexptr
);