GDB (xrefs)
/tmp/gdb-8.1/gdb/c-exp.c
Go to the documentation of this file.
1 /* A Bison parser, made by GNU Bison 3.0.4. */
2 
3 /* Bison implementation for Yacc-like parsers in C
4 
5  Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
6 
7  This program is free software: you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation, either version 3 of the License, or
10  (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program. If not, see <http://www.gnu.org/licenses/>. */
19 
20 /* As a special exception, you may create a larger work that contains
21  part or all of the Bison parser skeleton and distribute that work
22  under terms of your choice, so long as that work isn't itself a
23  parser generator using the skeleton or a modified version thereof
24  as a parser skeleton. Alternatively, if you modify or redistribute
25  the parser skeleton itself, you may (at your option) remove this
26  special exception, which will cause the skeleton and the resulting
27  Bison output files to be licensed under the GNU General Public
28  License without this special exception.
29 
30  This special exception was added by the Free Software Foundation in
31  version 2.2 of Bison. */
32 
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34  simplifying the original so-called "semantic" parser. */
35 
36 /* All symbols defined below should begin with yy or YY, to avoid
37  infringing on user name space. This should be done even for local
38  variables, as they might otherwise be expanded by user macros.
39  There are some unavoidable exceptions within include files to
40  define necessary library symbols; they are noted "INFRINGES ON
41  USER NAME SPACE" below. */
42 
43 /* Identify Bison output. */
44 #define YYBISON 1
45 
46 /* Bison version. */
47 #define YYBISON_VERSION "3.0.4"
48 
49 /* Skeleton name. */
50 #define YYSKELETON_NAME "yacc.c"
51 
52 /* Pure parsers. */
53 #define YYPURE 0
54 
55 /* Push parsers. */
56 #define YYPUSH 0
57 
58 /* Pull parsers. */
59 #define YYPULL 1
60 
61 
62 
63 
64 /* Copy the first part of user declarations. */
65 #line 36 "c-exp.y" /* yacc.c:339 */
66 
67 
68 #include "defs.h"
69 #include <ctype.h>
70 #include "expression.h"
71 #include "value.h"
72 #include "parser-defs.h"
73 #include "language.h"
74 #include "c-lang.h"
75 #include "bfd.h" /* Required by objfiles.h. */
76 #include "symfile.h" /* Required by objfiles.h. */
77 #include "objfiles.h" /* For have_full_symbols and have_partial_symbols */
78 #include "charset.h"
79 #include "block.h"
80 #include "cp-support.h"
81 #include "macroscope.h"
82 #include "objc-lang.h"
83 #include "typeprint.h"
84 #include "cp-abi.h"
85 
86 #define parse_type(ps) builtin_type (parse_gdbarch (ps))
87 
88 /* Remap normal yacc parser interface names (yyparse, yylex, yyerror,
89  etc). */
90 #define GDB_YY_REMAP_PREFIX c_
91 #include "yy-remap.h"
92 
93 /* The state of the parser, used internally when we are parsing the
94  expression. */
95 
96 static struct parser_state *pstate = NULL;
97 
98 int yyparse (void);
99 
100 static int yylex (void);
101 
102 void yyerror (const char *);
103 
104 static int type_aggregate_p (struct type *);
105 
106 
107 #line 108 "c-exp.c" /* yacc.c:339 */
108 
109 # ifndef YY_NULLPTRPTR
110 # if defined __cplusplus && 201103L <= __cplusplus
111 # define YY_NULLPTRPTR nullptr
112 # else
113 # define YY_NULLPTRPTR 0
114 # endif
115 # endif
116 
117 /* Enabling verbose error messages. */
118 #ifdef YYERROR_VERBOSE
119 # undef YYERROR_VERBOSE
120 # define YYERROR_VERBOSE 1
121 #else
122 # define YYERROR_VERBOSE 0
123 #endif
124 
125 
126 /* Debug traces. */
127 #ifndef YYDEBUG
128 # define YYDEBUG 0
129 #endif
130 #if YYDEBUG
131 extern int yydebug;
132 #endif
133 
134 /* Token type. */
135 #ifndef YYTOKENTYPE
136 # define YYTOKENTYPE
138  {
139  INT = 258,
140  FLOAT = 259,
141  STRING = 260,
142  NSSTRING = 261,
143  SELECTOR = 262,
144  CHAR = 263,
145  NAME = 264,
147  COMPLETE = 266,
148  TYPENAME = 267,
149  CLASSNAME = 268,
150  OBJC_LBRAC = 269,
151  NAME_OR_INT = 270,
152  OPERATOR = 271,
153  STRUCT = 272,
154  CLASS = 273,
155  UNION = 274,
156  ENUM = 275,
157  SIZEOF = 276,
158  UNSIGNED = 277,
159  COLONCOLON = 278,
160  TEMPLATE = 279,
161  ERROR = 280,
162  NEW = 281,
163  DELETE = 282,
166  STATIC_CAST = 285,
167  CONST_CAST = 286,
168  ENTRY = 287,
169  TYPEOF = 288,
170  DECLTYPE = 289,
171  TYPEID = 290,
173  LONG = 292,
174  SHORT = 293,
175  INT_KEYWORD = 294,
179  VARIABLE = 298,
181  TRUEKEYWORD = 300,
183  ABOVE_COMMA = 302,
184  OROR = 303,
185  ANDAND = 304,
186  EQUAL = 305,
187  NOTEQUAL = 306,
188  LEQ = 307,
189  GEQ = 308,
190  LSH = 309,
191  RSH = 310,
192  UNARY = 311,
193  INCREMENT = 312,
194  DECREMENT = 313,
195  ARROW = 314,
196  ARROW_STAR = 315,
197  DOT_STAR = 316,
198  BLOCKNAME = 317,
199  FILENAME = 318,
200  DOTDOTDOT = 319
201  };
202 #endif
203 /* Tokens. */
204 #define INT 258
205 #define FLOAT 259
206 #define STRING 260
207 #define NSSTRING 261
208 #define SELECTOR 262
209 #define CHAR 263
210 #define NAME 264
211 #define UNKNOWN_CPP_NAME 265
212 #define COMPLETE 266
213 #define TYPENAME 267
214 #define CLASSNAME 268
215 #define OBJC_LBRAC 269
216 #define NAME_OR_INT 270
217 #define OPERATOR 271
218 #define STRUCT 272
219 #define CLASS 273
220 #define UNION 274
221 #define ENUM 275
222 #define SIZEOF 276
223 #define UNSIGNED 277
224 #define COLONCOLON 278
225 #define TEMPLATE 279
226 #define ERROR 280
227 #define NEW 281
228 #define DELETE 282
229 #define REINTERPRET_CAST 283
230 #define DYNAMIC_CAST 284
231 #define STATIC_CAST 285
232 #define CONST_CAST 286
233 #define ENTRY 287
234 #define TYPEOF 288
235 #define DECLTYPE 289
236 #define TYPEID 290
237 #define SIGNED_KEYWORD 291
238 #define LONG 292
239 #define SHORT 293
240 #define INT_KEYWORD 294
241 #define CONST_KEYWORD 295
242 #define VOLATILE_KEYWORD 296
243 #define DOUBLE_KEYWORD 297
244 #define VARIABLE 298
245 #define ASSIGN_MODIFY 299
246 #define TRUEKEYWORD 300
247 #define FALSEKEYWORD 301
248 #define ABOVE_COMMA 302
249 #define OROR 303
250 #define ANDAND 304
251 #define EQUAL 305
252 #define NOTEQUAL 306
253 #define LEQ 307
254 #define GEQ 308
255 #define LSH 309
256 #define RSH 310
257 #define UNARY 311
258 #define INCREMENT 312
259 #define DECREMENT 313
260 #define ARROW 314
261 #define ARROW_STAR 315
262 #define DOT_STAR 316
263 #define BLOCKNAME 317
264 #define FILENAME 318
265 #define DOTDOTDOT 319
266 
267 /* Value type. */
268 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
269 
270 union YYSTYPE
271 {
272 #line 83 "c-exp.y" /* yacc.c:355 */
273 
274  LONGEST lval;
275  struct {
276  LONGEST val;
277  struct type *type;
278  } typed_val_int;
279  struct {
280  gdb_byte val[16];
281  struct type *type;
282  } typed_val_float;
283  struct type *tval;
284  struct stoken sval;
286  struct ttype tsym;
287  struct symtoken ssym;
288  int voidval;
289  const struct block *bval;
291 
293  VEC (type_ptr) *tvec;
294 
295  struct type_stack *type_stack;
296 
297  struct objc_class_str theclass;
298 
299 
300 #line 301 "c-exp.c" /* yacc.c:355 */
301 };
302 
303 typedef union YYSTYPE YYSTYPE;
304 # define YYSTYPE_IS_TRIVIAL 1
305 # define YYSTYPE_IS_DECLARED 1
306 #endif
307 
308 
309 extern YYSTYPE yylval;
310 
311 int yyparse (void);
312 
313 
314 
315 /* Copy the second part of user declarations. */
316 #line 110 "c-exp.y" /* yacc.c:358 */
317 
318 /* YYSTYPE gets defined by %union */
319 static int parse_number (struct parser_state *par_state,
320  const char *, int, int, YYSTYPE *);
321 static struct stoken operator_stoken (const char *);
322 static void check_parameter_typelist (VEC (type_ptr) *);
323 static void write_destructor_name (struct parser_state *par_state,
324  struct stoken);
325 
326 #ifdef YYBISON
327 static void c_print_token (FILE *file, int type, YYSTYPE value);
328 #define YYPRINT(FILE, TYPE, VALUE) c_print_token (FILE, TYPE, VALUE)
329 #endif
330 
331 #line 332 "c-exp.c" /* yacc.c:358 */
332 
333 #ifdef short
334 # undef short
335 #endif
336 
337 #ifdef YYTYPE_UINT8
338 typedef YYTYPE_UINT8 yytype_uint8;
339 #else
340 typedef unsigned char yytype_uint8;
341 #endif
342 
343 #ifdef YYTYPE_INT8
344 typedef YYTYPE_INT8 yytype_int8;
345 #else
346 typedef signed char yytype_int8;
347 #endif
348 
349 #ifdef YYTYPE_UINT16
350 typedef YYTYPE_UINT16 yytype_uint16;
351 #else
352 typedef unsigned short int yytype_uint16;
353 #endif
354 
355 #ifdef YYTYPE_INT16
356 typedef YYTYPE_INT16 yytype_int16;
357 #else
358 typedef short int yytype_int16;
359 #endif
360 
361 #ifndef YYSIZE_T
362 # ifdef __SIZE_TYPE__
363 # define YYSIZE_T __SIZE_TYPE__
364 # elif defined size_t
365 # define YYSIZE_T size_t
366 # elif ! defined YYSIZE_T
367 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
368 # define YYSIZE_T size_t
369 # else
370 # define YYSIZE_T unsigned int
371 # endif
372 #endif
373 
374 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
375 
376 #ifndef YY_
377 # if defined YYENABLE_NLS && YYENABLE_NLS
378 # if ENABLE_NLS
379 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
380 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
381 # endif
382 # endif
383 # ifndef YY_
384 # define YY_(Msgid) Msgid
385 # endif
386 #endif
387 
388 #ifndef YY_ATTRIBUTE
389 # if (defined __GNUC__ \
390  && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
391  || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
392 # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
393 # else
394 # define YY_ATTRIBUTE(Spec) /* empty */
395 # endif
396 #endif
397 
398 #ifndef YY_ATTRIBUTE_PURE
399 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
400 #endif
401 
402 #ifndef YY_ATTRIBUTE_UNUSED
403 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
404 #endif
405 
406 #if !defined _Noreturn \
407  && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
408 # if defined _MSC_VER && 1200 <= _MSC_VER
409 # define _Noreturn __declspec (noreturn)
410 # else
411 # define _Noreturn YY_ATTRIBUTE ((__noreturn__))
412 # endif
413 #endif
414 
415 /* Suppress unused-variable warnings by "using" E. */
416 #if ! defined lint || defined __GNUC__
417 # define YYUSE(E) ((void) (E))
418 #else
419 # define YYUSE(E) /* empty */
420 #endif
421 
422 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
423 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
424 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
425  _Pragma ("GCC diagnostic push") \
426  _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
427  _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
428 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
429  _Pragma ("GCC diagnostic pop")
430 #else
431 # define YY_INITIAL_VALUE(Value) Value
432 #endif
433 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
434 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
435 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
436 #endif
437 #ifndef YY_INITIAL_VALUE
438 # define YY_INITIAL_VALUE(Value) /* Nothing. */
439 #endif
440 
441 
442 #if ! defined yyoverflow || YYERROR_VERBOSE
443 
444 /* The parser invokes alloca or xmalloc; define the necessary symbols. */
445 
446 # ifdef YYSTACK_USE_ALLOCA
447 # if YYSTACK_USE_ALLOCA
448 # ifdef __GNUC__
449 # define YYSTACK_ALLOC __builtin_alloca
450 # elif defined __BUILTIN_VA_ARG_INCR
451 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
452 # elif defined _AIX
453 # define YYSTACK_ALLOC __alloca
454 # elif defined _MSC_VER
455 # define alloca _alloca
456 # else
457 # define YYSTACK_ALLOC alloca
458 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
459 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
460  /* Use EXIT_SUCCESS as a witness for stdlib.h. */
461 # ifndef EXIT_SUCCESS
462 # define EXIT_SUCCESS 0
463 # endif
464 # endif
465 # endif
466 # endif
467 # endif
468 
469 # ifdef YYSTACK_ALLOC
470  /* Pacify GCC's 'empty if-body' warning. */
471 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
472 # ifndef YYSTACK_ALLOC_MAXIMUM
473  /* The OS might guarantee only one guard page at the bottom of the stack,
474  and a page size can be as small as 4096 bytes. So we cannot safely
475  invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
476  to allow for a few compiler-allocated temporary stack slots. */
477 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
478 # endif
479 # else
480 # define YYSTACK_ALLOC YYMALLOC
481 # define YYSTACK_FREE YYFREE
482 # ifndef YYSTACK_ALLOC_MAXIMUM
483 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
484 # endif
485 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
486  && ! ((defined YYMALLOC || defined xmalloc) \
487  && (defined YYFREE || defined xfree)))
488 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
489 # ifndef EXIT_SUCCESS
490 # define EXIT_SUCCESS 0
491 # endif
492 # endif
493 # ifndef YYMALLOC
494 # define YYMALLOC xmalloc
495 # if ! defined xmalloc && ! defined EXIT_SUCCESS
496 void *xmalloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
497 # endif
498 # endif
499 # ifndef YYFREE
500 # define YYFREE xfree
501 # if ! defined xfree && ! defined EXIT_SUCCESS
502 void xfree (void *); /* INFRINGES ON USER NAME SPACE */
503 # endif
504 # endif
505 # endif
506 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
507 
508 
509 #if (! defined yyoverflow \
510  && (! defined __cplusplus \
511  || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
512 
513 /* A type that is properly aligned for any stack member. */
514 union yyalloc
515 {
518 };
519 
520 /* The size of the maximum gap between one aligned stack and the next. */
521 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
522 
523 /* The size of an array large to enough to hold all stacks, each with
524  N elements. */
525 # define YYSTACK_BYTES(N) \
526  ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
527  + YYSTACK_GAP_MAXIMUM)
528 
529 # define YYCOPY_NEEDED 1
530 
531 /* Relocate STACK from its old location to the new one. The
532  local variables YYSIZE and YYSTACKSIZE give the old and new number of
533  elements in the stack, and YYPTR gives the new location of the
534  stack. Advance YYPTR to a properly aligned location for the next
535  stack. */
536 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
537  do \
538  { \
539  YYSIZE_T yynewbytes; \
540  YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
541  Stack = &yyptr->Stack_alloc; \
542  yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
543  yyptr += yynewbytes / sizeof (*yyptr); \
544  } \
545  while (0)
546 
547 #endif
548 
549 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
550 /* Copy COUNT objects from SRC to DST. The source and destination do
551  not overlap. */
552 # ifndef YYCOPY
553 # if defined __GNUC__ && 1 < __GNUC__
554 # define YYCOPY(Dst, Src, Count) \
555  __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
556 # else
557 # define YYCOPY(Dst, Src, Count) \
558  do \
559  { \
560  YYSIZE_T yyi; \
561  for (yyi = 0; yyi < (Count); yyi++) \
562  (Dst)[yyi] = (Src)[yyi]; \
563  } \
564  while (0)
565 # endif
566 # endif
567 #endif /* !YYCOPY_NEEDED */
568 
569 /* YYFINAL -- State number of the termination state. */
570 #define YYFINAL 169
571 /* YYLAST -- Last index in YYTABLE. */
572 #define YYLAST 1705
573 
574 /* YYNTOKENS -- Number of terminals. */
575 #define YYNTOKENS 89
576 /* YYNNTS -- Number of nonterminals. */
577 #define YYNNTS 49
578 /* YYNRULES -- Number of rules. */
579 #define YYNRULES 267
580 /* YYNSTATES -- Number of states. */
581 #define YYNSTATES 421
582 
583 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
584  by yylex, with out-of-bounds checking. */
585 #define YYUNDEFTOK 2
586 #define YYMAXUTOK 319
587 
588 #define YYTRANSLATE(YYX) \
589  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
590 
591 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
592  as returned by yylex, without out-of-bounds checking. */
593 static const yytype_uint8 yytranslate[] =
594 {
595  0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
596  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
597  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
598  2, 2, 2, 83, 2, 2, 2, 69, 55, 2,
599  78, 82, 67, 65, 47, 66, 75, 68, 2, 2,
600  2, 2, 2, 2, 2, 2, 2, 2, 86, 2,
601  58, 49, 59, 50, 64, 2, 2, 2, 2, 2,
602  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
603  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
604  2, 77, 2, 85, 54, 2, 2, 2, 2, 2,
605  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
606  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
607  2, 2, 2, 87, 53, 88, 84, 2, 2, 2,
608  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
609  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
610  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
611  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
612  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
613  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
614  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
615  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
616  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
617  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
618  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
619  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
620  2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
621  5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
622  15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
623  25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
624  35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
625  45, 46, 48, 51, 52, 56, 57, 60, 61, 62,
626  63, 70, 71, 72, 73, 74, 76, 79, 80, 81
627 };
628 
629 #if YYDEBUG
630  /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
631 static const yytype_uint16 yyrline[] =
632 {
633  0, 227, 227, 228, 231, 235, 239, 245, 252, 253,
634  258, 262, 266, 270, 274, 278, 282, 286, 290, 294,
635  298, 302, 306, 310, 316, 323, 333, 339, 346, 354,
636  358, 364, 371, 381, 387, 394, 402, 406, 410, 420,
637  419, 443, 442, 459, 458, 467, 469, 472, 473, 476,
638  478, 480, 487, 484, 498, 508, 507, 533, 537, 540,
639  544, 548, 571, 582, 589, 590, 593, 601, 604, 611,
640  615, 619, 625, 629, 633, 637, 641, 645, 649, 653,
641  657, 661, 665, 669, 673, 677, 681, 685, 689, 693,
642  697, 701, 705, 709, 716, 723, 732, 745, 752, 755,
643  761, 768, 788, 793, 797, 801, 808, 825, 843, 876,
644  885, 893, 903, 911, 917, 928, 943, 965, 978, 1002,
645  1011, 1012, 1040, 1111, 1115, 1116, 1119, 1122, 1123, 1127,
646  1128, 1133, 1132, 1136, 1135, 1138, 1140, 1142, 1144, 1148,
647  1157, 1159, 1160, 1163, 1165, 1172, 1179, 1185, 1192, 1194,
648  1196, 1198, 1202, 1204, 1216, 1220, 1222, 1226, 1230, 1234,
649  1238, 1242, 1246, 1250, 1254, 1258, 1262, 1266, 1270, 1274,
650  1278, 1282, 1286, 1290, 1294, 1298, 1302, 1306, 1310, 1314,
651  1318, 1322, 1326, 1332, 1338, 1341, 1346, 1352, 1355, 1360,
652  1366, 1369, 1374, 1380, 1383, 1388, 1394, 1398, 1402, 1406,
653  1413, 1417, 1419, 1423, 1424, 1432, 1440, 1451, 1453, 1462,
654  1468, 1475, 1476, 1483, 1487, 1488, 1491, 1492, 1495, 1499,
655  1501, 1505, 1507, 1509, 1511, 1513, 1515, 1517, 1519, 1521,
656  1523, 1525, 1527, 1529, 1531, 1533, 1535, 1537, 1539, 1541,
657  1543, 1583, 1585, 1587, 1589, 1591, 1593, 1595, 1597, 1599,
658  1601, 1603, 1605, 1607, 1609, 1611, 1613, 1615, 1632, 1633,
659  1634, 1635, 1636, 1637, 1640, 1641, 1649, 1661
660 };
661 #endif
662 
663 #if YYDEBUG || YYERROR_VERBOSE || 0
664 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
665  First, the terminals, then, starting at YYNTOKENS, nonterminals. */
666 static const char *const yytname[] =
667 {
668  "$end", "error", "$undefined", "INT", "FLOAT", "STRING", "NSSTRING",
669  "SELECTOR", "CHAR", "NAME", "UNKNOWN_CPP_NAME", "COMPLETE", "TYPENAME",
670  "CLASSNAME", "OBJC_LBRAC", "NAME_OR_INT", "OPERATOR", "STRUCT", "CLASS",
671  "UNION", "ENUM", "SIZEOF", "UNSIGNED", "COLONCOLON", "TEMPLATE", "ERROR",
672  "NEW", "DELETE", "REINTERPRET_CAST", "DYNAMIC_CAST", "STATIC_CAST",
673  "CONST_CAST", "ENTRY", "TYPEOF", "DECLTYPE", "TYPEID", "SIGNED_KEYWORD",
674  "LONG", "SHORT", "INT_KEYWORD", "CONST_KEYWORD", "VOLATILE_KEYWORD",
675  "DOUBLE_KEYWORD", "VARIABLE", "ASSIGN_MODIFY", "TRUEKEYWORD",
676  "FALSEKEYWORD", "','", "ABOVE_COMMA", "'='", "'?'", "OROR", "ANDAND",
677  "'|'", "'^'", "'&'", "EQUAL", "NOTEQUAL", "'<'", "'>'", "LEQ", "GEQ",
678  "LSH", "RSH", "'@'", "'+'", "'-'", "'*'", "'/'", "'%'", "UNARY",
679  "INCREMENT", "DECREMENT", "ARROW", "ARROW_STAR", "'.'", "DOT_STAR",
680  "'['", "'('", "BLOCKNAME", "FILENAME", "DOTDOTDOT", "')'", "'!'", "'~'",
681  "']'", "':'", "'{'", "'}'", "$accept", "start", "type_exp", "exp1",
682  "exp", "$@1", "$@2", "$@3", "msglist", "msgarglist", "msgarg", "$@4",
683  "$@5", "lcurly", "arglist", "function_method", "function_method_void",
684  "function_method_void_or_typelist", "rcurly", "string_exp", "block",
685  "variable", "qualified_name", "space_identifier", "const_or_volatile",
686  "cv_with_space_id", "const_or_volatile_or_space_identifier_noopt",
687  "const_or_volatile_or_space_identifier", "ptr_operator", "$@6", "$@7",
688  "ptr_operator_ts", "abs_decl", "direct_abs_decl", "array_mod",
689  "func_mod", "type", "typebase", "type_name", "parameter_typelist",
690  "nonempty_typelist", "ptype", "conversion_type_id",
691  "conversion_declarator", "const_and_volatile", "const_or_volatile_noopt",
692  "oper", "name", "name_not_typename", YY_NULLPTRPTR
693 };
694 #endif
695 
696 # ifdef YYPRINT
697 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
698  (internal) symbol number NUM (which must be that of a token). */
699 static const yytype_uint16 yytoknum[] =
700 {
701  0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
702  265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
703  275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
704  285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
705  295, 296, 297, 298, 299, 300, 301, 44, 302, 61,
706  63, 303, 304, 124, 94, 38, 305, 306, 60, 62,
707  307, 308, 309, 310, 64, 43, 45, 42, 47, 37,
708  311, 312, 313, 314, 315, 46, 316, 91, 40, 317,
709  318, 319, 41, 33, 126, 93, 58, 123, 125
710 };
711 # endif
712 
713 #define YYPACT_NINF -218
714 
715 #define yypact_value_is_default(Yystate) \
716  (!!((Yystate) == (-218)))
717 
718 #define YYTABLE_NINF -126
719 
720 #define yytable_value_is_error(Yytable_value) \
721  0
722 
723  /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
724  STATE-NUM. */
725 static const yytype_int16 yypact[] =
726 {
727  476, -218, -218, -218, -218, -26, -218, -218, -16, 32,
728  646, -218, 890, 222, 263, 278, 302, 731, 111, 31,
729  245, 10, 14, 37, 50, 39, 43, 61, 116, 325,
730  184, -218, 105, 118, -218, -218, -218, -218, 816, 816,
731  816, 816, 816, 816, 476, 138, -218, 816, 816, -218,
732  188, -218, 145, 1430, 391, 172, -218, 173, 192, 175,
733  -218, -218, 139, -218, 751, -218, 51, 311, -218, 140,
734  -218, 183, 245, -218, 202, 32, -218, 1430, -218, 120,
735  20, 36, -218, -218, -218, -218, -218, -218, -218, -218,
736  -218, -218, -218, -218, -218, -218, -218, -218, -218, -218,
737  -218, -218, -218, -218, -218, -218, -218, 122, 137, -218,
738  -218, 267, -218, -218, -218, -218, -218, -218, -218, -218,
739  210, -218, 217, -218, 218, -218, 224, 32, 476, 452,
740  -218, 70, 197, -218, -218, -218, -218, -218, 181, 666,
741  666, 666, 666, 561, 816, 476, 99, -218, -218, 204,
742  212, 205, -218, -218, 214, 223, -218, -218, -218, 452,
743  452, 452, 452, 452, 452, 167, 4, 452, 452, -218,
744  816, 816, 816, 816, 816, 816, 816, 816, 816, 816,
745  816, 816, 816, 816, 816, 816, 816, 816, 816, 816,
746  816, 816, 816, 816, -218, -218, 48, 816, 72, 816,
747  816, 996, 189, 1430, -23, 245, -218, 245, 254, 89,
748  51, -218, 11, -1, 209, -218, 19, 228, 215, 12,
749  -218, 47, -218, -218, -218, 203, 816, 245, 248, 33,
750  33, 33, -218, 199, 207, 213, 230, -218, -218, 85,
751  -218, -218, -218, -218, -218, 227, 261, -218, -218, 751,
752  257, 262, 268, 269, 1038, 238, 1094, 244, 1150, 293,
753  -218, -218, -218, 296, 297, -218, -218, -218, 816, -218,
754  1430, -12, 1430, 1430, 926, 1486, 1515, 1542, 1571, 1598,
755  1627, 1627, 1059, 1059, 1059, 1059, 1115, 1115, 1171, 1227,
756  1227, 452, 452, 452, -218, 32, 245, -218, 327, 25,
757  -218, 245, -218, 328, 25, -11, 30, 816, -218, 258,
758  301, -218, 816, 816, -218, -218, 320, -218, -218, -218,
759  259, -218, 215, 215, 51, 264, -218, -218, 273, 277,
760  -218, 47, 334, -218, -218, -218, 29, -218, 245, 816,
761  816, 265, 33, -218, 279, 283, 284, -218, -218, -218,
762  -218, -218, -218, -218, -218, 318, 304, 305, 306, 307,
763  -218, -218, -218, -218, -218, -218, -218, -218, 452, -218,
764  816, 368, -218, 369, -218, -218, -218, 38, 89, 1005,
765  452, 1430, -218, -218, -218, -218, -218, -218, 51, -218,
766  -218, 1430, 1430, -218, -218, 279, 816, -218, -218, -218,
767  816, 816, 816, 816, 1459, -218, -218, -218, -218, -218,
768  -218, -218, 1430, 1206, 1262, 1318, 1374, -218, -218, -218,
769  -218
770 };
771 
772  /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
773  Performed when YYTABLE does not specify something else to do. Zero
774  means the default is an error. */
775 static const yytype_uint16 yydefact[] =
776 {
777  125, 94, 97, 106, 109, 0, 95, 264, 267, 155,
778  0, 96, 125, 0, 0, 0, 0, 0, 197, 0,
779  0, 0, 0, 0, 0, 0, 0, 0, 199, 157,
780  158, 156, 219, 220, 182, 99, 110, 111, 0, 0,
781  0, 0, 0, 0, 125, 265, 113, 0, 0, 57,
782  0, 3, 2, 8, 58, 63, 65, 0, 108, 0,
783  98, 120, 0, 127, 125, 4, 211, 154, 218, 128,
784  266, 122, 0, 55, 0, 39, 41, 43, 155, 0,
785  221, 222, 240, 251, 237, 248, 247, 234, 232, 233,
786  243, 244, 238, 239, 245, 246, 241, 242, 227, 228,
787  229, 230, 231, 249, 250, 253, 252, 0, 0, 236,
788  235, 214, 257, 258, 262, 185, 260, 261, 259, 263,
789  184, 188, 187, 191, 190, 194, 193, 0, 125, 22,
790  203, 205, 206, 204, 196, 267, 265, 121, 0, 125,
791  125, 125, 125, 125, 0, 125, 205, 206, 198, 165,
792  161, 166, 159, 183, 180, 178, 176, 216, 217, 11,
793  13, 12, 10, 16, 17, 0, 0, 14, 15, 1,
794  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
795  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
796  0, 0, 0, 0, 18, 19, 0, 0, 0, 0,
797  0, 52, 0, 59, 0, 0, 107, 0, 0, 125,
798  201, 202, 0, 137, 135, 133, 0, 125, 139, 141,
799  212, 142, 145, 147, 115, 0, 58, 0, 117, 0,
800  0, 0, 256, 0, 0, 0, 0, 255, 254, 214,
801  213, 186, 189, 192, 195, 0, 172, 163, 179, 125,
802  0, 0, 0, 0, 0, 0, 0, 0, 0, 170,
803  162, 164, 160, 174, 169, 167, 181, 177, 0, 71,
804  9, 0, 93, 92, 0, 90, 89, 88, 87, 86,
805  80, 81, 84, 85, 82, 83, 78, 79, 72, 76,
806  77, 73, 74, 75, 25, 260, 0, 28, 23, 29,
807  32, 0, 35, 30, 36, 0, 54, 58, 209, 0,
808  207, 67, 0, 0, 68, 66, 116, 123, 126, 124,
809  0, 149, 138, 136, 130, 0, 148, 152, 0, 0,
810  131, 140, 125, 144, 146, 100, 0, 118, 0, 0,
811  0, 0, 46, 47, 45, 0, 0, 225, 223, 226,
812  224, 131, 215, 101, 173, 0, 0, 0, 0, 0,
813  5, 6, 7, 21, 20, 171, 175, 168, 70, 38,
814  0, 26, 24, 33, 31, 37, 62, 0, 125, 125,
815  69, 60, 151, 129, 134, 150, 143, 153, 130, 56,
816  119, 51, 50, 40, 48, 0, 0, 42, 44, 200,
817  0, 0, 0, 0, 91, 27, 34, 53, 61, 208,
818  210, 132, 49, 0, 0, 0, 0, 102, 104, 103,
819  105
820 };
821 
822  /* YYPGOTO[NTERM-NUM]. */
823 static const yytype_int16 yypgoto[] =
824 {
825  -218, -218, 2, 13, -10, -218, -218, -218, -45, -218,
826  45, -218, -218, -218, -214, -218, -218, -218, 198, -218,
827  -218, -218, -39, -218, -188, -218, -65, 16, -108, -218,
828  -218, -218, 200, 216, -217, -215, -123, 15, 390, 237,
829  -218, -218, -218, 201, -218, -184, -5, 3, 404
830 };
831 
832  /* YYDEFGOTO[NTERM-NUM]. */
833 static const yytype_int16 yydefgoto[] =
834 {
835  -1, 50, 165, 166, 53, 229, 230, 231, 341, 342,
836  343, 307, 226, 54, 204, 55, 56, 57, 312, 58,
837  59, 60, 61, 209, 62, 63, 64, 384, 218, 388,
838  324, 219, 220, 221, 222, 223, 65, 66, 134, 329,
839  310, 67, 112, 240, 68, 69, 70, 344, 71
840 };
841 
842  /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
843  positive, shift that token. If negative, reduce the rule whose
844  number is the opposite. If YYTABLE_NINF, syntax error. */
845 static const yytype_int16 yytable[] =
846 {
847  77, 211, 51, 239, 333, 245, 334, 129, 119, 119,
848  119, 119, 336, 52, 320, 119, 120, 122, 124, 126,
849  255, 318, 325, 138, 313, 319, 212, 111, 159, 160,
850  161, 162, 163, 164, 233, 170, 170, 167, 168, 171,
851  7, 135, 113, 114, 203, 116, 211, 12, 117, 12,
852  235, 170, 72, -125, 214, 74, 202, 113, 114, 294,
853  295, 212, 73, 117, 12, 311, 215, 119, 139, 119,
854  32, 33, 140, 369, 375, 225, 313, 228, 308, 210,
855  339, 113, 114, 300, 295, 313, 269, 117, 12, 216,
856  217, 32, 33, 377, 308, 141, 321, 234, 196, 197,
857  198, 199, 200, 201, 326, 322, 323, 246, 142, 247,
858  136, 389, 118, 236, 333, -125, 334, 143, 376, 340,
859  407, 144, 319, 130, 216, 332, 355, 118, 130, 32,
860  33, 239, 296, 254, 256, 258, 259, 213, 260, 145,
861  214, 250, 251, 252, 253, 211, 157, 257, 131, 132,
862  133, 118, 351, 146, 147, 133, 301, 297, 158, 302,
863  270, -112, 272, 273, 274, 275, 276, 277, 278, 279,
864  280, 281, 282, 283, 284, 285, 286, 287, 288, 289,
865  290, 291, 292, 293, 271, 345, 346, 299, 169, 304,
866  408, 119, 170, 119, 319, -64, 205, 206, 207, 298,
867  119, 303, 119, 208, -124, 232, 154, 237, 315, 308,
868  316, 113, 114, 305, 116, 224, 203, 117, 12, 238,
869  155, 241, 119, 156, 119, 119, 119, 263, 242, 243,
870  337, 113, 114, 115, 116, 244, 248, 117, 12, 249,
871  78, 264, 212, 261, 265, 13, 14, 15, 16, 268,
872  18, 262, 20, 266, 113, 114, 410, 116, 368, 383,
873  117, 12, 267, 317, 28, 29, 30, 31, 32, 33,
874  34, 338, 113, 114, 121, 116, 215, 311, 117, 12,
875  213, 118, 330, 214, 347, 335, 227, 113, 114, 123,
876  116, 119, 348, 117, 12, 215, 119, 203, 349, 371,
877  354, 118, 380, 381, 373, 216, 217, 32, 33, 353,
878  327, 113, 114, 125, 116, 350, 356, 117, 12, 213,
879  361, 357, 214, 383, 118, 212, 363, 358, 359, 391,
880  392, -125, 365, 119, 215, 366, 367, 119, 372, 374,
881  378, 390, 118, -114, 382, 395, 78, 149, 379, 385,
882  393, 13, 14, 15, 16, 386, 18, 118, 20, 387,
883  404, 150, 151, 213, 152, 396, 214, 153, 397, 398,
884  28, 29, 30, 31, 32, 33, 34, 399, 215, 405,
885  406, 118, 400, 401, 402, 403, 412, 394, 216, 217,
886  413, 414, 415, 416, 1, 2, 3, 4, 5, 6,
887  7, 8, 314, 9, 411, 10, 11, 12, 13, 14,
888  15, 16, 17, 18, 19, 20, 327, 328, 148, 21,
889  22, 23, 24, 137, 25, 26, 27, 28, 29, 30,
890  31, 32, 33, 34, 35, 331, 36, 37, 309, 0,
891  352, 0, 0, 0, 0, 0, 38, 0, 0, 0,
892  0, 0, 0, 0, 0, -125, 39, 40, 41, 0,
893  0, 0, 42, 43, 0, 0, 171, 0, 0, 44,
894  45, 46, 0, 0, 47, 48, 0, 0, 49, 1,
895  2, 3, 4, 5, 6, 7, 8, 0, 9, 0,
896  10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
897  20, 0, 0, 0, 21, 22, 23, 24, 0, 25,
898  26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
899  0, 36, 37, 194, 195, 196, 197, 198, 199, 200,
900  201, 38, 0, 0, 0, 0, 0, 0, 0, 0,
901  0, 39, 40, 41, 0, 0, 0, 42, 43, 0,
902  0, 0, 0, 0, 44, 45, 46, 0, 0, 47,
903  48, 0, 0, 49, 1, 2, 3, 4, 5, 6,
904  7, 8, 0, 9, 0, 10, 11, 12, 13, 14,
905  15, 16, 17, 18, 19, 20, 0, 0, 0, 21,
906  22, 23, 24, 0, 0, 0, 27, 28, 29, 30,
907  31, 32, 33, 34, 35, 0, 36, 37, 0, 0,
908  0, 0, 0, 0, 0, 0, 38, 0, 0, 0,
909  0, 0, 0, 0, 0, 0, 39, 40, 41, 0,
910  0, 0, 42, 43, 0, 0, 0, 0, 0, 44,
911  45, 46, 0, 0, 47, 48, 0, 0, 49, 1,
912  2, 3, 4, 5, 6, 7, 8, 0, 75, 76,
913  10, 11, 12, 0, 0, 0, 0, 17, 0, 19,
914  0, 0, 0, 0, 21, 22, 23, 24, 78, 0,
915  0, 27, 0, 13, 14, 15, 16, 0, 18, 35,
916  20, 36, 37, 0, 0, 0, 0, 0, 0, 25,
917  26, 38, 28, 29, 30, 31, 32, 33, 34, 0,
918  0, 39, 40, 41, 0, 0, 0, 42, 43, 0,
919  0, 0, 0, 0, 44, 45, 46, 0, 0, 47,
920  48, 0, 0, 49, 1, 2, 3, 4, 5, 6,
921  7, 8, 0, 127, 0, 10, 11, 12, 0, 0,
922  0, 0, 17, 0, 19, 0, 0, 0, 0, 21,
923  22, 23, 24, 78, 0, 0, 27, 0, 13, 14,
924  15, 16, 0, 18, 35, 20, 36, 37, 0, 0,
925  0, 0, 0, 0, 0, 0, 38, 28, 29, 30,
926  31, 32, 33, 34, 0, 0, 39, 40, 41, 0,
927  0, 0, 42, 43, 0, 0, 0, 0, 0, 128,
928  45, 46, 0, 0, 47, 48, 0, 0, 49, 1,
929  2, 3, 4, 5, 6, 7, 8, 0, 127, 0,
930  10, 11, 12, 0, 0, 0, 0, 17, 0, 19,
931  0, 0, 0, 0, 21, 22, 23, 24, 0, 0,
932  0, 27, 0, 0, 0, 0, 0, 0, 0, 35,
933  0, 36, 37, 0, 0, 0, 0, 0, 0, 0,
934  0, 38, 0, 0, 0, 0, 0, 0, 0, 0,
935  0, 39, 40, 41, 0, 0, 0, 42, 43, 0,
936  0, 0, 0, 0, 44, 45, 46, 0, 0, 47,
937  48, 0, 78, 49, 79, 0, 0, 13, 14, 15,
938  16, 0, 18, 0, 20, 0, 80, 81, 0, 0,
939  0, 0, 0, 0, 0, 0, 28, 29, 30, 31,
940  32, 33, 34, 0, 82, 0, 0, 83, 0, 84,
941  171, 85, 86, 87, 88, 89, 90, 91, 92, 93,
942  94, 95, 96, 97, 0, 98, 99, 100, 101, 102,
943  0, 103, 104, 105, 106, 0, 0, 107, 108, 0,
944  172, 0, 0, 109, 110, 173, 174, 175, 176, 177,
945  178, 179, 180, 181, 182, 183, 184, 185, 186, 187,
946  188, 189, 190, 191, 192, 193, 0, 194, 195, 196,
947  197, 198, 199, 200, 201, 0, 0, 0, 78, 0,
948  0, 0, 370, 13, 14, 15, 16, 78, 18, 0,
949  20, 0, 13, 14, 15, 16, 0, 18, 0, 20,
950  0, 0, 28, 29, 30, 31, 32, 33, 34, 0,
951  0, 28, 29, 30, 31, 32, 33, 34, 0, 0,
952  0, 0, 171, 0, 0, 0, 0, 0, 0, 0,
953  -125, 0, 0, 0, 0, 0, 0, 0, 0, 0,
954  0, 0, 0, 171, 0, 0, 0, 0, 306, 0,
955  0, 0, 172, 0, 0, 0, 409, 173, 174, 175,
956  176, 177, 178, 179, 180, 181, 182, 183, 184, 185,
957  186, 187, 188, 189, 190, 191, 192, 193, 171, 194,
958  195, 196, 197, 198, 199, 200, 201, 0, 0, 0,
959  360, 186, 187, 188, 189, 190, 191, 192, 193, 171,
960  194, 195, 196, 197, 198, 199, 200, 201, 172, 0,
961  0, 0, 0, 173, 174, 175, 176, 177, 178, 179,
962  180, 181, 182, 183, 184, 185, 186, 187, 188, 189,
963  190, 191, 192, 193, 171, 194, 195, 196, 197, 198,
964  199, 200, 201, 0, 0, 0, 362, 0, 0, 188,
965  189, 190, 191, 192, 193, 171, 194, 195, 196, 197,
966  198, 199, 200, 201, 172, 0, 0, 0, 0, 173,
967  174, 175, 176, 177, 178, 179, 180, 181, 182, 183,
968  184, 185, 186, 187, 188, 189, 190, 191, 192, 193,
969  171, 194, 195, 196, 197, 198, 199, 200, 201, 0,
970  0, 0, 364, 0, 0, 0, 189, 190, 191, 192,
971  193, 171, 194, 195, 196, 197, 198, 199, 200, 201,
972  172, 0, 0, 0, 0, 173, 174, 175, 176, 177,
973  178, 179, 180, 181, 182, 183, 184, 185, 186, 187,
974  188, 189, 190, 191, 192, 193, 171, 194, 195, 196,
975  197, 198, 199, 200, 201, 0, 0, 0, 417, 0,
976  0, 0, 0, 0, 191, 192, 193, 0, 194, 195,
977  196, 197, 198, 199, 200, 201, 172, 0, 0, 0,
978  0, 173, 174, 175, 176, 177, 178, 179, 180, 181,
979  182, 183, 184, 185, 186, 187, 188, 189, 190, 191,
980  192, 193, 171, 194, 195, 196, 197, 198, 199, 200,
981  201, 0, 0, 0, 418, 0, 0, 0, 0, 0,
982  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
983  0, 0, 172, 0, 0, 0, 0, 173, 174, 175,
984  176, 177, 178, 179, 180, 181, 182, 183, 184, 185,
985  186, 187, 188, 189, 190, 191, 192, 193, 171, 194,
986  195, 196, 197, 198, 199, 200, 201, 0, 0, 0,
987  419, 0, 0, 0, 0, 0, 0, 0, 0, 0,
988  0, 0, 0, 0, 0, 0, 0, 0, 172, 0,
989  0, 0, 0, 173, 174, 175, 176, 177, 178, 179,
990  180, 181, 182, 183, 184, 185, 186, 187, 188, 189,
991  190, 191, 192, 193, 171, 194, 195, 196, 197, 198,
992  199, 200, 201, 0, 0, 0, 420, 0, 0, 0,
993  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
994  0, 0, 0, 171, 172, 0, 0, 0, 0, 173,
995  174, 175, 176, 177, 178, 179, 180, 181, 182, 183,
996  184, 185, 186, 187, 188, 189, 190, 191, 192, 193,
997  171, 194, 195, 196, 197, 198, 199, 200, 201, 174,
998  175, 176, 177, 178, 179, 180, 181, 182, 183, 184,
999  185, 186, 187, 188, 189, 190, 191, 192, 193, 171,
1000  194, 195, 196, 197, 198, 199, 200, 201, 176, 177,
1001  178, 179, 180, 181, 182, 183, 184, 185, 186, 187,
1002  188, 189, 190, 191, 192, 193, 171, 194, 195, 196,
1003  197, 198, 199, 200, 201, 0, 0, 0, 177, 178,
1004  179, 180, 181, 182, 183, 184, 185, 186, 187, 188,
1005  189, 190, 191, 192, 193, 171, 194, 195, 196, 197,
1006  198, 199, 200, 201, 0, 0, 178, 179, 180, 181,
1007  182, 183, 184, 185, 186, 187, 188, 189, 190, 191,
1008  192, 193, 171, 194, 195, 196, 197, 198, 199, 200,
1009  201, 0, 0, 0, 0, 0, 179, 180, 181, 182,
1010  183, 184, 185, 186, 187, 188, 189, 190, 191, 192,
1011  193, 171, 194, 195, 196, 197, 198, 199, 200, 201,
1012  0, 0, 0, 0, 180, 181, 182, 183, 184, 185,
1013  186, 187, 188, 189, 190, 191, 192, 193, 0, 194,
1014  195, 196, 197, 198, 199, 200, 201, 0, 0, 0,
1015  0, 0, 0, 0, 0, 182, 183, 184, 185, 186,
1016  187, 188, 189, 190, 191, 192, 193, 0, 194, 195,
1017  196, 197, 198, 199, 200, 201
1018 };
1019 
1020 static const yytype_int16 yycheck[] =
1021 {
1022  10, 66, 0, 111, 221, 128, 221, 17, 13, 14,
1023  15, 16, 226, 0, 3, 20, 13, 14, 15, 16,
1024  143, 209, 3, 20, 47, 209, 14, 12, 38, 39,
1025  40, 41, 42, 43, 14, 47, 47, 47, 48, 14,
1026  9, 10, 9, 10, 54, 12, 111, 16, 15, 16,
1027  14, 47, 78, 23, 55, 23, 54, 9, 10, 11,
1028  12, 14, 78, 15, 16, 88, 67, 72, 58, 74,
1029  40, 41, 58, 85, 85, 72, 47, 74, 201, 64,
1030  47, 9, 10, 11, 12, 47, 82, 15, 16, 77,
1031  78, 40, 41, 307, 217, 58, 85, 77, 73, 74,
1032  75, 76, 77, 78, 85, 213, 214, 37, 58, 39,
1033  79, 82, 79, 77, 331, 64, 331, 78, 306, 86,
1034  82, 78, 306, 12, 77, 78, 249, 79, 12, 40,
1035  41, 239, 84, 143, 144, 145, 37, 52, 39, 78,
1036  55, 139, 140, 141, 142, 210, 41, 145, 37, 38,
1037  39, 79, 67, 37, 38, 39, 84, 196, 40, 198,
1038  170, 23, 172, 173, 174, 175, 176, 177, 178, 179,
1039  180, 181, 182, 183, 184, 185, 186, 187, 188, 189,
1040  190, 191, 192, 193, 171, 230, 231, 197, 0, 199,
1041  378, 196, 47, 198, 378, 23, 23, 5, 23, 196,
1042  205, 198, 207, 64, 64, 85, 22, 85, 205, 332,
1043  207, 9, 10, 200, 12, 32, 226, 15, 16, 82,
1044  36, 11, 227, 39, 229, 230, 231, 22, 11, 11,
1045  227, 9, 10, 11, 12, 11, 39, 15, 16, 58,
1046  12, 36, 14, 39, 39, 17, 18, 19, 20, 82,
1047  22, 39, 24, 39, 9, 10, 379, 12, 268, 324,
1048  15, 16, 39, 9, 36, 37, 38, 39, 40, 41,
1049  42, 23, 9, 10, 11, 12, 67, 88, 15, 16,
1050  52, 79, 67, 55, 85, 82, 84, 9, 10, 11,
1051  12, 296, 85, 15, 16, 67, 301, 307, 85, 296,
1052  39, 79, 312, 313, 301, 77, 78, 40, 41, 82,
1053  82, 9, 10, 11, 12, 85, 59, 15, 16, 52,
1054  82, 59, 55, 388, 79, 14, 82, 59, 59, 339,
1055  340, 64, 39, 338, 67, 39, 39, 342, 11, 11,
1056  82, 338, 79, 23, 85, 342, 12, 22, 47, 85,
1057  85, 17, 18, 19, 20, 82, 22, 79, 24, 82,
1058  370, 36, 37, 52, 39, 86, 55, 42, 85, 85,
1059  36, 37, 38, 39, 40, 41, 42, 59, 67, 11,
1060  11, 79, 78, 78, 78, 78, 396, 342, 77, 78,
1061  400, 401, 402, 403, 3, 4, 5, 6, 7, 8,
1062  9, 10, 204, 12, 388, 14, 15, 16, 17, 18,
1063  19, 20, 21, 22, 23, 24, 82, 217, 28, 28,
1064  29, 30, 31, 19, 33, 34, 35, 36, 37, 38,
1065  39, 40, 41, 42, 43, 219, 45, 46, 201, -1,
1066  239, -1, -1, -1, -1, -1, 55, -1, -1, -1,
1067  -1, -1, -1, -1, -1, 64, 65, 66, 67, -1,
1068  -1, -1, 71, 72, -1, -1, 14, -1, -1, 78,
1069  79, 80, -1, -1, 83, 84, -1, -1, 87, 3,
1070  4, 5, 6, 7, 8, 9, 10, -1, 12, -1,
1071  14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
1072  24, -1, -1, -1, 28, 29, 30, 31, -1, 33,
1073  34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
1074  -1, 45, 46, 71, 72, 73, 74, 75, 76, 77,
1075  78, 55, -1, -1, -1, -1, -1, -1, -1, -1,
1076  -1, 65, 66, 67, -1, -1, -1, 71, 72, -1,
1077  -1, -1, -1, -1, 78, 79, 80, -1, -1, 83,
1078  84, -1, -1, 87, 3, 4, 5, 6, 7, 8,
1079  9, 10, -1, 12, -1, 14, 15, 16, 17, 18,
1080  19, 20, 21, 22, 23, 24, -1, -1, -1, 28,
1081  29, 30, 31, -1, -1, -1, 35, 36, 37, 38,
1082  39, 40, 41, 42, 43, -1, 45, 46, -1, -1,
1083  -1, -1, -1, -1, -1, -1, 55, -1, -1, -1,
1084  -1, -1, -1, -1, -1, -1, 65, 66, 67, -1,
1085  -1, -1, 71, 72, -1, -1, -1, -1, -1, 78,
1086  79, 80, -1, -1, 83, 84, -1, -1, 87, 3,
1087  4, 5, 6, 7, 8, 9, 10, -1, 12, 13,
1088  14, 15, 16, -1, -1, -1, -1, 21, -1, 23,
1089  -1, -1, -1, -1, 28, 29, 30, 31, 12, -1,
1090  -1, 35, -1, 17, 18, 19, 20, -1, 22, 43,
1091  24, 45, 46, -1, -1, -1, -1, -1, -1, 33,
1092  34, 55, 36, 37, 38, 39, 40, 41, 42, -1,
1093  -1, 65, 66, 67, -1, -1, -1, 71, 72, -1,
1094  -1, -1, -1, -1, 78, 79, 80, -1, -1, 83,
1095  84, -1, -1, 87, 3, 4, 5, 6, 7, 8,
1096  9, 10, -1, 12, -1, 14, 15, 16, -1, -1,
1097  -1, -1, 21, -1, 23, -1, -1, -1, -1, 28,
1098  29, 30, 31, 12, -1, -1, 35, -1, 17, 18,
1099  19, 20, -1, 22, 43, 24, 45, 46, -1, -1,
1100  -1, -1, -1, -1, -1, -1, 55, 36, 37, 38,
1101  39, 40, 41, 42, -1, -1, 65, 66, 67, -1,
1102  -1, -1, 71, 72, -1, -1, -1, -1, -1, 78,
1103  79, 80, -1, -1, 83, 84, -1, -1, 87, 3,
1104  4, 5, 6, 7, 8, 9, 10, -1, 12, -1,
1105  14, 15, 16, -1, -1, -1, -1, 21, -1, 23,
1106  -1, -1, -1, -1, 28, 29, 30, 31, -1, -1,
1107  -1, 35, -1, -1, -1, -1, -1, -1, -1, 43,
1108  -1, 45, 46, -1, -1, -1, -1, -1, -1, -1,
1109  -1, 55, -1, -1, -1, -1, -1, -1, -1, -1,
1110  -1, 65, 66, 67, -1, -1, -1, 71, 72, -1,
1111  -1, -1, -1, -1, 78, 79, 80, -1, -1, 83,
1112  84, -1, 12, 87, 14, -1, -1, 17, 18, 19,
1113  20, -1, 22, -1, 24, -1, 26, 27, -1, -1,
1114  -1, -1, -1, -1, -1, -1, 36, 37, 38, 39,
1115  40, 41, 42, -1, 44, -1, -1, 47, -1, 49,
1116  14, 51, 52, 53, 54, 55, 56, 57, 58, 59,
1117  60, 61, 62, 63, -1, 65, 66, 67, 68, 69,
1118  -1, 71, 72, 73, 74, -1, -1, 77, 78, -1,
1119  44, -1, -1, 83, 84, 49, 50, 51, 52, 53,
1120  54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
1121  64, 65, 66, 67, 68, 69, -1, 71, 72, 73,
1122  74, 75, 76, 77, 78, -1, -1, -1, 12, -1,
1123  -1, -1, 86, 17, 18, 19, 20, 12, 22, -1,
1124  24, -1, 17, 18, 19, 20, -1, 22, -1, 24,
1125  -1, -1, 36, 37, 38, 39, 40, 41, 42, -1,
1126  -1, 36, 37, 38, 39, 40, 41, 42, -1, -1,
1127  -1, -1, 14, -1, -1, -1, -1, -1, -1, -1,
1128  64, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1129  -1, -1, -1, 14, -1, -1, -1, -1, 82, -1,
1130  -1, -1, 44, -1, -1, -1, 81, 49, 50, 51,
1131  52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
1132  62, 63, 64, 65, 66, 67, 68, 69, 14, 71,
1133  72, 73, 74, 75, 76, 77, 78, -1, -1, -1,
1134  82, 62, 63, 64, 65, 66, 67, 68, 69, 14,
1135  71, 72, 73, 74, 75, 76, 77, 78, 44, -1,
1136  -1, -1, -1, 49, 50, 51, 52, 53, 54, 55,
1137  56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
1138  66, 67, 68, 69, 14, 71, 72, 73, 74, 75,
1139  76, 77, 78, -1, -1, -1, 82, -1, -1, 64,
1140  65, 66, 67, 68, 69, 14, 71, 72, 73, 74,
1141  75, 76, 77, 78, 44, -1, -1, -1, -1, 49,
1142  50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
1143  60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
1144  14, 71, 72, 73, 74, 75, 76, 77, 78, -1,
1145  -1, -1, 82, -1, -1, -1, 65, 66, 67, 68,
1146  69, 14, 71, 72, 73, 74, 75, 76, 77, 78,
1147  44, -1, -1, -1, -1, 49, 50, 51, 52, 53,
1148  54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
1149  64, 65, 66, 67, 68, 69, 14, 71, 72, 73,
1150  74, 75, 76, 77, 78, -1, -1, -1, 82, -1,
1151  -1, -1, -1, -1, 67, 68, 69, -1, 71, 72,
1152  73, 74, 75, 76, 77, 78, 44, -1, -1, -1,
1153  -1, 49, 50, 51, 52, 53, 54, 55, 56, 57,
1154  58, 59, 60, 61, 62, 63, 64, 65, 66, 67,
1155  68, 69, 14, 71, 72, 73, 74, 75, 76, 77,
1156  78, -1, -1, -1, 82, -1, -1, -1, -1, -1,
1157  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1158  -1, -1, 44, -1, -1, -1, -1, 49, 50, 51,
1159  52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
1160  62, 63, 64, 65, 66, 67, 68, 69, 14, 71,
1161  72, 73, 74, 75, 76, 77, 78, -1, -1, -1,
1162  82, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1163  -1, -1, -1, -1, -1, -1, -1, -1, 44, -1,
1164  -1, -1, -1, 49, 50, 51, 52, 53, 54, 55,
1165  56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
1166  66, 67, 68, 69, 14, 71, 72, 73, 74, 75,
1167  76, 77, 78, -1, -1, -1, 82, -1, -1, -1,
1168  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1169  -1, -1, -1, 14, 44, -1, -1, -1, -1, 49,
1170  50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
1171  60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
1172  14, 71, 72, 73, 74, 75, 76, 77, 78, 50,
1173  51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
1174  61, 62, 63, 64, 65, 66, 67, 68, 69, 14,
1175  71, 72, 73, 74, 75, 76, 77, 78, 52, 53,
1176  54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
1177  64, 65, 66, 67, 68, 69, 14, 71, 72, 73,
1178  74, 75, 76, 77, 78, -1, -1, -1, 53, 54,
1179  55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
1180  65, 66, 67, 68, 69, 14, 71, 72, 73, 74,
1181  75, 76, 77, 78, -1, -1, 54, 55, 56, 57,
1182  58, 59, 60, 61, 62, 63, 64, 65, 66, 67,
1183  68, 69, 14, 71, 72, 73, 74, 75, 76, 77,
1184  78, -1, -1, -1, -1, -1, 55, 56, 57, 58,
1185  59, 60, 61, 62, 63, 64, 65, 66, 67, 68,
1186  69, 14, 71, 72, 73, 74, 75, 76, 77, 78,
1187  -1, -1, -1, -1, 56, 57, 58, 59, 60, 61,
1188  62, 63, 64, 65, 66, 67, 68, 69, -1, 71,
1189  72, 73, 74, 75, 76, 77, 78, -1, -1, -1,
1190  -1, -1, -1, -1, -1, 58, 59, 60, 61, 62,
1191  63, 64, 65, 66, 67, 68, 69, -1, 71, 72,
1192  73, 74, 75, 76, 77, 78
1193 };
1194 
1195  /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1196  symbol of state STATE-NUM. */
1197 static const yytype_uint8 yystos[] =
1198 {
1199  0, 3, 4, 5, 6, 7, 8, 9, 10, 12,
1200  14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
1201  24, 28, 29, 30, 31, 33, 34, 35, 36, 37,
1202  38, 39, 40, 41, 42, 43, 45, 46, 55, 65,
1203  66, 67, 71, 72, 78, 79, 80, 83, 84, 87,
1204  90, 91, 92, 93, 102, 104, 105, 106, 108, 109,
1205  110, 111, 113, 114, 115, 125, 126, 130, 133, 134,
1206  135, 137, 78, 78, 23, 12, 13, 93, 12, 14,
1207  26, 27, 44, 47, 49, 51, 52, 53, 54, 55,
1208  56, 57, 58, 59, 60, 61, 62, 63, 65, 66,
1209  67, 68, 69, 71, 72, 73, 74, 77, 78, 83,
1210  84, 126, 131, 9, 10, 11, 12, 15, 79, 135,
1211  136, 11, 136, 11, 136, 11, 136, 12, 78, 93,
1212  12, 37, 38, 39, 127, 10, 79, 137, 136, 58,
1213  58, 58, 58, 78, 78, 78, 37, 38, 127, 22,
1214  36, 37, 39, 42, 22, 36, 39, 41, 40, 93,
1215  93, 93, 93, 93, 93, 91, 92, 93, 93, 0,
1216  47, 14, 44, 49, 50, 51, 52, 53, 54, 55,
1217  56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
1218  66, 67, 68, 69, 71, 72, 73, 74, 75, 76,
1219  77, 78, 91, 93, 103, 23, 5, 23, 64, 112,
1220  126, 115, 14, 52, 55, 67, 77, 78, 117, 120,
1221  121, 122, 123, 124, 32, 136, 101, 84, 136, 94,
1222  95, 96, 85, 14, 77, 14, 77, 85, 82, 117,
1223  132, 11, 11, 11, 11, 125, 37, 39, 39, 58,
1224  91, 91, 91, 91, 93, 125, 93, 91, 93, 37,
1225  39, 39, 39, 22, 36, 39, 39, 39, 82, 82,
1226  93, 92, 93, 93, 93, 93, 93, 93, 93, 93,
1227  93, 93, 93, 93, 93, 93, 93, 93, 93, 93,
1228  93, 93, 93, 93, 11, 12, 84, 111, 136, 93,
1229  11, 84, 111, 136, 93, 92, 82, 100, 125, 128,
1230  129, 88, 107, 47, 107, 136, 136, 9, 113, 134,
1231  3, 85, 117, 117, 119, 3, 85, 82, 121, 128,
1232  67, 122, 78, 123, 124, 82, 103, 136, 23, 47,
1233  86, 97, 98, 99, 136, 97, 97, 85, 85, 85,
1234  85, 67, 132, 82, 39, 125, 59, 59, 59, 59,
1235  82, 82, 82, 82, 82, 39, 39, 39, 93, 85,
1236  86, 136, 11, 136, 11, 85, 113, 103, 82, 47,
1237  93, 93, 85, 115, 116, 85, 82, 82, 118, 82,
1238  136, 93, 93, 85, 99, 136, 86, 85, 85, 59,
1239  78, 78, 78, 78, 93, 11, 11, 82, 113, 81,
1240  125, 116, 93, 93, 93, 93, 93, 82, 82, 82,
1241  82
1242 };
1243 
1244  /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
1245 static const yytype_uint8 yyr1[] =
1246 {
1247  0, 89, 90, 90, 91, 91, 91, 91, 92, 92,
1248  93, 93, 93, 93, 93, 93, 93, 93, 93, 93,
1249  93, 93, 93, 93, 93, 93, 93, 93, 93, 93,
1250  93, 93, 93, 93, 93, 93, 93, 93, 93, 94,
1251  93, 95, 93, 96, 93, 97, 97, 98, 98, 99,
1252  99, 99, 100, 93, 93, 101, 93, 102, 103, 103,
1253  103, 104, 105, 93, 106, 106, 93, 107, 93, 93,
1254  93, 93, 93, 93, 93, 93, 93, 93, 93, 93,
1255  93, 93, 93, 93, 93, 93, 93, 93, 93, 93,
1256  93, 93, 93, 93, 93, 93, 93, 93, 93, 93,
1257  93, 93, 93, 93, 93, 93, 108, 108, 93, 93,
1258  93, 93, 109, 109, 109, 110, 110, 111, 111, 111,
1259  110, 110, 110, 112, 113, 113, 114, 115, 115, 116,
1260  116, 118, 117, 119, 117, 117, 117, 117, 117, 120,
1261  121, 121, 121, 122, 122, 122, 122, 122, 123, 123,
1262  123, 123, 124, 124, 125, 126, 126, 126, 126, 126,
1263  126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
1264  126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
1265  126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
1266  126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
1267  126, 126, 126, 127, 127, 127, 127, 128, 128, 129,
1268  129, 130, 130, 131, 132, 132, 133, 133, 134, 134,
1269  134, 135, 135, 135, 135, 135, 135, 135, 135, 135,
1270  135, 135, 135, 135, 135, 135, 135, 135, 135, 135,
1271  135, 135, 135, 135, 135, 135, 135, 135, 135, 135,
1272  135, 135, 135, 135, 135, 135, 135, 135, 136, 136,
1273  136, 136, 136, 136, 137, 137, 137, 137
1274 };
1275 
1276  /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
1277 static const yytype_uint8 yyr2[] =
1278 {
1279  0, 2, 1, 1, 1, 4, 4, 4, 1, 3,
1280  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1281  4, 4, 2, 3, 4, 3, 4, 5, 3, 3,
1282  3, 4, 3, 4, 5, 3, 3, 4, 4, 0,
1283  5, 0, 5, 0, 5, 1, 1, 1, 2, 3,
1284  2, 2, 0, 5, 3, 0, 5, 1, 0, 1,
1285  3, 5, 4, 1, 1, 1, 3, 1, 3, 4,
1286  4, 3, 3, 3, 3, 3, 3, 3, 3, 3,
1287  3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
1288  3, 5, 3, 3, 1, 1, 1, 1, 1, 1,
1289  4, 4, 7, 7, 7, 7, 1, 2, 1, 1,
1290  1, 1, 1, 1, 3, 2, 3, 3, 4, 5,
1291  1, 2, 1, 2, 1, 0, 3, 1, 1, 1,
1292  0, 0, 4, 0, 3, 1, 2, 1, 2, 1,
1293  2, 1, 1, 3, 2, 1, 2, 1, 2, 2,
1294  3, 3, 2, 3, 1, 1, 1, 1, 1, 2,
1295  3, 2, 3, 3, 3, 2, 2, 3, 4, 3,
1296  3, 4, 3, 4, 3, 4, 2, 3, 2, 3,
1297  2, 3, 1, 2, 2, 2, 3, 2, 2, 3,
1298  2, 2, 3, 2, 2, 3, 2, 1, 2, 1,
1299  5, 2, 2, 1, 1, 1, 1, 1, 3, 1,
1300  3, 1, 2, 2, 0, 2, 2, 2, 1, 1,
1301  1, 2, 2, 4, 4, 4, 4, 2, 2, 2,
1302  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1303  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1304  2, 2, 2, 2, 3, 3, 3, 2, 1, 1,
1305  1, 1, 1, 1, 1, 1, 1, 1
1306 };
1307 
1308 
1309 #define yyerrok (yyerrstatus = 0)
1310 #define yyclearin (yychar = YYEMPTY)
1311 #define YYEMPTY (-2)
1312 #define YYEOF 0
1313 
1314 #define YYACCEPT goto yyacceptlab
1315 #define YYABORT goto yyabortlab
1316 #define YYERROR goto yyerrorlab
1317 
1318 
1319 #define YYRECOVERING() (!!yyerrstatus)
1320 
1321 #define YYBACKUP(Token, Value) \
1322 do \
1323  if (yychar == YYEMPTY) \
1324  { \
1325  yychar = (Token); \
1326  yylval = (Value); \
1327  YYPOPSTACK (yylen); \
1328  yystate = *yyssp; \
1329  goto yybackup; \
1330  } \
1331  else \
1332  { \
1333  yyerror (YY_("syntax error: cannot back up")); \
1334  YYERROR; \
1335  } \
1336 while (0)
1337 
1338 /* Error token number */
1339 #define YYTERROR 1
1340 #define YYERRCODE 256
1341 
1342 
1343 
1344 /* Enable debugging if requested. */
1345 #if YYDEBUG
1346 
1347 # ifndef YYFPRINTF
1348 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1349 # define YYFPRINTF fprintf
1350 # endif
1351 
1352 # define YYDPRINTF(Args) \
1353 do { \
1354  if (yydebug) \
1355  YYFPRINTF Args; \
1356 } while (0)
1357 
1358 /* This macro is provided for backward compatibility. */
1359 #ifndef YY_LOCATION_PRINT
1360 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1361 #endif
1362 
1363 
1364 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1365 do { \
1366  if (yydebug) \
1367  { \
1368  YYFPRINTF (stderr, "%s ", Title); \
1369  yy_symbol_print (stderr, \
1370  Type, Value); \
1371  YYFPRINTF (stderr, "\n"); \
1372  } \
1373 } while (0)
1374 
1375 
1376 /*----------------------------------------.
1377 | Print this symbol's value on YYOUTPUT. |
1378 `----------------------------------------*/
1379 
1380 static void
1381 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1382 {
1383  FILE *yyo = yyoutput;
1384  YYUSE (yyo);
1385  if (!yyvaluep)
1386  return;
1387 # ifdef YYPRINT
1388  if (yytype < YYNTOKENS)
1389  YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1390 # endif
1391  YYUSE (yytype);
1392 }
1393 
1394 
1395 /*--------------------------------.
1396 | Print this symbol on YYOUTPUT. |
1397 `--------------------------------*/
1398 
1399 static void
1400 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1401 {
1402  YYFPRINTF (yyoutput, "%s %s (",
1403  yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
1404 
1405  yy_symbol_value_print (yyoutput, yytype, yyvaluep);
1406  YYFPRINTF (yyoutput, ")");
1407 }
1408 
1409 /*------------------------------------------------------------------.
1410 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1411 | TOP (included). |
1412 `------------------------------------------------------------------*/
1413 
1414 static void
1416 {
1417  YYFPRINTF (stderr, "Stack now");
1418  for (; yybottom <= yytop; yybottom++)
1419  {
1420  int yybot = *yybottom;
1421  YYFPRINTF (stderr, " %d", yybot);
1422  }
1423  YYFPRINTF (stderr, "\n");
1424 }
1425 
1426 # define YY_STACK_PRINT(Bottom, Top) \
1427 do { \
1428  if (yydebug) \
1429  yy_stack_print ((Bottom), (Top)); \
1430 } while (0)
1431 
1432 
1433 /*------------------------------------------------.
1434 | Report that the YYRULE is going to be reduced. |
1435 `------------------------------------------------*/
1436 
1437 static void
1439 {
1440  unsigned long int yylno = yyrline[yyrule];
1441  int yynrhs = yyr2[yyrule];
1442  int yyi;
1443  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1444  yyrule - 1, yylno);
1445  /* The symbols being reduced. */
1446  for (yyi = 0; yyi < yynrhs; yyi++)
1447  {
1448  YYFPRINTF (stderr, " $%d = ", yyi + 1);
1449  yy_symbol_print (stderr,
1450  yystos[yyssp[yyi + 1 - yynrhs]],
1451  &(yyvsp[(yyi + 1) - (yynrhs)])
1452  );
1453  YYFPRINTF (stderr, "\n");
1454  }
1455 }
1456 
1457 # define YY_REDUCE_PRINT(Rule) \
1458 do { \
1459  if (yydebug) \
1460  yy_reduce_print (yyssp, yyvsp, Rule); \
1461 } while (0)
1462 
1463 /* Nonzero means print parse trace. It is left uninitialized so that
1464  multiple parsers can coexist. */
1466 #else /* !YYDEBUG */
1467 # define YYDPRINTF(Args)
1468 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1469 # define YY_STACK_PRINT(Bottom, Top)
1470 # define YY_REDUCE_PRINT(Rule)
1471 #endif /* !YYDEBUG */
1472 
1473 
1474 /* YYINITDEPTH -- initial size of the parser's stacks. */
1475 #ifndef YYINITDEPTH
1476 # define YYINITDEPTH 200
1477 #endif
1478 
1479 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1480  if the built-in stack extension method is used).
1481 
1482  Do not make this value too large; the results are undefined if
1483  YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1484  evaluated with infinite-precision integer arithmetic. */
1485 
1486 #ifndef YYMAXDEPTH
1487 # define YYMAXDEPTH 10000
1488 #endif
1489 
1490 
1491 #if YYERROR_VERBOSE
1492 
1493 # ifndef yystrlen
1494 # if defined __GLIBC__ && defined _STRING_H
1495 # define yystrlen strlen
1496 # else
1497 /* Return the length of YYSTR. */
1498 static YYSIZE_T
1499 yystrlen (const char *yystr)
1500 {
1501  YYSIZE_T yylen;
1502  for (yylen = 0; yystr[yylen]; yylen++)
1503  continue;
1504  return yylen;
1505 }
1506 # endif
1507 # endif
1508 
1509 # ifndef yystpcpy
1510 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1511 # define yystpcpy stpcpy
1512 # else
1513 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1514  YYDEST. */
1515 static char *
1516 yystpcpy (char *yydest, const char *yysrc)
1517 {
1518  char *yyd = yydest;
1519  const char *yys = yysrc;
1520 
1521  while ((*yyd++ = *yys++) != '\0')
1522  continue;
1523 
1524  return yyd - 1;
1525 }
1526 # endif
1527 # endif
1528 
1529 # ifndef yytnamerr
1530 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1531  quotes and backslashes, so that it's suitable for yyerror. The
1532  heuristic is that double-quoting is unnecessary unless the string
1533  contains an apostrophe, a comma, or backslash (other than
1534  backslash-backslash). YYSTR is taken from yytname. If YYRES is
1535  null, do not copy; instead, return the length of what the result
1536  would have been. */
1537 static YYSIZE_T
1538 yytnamerr (char *yyres, const char *yystr)
1539 {
1540  if (*yystr == '"')
1541  {
1542  YYSIZE_T yyn = 0;
1543  char const *yyp = yystr;
1544 
1545  for (;;)
1546  switch (*++yyp)
1547  {
1548  case '\'':
1549  case ',':
1550  goto do_not_strip_quotes;
1551 
1552  case '\\':
1553  if (*++yyp != '\\')
1554  goto do_not_strip_quotes;
1555  /* Fall through. */
1556  default:
1557  if (yyres)
1558  yyres[yyn] = *yyp;
1559  yyn++;
1560  break;
1561 
1562  case '"':
1563  if (yyres)
1564  yyres[yyn] = '\0';
1565  return yyn;
1566  }
1567  do_not_strip_quotes: ;
1568  }
1569 
1570  if (! yyres)
1571  return yystrlen (yystr);
1572 
1573  return yystpcpy (yyres, yystr) - yyres;
1574 }
1575 # endif
1576 
1577 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1578  about the unexpected token YYTOKEN for the state stack whose top is
1579  YYSSP.
1580 
1581  Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1582  not large enough to hold the message. In that case, also set
1583  *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1584  required number of bytes is too large to store. */
1585 static int
1586 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1587  yytype_int16 *yyssp, int yytoken)
1588 {
1589  YYSIZE_T yysize0 = yytnamerr (YY_NULLPTRPTR, yytname[yytoken]);
1590  YYSIZE_T yysize = yysize0;
1591  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1592  /* Internationalized format string. */
1593  const char *yyformat = YY_NULLPTRPTR;
1594  /* Arguments of yyformat. */
1595  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1596  /* Number of reported tokens (one for the "unexpected", one per
1597  "expected"). */
1598  int yycount = 0;
1599 
1600  /* There are many possibilities here to consider:
1601  - If this state is a consistent state with a default action, then
1602  the only way this function was invoked is if the default action
1603  is an error action. In that case, don't check for expected
1604  tokens because there are none.
1605  - The only way there can be no lookahead present (in yychar) is if
1606  this state is a consistent state with a default action. Thus,
1607  detecting the absence of a lookahead is sufficient to determine
1608  that there is no unexpected or expected token to report. In that
1609  case, just report a simple "syntax error".
1610  - Don't assume there isn't a lookahead just because this state is a
1611  consistent state with a default action. There might have been a
1612  previous inconsistent state, consistent state with a non-default
1613  action, or user semantic action that manipulated yychar.
1614  - Of course, the expected token list depends on states to have
1615  correct lookahead information, and it depends on the parser not
1616  to perform extra reductions after fetching a lookahead from the
1617  scanner and before detecting a syntax error. Thus, state merging
1618  (from LALR or IELR) and default reductions corrupt the expected
1619  token list. However, the list is correct for canonical LR with
1620  one exception: it will still contain any token that will not be
1621  accepted due to an error action in a later state.
1622  */
1623  if (yytoken != YYEMPTY)
1624  {
1625  int yyn = yypact[*yyssp];
1626  yyarg[yycount++] = yytname[yytoken];
1627  if (!yypact_value_is_default (yyn))
1628  {
1629  /* Start YYX at -YYN if negative to avoid negative indexes in
1630  YYCHECK. In other words, skip the first -YYN actions for
1631  this state because they are default actions. */
1632  int yyxbegin = yyn < 0 ? -yyn : 0;
1633  /* Stay within bounds of both yycheck and yytname. */
1634  int yychecklim = YYLAST - yyn + 1;
1635  int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1636  int yyx;
1637 
1638  for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1639  if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1640  && !yytable_value_is_error (yytable[yyx + yyn]))
1641  {
1642  if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1643  {
1644  yycount = 1;
1645  yysize = yysize0;
1646  break;
1647  }
1648  yyarg[yycount++] = yytname[yyx];
1649  {
1650  YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTRPTR, yytname[yyx]);
1651  if (! (yysize <= yysize1
1652  && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1653  return 2;
1654  yysize = yysize1;
1655  }
1656  }
1657  }
1658  }
1659 
1660  switch (yycount)
1661  {
1662 # define YYCASE_(N, S) \
1663  case N: \
1664  yyformat = S; \
1665  break
1666  YYCASE_(0, YY_("syntax error"));
1667  YYCASE_(1, YY_("syntax error, unexpected %s"));
1668  YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1669  YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1670  YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1671  YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1672 # undef YYCASE_
1673  }
1674 
1675  {
1676  YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1677  if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1678  return 2;
1679  yysize = yysize1;
1680  }
1681 
1682  if (*yymsg_alloc < yysize)
1683  {
1684  *yymsg_alloc = 2 * yysize;
1685  if (! (yysize <= *yymsg_alloc
1686  && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1687  *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1688  return 1;
1689  }
1690 
1691  /* Avoid sprintf, as that infringes on the user's name space.
1692  Don't have undefined behavior even if the translation
1693  produced a string with the wrong number of "%s"s. */
1694  {
1695  char *yyp = *yymsg;
1696  int yyi = 0;
1697  while ((*yyp = *yyformat) != '\0')
1698  if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1699  {
1700  yyp += yytnamerr (yyp, yyarg[yyi++]);
1701  yyformat += 2;
1702  }
1703  else
1704  {
1705  yyp++;
1706  yyformat++;
1707  }
1708  }
1709  return 0;
1710 }
1711 #endif /* YYERROR_VERBOSE */
1712 
1713 /*-----------------------------------------------.
1714 | Release the memory associated to this symbol. |
1715 `-----------------------------------------------*/
1716 
1717 static void
1718 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1719 {
1720  YYUSE (yyvaluep);
1721  if (!yymsg)
1722  yymsg = "Deleting";
1723  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1724 
1726  YYUSE (yytype);
1728 }
1729 
1730 
1731 
1732 
1733 /* The lookahead symbol. */
1735 
1736 /* The semantic value of the lookahead symbol. */
1738 /* Number of syntax errors so far. */
1740 
1741 
1742 /*----------.
1743 | yyparse. |
1744 `----------*/
1745 
1746 int
1747 yyparse (void)
1748 {
1749  int yystate;
1750  /* Number of tokens to shift before error messages enabled. */
1751  int yyerrstatus;
1752 
1753  /* The stacks and their tools:
1754  'yyss': related to states.
1755  'yyvs': related to semantic values.
1756 
1757  Refer to the stacks through separate pointers, to allow yyoverflow
1758  to xreallocate them elsewhere. */
1759 
1760  /* The state stack. */
1761  yytype_int16 yyssa[YYINITDEPTH];
1762  yytype_int16 *yyss;
1764 
1765  /* The semantic value stack. */
1766  YYSTYPE yyvsa[YYINITDEPTH];
1767  YYSTYPE *yyvs;
1768  YYSTYPE *yyvsp;
1769 
1771 
1772  int yyn;
1773  int yyresult;
1774  /* Lookahead token as an internal (translated) token number. */
1775  int yytoken = 0;
1776  /* The variables used to return semantic value and location from the
1777  action routines. */
1778  YYSTYPE yyval;
1779 
1780 #if YYERROR_VERBOSE
1781  /* Buffer for error messages, and its allocated size. */
1782  char yymsgbuf[128];
1783  char *yymsg = yymsgbuf;
1784  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1785 #endif
1786 
1787 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1788 
1789  /* The number of symbols on the RHS of the reduced rule.
1790  Keep to zero when no symbol should be popped. */
1791  int yylen = 0;
1792 
1793  yyssp = yyss = yyssa;
1794  yyvsp = yyvs = yyvsa;
1796 
1797  YYDPRINTF ((stderr, "Starting parse\n"));
1798 
1799  yystate = 0;
1800  yyerrstatus = 0;
1801  yynerrs = 0;
1802  yychar = YYEMPTY; /* Cause a token to be read. */
1803  goto yysetstate;
1804 
1805 /*------------------------------------------------------------.
1806 | yynewstate -- Push a new state, which is found in yystate. |
1807 `------------------------------------------------------------*/
1808  yynewstate:
1809  /* In all cases, when you get here, the value and location stacks
1810  have just been pushed. So pushing a state here evens the stacks. */
1811  yyssp++;
1812 
1813  yysetstate:
1814  *yyssp = yystate;
1815 
1816  if (yyss + yystacksize - 1 <= yyssp)
1817  {
1818  /* Get the current used size of the three stacks, in elements. */
1819  YYSIZE_T yysize = yyssp - yyss + 1;
1820 
1821 #ifdef yyoverflow
1822  {
1823  /* Give user a chance to xreallocate the stack. Use copies of
1824  these so that the &'s don't force the real ones into
1825  memory. */
1826  YYSTYPE *yyvs1 = yyvs;
1827  yytype_int16 *yyss1 = yyss;
1828 
1829  /* Each stack pointer address is followed by the size of the
1830  data in use in that stack, in bytes. This used to be a
1831  conditional around just the two extra args, but that might
1832  be undefined if yyoverflow is a macro. */
1833  yyoverflow (YY_("memory exhausted"),
1834  &yyss1, yysize * sizeof (*yyssp),
1835  &yyvs1, yysize * sizeof (*yyvsp),
1836  &yystacksize);
1837 
1838  yyss = yyss1;
1839  yyvs = yyvs1;
1840  }
1841 #else /* no yyoverflow */
1842 # ifndef YYSTACK_RELOCATE
1843  goto yyexhaustedlab;
1844 # else
1845  /* Extend the stack our own way. */
1846  if (YYMAXDEPTH <= yystacksize)
1847  goto yyexhaustedlab;
1848  yystacksize *= 2;
1849  if (YYMAXDEPTH < yystacksize)
1851 
1852  {
1853  yytype_int16 *yyss1 = yyss;
1854  union yyalloc *yyptr =
1856  if (! yyptr)
1857  goto yyexhaustedlab;
1860 # undef YYSTACK_RELOCATE
1861  if (yyss1 != yyssa)
1862  YYSTACK_FREE (yyss1);
1863  }
1864 # endif
1865 #endif /* no yyoverflow */
1866 
1867  yyssp = yyss + yysize - 1;
1868  yyvsp = yyvs + yysize - 1;
1869 
1870  YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1871  (unsigned long int) yystacksize));
1872 
1873  if (yyss + yystacksize - 1 <= yyssp)
1874  YYABORT;
1875  }
1876 
1877  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1878 
1879  if (yystate == YYFINAL)
1880  YYACCEPT;
1881 
1882  goto yybackup;
1883 
1884 /*-----------.
1885 | yybackup. |
1886 `-----------*/
1887 yybackup:
1888 
1889  /* Do appropriate processing given the current state. Read a
1890  lookahead token if we need one and don't already have one. */
1891 
1892  /* First try to decide what to do without reference to lookahead token. */
1893  yyn = yypact[yystate];
1894  if (yypact_value_is_default (yyn))
1895  goto yydefault;
1896 
1897  /* Not known => get a lookahead token if don't already have one. */
1898 
1899  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1900  if (yychar == YYEMPTY)
1901  {
1902  YYDPRINTF ((stderr, "Reading a token: "));
1903  yychar = yylex ();
1904  }
1905 
1906  if (yychar <= YYEOF)
1907  {
1908  yychar = yytoken = YYEOF;
1909  YYDPRINTF ((stderr, "Now at end of input.\n"));
1910  }
1911  else
1912  {
1913  yytoken = YYTRANSLATE (yychar);
1914  YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1915  }
1916 
1917  /* If the proper action on seeing token YYTOKEN is to reduce or to
1918  detect an error, take that action. */
1919  yyn += yytoken;
1920  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1921  goto yydefault;
1922  yyn = yytable[yyn];
1923  if (yyn <= 0)
1924  {
1925  if (yytable_value_is_error (yyn))
1926  goto yyerrlab;
1927  yyn = -yyn;
1928  goto yyreduce;
1929  }
1930 
1931  /* Count tokens shifted since error; after three, turn off error
1932  status. */
1933  if (yyerrstatus)
1934  yyerrstatus--;
1935 
1936  /* Shift the lookahead token. */
1937  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1938 
1939  /* Discard the shifted token. */
1940  yychar = YYEMPTY;
1941 
1942  yystate = yyn;
1944  *++yyvsp = yylval;
1946 
1947  goto yynewstate;
1948 
1949 
1950 /*-----------------------------------------------------------.
1951 | yydefault -- do the default action for the current state. |
1952 `-----------------------------------------------------------*/
1953 yydefault:
1954  yyn = yydefact[yystate];
1955  if (yyn == 0)
1956  goto yyerrlab;
1957  goto yyreduce;
1958 
1959 
1960 /*-----------------------------.
1961 | yyreduce -- Do a reduction. |
1962 `-----------------------------*/
1963 yyreduce:
1964  /* yyn is the number of a rule to reduce with. */
1965  yylen = yyr2[yyn];
1966 
1967  /* If YYLEN is nonzero, implement the default value of the action:
1968  '$$ = $1'.
1969 
1970  Otherwise, the following line sets YYVAL to garbage.
1971  This behavior is undocumented and Bison
1972  users should not rely upon it. Assigning to YYVAL
1973  unconditionally makes the parser a bit smaller, and it avoids a
1974  GCC warning that YYVAL may be used uninitialized. */
1975  yyval = yyvsp[1-yylen];
1976 
1977 
1978  YY_REDUCE_PRINT (yyn);
1979  switch (yyn)
1980  {
1981  case 4:
1982 #line 232 "c-exp.y" /* yacc.c:1646 */
1983  { write_exp_elt_opcode(pstate, OP_TYPE);
1984  write_exp_elt_type(pstate, (yyvsp[0].tval));
1985  write_exp_elt_opcode(pstate, OP_TYPE);}
1986 #line 1988 "c-exp.c" /* yacc.c:1646 */
1987  break;
1988 
1989  case 5:
1990 #line 236 "c-exp.y" /* yacc.c:1646 */
1991  {
1992  write_exp_elt_opcode (pstate, OP_TYPEOF);
1993  }
1994 #line 1996 "c-exp.c" /* yacc.c:1646 */
1995  break;
1996 
1997  case 6:
1998 #line 240 "c-exp.y" /* yacc.c:1646 */
1999  {
2000  write_exp_elt_opcode (pstate, OP_TYPE);
2001  write_exp_elt_type (pstate, (yyvsp[-1].tval));
2002  write_exp_elt_opcode (pstate, OP_TYPE);
2003  }
2004 #line 2006 "c-exp.c" /* yacc.c:1646 */
2005  break;
2006 
2007  case 7:
2008 #line 246 "c-exp.y" /* yacc.c:1646 */
2009  {
2010  write_exp_elt_opcode (pstate, OP_DECLTYPE);
2011  }
2012 #line 2014 "c-exp.c" /* yacc.c:1646 */
2013  break;
2014 
2015  case 9:
2016 #line 254 "c-exp.y" /* yacc.c:1646 */
2017  { write_exp_elt_opcode (pstate, BINOP_COMMA); }
2018 #line 2020 "c-exp.c" /* yacc.c:1646 */
2019  break;
2020 
2021  case 10:
2022 #line 259 "c-exp.y" /* yacc.c:1646 */
2023  { write_exp_elt_opcode (pstate, UNOP_IND); }
2024 #line 2026 "c-exp.c" /* yacc.c:1646 */
2025  break;
2026 
2027  case 11:
2028 #line 263 "c-exp.y" /* yacc.c:1646 */
2029  { write_exp_elt_opcode (pstate, UNOP_ADDR); }
2030 #line 2032 "c-exp.c" /* yacc.c:1646 */
2031  break;
2032 
2033  case 12:
2034 #line 267 "c-exp.y" /* yacc.c:1646 */
2035  { write_exp_elt_opcode (pstate, UNOP_NEG); }
2036 #line 2038 "c-exp.c" /* yacc.c:1646 */
2037  break;
2038 
2039  case 13:
2040 #line 271 "c-exp.y" /* yacc.c:1646 */
2041  { write_exp_elt_opcode (pstate, UNOP_PLUS); }
2042 #line 2044 "c-exp.c" /* yacc.c:1646 */
2043  break;
2044 
2045  case 14:
2046 #line 275 "c-exp.y" /* yacc.c:1646 */
2047  { write_exp_elt_opcode (pstate, UNOP_LOGICAL_NOT); }
2048 #line 2050 "c-exp.c" /* yacc.c:1646 */
2049  break;
2050 
2051  case 15:
2052 #line 279 "c-exp.y" /* yacc.c:1646 */
2053  { write_exp_elt_opcode (pstate, UNOP_COMPLEMENT); }
2054 #line 2056 "c-exp.c" /* yacc.c:1646 */
2055  break;
2056 
2057  case 16:
2058 #line 283 "c-exp.y" /* yacc.c:1646 */
2059  { write_exp_elt_opcode (pstate, UNOP_PREINCREMENT); }
2060 #line 2062 "c-exp.c" /* yacc.c:1646 */
2061  break;
2062 
2063  case 17:
2064 #line 287 "c-exp.y" /* yacc.c:1646 */
2065  { write_exp_elt_opcode (pstate, UNOP_PREDECREMENT); }
2066 #line 2068 "c-exp.c" /* yacc.c:1646 */
2067  break;
2068 
2069  case 18:
2070 #line 291 "c-exp.y" /* yacc.c:1646 */
2071  { write_exp_elt_opcode (pstate, UNOP_POSTINCREMENT); }
2072 #line 2074 "c-exp.c" /* yacc.c:1646 */
2073  break;
2074 
2075  case 19:
2076 #line 295 "c-exp.y" /* yacc.c:1646 */
2077  { write_exp_elt_opcode (pstate, UNOP_POSTDECREMENT); }
2078 #line 2080 "c-exp.c" /* yacc.c:1646 */
2079  break;
2080 
2081  case 20:
2082 #line 299 "c-exp.y" /* yacc.c:1646 */
2083  { write_exp_elt_opcode (pstate, OP_TYPEID); }
2084 #line 2086 "c-exp.c" /* yacc.c:1646 */
2085  break;
2086 
2087  case 21:
2088 #line 303 "c-exp.y" /* yacc.c:1646 */
2089  { write_exp_elt_opcode (pstate, OP_TYPEID); }
2090 #line 2092 "c-exp.c" /* yacc.c:1646 */
2091  break;
2092 
2093  case 22:
2094 #line 307 "c-exp.y" /* yacc.c:1646 */
2095  { write_exp_elt_opcode (pstate, UNOP_SIZEOF); }
2096 #line 2098 "c-exp.c" /* yacc.c:1646 */
2097  break;
2098 
2099  case 23:
2100 #line 311 "c-exp.y" /* yacc.c:1646 */
2101  { write_exp_elt_opcode (pstate, STRUCTOP_PTR);
2102  write_exp_string (pstate, (yyvsp[0].sval));
2103  write_exp_elt_opcode (pstate, STRUCTOP_PTR); }
2104 #line 2106 "c-exp.c" /* yacc.c:1646 */
2105  break;
2106 
2107  case 24:
2108 #line 317 "c-exp.y" /* yacc.c:1646 */
2110  write_exp_elt_opcode (pstate, STRUCTOP_PTR);
2111  write_exp_string (pstate, (yyvsp[-1].sval));
2112  write_exp_elt_opcode (pstate, STRUCTOP_PTR); }
2113 #line 2115 "c-exp.c" /* yacc.c:1646 */
2114  break;
2115 
2116  case 25:
2117 #line 324 "c-exp.y" /* yacc.c:1646 */
2118  { struct stoken s;
2120  write_exp_elt_opcode (pstate, STRUCTOP_PTR);
2121  s.ptr = "";
2122  s.length = 0;
2123  write_exp_string (pstate, s);
2124  write_exp_elt_opcode (pstate, STRUCTOP_PTR); }
2125 #line 2127 "c-exp.c" /* yacc.c:1646 */
2126  break;
2127 
2128  case 26:
2129 #line 334 "c-exp.y" /* yacc.c:1646 */
2130  { write_exp_elt_opcode (pstate, STRUCTOP_PTR);
2131  write_destructor_name (pstate, (yyvsp[0].sval));
2132  write_exp_elt_opcode (pstate, STRUCTOP_PTR); }
2133 #line 2135 "c-exp.c" /* yacc.c:1646 */
2134  break;
2135 
2136  case 27:
2137 #line 340 "c-exp.y" /* yacc.c:1646 */
2139  write_exp_elt_opcode (pstate, STRUCTOP_PTR);
2140  write_destructor_name (pstate, (yyvsp[-1].sval));
2141  write_exp_elt_opcode (pstate, STRUCTOP_PTR); }
2142 #line 2144 "c-exp.c" /* yacc.c:1646 */
2143  break;
2144 
2145  case 28:
2146 #line 347 "c-exp.y" /* yacc.c:1646 */
2147  { /* exp->type::name becomes exp->*(&type::name) */
2148  /* Note: this doesn't work if name is a
2149  static member! FIXME */
2150  write_exp_elt_opcode (pstate, UNOP_ADDR);
2151  write_exp_elt_opcode (pstate, STRUCTOP_MPTR); }
2152 #line 2154 "c-exp.c" /* yacc.c:1646 */
2153  break;
2154 
2155  case 29:
2156 #line 355 "c-exp.y" /* yacc.c:1646 */
2157  { write_exp_elt_opcode (pstate, STRUCTOP_MPTR); }
2158 #line 2160 "c-exp.c" /* yacc.c:1646 */
2159  break;
2160 
2161  case 30:
2162 #line 359 "c-exp.y" /* yacc.c:1646 */
2163  { write_exp_elt_opcode (pstate, STRUCTOP_STRUCT);
2164  write_exp_string (pstate, (yyvsp[0].sval));
2165  write_exp_elt_opcode (pstate, STRUCTOP_STRUCT); }
2166 #line 2168 "c-exp.c" /* yacc.c:1646 */
2167  break;
2168 
2169  case 31:
2170 #line 365 "c-exp.y" /* yacc.c:1646 */
2172  write_exp_elt_opcode (pstate, STRUCTOP_STRUCT);
2173  write_exp_string (pstate, (yyvsp[-1].sval));
2174  write_exp_elt_opcode (pstate, STRUCTOP_STRUCT); }
2175 #line 2177 "c-exp.c" /* yacc.c:1646 */
2176  break;
2177 
2178  case 32:
2179 #line 372 "c-exp.y" /* yacc.c:1646 */
2180  { struct stoken s;
2182  write_exp_elt_opcode (pstate, STRUCTOP_STRUCT);
2183  s.ptr = "";
2184  s.length = 0;
2185  write_exp_string (pstate, s);
2186  write_exp_elt_opcode (pstate, STRUCTOP_STRUCT); }
2187 #line 2189 "c-exp.c" /* yacc.c:1646 */
2188  break;
2189 
2190  case 33:
2191 #line 382 "c-exp.y" /* yacc.c:1646 */
2192  { write_exp_elt_opcode (pstate, STRUCTOP_STRUCT);
2193  write_destructor_name (pstate, (yyvsp[0].sval));
2194  write_exp_elt_opcode (pstate, STRUCTOP_STRUCT); }
2195 #line 2197 "c-exp.c" /* yacc.c:1646 */
2196  break;
2197 
2198  case 34:
2199 #line 388 "c-exp.y" /* yacc.c:1646 */
2201  write_exp_elt_opcode (pstate, STRUCTOP_STRUCT);
2202  write_destructor_name (pstate, (yyvsp[-1].sval));
2203  write_exp_elt_opcode (pstate, STRUCTOP_STRUCT); }
2204 #line 2206 "c-exp.c" /* yacc.c:1646 */
2205  break;
2206 
2207  case 35:
2208 #line 395 "c-exp.y" /* yacc.c:1646 */
2209  { /* exp.type::name becomes exp.*(&type::name) */
2210  /* Note: this doesn't work if name is a
2211  static member! FIXME */
2212  write_exp_elt_opcode (pstate, UNOP_ADDR);
2213  write_exp_elt_opcode (pstate, STRUCTOP_MEMBER); }
2214 #line 2216 "c-exp.c" /* yacc.c:1646 */
2215  break;
2216 
2217  case 36:
2218 #line 403 "c-exp.y" /* yacc.c:1646 */
2219  { write_exp_elt_opcode (pstate, STRUCTOP_MEMBER); }
2220 #line 2222 "c-exp.c" /* yacc.c:1646 */
2221  break;
2222 
2223  case 37:
2224 #line 407 "c-exp.y" /* yacc.c:1646 */
2225  { write_exp_elt_opcode (pstate, BINOP_SUBSCRIPT); }
2226 #line 2228 "c-exp.c" /* yacc.c:1646 */
2227  break;
2228 
2229  case 38:
2230 #line 411 "c-exp.y" /* yacc.c:1646 */
2231  { write_exp_elt_opcode (pstate, BINOP_SUBSCRIPT); }
2232 #line 2234 "c-exp.c" /* yacc.c:1646 */
2233  break;
2234 
2235  case 39:
2236 #line 420 "c-exp.y" /* yacc.c:1646 */
2237  {
2238  CORE_ADDR theclass;
2239 
2240  theclass = lookup_objc_class (parse_gdbarch (pstate),
2241  copy_name ((yyvsp[0].tsym).stoken));
2242  if (theclass == 0)
2243  error (_("%s is not an ObjC Class"),
2244  copy_name ((yyvsp[0].tsym).stoken));
2245  write_exp_elt_opcode (pstate, OP_LONG);
2247  parse_type (pstate)->builtin_int);
2248  write_exp_elt_longcst (pstate, (LONGEST) theclass);
2249  write_exp_elt_opcode (pstate, OP_LONG);
2250  start_msglist();
2251  }
2252 #line 2254 "c-exp.c" /* yacc.c:1646 */
2253  break;
2254 
2255  case 40:
2256 #line 436 "c-exp.y" /* yacc.c:1646 */
2257  { write_exp_elt_opcode (pstate, OP_OBJC_MSGCALL);
2258  end_msglist (pstate);
2259  write_exp_elt_opcode (pstate, OP_OBJC_MSGCALL);
2260  }
2261 #line 2263 "c-exp.c" /* yacc.c:1646 */
2262  break;
2263 
2264  case 41:
2265 #line 443 "c-exp.y" /* yacc.c:1646 */
2266  {
2267  write_exp_elt_opcode (pstate, OP_LONG);
2269  parse_type (pstate)->builtin_int);
2270  write_exp_elt_longcst (pstate, (LONGEST) (yyvsp[0].theclass).theclass);
2271  write_exp_elt_opcode (pstate, OP_LONG);
2272  start_msglist();
2273  }
2274 #line 2276 "c-exp.c" /* yacc.c:1646 */
2275  break;
2276 
2277  case 42:
2278 #line 452 "c-exp.y" /* yacc.c:1646 */
2279  { write_exp_elt_opcode (pstate, OP_OBJC_MSGCALL);
2280  end_msglist (pstate);
2281  write_exp_elt_opcode (pstate, OP_OBJC_MSGCALL);
2282  }
2283 #line 2285 "c-exp.c" /* yacc.c:1646 */
2284  break;
2285 
2286  case 43:
2287 #line 459 "c-exp.y" /* yacc.c:1646 */
2288  { start_msglist(); }
2289 #line 2291 "c-exp.c" /* yacc.c:1646 */
2290  break;
2291 
2292  case 44:
2293 #line 461 "c-exp.y" /* yacc.c:1646 */
2294  { write_exp_elt_opcode (pstate, OP_OBJC_MSGCALL);
2295  end_msglist (pstate);
2296  write_exp_elt_opcode (pstate, OP_OBJC_MSGCALL);
2297  }
2298 #line 2300 "c-exp.c" /* yacc.c:1646 */
2299  break;
2300 
2301  case 45:
2302 #line 468 "c-exp.y" /* yacc.c:1646 */
2303  { add_msglist(&(yyvsp[0].sval), 0); }
2304 #line 2306 "c-exp.c" /* yacc.c:1646 */
2305  break;
2306 
2307  case 49:
2308 #line 477 "c-exp.y" /* yacc.c:1646 */
2309  { add_msglist(&(yyvsp[-2].sval), 1); }
2310 #line 2312 "c-exp.c" /* yacc.c:1646 */
2311  break;
2312 
2313  case 50:
2314 #line 479 "c-exp.y" /* yacc.c:1646 */
2315  { add_msglist(0, 1); }
2316 #line 2318 "c-exp.c" /* yacc.c:1646 */
2317  break;
2318 
2319  case 51:
2320 #line 481 "c-exp.y" /* yacc.c:1646 */
2321  { add_msglist(0, 0); }
2322 #line 2324 "c-exp.c" /* yacc.c:1646 */
2323  break;
2324 
2325  case 52:
2326 #line 487 "c-exp.y" /* yacc.c:1646 */
2327  { start_arglist (); }
2328 #line 2330 "c-exp.c" /* yacc.c:1646 */
2329  break;
2330 
2331  case 53:
2332 #line 489 "c-exp.y" /* yacc.c:1646 */
2333  { write_exp_elt_opcode (pstate, OP_FUNCALL);
2335  (LONGEST) end_arglist ());
2336  write_exp_elt_opcode (pstate, OP_FUNCALL); }
2337 #line 2339 "c-exp.c" /* yacc.c:1646 */
2338  break;
2339 
2340  case 54:
2341 #line 499 "c-exp.y" /* yacc.c:1646 */
2342  { start_arglist ();
2343  write_exp_elt_opcode (pstate, OP_FUNCALL);
2345  (LONGEST) end_arglist ());
2346  write_exp_elt_opcode (pstate, OP_FUNCALL); }
2347 #line 2349 "c-exp.c" /* yacc.c:1646 */
2348  break;
2349 
2350  case 55:
2351 #line 508 "c-exp.y" /* yacc.c:1646 */
2352  {
2353  /* This could potentially be a an argument defined
2354  lookup function (Koenig). */
2355  write_exp_elt_opcode (pstate, OP_ADL_FUNC);
2359  NULL); /* Placeholder. */
2360  write_exp_string (pstate, (yyvsp[-1].ssym).stoken);
2361  write_exp_elt_opcode (pstate, OP_ADL_FUNC);
2362 
2363  /* This is to save the value of arglist_len
2364  being accumulated by an outer function call. */
2365 
2366  start_arglist ();
2367  }
2368 #line 2370 "c-exp.c" /* yacc.c:1646 */
2369  break;
2370 
2371  case 56:
2372 #line 525 "c-exp.y" /* yacc.c:1646 */
2373  {
2374  write_exp_elt_opcode (pstate, OP_FUNCALL);
2376  (LONGEST) end_arglist ());
2377  write_exp_elt_opcode (pstate, OP_FUNCALL);
2378  }
2379 #line 2381 "c-exp.c" /* yacc.c:1646 */
2380  break;
2381 
2382  case 57:
2383 #line 534 "c-exp.y" /* yacc.c:1646 */
2384  { start_arglist (); }
2385 #line 2387 "c-exp.c" /* yacc.c:1646 */
2386  break;
2387 
2388  case 59:
2389 #line 541 "c-exp.y" /* yacc.c:1646 */
2390  { arglist_len = 1; }
2391 #line 2393 "c-exp.c" /* yacc.c:1646 */
2392  break;
2393 
2394  case 60:
2395 #line 545 "c-exp.y" /* yacc.c:1646 */
2396  { arglist_len++; }
2397 #line 2399 "c-exp.c" /* yacc.c:1646 */
2398  break;
2399 
2400  case 61:
2401 #line 549 "c-exp.y" /* yacc.c:1646 */
2402  { int i;
2403  VEC (type_ptr) *type_list = (yyvsp[-2].tvec);
2404  struct type *type_elt;
2405  LONGEST len = VEC_length (type_ptr, type_list);
2406 
2407  write_exp_elt_opcode (pstate, TYPE_INSTANCE);
2408  /* Save the const/volatile qualifiers as
2409  recorded by the const_or_volatile
2410  production's actions. */
2414  for (i = 0;
2415  VEC_iterate (type_ptr, type_list, i, type_elt);
2416  ++i)
2417  write_exp_elt_type (pstate, type_elt);
2419  write_exp_elt_opcode (pstate, TYPE_INSTANCE);
2420  VEC_free (type_ptr, type_list);
2421  }
2422 #line 2424 "c-exp.c" /* yacc.c:1646 */
2423  break;
2424 
2425  case 62:
2426 #line 572 "c-exp.y" /* yacc.c:1646 */
2427  { write_exp_elt_opcode (pstate, TYPE_INSTANCE);
2428  /* See above. */
2433  write_exp_elt_opcode (pstate, TYPE_INSTANCE);
2434  }
2435 #line 2437 "c-exp.c" /* yacc.c:1646 */
2436  break;
2437 
2438  case 66:
2439 #line 594 "c-exp.y" /* yacc.c:1646 */
2440  {
2441  write_exp_elt_opcode (pstate, OP_FUNC_STATIC_VAR);
2442  write_exp_string (pstate, (yyvsp[0].sval));
2443  write_exp_elt_opcode (pstate, OP_FUNC_STATIC_VAR);
2444  }
2445 #line 2447 "c-exp.c" /* yacc.c:1646 */
2446  break;
2447 
2448  case 67:
2449 #line 602 "c-exp.y" /* yacc.c:1646 */
2450  { (yyval.lval) = end_arglist () - 1; }
2451 #line 2453 "c-exp.c" /* yacc.c:1646 */
2452  break;
2453 
2454  case 68:
2455 #line 605 "c-exp.y" /* yacc.c:1646 */
2456  { write_exp_elt_opcode (pstate, OP_ARRAY);
2458  write_exp_elt_longcst (pstate, (LONGEST) (yyvsp[0].lval));
2459  write_exp_elt_opcode (pstate, OP_ARRAY); }
2460 #line 2462 "c-exp.c" /* yacc.c:1646 */
2461  break;
2462 
2463  case 69:
2464 #line 612 "c-exp.y" /* yacc.c:1646 */
2465  { write_exp_elt_opcode (pstate, UNOP_MEMVAL_TYPE); }
2466 #line 2468 "c-exp.c" /* yacc.c:1646 */
2467  break;
2468 
2469  case 70:
2470 #line 616 "c-exp.y" /* yacc.c:1646 */
2471  { write_exp_elt_opcode (pstate, UNOP_CAST_TYPE); }
2472 #line 2474 "c-exp.c" /* yacc.c:1646 */
2473  break;
2474 
2475  case 71:
2476 #line 620 "c-exp.y" /* yacc.c:1646 */
2477  { }
2478 #line 2480 "c-exp.c" /* yacc.c:1646 */
2479  break;
2480 
2481  case 72:
2482 #line 626 "c-exp.y" /* yacc.c:1646 */
2483  { write_exp_elt_opcode (pstate, BINOP_REPEAT); }
2484 #line 2486 "c-exp.c" /* yacc.c:1646 */
2485  break;
2486 
2487  case 73:
2488 #line 630 "c-exp.y" /* yacc.c:1646 */
2489  { write_exp_elt_opcode (pstate, BINOP_MUL); }
2490 #line 2492 "c-exp.c" /* yacc.c:1646 */
2491  break;
2492 
2493  case 74:
2494 #line 634 "c-exp.y" /* yacc.c:1646 */
2495  { write_exp_elt_opcode (pstate, BINOP_DIV); }
2496 #line 2498 "c-exp.c" /* yacc.c:1646 */
2497  break;
2498 
2499  case 75:
2500 #line 638 "c-exp.y" /* yacc.c:1646 */
2501  { write_exp_elt_opcode (pstate, BINOP_REM); }
2502 #line 2504 "c-exp.c" /* yacc.c:1646 */
2503  break;
2504 
2505  case 76:
2506 #line 642 "c-exp.y" /* yacc.c:1646 */
2507  { write_exp_elt_opcode (pstate, BINOP_ADD); }
2508 #line 2510 "c-exp.c" /* yacc.c:1646 */
2509  break;
2510 
2511  case 77:
2512 #line 646 "c-exp.y" /* yacc.c:1646 */
2513  { write_exp_elt_opcode (pstate, BINOP_SUB); }
2514 #line 2516 "c-exp.c" /* yacc.c:1646 */
2515  break;
2516 
2517  case 78:
2518 #line 650 "c-exp.y" /* yacc.c:1646 */
2519  { write_exp_elt_opcode (pstate, BINOP_LSH); }
2520 #line 2522 "c-exp.c" /* yacc.c:1646 */
2521  break;
2522 
2523  case 79:
2524 #line 654 "c-exp.y" /* yacc.c:1646 */
2525  { write_exp_elt_opcode (pstate, BINOP_RSH); }
2526 #line 2528 "c-exp.c" /* yacc.c:1646 */
2527  break;
2528 
2529  case 80:
2530 #line 658 "c-exp.y" /* yacc.c:1646 */
2531  { write_exp_elt_opcode (pstate, BINOP_EQUAL); }
2532 #line 2534 "c-exp.c" /* yacc.c:1646 */
2533  break;
2534 
2535  case 81:
2536 #line 662 "c-exp.y" /* yacc.c:1646 */
2537  { write_exp_elt_opcode (pstate, BINOP_NOTEQUAL); }
2538 #line 2540 "c-exp.c" /* yacc.c:1646 */
2539  break;
2540 
2541  case 82:
2542 #line 666 "c-exp.y" /* yacc.c:1646 */
2543  { write_exp_elt_opcode (pstate, BINOP_LEQ); }
2544 #line 2546 "c-exp.c" /* yacc.c:1646 */
2545  break;
2546 
2547  case 83:
2548 #line 670 "c-exp.y" /* yacc.c:1646 */
2549  { write_exp_elt_opcode (pstate, BINOP_GEQ); }
2550 #line 2552 "c-exp.c" /* yacc.c:1646 */
2551  break;
2552 
2553  case 84:
2554 #line 674 "c-exp.y" /* yacc.c:1646 */
2555  { write_exp_elt_opcode (pstate, BINOP_LESS); }
2556 #line 2558 "c-exp.c" /* yacc.c:1646 */
2557  break;
2558 
2559  case 85:
2560 #line 678 "c-exp.y" /* yacc.c:1646 */
2561  { write_exp_elt_opcode (pstate, BINOP_GTR); }
2562 #line 2564 "c-exp.c" /* yacc.c:1646 */
2563  break;
2564 
2565  case 86:
2566 #line 682 "c-exp.y" /* yacc.c:1646 */
2567  { write_exp_elt_opcode (pstate, BINOP_BITWISE_AND); }
2568 #line 2570 "c-exp.c" /* yacc.c:1646 */
2569  break;
2570 
2571  case 87:
2572 #line 686 "c-exp.y" /* yacc.c:1646 */
2573  { write_exp_elt_opcode (pstate, BINOP_BITWISE_XOR); }
2574 #line 2576 "c-exp.c" /* yacc.c:1646 */
2575  break;
2576 
2577  case 88:
2578 #line 690 "c-exp.y" /* yacc.c:1646 */
2579  { write_exp_elt_opcode (pstate, BINOP_BITWISE_IOR); }
2580 #line 2582 "c-exp.c" /* yacc.c:1646 */
2581  break;
2582 
2583  case 89:
2584 #line 694 "c-exp.y" /* yacc.c:1646 */
2585  { write_exp_elt_opcode (pstate, BINOP_LOGICAL_AND); }
2586 #line 2588 "c-exp.c" /* yacc.c:1646 */
2587  break;
2588 
2589  case 90:
2590 #line 698 "c-exp.y" /* yacc.c:1646 */
2591  { write_exp_elt_opcode (pstate, BINOP_LOGICAL_OR); }
2592 #line 2594 "c-exp.c" /* yacc.c:1646 */
2593  break;
2594 
2595  case 91:
2596 #line 702 "c-exp.y" /* yacc.c:1646 */
2597  { write_exp_elt_opcode (pstate, TERNOP_COND); }
2598 #line 2600 "c-exp.c" /* yacc.c:1646 */
2599  break;
2600 
2601  case 92:
2602 #line 706 "c-exp.y" /* yacc.c:1646 */
2603  { write_exp_elt_opcode (pstate, BINOP_ASSIGN); }
2604 #line 2606 "c-exp.c" /* yacc.c:1646 */
2605  break;
2606 
2607  case 93:
2608 #line 710 "c-exp.y" /* yacc.c:1646 */
2609  { write_exp_elt_opcode (pstate, BINOP_ASSIGN_MODIFY);
2610  write_exp_elt_opcode (pstate, (yyvsp[-1].opcode));
2612  BINOP_ASSIGN_MODIFY); }
2613 #line 2615 "c-exp.c" /* yacc.c:1646 */
2614  break;
2615 
2616  case 94:
2617 #line 717 "c-exp.y" /* yacc.c:1646 */
2618  { write_exp_elt_opcode (pstate, OP_LONG);
2621  write_exp_elt_opcode (pstate, OP_LONG); }
2622 #line 2624 "c-exp.c" /* yacc.c:1646 */
2623  break;
2624 
2625  case 95:
2626 #line 724 "c-exp.y" /* yacc.c:1646 */
2627  {
2628  struct stoken_vector vec;
2629  vec.len = 1;
2630  vec.tokens = &(yyvsp[0].tsval);
2631  write_exp_string_vector (pstate, (yyvsp[0].tsval).type, &vec);
2632  }
2633 #line 2635 "c-exp.c" /* yacc.c:1646 */
2634  break;
2635 
2636  case 96:
2637 #line 733 "c-exp.y" /* yacc.c:1646 */
2638  { YYSTYPE val;
2639  parse_number (pstate, (yyvsp[0].ssym).stoken.ptr,
2640  (yyvsp[0].ssym).stoken.length, 0, &val);
2641  write_exp_elt_opcode (pstate, OP_LONG);
2644  (LONGEST) val.typed_val_int.val);
2645  write_exp_elt_opcode (pstate, OP_LONG);
2646  }
2647 #line 2649 "c-exp.c" /* yacc.c:1646 */
2648  break;
2649 
2650  case 97:
2651 #line 746 "c-exp.y" /* yacc.c:1646 */
2652  { write_exp_elt_opcode (pstate, OP_FLOAT);
2655  write_exp_elt_opcode (pstate, OP_FLOAT); }
2656 #line 2658 "c-exp.c" /* yacc.c:1646 */
2657  break;
2658 
2659  case 99:
2660 #line 756 "c-exp.y" /* yacc.c:1646 */
2661  {
2662  write_dollar_variable (pstate, (yyvsp[0].sval));
2663  }
2664 #line 2666 "c-exp.c" /* yacc.c:1646 */
2665  break;
2666 
2667  case 100:
2668 #line 762 "c-exp.y" /* yacc.c:1646 */
2669  {
2670  write_exp_elt_opcode (pstate, OP_OBJC_SELECTOR);
2671  write_exp_string (pstate, (yyvsp[-1].sval));
2672  write_exp_elt_opcode (pstate, OP_OBJC_SELECTOR); }
2673 #line 2675 "c-exp.c" /* yacc.c:1646 */
2674  break;
2675 
2676  case 101:
2677 #line 769 "c-exp.y" /* yacc.c:1646 */
2678  { struct type *type = (yyvsp[-1].tval);
2679  write_exp_elt_opcode (pstate, OP_LONG);
2683  "int"));
2684  type = check_typedef (type);
2685 
2686  /* $5.3.3/2 of the C++ Standard (n3290 draft)
2687  says of sizeof: "When applied to a reference
2688  or a reference type, the result is the size of
2689  the referenced type." */
2690  if (TYPE_IS_REFERENCE (type))
2693  (LONGEST) TYPE_LENGTH (type));
2694  write_exp_elt_opcode (pstate, OP_LONG); }
2695 #line 2697 "c-exp.c" /* yacc.c:1646 */
2696  break;
2697 
2698  case 102:
2699 #line 789 "c-exp.y" /* yacc.c:1646 */
2701  UNOP_REINTERPRET_CAST); }
2702 #line 2704 "c-exp.c" /* yacc.c:1646 */
2703  break;
2704 
2705  case 103:
2706 #line 794 "c-exp.y" /* yacc.c:1646 */
2707  { write_exp_elt_opcode (pstate, UNOP_CAST_TYPE); }
2708 #line 2710 "c-exp.c" /* yacc.c:1646 */
2709  break;
2710 
2711  case 104:
2712 #line 798 "c-exp.y" /* yacc.c:1646 */
2713  { write_exp_elt_opcode (pstate, UNOP_DYNAMIC_CAST); }
2714 #line 2716 "c-exp.c" /* yacc.c:1646 */
2715  break;
2716 
2717  case 105:
2718 #line 802 "c-exp.y" /* yacc.c:1646 */
2719  { /* We could do more error checking here, but
2720  it doesn't seem worthwhile. */
2721  write_exp_elt_opcode (pstate, UNOP_CAST_TYPE); }
2722 #line 2724 "c-exp.c" /* yacc.c:1646 */
2723  break;
2724 
2725  case 106:
2726 #line 809 "c-exp.y" /* yacc.c:1646 */
2727  {
2728  /* We copy the string here, and not in the
2729  lexer, to guarantee that we do not leak a
2730  string. Note that we follow the
2731  NUL-termination convention of the
2732  lexer. */
2733  struct typed_stoken *vec = XNEW (struct typed_stoken);
2734  (yyval.svec).len = 1;
2735  (yyval.svec).tokens = vec;
2736 
2737  vec->type = (yyvsp[0].tsval).type;
2738  vec->length = (yyvsp[0].tsval).length;
2739  vec->ptr = (char *) xmalloc ((yyvsp[0].tsval).length + 1);
2740  memcpy (vec->ptr, (yyvsp[0].tsval).ptr, (yyvsp[0].tsval).length + 1);
2741  }
2742 #line 2744 "c-exp.c" /* yacc.c:1646 */
2743  break;
2744 
2745  case 107:
2746 #line 826 "c-exp.y" /* yacc.c:1646 */
2747  {
2748  /* Note that we NUL-terminate here, but just
2749  for convenience. */
2750  char *p;
2751  ++(yyval.svec).len;
2752  (yyval.svec).tokens = XRESIZEVEC (struct typed_stoken,
2753  (yyval.svec).tokens, (yyval.svec).len);
2754 
2755  p = (char *) xmalloc ((yyvsp[0].tsval).length + 1);
2756  memcpy (p, (yyvsp[0].tsval).ptr, (yyvsp[0].tsval).length + 1);
2757 
2758  (yyval.svec).tokens[(yyval.svec).len - 1].type = (yyvsp[0].tsval).type;
2759  (yyval.svec).tokens[(yyval.svec).len - 1].length = (yyvsp[0].tsval).length;
2760  (yyval.svec).tokens[(yyval.svec).len - 1].ptr = p;
2761  }
2762 #line 2764 "c-exp.c" /* yacc.c:1646 */
2763  break;
2764 
2765  case 108:
2766 #line 844 "c-exp.y" /* yacc.c:1646 */
2767  {
2768  int i;
2769  c_string_type type = C_STRING;
2770 
2771  for (i = 0; i < (yyvsp[0].svec).len; ++i)
2772  {
2773  switch ((yyvsp[0].svec).tokens[i].type)
2774  {
2775  case C_STRING:
2776  break;
2777  case C_WIDE_STRING:
2778  case C_STRING_16:
2779  case C_STRING_32:
2780  if (type != C_STRING
2781  && type != (yyvsp[0].svec).tokens[i].type)
2782  error (_("Undefined string concatenation."));
2783  type = (enum c_string_type_values) (yyvsp[0].svec).tokens[i].type;
2784  break;
2785  default:
2786  /* internal error */
2787  internal_error (__FILE__, __LINE__,
2788  "unrecognized type in string concatenation");
2789  }
2790  }
2791 
2792  write_exp_string_vector (pstate, type, &(yyvsp[0].svec));
2793  for (i = 0; i < (yyvsp[0].svec).len; ++i)
2794  xfree ((yyvsp[0].svec).tokens[i].ptr);
2795  xfree ((yyvsp[0].svec).tokens);
2796  }
2797 #line 2799 "c-exp.c" /* yacc.c:1646 */
2798  break;
2799 
2800  case 109:
2801 #line 879 "c-exp.y" /* yacc.c:1646 */
2802  { write_exp_elt_opcode (pstate, OP_OBJC_NSSTRING);
2803  write_exp_string (pstate, (yyvsp[0].sval));
2804  write_exp_elt_opcode (pstate, OP_OBJC_NSSTRING); }
2805 #line 2807 "c-exp.c" /* yacc.c:1646 */
2806  break;
2807 
2808  case 110:
2809 #line 886 "c-exp.y" /* yacc.c:1646 */
2810  { write_exp_elt_opcode (pstate, OP_LONG);
2812  parse_type (pstate)->builtin_bool);
2814  write_exp_elt_opcode (pstate, OP_LONG); }
2815 #line 2817 "c-exp.c" /* yacc.c:1646 */
2816  break;
2817 
2818  case 111:
2819 #line 894 "c-exp.y" /* yacc.c:1646 */
2820  { write_exp_elt_opcode (pstate, OP_LONG);
2822  parse_type (pstate)->builtin_bool);
2824  write_exp_elt_opcode (pstate, OP_LONG); }
2825 #line 2827 "c-exp.c" /* yacc.c:1646 */
2826  break;
2827 
2828  case 112:
2829 #line 904 "c-exp.y" /* yacc.c:1646 */
2830  {
2831  if ((yyvsp[0].ssym).sym.symbol)
2832  (yyval.bval) = SYMBOL_BLOCK_VALUE ((yyvsp[0].ssym).sym.symbol);
2833  else
2834  error (_("No file or function \"%s\"."),
2835  copy_name ((yyvsp[0].ssym).stoken));
2836  }
2837 #line 2839 "c-exp.c" /* yacc.c:1646 */
2838  break;
2839 
2840  case 113:
2841 #line 912 "c-exp.y" /* yacc.c:1646 */
2842  {
2843  (yyval.bval) = (yyvsp[0].bval);
2844  }
2845 #line 2847 "c-exp.c" /* yacc.c:1646 */
2846  break;
2847 
2848  case 114:
2849 #line 918 "c-exp.y" /* yacc.c:1646 */
2850  { struct symbol *tem
2851  = lookup_symbol (copy_name ((yyvsp[0].sval)), (yyvsp[-2].bval),
2852  VAR_DOMAIN, NULL).symbol;
2853 
2854  if (!tem || SYMBOL_CLASS (tem) != LOC_BLOCK)
2855  error (_("No function \"%s\" in specified context."),
2856  copy_name ((yyvsp[0].sval)));
2857  (yyval.bval) = SYMBOL_BLOCK_VALUE (tem); }
2858 #line 2860 "c-exp.c" /* yacc.c:1646 */
2859  break;
2860 
2861  case 115:
2862 #line 929 "c-exp.y" /* yacc.c:1646 */
2863  { struct symbol *sym = (yyvsp[-1].ssym).sym.symbol;
2864 
2865  if (sym == NULL || !SYMBOL_IS_ARGUMENT (sym)
2866  || !symbol_read_needs_frame (sym))
2867  error (_("@entry can be used only for function "
2868  "parameters, not for \"%s\""),
2869  copy_name ((yyvsp[-1].ssym).stoken));
2870 
2871  write_exp_elt_opcode (pstate, OP_VAR_ENTRY_VALUE);
2872  write_exp_elt_sym (pstate, sym);
2873  write_exp_elt_opcode (pstate, OP_VAR_ENTRY_VALUE);
2874  }
2875 #line 2877 "c-exp.c" /* yacc.c:1646 */
2876  break;
2877 
2878  case 116:
2879 #line 944 "c-exp.y" /* yacc.c:1646 */
2880  { struct block_symbol sym
2881  = lookup_symbol (copy_name ((yyvsp[0].sval)), (yyvsp[-2].bval),
2882  VAR_DOMAIN, NULL);
2883 
2884  if (sym.symbol == 0)
2885  error (_("No symbol \"%s\" in specified context."),
2886  copy_name ((yyvsp[0].sval)));
2887  if (symbol_read_needs_frame (sym.symbol))
2888  {
2889  if (innermost_block == 0
2890  || contained_in (sym.block,
2891  innermost_block))
2892  innermost_block = sym.block;
2893  }
2894 
2895  write_exp_elt_opcode (pstate, OP_VAR_VALUE);
2898  write_exp_elt_opcode (pstate, OP_VAR_VALUE); }
2899 #line 2901 "c-exp.c" /* yacc.c:1646 */
2900  break;
2901 
2902  case 117:
2903 #line 966 "c-exp.y" /* yacc.c:1646 */
2904  {
2905  struct type *type = (yyvsp[-2].tsym).type;
2906  type = check_typedef (type);
2907  if (!type_aggregate_p (type))
2908  error (_("`%s' is not defined as an aggregate type."),
2909  TYPE_SAFE_NAME (type));
2910 
2911  write_exp_elt_opcode (pstate, OP_SCOPE);
2913  write_exp_string (pstate, (yyvsp[0].sval));
2914  write_exp_elt_opcode (pstate, OP_SCOPE);
2915  }
2916 #line 2918 "c-exp.c" /* yacc.c:1646 */
2917  break;
2918 
2919  case 118:
2920 #line 979 "c-exp.y" /* yacc.c:1646 */
2921  {
2922  struct type *type = (yyvsp[-3].tsym).type;
2923  struct stoken tmp_token;
2924  char *buf;
2925 
2926  type = check_typedef (type);
2927  if (!type_aggregate_p (type))
2928  error (_("`%s' is not defined as an aggregate type."),
2929  TYPE_SAFE_NAME (type));
2930  buf = (char *) alloca ((yyvsp[0].sval).length + 2);
2931  tmp_token.ptr = buf;
2932  tmp_token.length = (yyvsp[0].sval).length + 1;
2933  buf[0] = '~';
2934  memcpy (buf+1, (yyvsp[0].sval).ptr, (yyvsp[0].sval).length);
2935  buf[tmp_token.length] = 0;
2936 
2937  /* Check for valid destructor name. */
2938  destructor_name_p (tmp_token.ptr, (yyvsp[-3].tsym).type);
2939  write_exp_elt_opcode (pstate, OP_SCOPE);
2941  write_exp_string (pstate, tmp_token);
2942  write_exp_elt_opcode (pstate, OP_SCOPE);
2943  }
2944 #line 2946 "c-exp.c" /* yacc.c:1646 */
2945  break;
2946 
2947  case 119:
2948 #line 1003 "c-exp.y" /* yacc.c:1646 */
2949  {
2950  char *copy = copy_name ((yyvsp[-2].sval));
2951  error (_("No type \"%s\" within class "
2952  "or namespace \"%s\"."),
2953  copy, TYPE_SAFE_NAME ((yyvsp[-4].tsym).type));
2954  }
2955 #line 2957 "c-exp.c" /* yacc.c:1646 */
2956  break;
2957 
2958  case 121:
2959 #line 1013 "c-exp.y" /* yacc.c:1646 */
2960  {
2961  char *name = copy_name ((yyvsp[0].ssym).stoken);
2962  struct symbol *sym;
2963  struct bound_minimal_symbol msymbol;
2964 
2965  sym
2966  = lookup_symbol (name, (const struct block *) NULL,
2967  VAR_DOMAIN, NULL).symbol;
2968  if (sym)
2969  {
2970  write_exp_elt_opcode (pstate, OP_VAR_VALUE);
2971  write_exp_elt_block (pstate, NULL);
2972  write_exp_elt_sym (pstate, sym);
2973  write_exp_elt_opcode (pstate, OP_VAR_VALUE);
2974  break;
2975  }
2976 
2977  msymbol = lookup_bound_minimal_symbol (name);
2978  if (msymbol.minsym != NULL)
2979  write_exp_msymbol (pstate, msymbol);
2980  else if (!have_full_symbols () && !have_partial_symbols ())
2981  error (_("No symbol table is loaded. Use the \"file\" command."));
2982  else
2983  error (_("No symbol \"%s\" in current context."), name);
2984  }
2985 #line 2987 "c-exp.c" /* yacc.c:1646 */
2986  break;
2987 
2988  case 122:
2989 #line 1041 "c-exp.y" /* yacc.c:1646 */
2990  { struct block_symbol sym = (yyvsp[0].ssym).sym;
2991 
2992  if (sym.symbol)
2993  {
2994  if (symbol_read_needs_frame (sym.symbol))
2995  {
2996  if (innermost_block == 0
2997  || contained_in (sym.block,
2998  innermost_block))
2999  innermost_block = sym.block;
3000  }
3001 
3002  write_exp_elt_opcode (pstate, OP_VAR_VALUE);
3005  write_exp_elt_opcode (pstate, OP_VAR_VALUE);
3006  }
3007  else if ((yyvsp[0].ssym).is_a_field_of_this)
3008  {
3009  /* C++: it hangs off of `this'. Must
3010  not inadvertently convert from a method call
3011  to data ref. */
3012  if (innermost_block == 0
3013  || contained_in (sym.block,
3014  innermost_block))
3015  innermost_block = sym.block;
3016  write_exp_elt_opcode (pstate, OP_THIS);
3017  write_exp_elt_opcode (pstate, OP_THIS);
3018  write_exp_elt_opcode (pstate, STRUCTOP_PTR);
3019  write_exp_string (pstate, (yyvsp[0].ssym).stoken);
3020  write_exp_elt_opcode (pstate, STRUCTOP_PTR);
3021  }
3022  else
3023  {
3024  char *arg = copy_name ((yyvsp[0].ssym).stoken);
3025 
3026  bound_minimal_symbol msymbol
3028  if (msymbol.minsym == NULL)
3029  {
3030  if (!have_full_symbols () && !have_partial_symbols ())
3031  error (_("No symbol table is loaded. Use the \"file\" command."));
3032  else
3033  error (_("No symbol \"%s\" in current context."),
3034  copy_name ((yyvsp[0].ssym).stoken));
3035  }
3036 
3037  /* This minsym might be an alias for
3038  another function. See if we can find
3039  the debug symbol for the target, and
3040  if so, use it instead, since it has
3041  return type / prototype info. This
3042  is important for example for "p
3043  *__errno_location()". */
3044  symbol *alias_target
3045  = find_function_alias_target (msymbol);
3046  if (alias_target != NULL)
3047  {
3048  write_exp_elt_opcode (pstate, OP_VAR_VALUE);
3050  (pstate, SYMBOL_BLOCK_VALUE (alias_target));
3051  write_exp_elt_sym (pstate, alias_target);
3052  write_exp_elt_opcode (pstate, OP_VAR_VALUE);
3053  }
3054  else
3055  write_exp_msymbol (pstate, msymbol);
3056  }
3057  }
3058 #line 3060 "c-exp.c" /* yacc.c:1646 */
3059  break;
3060 
3061  case 123:
3062 #line 1112 "c-exp.y" /* yacc.c:1646 */
3064 #line 3066 "c-exp.c" /* yacc.c:1646 */
3065  break;
3066 
3067  case 131:
3068 #line 1133 "c-exp.y" /* yacc.c:1646 */
3069  { insert_type (tp_pointer); }
3070 #line 3072 "c-exp.c" /* yacc.c:1646 */
3071  break;
3072 
3073  case 133:
3074 #line 1136 "c-exp.y" /* yacc.c:1646 */
3075  { insert_type (tp_pointer); }
3076 #line 3078 "c-exp.c" /* yacc.c:1646 */
3077  break;
3078 
3079  case 135:
3080 #line 1139 "c-exp.y" /* yacc.c:1646 */
3081  { insert_type (tp_reference); }
3082 #line 3084 "c-exp.c" /* yacc.c:1646 */
3083  break;
3084 
3085  case 136:
3086 #line 1141 "c-exp.y" /* yacc.c:1646 */
3087  { insert_type (tp_reference); }
3088 #line 3090 "c-exp.c" /* yacc.c:1646 */
3089  break;
3090 
3091  case 137:
3092 #line 1143 "c-exp.y" /* yacc.c:1646 */
3094 #line 3096 "c-exp.c" /* yacc.c:1646 */
3095  break;
3096 
3097  case 138:
3098 #line 1145 "c-exp.y" /* yacc.c:1646 */
3100 #line 3102 "c-exp.c" /* yacc.c:1646 */
3101  break;
3102 
3103  case 139:
3104 #line 1149 "c-exp.y" /* yacc.c:1646 */
3105  {
3106  (yyval.type_stack) = get_type_stack ();
3107  /* This cleanup is eventually run by
3108  c_parse. */
3109  make_cleanup (type_stack_cleanup, (yyval.type_stack));
3110  }
3111 #line 3113 "c-exp.c" /* yacc.c:1646 */
3112  break;
3113 
3114  case 140:
3115 #line 1158 "c-exp.y" /* yacc.c:1646 */
3116  { (yyval.type_stack) = append_type_stack ((yyvsp[0].type_stack), (yyvsp[-1].type_stack)); }
3117 #line 3119 "c-exp.c" /* yacc.c:1646 */
3118  break;
3119 
3120  case 143:
3121 #line 1164 "c-exp.y" /* yacc.c:1646 */
3122  { (yyval.type_stack) = (yyvsp[-1].type_stack); }
3123 #line 3125 "c-exp.c" /* yacc.c:1646 */
3124  break;
3125 
3126  case 144:
3127 #line 1166 "c-exp.y" /* yacc.c:1646 */
3128  {
3130  push_type_int ((yyvsp[0].lval));
3131  push_type (tp_array);
3132  (yyval.type_stack) = get_type_stack ();
3133  }
3134 #line 3136 "c-exp.c" /* yacc.c:1646 */
3135  break;
3136 
3137  case 145:
3138 #line 1173 "c-exp.y" /* yacc.c:1646 */
3139  {
3140  push_type_int ((yyvsp[0].lval));
3141  push_type (tp_array);
3142  (yyval.type_stack) = get_type_stack ();
3143  }
3144 #line 3146 "c-exp.c" /* yacc.c:1646 */
3145  break;
3146 
3147  case 146:
3148 #line 1180 "c-exp.y" /* yacc.c:1646 */
3149  {
3151  push_typelist ((yyvsp[0].tvec));
3152  (yyval.type_stack) = get_type_stack ();
3153  }
3154 #line 3156 "c-exp.c" /* yacc.c:1646 */
3155  break;
3156 
3157  case 147:
3158 #line 1186 "c-exp.y" /* yacc.c:1646 */
3159  {
3160  push_typelist ((yyvsp[0].tvec));
3161  (yyval.type_stack) = get_type_stack ();
3162  }
3163 #line 3165 "c-exp.c" /* yacc.c:1646 */
3164  break;
3165 
3166  case 148:
3167 #line 1193 "c-exp.y" /* yacc.c:1646 */
3168  { (yyval.lval) = -1; }
3169 #line 3171 "c-exp.c" /* yacc.c:1646 */
3170  break;
3171 
3172  case 149:
3173 #line 1195 "c-exp.y" /* yacc.c:1646 */
3174  { (yyval.lval) = -1; }
3175 #line 3177 "c-exp.c" /* yacc.c:1646 */
3176  break;
3177 
3178  case 150:
3179 #line 1197 "c-exp.y" /* yacc.c:1646 */
3180  { (yyval.lval) = (yyvsp[-1].typed_val_int).val; }
3181 #line 3183 "c-exp.c" /* yacc.c:1646 */
3182  break;
3183 
3184  case 151:
3185 #line 1199 "c-exp.y" /* yacc.c:1646 */
3186  { (yyval.lval) = (yyvsp[-1].typed_val_int).val; }
3187 #line 3189 "c-exp.c" /* yacc.c:1646 */
3188  break;
3189 
3190  case 152:
3191 #line 1203 "c-exp.y" /* yacc.c:1646 */
3192  { (yyval.tvec) = NULL; }
3193 #line 3195 "c-exp.c" /* yacc.c:1646 */
3194  break;
3195 
3196  case 153:
3197 #line 1205 "c-exp.y" /* yacc.c:1646 */
3198  { (yyval.tvec) = (yyvsp[-1].tvec); }
3199 #line 3201 "c-exp.c" /* yacc.c:1646 */
3200  break;
3201 
3202  case 155:
3203 #line 1221 "c-exp.y" /* yacc.c:1646 */
3204  { (yyval.tval) = (yyvsp[0].tsym).type; }
3205 #line 3207 "c-exp.c" /* yacc.c:1646 */
3206  break;
3207 
3208  case 156:
3209 #line 1223 "c-exp.y" /* yacc.c:1646 */
3212  "int"); }
3213 #line 3215 "c-exp.c" /* yacc.c:1646 */
3214  break;
3215 
3216  case 157:
3217 #line 1227 "c-exp.y" /* yacc.c:1646 */
3220  "long"); }
3221 #line 3223 "c-exp.c" /* yacc.c:1646 */
3222  break;
3223 
3224  case 158:
3225 #line 1231 "c-exp.y" /* yacc.c:1646 */
3228  "short"); }
3229 #line 3231 "c-exp.c" /* yacc.c:1646 */
3230  break;
3231 
3232  case 159:
3233 #line 1235 "c-exp.y" /* yacc.c:1646 */
3236  "long"); }
3237 #line 3239 "c-exp.c" /* yacc.c:1646 */
3238  break;
3239 
3240  case 160:
3241 #line 1239 "c-exp.y" /* yacc.c:1646 */
3244  "long"); }
3245 #line 3247 "c-exp.c" /* yacc.c:1646 */
3246  break;
3247 
3248  case 161:
3249 #line 1243 "c-exp.y" /* yacc.c:1646 */
3252  "long"); }
3253 #line 3255 "c-exp.c" /* yacc.c:1646 */
3254  break;
3255 
3256  case 162:
3257 #line 1247 "c-exp.y" /* yacc.c:1646 */
3260  "long"); }
3261 #line 3263 "c-exp.c" /* yacc.c:1646 */
3262  break;
3263 
3264  case 163:
3265 #line 1251 "c-exp.y" /* yacc.c:1646 */
3268  "long"); }
3269 #line 3271 "c-exp.c" /* yacc.c:1646 */
3270  break;
3271 
3272  case 164:
3273 #line 1255 "c-exp.y" /* yacc.c:1646 */
3276  "long"); }
3277 #line 3279 "c-exp.c" /* yacc.c:1646 */
3278  break;
3279 
3280  case 165:
3281 #line 1259 "c-exp.y" /* yacc.c:1646 */
3284  "long"); }
3285 #line 3287 "c-exp.c" /* yacc.c:1646 */
3286  break;
3287 
3288  case 166:
3289 #line 1263 "c-exp.y" /* yacc.c:1646 */
3292  "long long"); }
3293 #line 3295 "c-exp.c" /* yacc.c:1646 */
3294  break;
3295 
3296  case 167:
3297 #line 1267 "c-exp.y" /* yacc.c:1646 */
3300  "long long"); }
3301 #line 3303 "c-exp.c" /* yacc.c:1646 */
3302  break;
3303 
3304  case 168:
3305 #line 1271 "c-exp.y" /* yacc.c:1646 */
3308  "long long"); }
3309 #line 3311 "c-exp.c" /* yacc.c:1646 */
3310  break;
3311 
3312  case 169:
3313 #line 1275 "c-exp.y" /* yacc.c:1646 */
3316  "long long"); }
3317 #line 3319 "c-exp.c" /* yacc.c:1646 */
3318  break;
3319 
3320  case 170:
3321 #line 1279 "c-exp.y" /* yacc.c:1646 */
3324  "long long"); }
3325 #line 3327 "c-exp.c" /* yacc.c:1646 */
3326  break;
3327 
3328  case 171:
3329 #line 1283 "c-exp.y" /* yacc.c:1646 */
3332  "long long"); }
3333 #line 3335 "c-exp.c" /* yacc.c:1646 */
3334  break;
3335 
3336  case 172:
3337 #line 1287 "c-exp.y" /* yacc.c:1646 */
3340  "long long"); }
3341 #line 3343 "c-exp.c" /* yacc.c:1646 */
3342  break;
3343 
3344  case 173:
3345 #line 1291 "c-exp.y" /* yacc.c:1646 */
3348  "long long"); }
3349 #line 3351 "c-exp.c" /* yacc.c:1646 */
3350  break;
3351 
3352  case 174:
3353 #line 1295 "c-exp.y" /* yacc.c:1646 */
3356  "long long"); }
3357 #line 3359 "c-exp.c" /* yacc.c:1646 */
3358  break;
3359 
3360  case 175:
3361 #line 1299 "c-exp.y" /* yacc.c:1646 */
3364  "long long"); }
3365 #line 3367 "c-exp.c" /* yacc.c:1646 */
3366  break;
3367 
3368  case 176:
3369 #line 1303 "c-exp.y" /* yacc.c:1646 */
3372  "short"); }
3373 #line 3375 "c-exp.c" /* yacc.c:1646 */
3374  break;
3375 
3376  case 177:
3377 #line 1307 "c-exp.y" /* yacc.c:1646 */
3380  "short"); }
3381 #line 3383 "c-exp.c" /* yacc.c:1646 */
3382  break;
3383 
3384  case 178:
3385 #line 1311 "c-exp.y" /* yacc.c:1646 */
3388  "short"); }
3389 #line 3391 "c-exp.c" /* yacc.c:1646 */
3390  break;
3391 
3392  case 179:
3393 #line 1315 "c-exp.y" /* yacc.c:1646 */
3396  "short"); }
3397 #line 3399 "c-exp.c" /* yacc.c:1646 */
3398  break;
3399 
3400  case 180:
3401 #line 1319 "c-exp.y" /* yacc.c:1646 */
3404  "short"); }
3405 #line 3407 "c-exp.c" /* yacc.c:1646 */
3406  break;
3407 
3408  case 181:
3409 #line 1323 "c-exp.y" /* yacc.c:1646 */
3412  "short"); }
3413 #line 3415 "c-exp.c" /* yacc.c:1646 */
3414  break;
3415 
3416  case 182:
3417 #line 1327 "c-exp.y" /* yacc.c:1646 */
3420  "double",
3421  (struct block *) NULL,
3422  0); }
3423 #line 3425 "c-exp.c" /* yacc.c:1646 */
3424  break;
3425 
3426  case 183:
3427 #line 1333 "c-exp.y" /* yacc.c:1646 */
3430  "long double",
3431  (struct block *) NULL,
3432  0); }
3433 #line 3435 "c-exp.c" /* yacc.c:1646 */
3434  break;
3435 
3436  case 184:
3437 #line 1339 "c-exp.y" /* yacc.c:1646 */
3438  { (yyval.tval) = lookup_struct (copy_name ((yyvsp[0].sval)),
3440 #line 3442 "c-exp.c" /* yacc.c:1646 */
3441  break;
3442 
3443  case 185:
3444 #line 1342 "c-exp.y" /* yacc.c:1646 */
3445  {
3447  (yyval.tval) = NULL;
3448  }
3449 #line 3451 "c-exp.c" /* yacc.c:1646 */
3450  break;
3451 
3452  case 186:
3453 #line 1347 "c-exp.y" /* yacc.c:1646 */
3454  {
3455  mark_completion_tag (TYPE_CODE_STRUCT, (yyvsp[-1].sval).ptr,
3456  (yyvsp[-1].sval).length);
3457  (yyval.tval) = NULL;
3458  }
3459 #line 3461 "c-exp.c" /* yacc.c:1646 */
3460  break;
3461 
3462  case 187:
3463 #line 1353 "c-exp.y" /* yacc.c:1646 */
3464  { (yyval.tval) = lookup_struct (copy_name ((yyvsp[0].sval)),
3466 #line 3468 "c-exp.c" /* yacc.c:1646 */
3467  break;
3468 
3469  case 188:
3470 #line 1356 "c-exp.y" /* yacc.c:1646 */
3471  {
3473  (yyval.tval) = NULL;
3474  }
3475 #line 3477 "c-exp.c" /* yacc.c:1646 */
3476  break;
3477 
3478  case 189:
3479 #line 1361 "c-exp.y" /* yacc.c:1646 */
3480  {
3481  mark_completion_tag (TYPE_CODE_STRUCT, (yyvsp[-1].sval).ptr,
3482  (yyvsp[-1].sval).length);
3483  (yyval.tval) = NULL;
3484  }
3485 #line 3487 "c-exp.c" /* yacc.c:1646 */
3486  break;
3487 
3488  case 190:
3489 #line 1367 "c-exp.y" /* yacc.c:1646 */
3490  { (yyval.tval) = lookup_union (copy_name ((yyvsp[0].sval)),
3492 #line 3494 "c-exp.c" /* yacc.c:1646 */
3493  break;
3494 
3495  case 191:
3496 #line 1370 "c-exp.y" /* yacc.c:1646 */
3497  {
3499  (yyval.tval) = NULL;
3500  }
3501 #line 3503 "c-exp.c" /* yacc.c:1646 */
3502  break;
3503 
3504  case 192:
3505 #line 1375 "c-exp.y" /* yacc.c:1646 */
3506  {
3507  mark_completion_tag (TYPE_CODE_UNION, (yyvsp[-1].sval).ptr,
3508  (yyvsp[-1].sval).length);
3509  (yyval.tval) = NULL;
3510  }
3511 #line 3513 "c-exp.c" /* yacc.c:1646 */
3512  break;
3513 
3514  case 193:
3515 #line 1381 "c-exp.y" /* yacc.c:1646 */
3516  { (yyval.tval) = lookup_enum (copy_name ((yyvsp[0].sval)),
3518 #line 3520 "c-exp.c" /* yacc.c:1646 */
3519  break;
3520 
3521  case 194:
3522 #line 1384 "c-exp.y" /* yacc.c:1646 */
3523  {
3525  (yyval.tval) = NULL;
3526  }
3527 #line 3529 "c-exp.c" /* yacc.c:1646 */
3528  break;
3529 
3530  case 195:
3531 #line 1389 "c-exp.y" /* yacc.c:1646 */
3532  {
3533  mark_completion_tag (TYPE_CODE_ENUM, (yyvsp[-1].sval).ptr,
3534  (yyvsp[-1].sval).length);
3535  (yyval.tval) = NULL;
3536  }
3537 #line 3539 "c-exp.c" /* yacc.c:1646 */
3538  break;
3539 
3540  case 196:
3541 #line 1395 "c-exp.y" /* yacc.c:1646 */
3544  TYPE_NAME((yyvsp[0].tsym).type)); }
3545 #line 3547 "c-exp.c" /* yacc.c:1646 */
3546  break;
3547 
3548  case 197:
3549 #line 1399 "c-exp.y" /* yacc.c:1646 */
3552  "int"); }
3553 #line 3555 "c-exp.c" /* yacc.c:1646 */
3554  break;
3555 
3556  case 198:
3557 #line 1403 "c-exp.y" /* yacc.c:1646 */
3560  TYPE_NAME((yyvsp[0].tsym).type)); }
3561 #line 3563 "c-exp.c" /* yacc.c:1646 */
3562  break;
3563 
3564  case 199:
3565 #line 1407 "c-exp.y" /* yacc.c:1646 */
3568  "int"); }
3569 #line 3571 "c-exp.c" /* yacc.c:1646 */
3570  break;
3571 
3572  case 200:
3573 #line 1414 "c-exp.y" /* yacc.c:1646 */
3574  { (yyval.tval) = lookup_template_type(copy_name((yyvsp[-3].sval)), (yyvsp[-1].tval),
3576  }
3577 #line 3579 "c-exp.c" /* yacc.c:1646 */
3578  break;
3579 
3580  case 201:
3581 #line 1418 "c-exp.y" /* yacc.c:1646 */
3582  { (yyval.tval) = follow_types ((yyvsp[0].tval)); }
3583 #line 3585 "c-exp.c" /* yacc.c:1646 */
3584  break;
3585 
3586  case 202:
3587 #line 1420 "c-exp.y" /* yacc.c:1646 */
3588  { (yyval.tval) = follow_types ((yyvsp[-1].tval)); }
3589 #line 3591 "c-exp.c" /* yacc.c:1646 */
3590  break;
3591 
3592  case 204:
3593 #line 1425 "c-exp.y" /* yacc.c:1646 */
3594  {
3595  (yyval.tsym).stoken.ptr = "int";
3596  (yyval.tsym).stoken.length = 3;
3599  "int");
3600  }
3601 #line 3603 "c-exp.c" /* yacc.c:1646 */
3602  break;
3603 
3604  case 205:
3605 #line 1433 "c-exp.y" /* yacc.c:1646 */
3606  {
3607  (yyval.tsym).stoken.ptr = "long";
3608  (yyval.tsym).stoken.length = 4;
3611  "long");
3612  }
3613 #line 3615 "c-exp.c" /* yacc.c:1646 */
3614  break;
3615 
3616  case 206:
3617 #line 1441 "c-exp.y" /* yacc.c:1646 */
3618  {
3619  (yyval.tsym).stoken.ptr = "short";
3620  (yyval.tsym).stoken.length = 5;
3623  "short");
3624  }
3625 #line 3627 "c-exp.c" /* yacc.c:1646 */
3626  break;
3627 
3628  case 207:
3629 #line 1452 "c-exp.y" /* yacc.c:1646 */
3630  { check_parameter_typelist ((yyvsp[0].tvec)); }
3631 #line 3633 "c-exp.c" /* yacc.c:1646 */
3632  break;
3633 
3634  case 208:
3635 #line 1454 "c-exp.y" /* yacc.c:1646 */
3636  {
3637  VEC_safe_push (type_ptr, (yyvsp[-2].tvec), NULL);
3638  check_parameter_typelist ((yyvsp[-2].tvec));
3639  (yyval.tvec) = (yyvsp[-2].tvec);
3640  }
3641 #line 3643 "c-exp.c" /* yacc.c:1646 */
3642  break;
3643 
3644  case 209:
3645 #line 1463 "c-exp.y" /* yacc.c:1646 */
3646  {
3647  VEC (type_ptr) *typelist = NULL;
3648  VEC_safe_push (type_ptr, typelist, (yyvsp[0].tval));
3649  (yyval.tvec) = typelist;
3650  }
3651 #line 3653 "c-exp.c" /* yacc.c:1646 */
3652  break;
3653 
3654  case 210:
3655 #line 1469 "c-exp.y" /* yacc.c:1646 */
3656  {
3657  VEC_safe_push (type_ptr, (yyvsp[-2].tvec), (yyvsp[0].tval));
3658  (yyval.tvec) = (yyvsp[-2].tvec);
3659  }
3660 #line 3662 "c-exp.c" /* yacc.c:1646 */
3661  break;
3662 
3663  case 212:
3664 #line 1477 "c-exp.y" /* yacc.c:1646 */
3665  {
3667  (yyval.tval) = follow_types ((yyvsp[-1].tval));
3668  }
3669 #line 3671 "c-exp.c" /* yacc.c:1646 */
3670  break;
3671 
3672  case 213:
3673 #line 1484 "c-exp.y" /* yacc.c:1646 */
3674  { (yyval.tval) = follow_types ((yyvsp[-1].tval)); }
3675 #line 3677 "c-exp.c" /* yacc.c:1646 */
3676  break;
3677 
3678  case 218:
3679 #line 1496 "c-exp.y" /* yacc.c:1646 */
3680  { insert_type (tp_const);
3682  }
3683 #line 3685 "c-exp.c" /* yacc.c:1646 */
3684  break;
3685 
3686  case 219:
3687 #line 1500 "c-exp.y" /* yacc.c:1646 */
3688  { insert_type (tp_const); }
3689 #line 3691 "c-exp.c" /* yacc.c:1646 */
3690  break;
3691 
3692  case 220:
3693 #line 1502 "c-exp.y" /* yacc.c:1646 */
3694  { insert_type (tp_volatile); }
3695 #line 3697 "c-exp.c" /* yacc.c:1646 */
3696  break;
3697 
3698  case 221:
3699 #line 1506 "c-exp.y" /* yacc.c:1646 */
3700  { (yyval.sval) = operator_stoken (" new"); }
3701 #line 3703 "c-exp.c" /* yacc.c:1646 */
3702  break;
3703 
3704  case 222:
3705 #line 1508 "c-exp.y" /* yacc.c:1646 */
3706  { (yyval.sval) = operator_stoken (" delete"); }
3707 #line 3709 "c-exp.c" /* yacc.c:1646 */
3708  break;
3709 
3710  case 223:
3711 #line 1510 "c-exp.y" /* yacc.c:1646 */
3712  { (yyval.sval) = operator_stoken (" new[]"); }
3713 #line 3715 "c-exp.c" /* yacc.c:1646 */
3714  break;
3715 
3716  case 224:
3717 #line 1512 "c-exp.y" /* yacc.c:1646 */
3718  { (yyval.sval) = operator_stoken (" delete[]"); }
3719 #line 3721 "c-exp.c" /* yacc.c:1646 */
3720  break;
3721 
3722  case 225:
3723 #line 1514 "c-exp.y" /* yacc.c:1646 */
3724  { (yyval.sval) = operator_stoken (" new[]"); }
3725 #line 3727 "c-exp.c" /* yacc.c:1646 */
3726  break;
3727 
3728  case 226:
3729 #line 1516 "c-exp.y" /* yacc.c:1646 */
3730  { (yyval.sval) = operator_stoken (" delete[]"); }
3731 #line 3733 "c-exp.c" /* yacc.c:1646 */
3732  break;
3733 
3734  case 227:
3735 #line 1518 "c-exp.y" /* yacc.c:1646 */
3736  { (yyval.sval) = operator_stoken ("+"); }
3737 #line 3739 "c-exp.c" /* yacc.c:1646 */
3738  break;
3739 
3740  case 228:
3741 #line 1520 "c-exp.y" /* yacc.c:1646 */
3742  { (yyval.sval) = operator_stoken ("-"); }
3743 #line 3745 "c-exp.c" /* yacc.c:1646 */
3744  break;
3745 
3746  case 229:
3747 #line 1522 "c-exp.y" /* yacc.c:1646 */
3748  { (yyval.sval) = operator_stoken ("*"); }
3749 #line 3751 "c-exp.c" /* yacc.c:1646 */
3750  break;
3751 
3752  case 230:
3753 #line 1524 "c-exp.y" /* yacc.c:1646 */
3754  { (yyval.sval) = operator_stoken ("/"); }
3755 #line 3757 "c-exp.c" /* yacc.c:1646 */
3756  break;
3757 
3758  case 231:
3759 #line 1526 "c-exp.y" /* yacc.c:1646 */
3760  { (yyval.sval) = operator_stoken ("%"); }
3761 #line 3763 "c-exp.c" /* yacc.c:1646 */
3762  break;
3763 
3764  case 232:
3765 #line 1528 "c-exp.y" /* yacc.c:1646 */
3766  { (yyval.sval) = operator_stoken ("^"); }
3767 #line 3769 "c-exp.c" /* yacc.c:1646 */
3768  break;
3769 
3770  case 233:
3771 #line 1530 "c-exp.y" /* yacc.c:1646 */
3772  { (yyval.sval) = operator_stoken ("&"); }
3773 #line 3775 "c-exp.c" /* yacc.c:1646 */
3774  break;
3775 
3776  case 234:
3777 #line 1532 "c-exp.y" /* yacc.c:1646 */
3778  { (yyval.sval) = operator_stoken ("|"); }
3779 #line 3781 "c-exp.c" /* yacc.c:1646 */
3780  break;
3781 
3782  case 235:
3783 #line 1534 "c-exp.y" /* yacc.c:1646 */
3784  { (yyval.sval) = operator_stoken ("~"); }
3785 #line 3787 "c-exp.c" /* yacc.c:1646 */
3786  break;
3787 
3788  case 236:
3789 #line 1536 "c-exp.y" /* yacc.c:1646 */
3790  { (yyval.sval) = operator_stoken ("!"); }
3791 #line 3793 "c-exp.c" /* yacc.c:1646 */
3792  break;
3793 
3794  case 237:
3795 #line 1538 "c-exp.y" /* yacc.c:1646 */
3796  { (yyval.sval) = operator_stoken ("="); }
3797 #line 3799 "c-exp.c" /* yacc.c:1646 */
3798  break;
3799 
3800  case 238:
3801 #line 1540 "c-exp.y" /* yacc.c:1646 */
3802  { (yyval.sval) = operator_stoken ("<"); }
3803 #line 3805 "c-exp.c" /* yacc.c:1646 */
3804  break;
3805 
3806  case 239:
3807 #line 1542 "c-exp.y" /* yacc.c:1646 */
3808  { (yyval.sval) = operator_stoken (">"); }
3809 #line 3811 "c-exp.c" /* yacc.c:1646 */
3810  break;
3811 
3812  case 240:
3813 #line 1544 "c-exp.y" /* yacc.c:1646 */
3814  { const char *op = " unknown";
3815  switch ((yyvsp[0].opcode))
3816  {
3817  case BINOP_RSH:
3818  op = ">>=";
3819  break;
3820  case BINOP_LSH:
3821  op = "<<=";
3822  break;
3823  case BINOP_ADD:
3824  op = "+=";
3825  break;
3826  case BINOP_SUB:
3827  op = "-=";
3828  break;
3829  case BINOP_MUL:
3830  op = "*=";
3831  break;
3832  case BINOP_DIV:
3833  op = "/=";
3834  break;
3835  case BINOP_REM:
3836  op = "%=";
3837  break;
3838  case BINOP_BITWISE_IOR:
3839  op = "|=";
3840  break;
3841  case BINOP_BITWISE_AND:
3842  op = "&=";
3843  break;
3844  case BINOP_BITWISE_XOR:
3845  op = "^=";
3846  break;
3847  default:
3848  break;
3849  }
3850 
3851  (yyval.sval) = operator_stoken (op);
3852  }
3853 #line 3855 "c-exp.c" /* yacc.c:1646 */
3854  break;
3855 
3856  case 241:
3857 #line 1584 "c-exp.y" /* yacc.c:1646 */
3858  { (yyval.sval) = operator_stoken ("<<"); }
3859 #line 3861 "c-exp.c" /* yacc.c:1646 */
3860  break;
3861 
3862  case 242:
3863 #line 1586 "c-exp.y" /* yacc.c:1646 */
3864  { (yyval.sval) = operator_stoken (">>"); }
3865 #line 3867 "c-exp.c" /* yacc.c:1646 */
3866  break;
3867 
3868  case 243:
3869 #line 1588 "c-exp.y" /* yacc.c:1646 */
3870  { (yyval.sval) = operator_stoken ("=="); }
3871 #line 3873 "c-exp.c" /* yacc.c:1646 */
3872  break;
3873 
3874  case 244:
3875 #line 1590 "c-exp.y" /* yacc.c:1646 */
3876  { (yyval.sval) = operator_stoken ("!="); }
3877 #line 3879 "c-exp.c" /* yacc.c:1646 */
3878  break;
3879 
3880  case 245:
3881 #line 1592 "c-exp.y" /* yacc.c:1646 */
3882  { (yyval.sval) = operator_stoken ("<="); }
3883 #line 3885 "c-exp.c" /* yacc.c:1646 */
3884  break;
3885 
3886  case 246:
3887 #line 1594 "c-exp.y" /* yacc.c:1646 */
3888  { (yyval.sval) = operator_stoken (">="); }
3889 #line 3891 "c-exp.c" /* yacc.c:1646 */
3890  break;
3891 
3892  case 247:
3893 #line 1596 "c-exp.y" /* yacc.c:1646 */
3894  { (yyval.sval) = operator_stoken ("&&"); }
3895 #line 3897 "c-exp.c" /* yacc.c:1646 */
3896  break;
3897 
3898  case 248:
3899 #line 1598 "c-exp.y" /* yacc.c:1646 */
3900  { (yyval.sval) = operator_stoken ("||"); }
3901 #line 3903 "c-exp.c" /* yacc.c:1646 */
3902  break;
3903 
3904  case 249:
3905 #line 1600 "c-exp.y" /* yacc.c:1646 */
3906  { (yyval.sval) = operator_stoken ("++"); }
3907 #line 3909 "c-exp.c" /* yacc.c:1646 */
3908  break;
3909 
3910  case 250:
3911 #line 1602 "c-exp.y" /* yacc.c:1646 */
3912  { (yyval.sval) = operator_stoken ("--"); }
3913 #line 3915 "c-exp.c" /* yacc.c:1646 */
3914  break;
3915 
3916  case 251:
3917 #line 1604 "c-exp.y" /* yacc.c:1646 */
3918  { (yyval.sval) = operator_stoken (","); }
3919 #line 3921 "c-exp.c" /* yacc.c:1646 */
3920  break;
3921 
3922  case 252:
3923 #line 1606 "c-exp.y" /* yacc.c:1646 */
3924  { (yyval.sval) = operator_stoken ("->*"); }
3925 #line 3927 "c-exp.c" /* yacc.c:1646 */
3926  break;
3927 
3928  case 253:
3929 #line 1608 "c-exp.y" /* yacc.c:1646 */
3930  { (yyval.sval) = operator_stoken ("->"); }
3931 #line 3933 "c-exp.c" /* yacc.c:1646 */
3932  break;
3933 
3934  case 254:
3935 #line 1610 "c-exp.y" /* yacc.c:1646 */
3936  { (yyval.sval) = operator_stoken ("()"); }
3937 #line 3939 "c-exp.c" /* yacc.c:1646 */
3938  break;
3939 
3940  case 255:
3941 #line 1612 "c-exp.y" /* yacc.c:1646 */
3942  { (yyval.sval) = operator_stoken ("[]"); }
3943 #line 3945 "c-exp.c" /* yacc.c:1646 */
3944  break;
3945 
3946  case 256:
3947 #line 1614 "c-exp.y" /* yacc.c:1646 */
3948  { (yyval.sval) = operator_stoken ("[]"); }
3949 #line 3951 "c-exp.c" /* yacc.c:1646 */
3950  break;
3951 
3952  case 257:
3953 #line 1616 "c-exp.y" /* yacc.c:1646 */
3954  { string_file buf;
3955 
3956  c_print_type ((yyvsp[0].tval), NULL, &buf, -1, 0,
3958 
3959  /* This also needs canonicalization. */
3960  std::string canon
3961  = cp_canonicalize_string (buf.c_str ());
3962  if (canon.empty ())
3963  canon = std::move (buf.string ());
3964  (yyval.sval) = operator_stoken ((" " + canon).c_str ());
3965  }
3966 #line 3968 "c-exp.c" /* yacc.c:1646 */
3967  break;
3968 
3969  case 258:
3970 #line 1632 "c-exp.y" /* yacc.c:1646 */
3971  { (yyval.sval) = (yyvsp[0].ssym).stoken; }
3972 #line 3974 "c-exp.c" /* yacc.c:1646 */
3973  break;
3974 
3975  case 259:
3976 #line 1633 "c-exp.y" /* yacc.c:1646 */
3977  { (yyval.sval) = (yyvsp[0].ssym).stoken; }
3978 #line 3980 "c-exp.c" /* yacc.c:1646 */
3979  break;
3980 
3981  case 260:
3982 #line 1634 "c-exp.y" /* yacc.c:1646 */
3983  { (yyval.sval) = (yyvsp[0].tsym).stoken; }
3984 #line 3986 "c-exp.c" /* yacc.c:1646 */
3985  break;
3986 
3987  case 261:
3988 #line 1635 "c-exp.y" /* yacc.c:1646 */
3989  { (yyval.sval) = (yyvsp[0].ssym).stoken; }
3990 #line 3992 "c-exp.c" /* yacc.c:1646 */
3991  break;
3992 
3993  case 262:
3994 #line 1636 "c-exp.y" /* yacc.c:1646 */
3995  { (yyval.sval) = (yyvsp[0].ssym).stoken; }
3996 #line 3998 "c-exp.c" /* yacc.c:1646 */
3997  break;
3998 
3999  case 263:
4000 #line 1637 "c-exp.y" /* yacc.c:1646 */
4001  { (yyval.sval) = (yyvsp[0].sval); }
4002 #line 4004 "c-exp.c" /* yacc.c:1646 */
4003  break;
4004 
4005  case 266:
4006 #line 1650 "c-exp.y" /* yacc.c:1646 */
4007  {
4008  struct field_of_this_result is_a_field_of_this;
4009 
4010  (yyval.ssym).stoken = (yyvsp[0].sval);
4011  (yyval.ssym).sym = lookup_symbol ((yyvsp[0].sval).ptr,
4013  VAR_DOMAIN,
4014  &is_a_field_of_this);
4015  (yyval.ssym).is_a_field_of_this
4016  = is_a_field_of_this.type != NULL;
4017  }
4018 #line 4020 "c-exp.c" /* yacc.c:1646 */
4019  break;
4020 
4021 
4022 #line 4024 "c-exp.c" /* yacc.c:1646 */
4023  default: break;
4024  }
4025  /* User semantic actions sometimes alter yychar, and that requires
4026  that yytoken be updated with the new translation. We take the
4027  approach of translating immediately before every use of yytoken.
4028  One alternative is translating here after every semantic action,
4029  but that translation would be missed if the semantic action invokes
4030  YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
4031  if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
4032  incorrect destructor might then be invoked immediately. In the
4033  case of YYERROR or YYBACKUP, subsequent parser actions might lead
4034  to an incorrect destructor call or verbose syntax error message
4035  before the lookahead is translated. */
4036  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
4037 
4038  YYPOPSTACK (yylen);
4039  yylen = 0;
4041 
4042  *++yyvsp = yyval;
4043 
4044  /* Now 'shift' the result of the reduction. Determine what state
4045  that goes to, based on the state we popped back to and the rule
4046  number reduced by. */
4047 
4048  yyn = yyr1[yyn];
4049 
4050  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
4051  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
4052  yystate = yytable[yystate];
4053  else
4054  yystate = yydefgoto[yyn - YYNTOKENS];
4055 
4056  goto yynewstate;
4057 
4058 
4059 /*--------------------------------------.
4060 | yyerrlab -- here on detecting error. |
4061 `--------------------------------------*/
4062 yyerrlab:
4063  /* Make sure we have latest lookahead translation. See comments at
4064  user semantic actions for why this is necessary. */
4065  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
4066 
4067  /* If not already recovering from an error, report this error. */
4068  if (!yyerrstatus)
4069  {
4070  ++yynerrs;
4071 #if ! YYERROR_VERBOSE
4072  yyerror (YY_("syntax error"));
4073 #else
4074 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
4075  yyssp, yytoken)
4076  {
4077  char const *yymsgp = YY_("syntax error");
4078  int yysyntax_error_status;
4079  yysyntax_error_status = YYSYNTAX_ERROR;
4080  if (yysyntax_error_status == 0)
4081  yymsgp = yymsg;
4082  else if (yysyntax_error_status == 1)
4083  {
4084  if (yymsg != yymsgbuf)
4085  YYSTACK_FREE (yymsg);
4086  yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
4087  if (!yymsg)
4088  {
4089  yymsg = yymsgbuf;
4090  yymsg_alloc = sizeof yymsgbuf;
4091  yysyntax_error_status = 2;
4092  }
4093  else
4094  {
4095  yysyntax_error_status = YYSYNTAX_ERROR;
4096  yymsgp = yymsg;
4097  }
4098  }
4099  yyerror (yymsgp);
4100  if (yysyntax_error_status == 2)
4101  goto yyexhaustedlab;
4102  }
4103 # undef YYSYNTAX_ERROR
4104 #endif
4105  }
4106 
4107 
4108 
4109  if (yyerrstatus == 3)
4110  {
4111  /* If just tried and failed to reuse lookahead token after an
4112  error, discard it. */
4113 
4114  if (yychar <= YYEOF)
4115  {
4116  /* Return failure if at end of input. */
4117  if (yychar == YYEOF)
4118  YYABORT;
4119  }
4120  else
4121  {
4122  yydestruct ("Error: discarding",
4123  yytoken, &yylval);
4124  yychar = YYEMPTY;
4125  }
4126  }
4127 
4128  /* Else will try to reuse lookahead token after shifting the error
4129  token. */
4130  goto yyerrlab1;
4131 
4132 
4133 /*---------------------------------------------------.
4134 | yyerrorlab -- error raised explicitly by YYERROR. |
4135 `---------------------------------------------------*/
4136 yyerrorlab:
4137 
4138  /* Pacify compilers like GCC when the user code never invokes
4139  YYERROR and the label yyerrorlab therefore never appears in user
4140  code. */
4141  if (/*CONSTCOND*/ 0)
4142  goto yyerrorlab;
4143 
4144  /* Do not reclaim the symbols of the rule whose action triggered
4145  this YYERROR. */
4146  YYPOPSTACK (yylen);
4147  yylen = 0;
4149  yystate = *yyssp;
4150  goto yyerrlab1;
4151 
4152 
4153 /*-------------------------------------------------------------.
4154 | yyerrlab1 -- common code for both syntax error and YYERROR. |
4155 `-------------------------------------------------------------*/
4156 yyerrlab1:
4157  yyerrstatus = 3; /* Each real token shifted decrements this. */
4158 
4159  for (;;)
4160  {
4161  yyn = yypact[yystate];
4162  if (!yypact_value_is_default (yyn))
4163  {
4164  yyn += YYTERROR;
4165  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
4166  {
4167  yyn = yytable[yyn];
4168  if (0 < yyn)
4169  break;
4170  }
4171  }
4172 
4173  /* Pop the current state because it cannot handle the error token. */
4174  if (yyssp == yyss)
4175  YYABORT;
4176 
4177 
4178  yydestruct ("Error: popping",
4179  yystos[yystate], yyvsp);
4180  YYPOPSTACK (1);
4181  yystate = *yyssp;
4183  }
4184 
4186  *++yyvsp = yylval;
4188 
4189 
4190  /* Shift the error token. */
4191  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
4192 
4193  yystate = yyn;
4194  goto yynewstate;
4195 
4196 
4197 /*-------------------------------------.
4198 | yyacceptlab -- YYACCEPT comes here. |
4199 `-------------------------------------*/
4200 yyacceptlab:
4201  yyresult = 0;
4202  goto yyreturn;
4203 
4204 /*-----------------------------------.
4205 | yyabortlab -- YYABORT comes here. |
4206 `-----------------------------------*/
4207 yyabortlab:
4208  yyresult = 1;
4209  goto yyreturn;
4210 
4211 #if !defined yyoverflow || YYERROR_VERBOSE
4212 /*-------------------------------------------------.
4213 | yyexhaustedlab -- memory exhaustion comes here. |
4214 `-------------------------------------------------*/
4215 yyexhaustedlab:
4216  yyerror (YY_("memory exhausted"));
4217  yyresult = 2;
4218  /* Fall through. */
4219 #endif
4220 
4221 yyreturn:
4222  if (yychar != YYEMPTY)
4223  {
4224  /* Make sure we have latest lookahead translation. See comments at
4225  user semantic actions for why this is necessary. */
4226  yytoken = YYTRANSLATE (yychar);
4227  yydestruct ("Cleanup: discarding lookahead",
4228  yytoken, &yylval);
4229  }
4230  /* Do not reclaim the symbols of the rule whose action triggered
4231  this YYABORT or YYACCEPT. */
4232  YYPOPSTACK (yylen);
4234  while (yyssp != yyss)
4235  {
4236  yydestruct ("Cleanup: popping",
4237  yystos[*yyssp], yyvsp);
4238  YYPOPSTACK (1);
4239  }
4240 #ifndef yyoverflow
4241  if (yyss != yyssa)
4242  YYSTACK_FREE (yyss);
4243 #endif
4244 #if YYERROR_VERBOSE
4245  if (yymsg != yymsgbuf)
4246  YYSTACK_FREE (yymsg);
4247 #endif
4248  return yyresult;
4249 }
4250 #line 1664 "c-exp.y" /* yacc.c:1906 */
4251 
4252 
4253 /* Like write_exp_string, but prepends a '~'. */
4254 
4255 static void
4256 write_destructor_name (struct parser_state *par_state, struct stoken token)
4257 {
4258  char *copy = (char *) alloca (token.length + 1);
4259 
4260  copy[0] = '~';
4261  memcpy (&copy[1], token.ptr, token.length);
4262 
4263  token.ptr = copy;
4264  ++token.length;
4265 
4266  write_exp_string (par_state, token);
4267 }
4268 
4269 /* Returns a stoken of the operator name given by OP (which does not
4270  include the string "operator"). */
4271 
4272 static struct stoken
4273 operator_stoken (const char *op)
4274 {
4275  struct stoken st = { NULL, 0 };
4276  char *buf;
4277 
4278  st.length = CP_OPERATOR_LEN + strlen (op);
4279  buf = (char *) xmalloc (st.length + 1);
4280  strcpy (buf, CP_OPERATOR_STR);
4281  strcat (buf, op);
4282  st.ptr = buf;
4283 
4284  /* The toplevel (c_parse) will free the memory allocated here. */
4285  make_cleanup (xfree, buf);
4286  return st;
4287 };
4288 
4289 /* Return true if the type is aggregate-like. */
4290 
4291 static int
4293 {
4294  return (TYPE_CODE (type) == TYPE_CODE_STRUCT
4297  || (TYPE_CODE (type) == TYPE_CODE_ENUM
4298  && TYPE_DECLARED_CLASS (type)));
4299 }
4300 
4301 /* Validate a parameter typelist. */
4302 
4303 static void
4305 {
4306  struct type *type;
4307  int ix;
4308 
4309  for (ix = 0; VEC_iterate (type_ptr, params, ix, type); ++ix)
4310  {
4311  if (type != NULL && TYPE_CODE (check_typedef (type)) == TYPE_CODE_VOID)
4312  {
4313  if (ix == 0)
4314  {
4315  if (VEC_length (type_ptr, params) == 1)
4316  {
4317  /* Ok. */
4318  break;
4319  }
4320  VEC_free (type_ptr, params);
4321  error (_("parameter types following 'void'"));
4322  }
4323  else
4324  {
4325  VEC_free (type_ptr, params);
4326  error (_("'void' invalid as parameter type"));
4327  }
4328  }
4329  }
4330 }
4331 
4332 /* Take care of parsing a number (anything that starts with a digit).
4333  Set yylval and return the token type; update lexptr.
4334  LEN is the number of characters in it. */
4335 
4336 /*** Needs some error checking for the float case ***/
4337 
4338 static int
4339 parse_number (struct parser_state *par_state,
4340  const char *buf, int len, int parsed_float, YYSTYPE *putithere)
4341 {
4342  /* FIXME: Shouldn't these be unsigned? We don't deal with negative values
4343  here, and we do kind of silly things like cast to unsigned. */
4344  LONGEST n = 0;
4345  LONGEST prevn = 0;
4346  ULONGEST un;
4347 
4348  int i = 0;
4349  int c;
4350  int base = input_radix;
4351  int unsigned_p = 0;
4352 
4353  /* Number of "L" suffixes encountered. */
4354  int long_p = 0;
4355 
4356  /* We have found a "L" or "U" suffix. */
4357  int found_suffix = 0;
4358 
4359  ULONGEST high_bit;
4360  struct type *signed_type;
4361  struct type *unsigned_type;
4362  char *p;
4363 
4364  p = (char *) alloca (len);
4365  memcpy (p, buf, len);
4366 
4367  if (parsed_float)
4368  {
4369  /* Handle suffixes for decimal floating-point: "df", "dd" or "dl". */
4370  if (len >= 2 && p[len - 2] == 'd' && p[len - 1] == 'f')
4371  {
4372  putithere->typed_val_float.type
4373  = parse_type (par_state)->builtin_decfloat;
4374  len -= 2;
4375  }
4376  else if (len >= 2 && p[len - 2] == 'd' && p[len - 1] == 'd')
4377  {
4378  putithere->typed_val_float.type
4379  = parse_type (par_state)->builtin_decdouble;
4380  len -= 2;
4381  }
4382  else if (len >= 2 && p[len - 2] == 'd' && p[len - 1] == 'l')
4383  {
4384  putithere->typed_val_float.type
4385  = parse_type (par_state)->builtin_declong;
4386  len -= 2;
4387  }
4388  /* Handle suffixes: 'f' for float, 'l' for long double. */
4389  else if (len >= 1 && tolower (p[len - 1]) == 'f')
4390  {
4391  putithere->typed_val_float.type
4392  = parse_type (par_state)->builtin_float;
4393  len -= 1;
4394  }
4395  else if (len >= 1 && tolower (p[len - 1]) == 'l')
4396  {
4397  putithere->typed_val_float.type
4398  = parse_type (par_state)->builtin_long_double;
4399  len -= 1;
4400  }
4401  /* Default type for floating-point literals is double. */
4402  else
4403  {
4404  putithere->typed_val_float.type
4405  = parse_type (par_state)->builtin_double;
4406  }
4407 
4408  if (!parse_float (p, len,
4409  putithere->typed_val_float.type,
4410  putithere->typed_val_float.val))
4411  return ERROR;
4412  return FLOAT;
4413  }
4414 
4415  /* Handle base-switching prefixes 0x, 0t, 0d, 0 */
4416  if (p[0] == '0' && len > 1)
4417  switch (p[1])
4418  {
4419  case 'x':
4420  case 'X':
4421  if (len >= 3)
4422  {
4423  p += 2;
4424  base = 16;
4425  len -= 2;
4426  }
4427  break;
4428 
4429  case 'b':
4430  case 'B':
4431  if (len >= 3)
4432  {
4433  p += 2;
4434  base = 2;
4435  len -= 2;
4436  }
4437  break;
4438 
4439  case 't':
4440  case 'T':
4441  case 'd':
4442  case 'D':
4443  if (len >= 3)
4444  {
4445  p += 2;
4446  base = 10;
4447  len -= 2;
4448  }
4449  break;
4450 
4451  default:
4452  base = 8;
4453  break;
4454  }
4455 
4456  while (len-- > 0)
4457  {
4458  c = *p++;
4459  if (c >= 'A' && c <= 'Z')
4460  c += 'a' - 'A';
4461  if (c != 'l' && c != 'u')
4462  n *= base;
4463  if (c >= '0' && c <= '9')
4464  {
4465  if (found_suffix)
4466  return ERROR;
4467  n += i = c - '0';
4468  }
4469  else
4470  {
4471  if (base > 10 && c >= 'a' && c <= 'f')
4472  {
4473  if (found_suffix)
4474  return ERROR;
4475  n += i = c - 'a' + 10;
4476  }
4477  else if (c == 'l')
4478  {
4479  ++long_p;
4480  found_suffix = 1;
4481  }
4482  else if (c == 'u')
4483  {
4484  unsigned_p = 1;
4485  found_suffix = 1;
4486  }
4487  else
4488  return ERROR; /* Char not a digit */
4489  }
4490  if (i >= base)
4491  return ERROR; /* Invalid digit in this base */
4492 
4493  /* Portably test for overflow (only works for nonzero values, so make
4494  a second check for zero). FIXME: Can't we just make n and prevn
4495  unsigned and avoid this? */
4496  if (c != 'l' && c != 'u' && (prevn >= n) && n != 0)
4497  unsigned_p = 1; /* Try something unsigned */
4498 
4499  /* Portably test for unsigned overflow.
4500  FIXME: This check is wrong; for example it doesn't find overflow
4501  on 0x123456789 when LONGEST is 32 bits. */
4502  if (c != 'l' && c != 'u' && n != 0)
4503  {
4504  if ((unsigned_p && (ULONGEST) prevn >= (ULONGEST) n))
4505  error (_("Numeric constant too large."));
4506  }
4507  prevn = n;
4508  }
4509 
4510  /* An integer constant is an int, a long, or a long long. An L
4511  suffix forces it to be long; an LL suffix forces it to be long
4512  long. If not forced to a larger size, it gets the first type of
4513  the above that it fits in. To figure out whether it fits, we
4514  shift it right and see whether anything remains. Note that we
4515  can't shift sizeof (LONGEST) * HOST_CHAR_BIT bits or more in one
4516  operation, because many compilers will warn about such a shift
4517  (which always produces a zero result). Sometimes gdbarch_int_bit
4518  or gdbarch_long_bit will be that big, sometimes not. To deal with
4519  the case where it is we just always shift the value more than
4520  once, with fewer bits each time. */
4521 
4522  un = (ULONGEST)n >> 2;
4523  if (long_p == 0
4524  && (un >> (gdbarch_int_bit (parse_gdbarch (par_state)) - 2)) == 0)
4525  {
4526  high_bit
4527  = ((ULONGEST)1) << (gdbarch_int_bit (parse_gdbarch (par_state)) - 1);
4528 
4529  /* A large decimal (not hex or octal) constant (between INT_MAX
4530  and UINT_MAX) is a long or unsigned long, according to ANSI,
4531  never an unsigned int, but this code treats it as unsigned
4532  int. This probably should be fixed. GCC gives a warning on
4533  such constants. */
4534 
4535  unsigned_type = parse_type (par_state)->builtin_unsigned_int;
4536  signed_type = parse_type (par_state)->builtin_int;
4537  }
4538  else if (long_p <= 1
4539  && (un >> (gdbarch_long_bit (parse_gdbarch (par_state)) - 2)) == 0)
4540  {
4541  high_bit
4542  = ((ULONGEST)1) << (gdbarch_long_bit (parse_gdbarch (par_state)) - 1);
4543  unsigned_type = parse_type (par_state)->builtin_unsigned_long;
4544  signed_type = parse_type (par_state)->builtin_long;
4545  }
4546  else
4547  {
4548  int shift;
4549  if (sizeof (ULONGEST) * HOST_CHAR_BIT
4550  < gdbarch_long_long_bit (parse_gdbarch (par_state)))
4551  /* A long long does not fit in a LONGEST. */
4552  shift = (sizeof (ULONGEST) * HOST_CHAR_BIT - 1);
4553  else
4554  shift = (gdbarch_long_long_bit (parse_gdbarch (par_state)) - 1);
4555  high_bit = (ULONGEST) 1 << shift;
4556  unsigned_type = parse_type (par_state)->builtin_unsigned_long_long;
4557  signed_type = parse_type (par_state)->builtin_long_long;
4558  }
4559 
4560  putithere->typed_val_int.val = n;
4561 
4562  /* If the high bit of the worked out type is set then this number
4563  has to be unsigned. */
4564 
4565  if (unsigned_p || (n & high_bit))
4566  {
4567  putithere->typed_val_int.type = unsigned_type;
4568  }
4569  else
4570  {
4571  putithere->typed_val_int.type = signed_type;
4572  }
4573 
4574  return INT;
4575 }
4576 
4577 /* Temporary obstack used for holding strings. */
4578 static struct obstack tempbuf;
4579 static int tempbuf_init;
4580 
4581 /* Parse a C escape sequence. The initial backslash of the sequence
4582  is at (*PTR)[-1]. *PTR will be updated to point to just after the
4583  last character of the sequence. If OUTPUT is not NULL, the
4584  translated form of the escape sequence will be written there. If
4585  OUTPUT is NULL, no output is written and the call will only affect
4586  *PTR. If an escape sequence is expressed in target bytes, then the
4587  entire sequence will simply be copied to OUTPUT. Return 1 if any
4588  character was emitted, 0 otherwise. */
4589 
4590 int
4591 c_parse_escape (const char **ptr, struct obstack *output)
4592 {
4593  const char *tokptr = *ptr;
4594  int result = 1;
4595 
4596  /* Some escape sequences undergo character set conversion. Those we
4597  translate here. */
4598  switch (*tokptr)
4599  {
4600  /* Hex escapes do not undergo character set conversion, so keep
4601  the escape sequence for later. */
4602  case 'x':
4603  if (output)
4604  obstack_grow_str (output, "\\x");
4605  ++tokptr;
4606  if (!isxdigit (*tokptr))
4607  error (_("\\x escape without a following hex digit"));
4608  while (isxdigit (*tokptr))
4609  {
4610  if (output)
4611  obstack_1grow (output, *tokptr);
4612  ++tokptr;
4613  }
4614  break;
4615 
4616  /* Octal escapes do not undergo character set conversion, so
4617  keep the escape sequence for later. */
4618  case '0':
4619  case '1':
4620  case '2':
4621  case '3':
4622  case '4':
4623  case '5':
4624  case '6':
4625  case '7':
4626  {
4627  int i;
4628  if (output)
4629  obstack_grow_str (output, "\\");
4630  for (i = 0;
4631  i < 3 && isdigit (*tokptr) && *tokptr != '8' && *tokptr != '9';
4632  ++i)
4633  {
4634  if (output)
4635  obstack_1grow (output, *tokptr);
4636  ++tokptr;
4637  }
4638  }
4639  break;
4640 
4641  /* We handle UCNs later. We could handle them here, but that
4642  would mean a spurious error in the case where the UCN could
4643  be converted to the target charset but not the host
4644  charset. */
4645  case 'u':
4646  case 'U':
4647  {
4648  char c = *tokptr;
4649  int i, len = c == 'U' ? 8 : 4;
4650  if (output)
4651  {
4652  obstack_1grow (output, '\\');
4653  obstack_1grow (output, *tokptr);
4654  }
4655  ++tokptr;
4656  if (!isxdigit (*tokptr))
4657  error (_("\\%c escape without a following hex digit"), c);
4658  for (i = 0; i < len && isxdigit (*tokptr); ++i)
4659  {
4660  if (output)
4661  obstack_1grow (output, *tokptr);
4662  ++tokptr;
4663  }
4664  }
4665  break;
4666 
4667  /* We must pass backslash through so that it does not
4668  cause quoting during the second expansion. */
4669  case '\\':
4670  if (output)
4671  obstack_grow_str (output, "\\\\");
4672  ++tokptr;
4673  break;
4674 
4675  /* Escapes which undergo conversion. */
4676  case 'a':
4677  if (output)
4678  obstack_1grow (output, '\a');
4679  ++tokptr;
4680  break;
4681  case 'b':
4682  if (output)
4683  obstack_1grow (output, '\b');
4684  ++tokptr;
4685  break;
4686  case 'f':
4687  if (output)
4688  obstack_1grow (output, '\f');
4689  ++tokptr;
4690  break;
4691  case 'n':
4692  if (output)
4693  obstack_1grow (output, '\n');
4694  ++tokptr;
4695  break;
4696  case 'r':
4697  if (output)
4698  obstack_1grow (output, '\r');
4699  ++tokptr;
4700  break;
4701  case 't':
4702  if (output)
4703  obstack_1grow (output, '\t');
4704  ++tokptr;
4705  break;
4706  case 'v':
4707  if (output)
4708  obstack_1grow (output, '\v');
4709  ++tokptr;
4710  break;
4711 
4712  /* GCC extension. */
4713  case 'e':
4714  if (output)
4715  obstack_1grow (output, HOST_ESCAPE_CHAR);
4716  ++tokptr;
4717  break;
4718 
4719  /* Backslash-newline expands to nothing at all. */
4720  case '\n':
4721  ++tokptr;
4722  result = 0;
4723  break;
4724 
4725  /* A few escapes just expand to the character itself. */
4726  case '\'':
4727  case '\"':
4728  case '?':
4729  /* GCC extensions. */
4730  case '(':
4731  case '{':
4732  case '[':
4733  case '%':
4734  /* Unrecognized escapes turn into the character itself. */
4735  default:
4736  if (output)
4737  obstack_1grow (output, *tokptr);
4738  ++tokptr;
4739  break;
4740  }
4741  *ptr = tokptr;
4742  return result;
4743 }
4744 
4745 /* Parse a string or character literal from TOKPTR. The string or
4746  character may be wide or unicode. *OUTPTR is set to just after the
4747  end of the literal in the input string. The resulting token is
4748  stored in VALUE. This returns a token value, either STRING or
4749  CHAR, depending on what was parsed. *HOST_CHARS is set to the
4750  number of host characters in the literal. */
4751 
4752 static int
4753 parse_string_or_char (const char *tokptr, const char **outptr,
4754  struct typed_stoken *value, int *host_chars)
4755 {
4756  int quote;
4757  c_string_type type;
4758  int is_objc = 0;
4759 
4760  /* Build the gdb internal form of the input string in tempbuf. Note
4761  that the buffer is null byte terminated *only* for the
4762  convenience of debugging gdb itself and printing the buffer
4763  contents when the buffer contains no embedded nulls. Gdb does
4764  not depend upon the buffer being null byte terminated, it uses
4765  the length string instead. This allows gdb to handle C strings
4766  (as well as strings in other languages) with embedded null
4767  bytes */
4768 
4769  if (!tempbuf_init)
4770  tempbuf_init = 1;
4771  else
4772  obstack_free (&tempbuf, NULL);
4773  obstack_init (&tempbuf);
4774 
4775  /* Record the string type. */
4776  if (*tokptr == 'L')
4777  {
4778  type = C_WIDE_STRING;
4779  ++tokptr;
4780  }
4781  else if (*tokptr == 'u')
4782  {
4783  type = C_STRING_16;
4784  ++tokptr;
4785  }
4786  else if (*tokptr == 'U')
4787  {
4788  type = C_STRING_32;
4789  ++tokptr;
4790  }
4791  else if (*tokptr == '@')
4792  {
4793  /* An Objective C string. */
4794  is_objc = 1;
4795  type = C_STRING;
4796  ++tokptr;
4797  }
4798  else
4799  type = C_STRING;
4800 
4801  /* Skip the quote. */
4802  quote = *tokptr;
4803  if (quote == '\'')
4804  type |= C_CHAR;
4805  ++tokptr;
4806 
4807  *host_chars = 0;
4808 
4809  while (*tokptr)
4810  {
4811  char c = *tokptr;
4812  if (c == '\\')
4813  {
4814  ++tokptr;
4815  *host_chars += c_parse_escape (&tokptr, &tempbuf);
4816  }
4817  else if (c == quote)
4818  break;
4819  else
4820  {
4821  obstack_1grow (&tempbuf, c);
4822  ++tokptr;
4823  /* FIXME: this does the wrong thing with multi-byte host
4824  characters. We could use mbrlen here, but that would
4825  make "set host-charset" a bit less useful. */
4826  ++*host_chars;
4827  }
4828  }
4829 
4830  if (*tokptr != quote)
4831  {
4832  if (quote == '"')
4833  error (_("Unterminated string in expression."));
4834  else
4835  error (_("Unmatched single quote."));
4836  }
4837  ++tokptr;
4838 
4839  value->type = type;
4840  value->ptr = (char *) obstack_base (&tempbuf);
4841  value->length = obstack_object_size (&tempbuf);
4842 
4843  *outptr = tokptr;
4844 
4845  return quote == '"' ? (is_objc ? NSSTRING : STRING) : CHAR;
4846 }
4847 
4848 /* This is used to associate some attributes with a token. */
4849 
4851 {
4852  /* If this bit is set, the token is C++-only. */
4853 
4855 
4856  /* If this bit is set, the token is conditional: if there is a
4857  symbol of the same name, then the token is a symbol; otherwise,
4858  the token is a keyword. */
4859 
4861 };
4862 DEF_ENUM_FLAGS_TYPE (enum token_flag, token_flags);
4863 
4864 struct token
4865 {
4866  const char *oper;
4867  int token;
4869  token_flags flags;
4870 };
4871 
4872 static const struct token tokentab3[] =
4873  {
4874  {">>=", ASSIGN_MODIFY, BINOP_RSH, 0},
4875  {"<<=", ASSIGN_MODIFY, BINOP_LSH, 0},
4876  {"->*", ARROW_STAR, BINOP_END, FLAG_CXX},
4877  {"...", DOTDOTDOT, BINOP_END, 0}
4878  };
4879 
4880 static const struct token tokentab2[] =
4881  {
4882  {"+=", ASSIGN_MODIFY, BINOP_ADD, 0},
4883  {"-=", ASSIGN_MODIFY, BINOP_SUB, 0},
4884  {"*=", ASSIGN_MODIFY, BINOP_MUL, 0},
4885  {"/=", ASSIGN_MODIFY, BINOP_DIV, 0},
4886  {"%=", ASSIGN_MODIFY, BINOP_REM, 0},
4887  {"|=", ASSIGN_MODIFY, BINOP_BITWISE_IOR, 0},
4888  {"&=", ASSIGN_MODIFY, BINOP_BITWISE_AND, 0},
4889  {"^=", ASSIGN_MODIFY, BINOP_BITWISE_XOR, 0},
4890  {"++", INCREMENT, BINOP_END, 0},
4891  {"--", DECREMENT, BINOP_END, 0},
4892  {"->", ARROW, BINOP_END, 0},
4893  {"&&", ANDAND, BINOP_END, 0},
4894  {"||", OROR, BINOP_END, 0},
4895  /* "::" is *not* only C++: gdb overrides its meaning in several
4896  different ways, e.g., 'filename'::func, function::variable. */
4897  {"::", COLONCOLON, BINOP_END, 0},
4898  {"<<", LSH, BINOP_END, 0},
4899  {">>", RSH, BINOP_END, 0},
4900  {"==", EQUAL, BINOP_END, 0},
4901  {"!=", NOTEQUAL, BINOP_END, 0},
4902  {"<=", LEQ, BINOP_END, 0},
4903  {">=", GEQ, BINOP_END, 0},
4904  {".*", DOT_STAR, BINOP_END, FLAG_CXX}
4905  };
4906 
4907 /* Identifier-like tokens. */
4908 static const struct token ident_tokens[] =
4909  {
4910  {"unsigned", UNSIGNED, OP_NULL, 0},
4911  {"template", TEMPLATE, OP_NULL, FLAG_CXX},
4912  {"volatile", VOLATILE_KEYWORD, OP_NULL, 0},
4913  {"struct", STRUCT, OP_NULL, 0},
4914  {"signed", SIGNED_KEYWORD, OP_NULL, 0},
4915  {"sizeof", SIZEOF, OP_NULL, 0},
4916  {"double", DOUBLE_KEYWORD, OP_NULL, 0},
4917  {"false", FALSEKEYWORD, OP_NULL, FLAG_CXX},
4918  {"class", CLASS, OP_NULL, FLAG_CXX},
4919  {"union", UNION, OP_NULL, 0},
4920  {"short", SHORT, OP_NULL, 0},
4921  {"const", CONST_KEYWORD, OP_NULL, 0},
4922  {"enum", ENUM, OP_NULL, 0},
4923  {"long", LONG, OP_NULL, 0},
4924  {"true", TRUEKEYWORD, OP_NULL, FLAG_CXX},
4925  {"int", INT_KEYWORD, OP_NULL, 0},
4926  {"new", NEW, OP_NULL, FLAG_CXX},
4927  {"delete", DELETE, OP_NULL, FLAG_CXX},
4928  {"operator", OPERATOR, OP_NULL, FLAG_CXX},
4929 
4930  {"and", ANDAND, BINOP_END, FLAG_CXX},
4931  {"and_eq", ASSIGN_MODIFY, BINOP_BITWISE_AND, FLAG_CXX},
4932  {"bitand", '&', OP_NULL, FLAG_CXX},
4933  {"bitor", '|', OP_NULL, FLAG_CXX},
4934  {"compl", '~', OP_NULL, FLAG_CXX},
4935  {"not", '!', OP_NULL, FLAG_CXX},
4936  {"not_eq", NOTEQUAL, BINOP_END, FLAG_CXX},
4937  {"or", OROR, BINOP_END, FLAG_CXX},
4938  {"or_eq", ASSIGN_MODIFY, BINOP_BITWISE_IOR, FLAG_CXX},
4939  {"xor", '^', OP_NULL, FLAG_CXX},
4940  {"xor_eq", ASSIGN_MODIFY, BINOP_BITWISE_XOR, FLAG_CXX},
4941 
4942  {"const_cast", CONST_CAST, OP_NULL, FLAG_CXX },
4943  {"dynamic_cast", DYNAMIC_CAST, OP_NULL, FLAG_CXX },
4944  {"static_cast", STATIC_CAST, OP_NULL, FLAG_CXX },
4945  {"reinterpret_cast", REINTERPRET_CAST, OP_NULL, FLAG_CXX },
4946 
4947  {"__typeof__", TYPEOF, OP_TYPEOF, 0 },
4948  {"__typeof", TYPEOF, OP_TYPEOF, 0 },
4949  {"typeof", TYPEOF, OP_TYPEOF, FLAG_SHADOW },
4950  {"__decltype", DECLTYPE, OP_DECLTYPE, FLAG_CXX },
4951  {"decltype", DECLTYPE, OP_DECLTYPE, FLAG_CXX | FLAG_SHADOW },
4952 
4953  {"typeid", TYPEID, OP_TYPEID, FLAG_CXX}
4954  };
4955 
4956 /* When we find that lexptr (the global var defined in parse.c) is
4957  pointing at a macro invocation, we expand the invocation, and call
4958  scan_macro_expansion to save the old lexptr here and point lexptr
4959  into the expanded text. When we reach the end of that, we call
4960  end_macro_expansion to pop back to the value we saved here. The
4961  macro expansion code promises to return only fully-expanded text,
4962  so we don't need to "push" more than one level.
4963 
4964  This is disgusting, of course. It would be cleaner to do all macro
4965  expansion beforehand, and then hand that to lexptr. But we don't
4966  really know where the expression ends. Remember, in a command like
4967 
4968  (gdb) break *ADDRESS if CONDITION
4969 
4970  we evaluate ADDRESS in the scope of the current frame, but we
4971  evaluate CONDITION in the scope of the breakpoint's location. So
4972  it's simply wrong to try to macro-expand the whole thing at once. */
4973 static const char *macro_original_text;
4974 
4975 /* We save all intermediate macro expansions on this obstack for the
4976  duration of a single parse. The expansion text may sometimes have
4977  to live past the end of the expansion, due to yacc lookahead.
4978  Rather than try to be clever about saving the data for a single
4979  token, we simply keep it all and delete it after parsing has
4980  completed. */
4981 static struct obstack expansion_obstack;
4982 
4983 static void
4984 scan_macro_expansion (char *expansion)
4985 {
4986  char *copy;
4987 
4988  /* We'd better not be trying to push the stack twice. */
4990 
4991  /* Copy to the obstack, and then free the intermediate
4992  expansion. */
4993  copy = (char *) obstack_copy0 (&expansion_obstack, expansion,
4994  strlen (expansion));
4995  xfree (expansion);
4996 
4997  /* Save the old lexptr value, so we can return to it when we're done
4998  parsing the expanded text. */
5000  lexptr = copy;
5001 }
5002 
5003 static int
5005 {
5006  return macro_original_text != 0;
5007 }
5008 
5009 static void
5011 {
5012  /* There'd better be something to pop back to. */
5014 
5015  /* Pop back to the original text. */
5017  macro_original_text = 0;
5018 }
5019 
5020 static void
5022 {
5023  if (macro_original_text)
5025 
5026  obstack_free (&expansion_obstack, NULL);
5027 }
5028 
5029 /* Return true iff the token represents a C++ cast operator. */
5030 
5031 static int
5032 is_cast_operator (const char *token, int len)
5033 {
5034  return (! strncmp (token, "dynamic_cast", len)
5035  || ! strncmp (token, "static_cast", len)
5036  || ! strncmp (token, "reinterpret_cast", len)
5037  || ! strncmp (token, "const_cast", len));
5038 }
5039 
5040 /* The scope used for macro expansion. */
5042 
5043 /* This is set if a NAME token appeared at the very end of the input
5044  string, with no whitespace separating the name from the EOF. This
5045  is used only when parsing to do field name completion. */
5046 static int saw_name_at_eof;
5047 
5048 /* This is set if the previously-returned token was a structure
5049  operator -- either '.' or ARROW. This is used only when parsing to
5050  do field name completion. */
5052 
5053 /* Read one token, getting characters through lexptr. */
5054 
5055 static int
5056 lex_one_token (struct parser_state *par_state, int *is_quoted_name)
5057 {
5058  int c;
5059  int namelen;
5060  unsigned int i;
5061  const char *tokstart;
5062  int saw_structop = last_was_structop;
5063  char *copy;
5064 
5065  last_was_structop = 0;
5066  *is_quoted_name = 0;
5067 
5068  retry:
5069 
5070  /* Check if this is a macro invocation that we need to expand. */
5071  if (! scanning_macro_expansion ())
5072  {
5073  char *expanded = macro_expand_next (&lexptr,
5076 
5077  if (expanded)
5078  scan_macro_expansion (expanded);
5079  }
5080 
5081  prev_lexptr = lexptr;
5082 
5083  tokstart = lexptr;
5084  /* See if it is a special token of length 3. */
5085  for (i = 0; i < sizeof tokentab3 / sizeof tokentab3[0]; i++)
5086  if (strncmp (tokstart, tokentab3[i].oper, 3) == 0)
5087  {
5088  if ((tokentab3[i].flags & FLAG_CXX) != 0
5089  && parse_language (par_state)->la_language != language_cplus)
5090  break;
5091 
5092  lexptr += 3;
5094  return tokentab3[i].token;
5095  }
5096 
5097  /* See if it is a special token of length 2. */
5098  for (i = 0; i < sizeof tokentab2 / sizeof tokentab2[0]; i++)
5099  if (strncmp (tokstart, tokentab2[i].oper, 2) == 0)
5100  {
5101  if ((tokentab2[i].flags & FLAG_CXX) != 0
5102  && parse_language (par_state)->la_language != language_cplus)
5103  break;
5104 
5105  lexptr += 2;
5107  if (parse_completion && tokentab2[i].token == ARROW)
5108  last_was_structop = 1;
5109  return tokentab2[i].token;
5110  }
5111 
5112  switch (c = *tokstart)
5113  {
5114  case 0:
5115  /* If we were just scanning the result of a macro expansion,
5116  then we need to resume scanning the original text.
5117  If we're parsing for field name completion, and the previous
5118  token allows such completion, return a COMPLETE token.
5119  Otherwise, we were already scanning the original text, and
5120  we're really done. */
5121  if (scanning_macro_expansion ())
5122  {
5124  goto retry;
5125  }
5126  else if (saw_name_at_eof)
5127  {
5128  saw_name_at_eof = 0;
5129  return COMPLETE;
5130  }
5131  else if (saw_structop)
5132  return COMPLETE;
5133  else
5134  return 0;
5135 
5136  case ' ':
5137  case '\t':
5138  case '\n':
5139  lexptr++;
5140  goto retry;
5141 
5142  case '[':
5143  case '(':
5144  paren_depth++;
5145  lexptr++;
5146  if (parse_language (par_state)->la_language == language_objc
5147  && c == '[')
5148  return OBJC_LBRAC;
5149  return c;
5150 
5151  case ']':
5152  case ')':
5153  if (paren_depth == 0)
5154  return 0;
5155  paren_depth--;
5156  lexptr++;
5157  return c;
5158 
5159  case ',':
5160  if (comma_terminates
5161  && paren_depth == 0
5162  && ! scanning_macro_expansion ())
5163  return 0;
5164  lexptr++;
5165  return c;
5166 
5167  case '.':
5168  /* Might be a floating point number. */
5169  if (lexptr[1] < '0' || lexptr[1] > '9')
5170  {
5171  if (parse_completion)
5172  last_was_structop = 1;
5173  goto symbol; /* Nope, must be a symbol. */
5174  }
5175  /* FALL THRU into number case. */
5176 
5177  case '0':
5178  case '1':
5179  case '2':
5180  case '3':
5181  case '4':
5182  case '5':
5183  case '6':
5184  case '7':
5185  case '8':
5186  case '9':
5187  {
5188  /* It's a number. */
5189  int got_dot = 0, got_e = 0, toktype;
5190  const char *p = tokstart;
5191  int hex = input_radix > 10;
5192 
5193  if (c == '0' && (p[1] == 'x' || p[1] == 'X'))
5194  {
5195  p += 2;
5196  hex = 1;
5197  }
5198  else if (c == '0' && (p[1]=='t' || p[1]=='T' || p[1]=='d' || p[1]=='D'))
5199  {
5200  p += 2;
5201  hex = 0;
5202  }
5203 
5204  for (;; ++p)
5205  {
5206  /* This test includes !hex because 'e' is a valid hex digit
5207  and thus does not indicate a floating point number when
5208  the radix is hex. */
5209  if (!hex && !got_e && (*p == 'e' || *p == 'E'))
5210  got_dot = got_e = 1;
5211  /* This test does not include !hex, because a '.' always indicates
5212  a decimal floating point number regardless of the radix. */
5213  else if (!got_dot && *p == '.')
5214  got_dot = 1;
5215  else if (got_e && (p[-1] == 'e' || p[-1] == 'E')
5216  && (*p == '-' || *p == '+'))
5217  /* This is the sign of the exponent, not the end of the
5218  number. */
5219  continue;
5220  /* We will take any letters or digits. parse_number will
5221  complain if past the radix, or if L or U are not final. */
5222  else if ((*p < '0' || *p > '9')
5223  && ((*p < 'a' || *p > 'z')
5224  && (*p < 'A' || *p > 'Z')))
5225  break;
5226  }
5227  toktype = parse_number (par_state, tokstart, p - tokstart,
5228  got_dot|got_e, &yylval);
5229  if (toktype == ERROR)
5230  {
5231  char *err_copy = (char *) alloca (p - tokstart + 1);
5232 
5233  memcpy (err_copy, tokstart, p - tokstart);
5234  err_copy[p - tokstart] = 0;
5235  error (_("Invalid number \"%s\"."), err_copy);
5236  }
5237  lexptr = p;
5238  return toktype;
5239  }
5240 
5241  case '@':
5242  {
5243  const char *p = &tokstart[1];
5244  size_t len = strlen ("entry");
5245 
5246  if (parse_language (par_state)->la_language == language_objc)
5247  {
5248  size_t len = strlen ("selector");
5249 
5250  if (strncmp (p, "selector", len) == 0
5251  && (p[len] == '\0' || isspace (p[len])))
5252  {
5253  lexptr = p + len;
5254  return SELECTOR;
5255  }
5256  else if (*p == '"')
5257  goto parse_string;
5258  }
5259 
5260  while (isspace (*p))
5261  p++;
5262  if (strncmp (p, "entry", len) == 0 && !isalnum (p[len])
5263  && p[len] != '_')
5264  {
5265  lexptr = &p[len];
5266  return ENTRY;
5267  }
5268  }
5269  /* FALLTHRU */
5270  case '+':
5271  case '-':
5272  case '*':
5273  case '/':
5274  case '%':
5275  case '|':
5276  case '&':
5277  case '^':
5278  case '~':
5279  case '!':
5280  case '<':
5281  case '>':
5282  case '?':
5283  case ':':
5284  case '=':
5285  case '{':
5286  case '}':
5287  symbol:
5288  lexptr++;
5289  return c;
5290 
5291  case 'L':
5292  case 'u':
5293  case 'U':
5294  if (tokstart[1] != '"' && tokstart[1] != '\'')
5295  break;
5296  /* Fall through. */
5297  case '\'':
5298  case '"':
5299 
5300  parse_string:
5301  {
5302  int host_len;
5303  int result = parse_string_or_char (tokstart, &lexptr, &yylval.tsval,
5304  &host_len);
5305  if (result == CHAR)
5306  {
5307  if (host_len == 0)
5308  error (_("Empty character constant."));
5309  else if (host_len > 2 && c == '\'')
5310  {
5311  ++tokstart;
5312  namelen = lexptr - tokstart - 1;
5313  *is_quoted_name = 1;
5314 
5315  goto tryname;
5316  }
5317  else if (host_len > 1)
5318  error (_("Invalid character constant."));
5319  }
5320  return result;
5321  }
5322  }
5323 
5324  if (!(c == '_' || c == '$'
5325  || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')))
5326  /* We must have come across a bad character (e.g. ';'). */
5327  error (_("Invalid character '%c' in expression."), c);
5328 
5329  /* It's a name. See how long it is. */
5330  namelen = 0;
5331  for (c = tokstart[namelen];
5332  (c == '_' || c == '$' || (c >= '0' && c <= '9')
5333  || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '<');)
5334  {
5335  /* Template parameter lists are part of the name.
5336  FIXME: This mishandles `print $a<4&&$a>3'. */
5337 
5338  if (c == '<')
5339  {
5340  if (! is_cast_operator (tokstart, namelen))
5341  {
5342  /* Scan ahead to get rest of the template specification. Note
5343  that we look ahead only when the '<' adjoins non-whitespace
5344  characters; for comparison expressions, e.g. "a < b > c",
5345  there must be spaces before the '<', etc. */
5346  const char *p = find_template_name_end (tokstart + namelen);
5347 
5348  if (p)
5349  namelen = p - tokstart;
5350  }
5351  break;
5352  }
5353  c = tokstart[++namelen];
5354  }
5355 
5356  /* The token "if" terminates the expression and is NOT removed from
5357  the input stream. It doesn't count if it appears in the
5358  expansion of a macro. */
5359  if (namelen == 2
5360  && tokstart[0] == 'i'
5361  && tokstart[1] == 'f'
5362  && ! scanning_macro_expansion ())
5363  {
5364  return 0;
5365  }
5366 
5367  /* For the same reason (breakpoint conditions), "thread N"
5368  terminates the expression. "thread" could be an identifier, but
5369  an identifier is never followed by a number without intervening
5370  punctuation. "task" is similar. Handle abbreviations of these,
5371  similarly to breakpoint.c:find_condition_and_thread. */
5372  if (namelen >= 1
5373  && (strncmp (tokstart, "thread", namelen) == 0
5374  || strncmp (tokstart, "task", namelen) == 0)
5375  && (tokstart[namelen] == ' ' || tokstart[namelen] == '\t')
5376  && ! scanning_macro_expansion ())
5377  {
5378  const char *p = tokstart + namelen + 1;
5379 
5380  while (*p == ' ' || *p == '\t')
5381  p++;
5382  if (*p >= '0' && *p <= '9')
5383  return 0;
5384  }
5385 
5386  lexptr += namelen;
5387 
5388  tryname:
5389 
5390  yylval.sval.ptr = tokstart;
5391  yylval.sval.length = namelen;
5392 
5393  /* Catch specific keywords. */
5394  copy = copy_name (yylval.sval);
5395  for (i = 0; i < sizeof ident_tokens / sizeof ident_tokens[0]; i++)
5396  if (strcmp (copy, ident_tokens[i].oper) == 0)
5397  {
5398  if ((ident_tokens[i].flags & FLAG_CXX) != 0
5399  && parse_language (par_state)->la_language != language_cplus)
5400  break;
5401 
5402  if ((ident_tokens[i].flags & FLAG_SHADOW) != 0)
5403  {
5404  struct field_of_this_result is_a_field_of_this;
5405 
5407  VAR_DOMAIN,
5408  (parse_language (par_state)->la_language
5409  == language_cplus ? &is_a_field_of_this
5410  : NULL)).symbol
5411  != NULL)
5412  {
5413  /* The keyword is shadowed. */
5414  break;
5415  }
5416  }
5417 
5418  /* It is ok to always set this, even though we don't always
5419  strictly need to. */
5421  return ident_tokens[i].token;
5422  }
5423 
5424  if (*tokstart == '$')
5425  return VARIABLE;
5426 
5427  if (parse_completion && *lexptr == '\0')
5428  saw_name_at_eof = 1;
5429 
5431  yylval.ssym.sym.symbol = NULL;
5432  yylval.ssym.sym.block = NULL;
5434  return NAME;
5435 }
5436 
5437 /* An object of this type is pushed on a FIFO by the "outer" lexer. */
5438 typedef struct
5439 {
5440  int token;
5442 } token_and_value;
5443 
5445 
5446 /* A FIFO of tokens that have been read but not yet returned to the
5447  parser. */
5448 static VEC (token_and_value) *token_fifo;
5449 
5450 /* Non-zero if the lexer should return tokens from the FIFO. */
5451 static int popping;
5452 
5453 /* Temporary storage for c_lex; this holds symbol names as they are
5454  built up. */
5455 auto_obstack name_obstack;
5456 
5457 /* Classify a NAME token. The contents of the token are in `yylval'.
5458  Updates yylval and returns the new token type. BLOCK is the block
5459  in which lookups start; this can be NULL to mean the global scope.
5460  IS_QUOTED_NAME is non-zero if the name token was originally quoted
5461  in single quotes. */
5462 
5463 static int
5464 classify_name (struct parser_state *par_state, const struct block *block,
5465  int is_quoted_name)
5466 {
5467  struct block_symbol bsym;
5468  char *copy;
5469  struct field_of_this_result is_a_field_of_this;
5470 
5471  copy = copy_name (yylval.sval);
5472 
5473  /* Initialize this in case we *don't* use it in this call; that way
5474  we can refer to it unconditionally below. */
5475  memset (&is_a_field_of_this, 0, sizeof (is_a_field_of_this));
5476 
5477  bsym = lookup_symbol (copy, block, VAR_DOMAIN,
5478  parse_language (par_state)->la_name_of_this
5479  ? &is_a_field_of_this : NULL);
5480 
5481  if (bsym.symbol && SYMBOL_CLASS (bsym.symbol) == LOC_BLOCK)
5482  {
5483  yylval.ssym.sym = bsym;
5484  yylval.ssym.is_a_field_of_this = is_a_field_of_this.type != NULL;
5485  return BLOCKNAME;
5486  }
5487  else if (!bsym.symbol)
5488  {
5489  /* If we found a field of 'this', we might have erroneously
5490  found a constructor where we wanted a type name. Handle this
5491  case by noticing that we found a constructor and then look up
5492  the type tag instead. */
5493  if (is_a_field_of_this.type != NULL
5494  && is_a_field_of_this.fn_field != NULL
5495  && TYPE_FN_FIELD_CONSTRUCTOR (is_a_field_of_this.fn_field->fn_fields,
5496  0))
5497  {
5498  struct field_of_this_result inner_is_a_field_of_this;
5499 
5500  bsym = lookup_symbol (copy, block, STRUCT_DOMAIN,
5501  &inner_is_a_field_of_this);
5502  if (bsym.symbol != NULL)
5503  {
5504  yylval.tsym.type = SYMBOL_TYPE (bsym.symbol);
5505  return TYPENAME;
5506  }
5507  }
5508 
5509  /* If we found a field, then we want to prefer it over a
5510  filename. However, if the name was quoted, then it is better
5511  to check for a filename or a block, since this is the only
5512  way the user has of requiring the extension to be used. */
5513  if (is_a_field_of_this.type == NULL || is_quoted_name)
5514  {
5515  /* See if it's a file name. */
5516  struct symtab *symtab;
5517 
5518  symtab = lookup_symtab (copy);
5519  if (symtab)
5520  {
5522  STATIC_BLOCK);
5523  return FILENAME;
5524  }
5525  }
5526  }
5527 
5528  if (bsym.symbol && SYMBOL_CLASS (bsym.symbol) == LOC_TYPEDEF)
5529  {
5530  yylval.tsym.type = SYMBOL_TYPE (bsym.symbol);
5531  return TYPENAME;
5532  }
5533 
5534  /* See if it's an ObjC classname. */
5535  if (parse_language (par_state)->la_language == language_objc && !bsym.symbol)
5536  {
5537  CORE_ADDR Class = lookup_objc_class (parse_gdbarch (par_state), copy);
5538  if (Class)
5539  {
5540  struct symbol *sym;
5541 
5542  yylval.theclass.theclass = Class;
5544  if (sym)
5545  yylval.theclass.type = SYMBOL_TYPE (sym);
5546  return CLASSNAME;
5547  }
5548  }
5549 
5550  /* Input names that aren't symbols but ARE valid hex numbers, when
5551  the input radix permits them, can be names or numbers depending
5552  on the parse. Note we support radixes > 16 here. */
5553  if (!bsym.symbol
5554  && ((copy[0] >= 'a' && copy[0] < 'a' + input_radix - 10)
5555  || (copy[0] >= 'A' && copy[0] < 'A' + input_radix - 10)))
5556  {
5557  YYSTYPE newlval; /* Its value is ignored. */
5558  int hextype = parse_number (par_state, copy, yylval.sval.length,
5559  0, &newlval);
5560 
5561  if (hextype == INT)
5562  {
5563  yylval.ssym.sym = bsym;
5564  yylval.ssym.is_a_field_of_this = is_a_field_of_this.type != NULL;
5565  return NAME_OR_INT;
5566  }
5567  }
5568 
5569  /* Any other kind of symbol */
5570  yylval.ssym.sym = bsym;
5571  yylval.ssym.is_a_field_of_this = is_a_field_of_this.type != NULL;
5572 
5573  if (bsym.symbol == NULL
5574  && parse_language (par_state)->la_language == language_cplus
5575  && is_a_field_of_this.type == NULL
5576  && lookup_minimal_symbol (copy, NULL, NULL).minsym == NULL)
5577  return UNKNOWN_CPP_NAME;
5578 
5579  return NAME;
5580 }
5581 
5582 /* Like classify_name, but used by the inner loop of the lexer, when a
5583  name might have already been seen. CONTEXT is the context type, or
5584  NULL if this is the first component of a name. */
5585 
5586 static int
5588  const struct block *block, struct type *context)
5589 {
5590  struct type *type;
5591  char *copy;
5592 
5593  if (context == NULL)
5594  return classify_name (par_state, block, 0);
5595 
5596  type = check_typedef (context);
5597  if (!type_aggregate_p (type))
5598  return ERROR;
5599 
5600  copy = copy_name (yylval.ssym.stoken);
5601  /* N.B. We assume the symbol can only be in VAR_DOMAIN. */
5603 
5604  /* If no symbol was found, search for a matching base class named
5605  COPY. This will allow users to enter qualified names of class members
5606  relative to the `this' pointer. */
5607  if (yylval.ssym.sym.symbol == NULL)
5608  {
5609  struct type *base_type = cp_find_type_baseclass_by_name (type, copy);
5610 
5611  if (base_type != NULL)
5612  {
5613  yylval.tsym.type = base_type;
5614  return TYPENAME;
5615  }
5616 
5617  return ERROR;
5618  }
5619 
5620  switch (SYMBOL_CLASS (yylval.ssym.sym.symbol))
5621  {
5622  case LOC_BLOCK:
5623  case LOC_LABEL:
5624  /* cp_lookup_nested_symbol might have accidentally found a constructor
5625  named COPY when we really wanted a base class of the same name.
5626  Double-check this case by looking for a base class. */
5627  {
5628  struct type *base_type = cp_find_type_baseclass_by_name (type, copy);
5629 
5630  if (base_type != NULL)
5631  {
5632  yylval.tsym.type = base_type;
5633  return TYPENAME;
5634  }
5635  }
5636  return ERROR;
5637 
5638  case LOC_TYPEDEF:
5640  return TYPENAME;
5641 
5642  default:
5643  return NAME;
5644  }
5645  internal_error (__FILE__, __LINE__, _("not reached"));
5646 }
5647 
5648 /* The outer level of a two-level lexer. This calls the inner lexer
5649  to return tokens. It then either returns these tokens, or
5650  aggregates them into a larger token. This lets us work around a
5651  problem in our parsing approach, where the parser could not
5652  distinguish between qualified names and qualified types at the
5653  right point.
5654 
5655  This approach is still not ideal, because it mishandles template
5656  types. See the comment in lex_one_token for an example. However,
5657  this is still an improvement over the earlier approach, and will
5658  suffice until we move to better parsing technology. */
5659 
5660 static int
5661 yylex (void)
5662 {
5663  token_and_value current;
5664  int first_was_coloncolon, last_was_coloncolon;
5665  struct type *context_type = NULL;
5666  int last_to_examine, next_to_examine, checkpoint;
5667  const struct block *search_block;
5668  int is_quoted_name;
5669 
5670  if (popping && !VEC_empty (token_and_value, token_fifo))
5671  goto do_pop;
5672  popping = 0;
5673 
5674  /* Read the first token and decide what to do. Most of the
5675  subsequent code is C++-only; but also depends on seeing a "::" or
5676  name-like token. */
5677  current.token = lex_one_token (pstate, &is_quoted_name);
5678  if (current.token == NAME)
5680  is_quoted_name);
5681  if (parse_language (pstate)->la_language != language_cplus
5682  || (current.token != TYPENAME && current.token != COLONCOLON
5683  && current.token != FILENAME))
5684  return current.token;
5685 
5686  /* Read any sequence of alternating "::" and name-like tokens into
5687  the token FIFO. */
5688  current.value = yylval;
5689  VEC_safe_push (token_and_value, token_fifo, &current);
5690  last_was_coloncolon = current.token == COLONCOLON;
5691  while (1)
5692  {
5693  int ignore;
5694 
5695  /* We ignore quoted names other than the very first one.
5696  Subsequent ones do not have any special meaning. */
5697  current.token = lex_one_token (pstate, &ignore);
5698  current.value = yylval;
5699  VEC_safe_push (token_and_value, token_fifo, &current);
5700 
5701  if ((last_was_coloncolon && current.token != NAME)
5702  || (!last_was_coloncolon && current.token != COLONCOLON))
5703  break;
5704  last_was_coloncolon = !last_was_coloncolon;
5705  }
5706  popping = 1;
5707 
5708  /* We always read one extra token, so compute the number of tokens
5709  to examine accordingly. */
5710  last_to_examine = VEC_length (token_and_value, token_fifo) - 2;
5711  next_to_examine = 0;
5712 
5713  current = *VEC_index (token_and_value, token_fifo, next_to_examine);
5714  ++next_to_examine;
5715 
5716  name_obstack.clear ();
5717  checkpoint = 0;
5718  if (current.token == FILENAME)
5719  search_block = current.value.bval;
5720  else if (current.token == COLONCOLON)
5721  search_block = NULL;
5722  else
5723  {
5724  gdb_assert (current.token == TYPENAME);
5725  search_block = expression_context_block;
5726  obstack_grow (&name_obstack, current.value.sval.ptr,
5727  current.value.sval.length);
5728  context_type = current.value.tsym.type;
5729  checkpoint = 1;
5730  }
5731 
5732  first_was_coloncolon = current.token == COLONCOLON;
5733  last_was_coloncolon = first_was_coloncolon;
5734 
5735  while (next_to_examine <= last_to_examine)
5736  {
5737  token_and_value *next;
5738 
5739  next = VEC_index (token_and_value, token_fifo, next_to_examine);
5740  ++next_to_examine;
5741 
5742  if (next->token == NAME && last_was_coloncolon)
5743  {
5744  int classification;
5745 
5746  yylval = next->value;
5747  classification = classify_inner_name (pstate, search_block,
5748  context_type);
5749  /* We keep going until we either run out of names, or until
5750  we have a qualified name which is not a type. */
5751  if (classification != TYPENAME && classification != NAME)
5752  break;
5753 
5754  /* Accept up to this token. */
5755  checkpoint = next_to_examine;
5756 
5757  /* Update the partial name we are constructing. */
5758  if (context_type != NULL)
5759  {
5760  /* We don't want to put a leading "::" into the name. */
5761  obstack_grow_str (&name_obstack, "::");
5762  }
5763  obstack_grow (&name_obstack, next->value.sval.ptr,
5764  next->value.sval.length);
5765 
5766  yylval.sval.ptr = (const char *) obstack_base (&name_obstack);
5767  yylval.sval.length = obstack_object_size (&name_obstack);
5768  current.value = yylval;
5769  current.token = classification;
5770 
5771  last_was_coloncolon = 0;
5772 
5773  if (classification == NAME)
5774  break;
5775 
5776  context_type = yylval.tsym.type;
5777  }
5778  else if (next->token == COLONCOLON && !last_was_coloncolon)
5779  last_was_coloncolon = 1;
5780  else
5781  {
5782  /* We've reached the end of the name. */
5783  break;
5784  }
5785  }
5786 
5787  /* If we have a replacement token, install it as the first token in
5788  the FIFO, and delete the other constituent tokens. */
5789  if (checkpoint > 0)
5790  {
5791  current.value.sval.ptr
5792  = (const char *) obstack_copy0 (&expansion_obstack,
5793  current.value.sval.ptr,
5794  current.value.sval.length);
5795 
5796  VEC_replace (token_and_value, token_fifo, 0, &current);
5797  if (checkpoint > 1)
5798  VEC_block_remove (token_and_value, token_fifo, 1, checkpoint - 1);
5799  }
5800 
5801  do_pop:
5802  current = *VEC_index (token_and_value, token_fifo, 0);
5803  VEC_ordered_remove (token_and_value, token_fifo, 0);
5804  yylval = current.value;
5805  return current.token;
5806 }
5807 
5808 int
5809 c_parse (struct parser_state *par_state)
5810 {
5811  int result;
5812  struct cleanup *back_to;
5813 
5814  /* Setting up the parser state. */
5815  scoped_restore pstate_restore = make_scoped_restore (&pstate);
5816  gdb_assert (par_state != NULL);
5817  pstate = par_state;
5818 
5819  /* Note that parsing (within yyparse) freely installs cleanups
5820  assuming they'll be run here (below). */
5821 
5823 
5824  /* Set up the scope for macro expansion. */
5825  expression_macro_scope = NULL;
5826 
5830  else
5832  if (! expression_macro_scope)
5834 
5835  /* Initialize macro expansion code. */
5836  obstack_init (&expansion_obstack);
5839 
5840  scoped_restore restore_yydebug = make_scoped_restore (&yydebug,
5841  parser_debug);
5842 
5843  /* Initialize some state used by the lexer. */
5844  last_was_structop = 0;
5845  saw_name_at_eof = 0;
5846 
5847  VEC_free (token_and_value, token_fifo);
5848  popping = 0;
5849  name_obstack.clear ();
5850 
5851  result = yyparse ();
5852  do_cleanups (back_to);
5853 
5854  return result;
5855 }
5856 
5857 #ifdef YYBISON
5858 
5859 /* This is called via the YYPRINT macro when parser debugging is
5860  enabled. It prints a token's value. */
5861 
5862 static void
5863 c_print_token (FILE *file, int type, YYSTYPE value)
5864 {
5865  switch (type)
5866  {
5867  case INT:
5868  parser_fprintf (file, "typed_val_int<%s, %s>",
5869  TYPE_SAFE_NAME (value.typed_val_int.type),
5870  pulongest (value.typed_val_int.val));
5871  break;
5872 
5873  case CHAR:
5874  case STRING:
5875  {
5876  char *copy = (char *) alloca (value.tsval.length + 1);
5877 
5878  memcpy (copy, value.tsval.ptr, value.tsval.length);
5879  copy[value.tsval.length] = '\0';
5880 
5881  parser_fprintf (file, "tsval<type=%d, %s>", value.tsval.type, copy);
5882  }
5883  break;
5884 
5885  case NSSTRING:
5886  case VARIABLE:
5887  parser_fprintf (file, "sval<%s>", copy_name (value.sval));
5888  break;
5889 
5890  case TYPENAME:
5891  parser_fprintf (file, "tsym<type=%s, name=%s>",
5892  TYPE_SAFE_NAME (value.tsym.type),
5893  copy_name (value.tsym.stoken));
5894  break;
5895 
5896  case NAME:
5897  case UNKNOWN_CPP_NAME:
5898  case NAME_OR_INT:
5899  case BLOCKNAME:
5900  parser_fprintf (file, "ssym<name=%s, sym=%s, field_of_this=%d>",
5901  copy_name (value.ssym.stoken),
5902  (value.ssym.sym.symbol == NULL
5903  ? "(null)" : SYMBOL_PRINT_NAME (value.ssym.sym.symbol)),
5904  value.ssym.is_a_field_of_this);
5905  break;
5906 
5907  case FILENAME:
5908  parser_fprintf (file, "bval<%s>", host_address_to_string (value.bval));
5909  break;
5910  }
5911 }
5912 
5913 #endif
5914 
5915 void
5916 yyerror (const char *msg)
5917 {
5918  if (prev_lexptr)
5919  lexptr = prev_lexptr;
5920 
5921  error (_("A %s in expression, near `%s'."), (msg ? msg : "error"), lexptr);
5922 }
unsigned int length
Definition: gdbtypes.h:803
const char * string
Definition: signals.c:50
struct type * type
Definition: parser-defs.h:115
type_instance_flags follow_type_instance_flags()
Definition: parse.c:1556
#define YYFPRINTF
Definition: yy-remap.h:92
#define yylen
#define ABOVE_COMMA
Definition: c-exp.c:248
static const yytype_int16 yypact[]
Definition: c-exp.c:725
static const yytype_uint8 yystos[]
Definition: c-exp.c:1197
unsigned short int yytype_uint16
Definition: c-exp.c:352
#define DOUBLE_KEYWORD
Definition: c-exp.c:243
#define NOTEQUAL
Definition: c-exp.c:252
int end_msglist(struct parser_state *ps)
Definition: objc-lang.c:486
void write_exp_elt_sym(struct parser_state *ps, struct symbol *expelt)
Definition: parse.c:215
#define parse_language(ps)
Definition: parser-defs.h:36
#define VEC_replace(T, V, I, O)
Definition: vec.h:318
#define COLONCOLON
Definition: c-exp.c:224
#define SYMBOL_PRINT_NAME(symbol)
Definition: symtab.h:542
struct YYSTYPE::@18 typed_val_int
void push_type_stack(struct type_stack *stack)
Definition: parse.c:1503
struct type * lookup_signed_typename(const struct language_defn *language, struct gdbarch *gdbarch, const char *name)
Definition: gdbtypes.c:1537
bfd_vma CORE_ADDR
Definition: common-types.h:41
#define YYNTOKENS
Definition: c-exp.c:575
#define parse_gdbarch(ps)
Definition: parser-defs.h:35
struct type * type
Definition: value.c:266
struct fn_field * fn_fields
Definition: gdbtypes.h:827
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
Definition: c-exp.c:435
bool parse_float(const char *p, int len, const struct type *type, gdb_byte *data)
Definition: parse.c:1331
void type_stack_cleanup(void *arg)
Definition: parse.c:1530
#define yyvs
#define VOLATILE_KEYWORD
Definition: c-exp.c:242
#define yylloc
DEF_ENUM_FLAGS_TYPE(enum token_flag, token_flags)
const char * ptr
Definition: parser-defs.h:91
#define yyssp
CORE_ADDR expression_context_pc
Definition: parse.c:70
static int classify_inner_name(struct parser_state *par_state, const struct block *block, struct type *context)
Definition: c-exp.c:5587
static const char * macro_original_text
Definition: c-exp.c:4973
void yyerror(const char *)
Definition: c-exp.c:5916
int comma_terminates
Definition: parse.c:77
token_flag
Definition: c-exp.c:4850
int gdbarch_int_bit(struct gdbarch *gdbarch)
Definition: gdbarch.c:1579
if(!(yy_init))
Definition: ada-lex.c:1075
Definition: c-lang.h:51
int parse_completion
Definition: parse.c:80
#define YYEMPTY
Definition: c-exp.c:1311
#define TYPE_NAME(thistype)
Definition: gdbtypes.h:1224
static struct macro_scope * expression_macro_scope
Definition: c-exp.c:5041
#define YYMAXDEPTH
Definition: c-exp.c:1487
#define YYLAST
Definition: c-exp.c:572
#define yyvsp
#define LSH
Definition: c-exp.c:255
int end_arglist(void)
Definition: parse.c:143
const struct type_print_options type_print_raw_options
Definition: typeprint.c:40
#define STRING
Definition: c-exp.c:206
int arglist_len
Definition: parse.c:72
#define parse_type(ps)
Definition: c-exp.c:86
#define HOST_ESCAPE_CHAR
Definition: charset.h:156
struct symtab * lookup_symtab(const char *name)
Definition: symtab.c:502
#define SYMBOL_CLASS(symbol)
Definition: symtab.h:1155
void * memset(T *s, int c, size_t n)=delete
void internal_error(const char *file, int line, const char *fmt,...)
Definition: errors.c:50
#define YYABORT
Definition: c-exp.c:1315
struct macro_definition * standard_macro_lookup(const char *name, void *baton)
Definition: macroscope.c:147
#define VEC_block_remove(T, V, I, L)
Definition: vec.h:376
static const struct token tokentab3[]
Definition: c-exp.c:4872
struct symtoken ssym
Definition: c-exp.c:287
static const yytype_uint8 yyr2[]
Definition: c-exp.c:1277
#define DECREMENT
Definition: c-exp.c:259
static struct stoken operator_stoken(const char *)
Definition: c-exp.c:4273
#define SHORT
Definition: c-exp.c:239
int gdbarch_long_bit(struct gdbarch *gdbarch)
Definition: gdbarch.c:1596
const struct block * innermost_block
Definition: parse.c:71
static const yytype_uint16 yyrline[]
Definition: c-exp.c:631
int have_partial_symbols(void)
Definition: objfiles.c:1023
Definition: c-exp.c:4864
#define VEC_safe_push(T, V, O)
Definition: vec.h:276
#define BLOCKVECTOR_BLOCK(blocklist, n)
Definition: block.h:125
#define ARROW_STAR
Definition: c-exp.c:261
struct block_symbol lookup_symbol(const char *name, const struct block *block, domain_enum domain, struct field_of_this_result *is_a_field_of_this)
Definition: symtab.c:1893
int token
Definition: c-exp.c:4867
void push_type(enum type_pieces tp)
Definition: parse.c:1408
static void insert_type(struct compile_c_instance *context, struct type *type, gcc_type gcc_type)
CORE_ADDR lookup_objc_class(struct gdbarch *gdbarch, const char *classname)
Definition: objc-lang.c:109
int c_parse_escape(const char **ptr, struct obstack *output)
Definition: c-exp.c:4591
#define _(String)
Definition: gdb_locale.h:35
struct macro_scope * sal_macro_scope(struct symtab_and_line sal)
Definition: macroscope.c:39
#define SELECTOR
Definition: c-exp.c:208
#define INT
Definition: c-exp.c:204
#define YYTRANSLATE(YYX)
Definition: c-exp.c:588
#define YYPRINT(FILE, TYPE, VALUE)
Definition: c-exp.c:328
#define NSSTRING
Definition: c-exp.c:207
static void yy_symbol_value_print(FILE *yyoutput, int yytype, YYSTYPE const *const yyvaluep)
Definition: c-exp.c:1381
short int yytype_int16
Definition: c-exp.c:358
struct macro_scope * default_macro_scope(void)
Definition: macroscope.c:102
#define INT_KEYWORD
Definition: c-exp.c:240
#define YYDPRINTF(Args)
Definition: c-exp.c:1352
static const yytype_int16 yycheck[]
Definition: c-exp.c:1020
#define yytable_value_is_error(Yytable_value)
Definition: c-exp.c:720
#define FILENAME
Definition: c-exp.c:264
#define CONST_KEYWORD
Definition: c-exp.c:241
#define TYPE_IS_REFERENCE(t)
Definition: gdbtypes.h:332
#define XNEW(T)
Definition: poison.h:109
unsigned input_radix
Definition: valprint.c:157
static int tempbuf_init
Definition: c-exp.c:4579
scoped_restore_tmpl< T > make_scoped_restore(T *var)
void push_type_int(int n)
Definition: parse.c:1415
mach_port_t kern_return_t mach_port_t msgports mach_port_t kern_return_t pid_t pid mach_port_t kern_return_t mach_port_t task mach_port_t kern_return_t int flags
Definition: gnu-nat.c:1891
#define STATIC_CAST
Definition: c-exp.c:231
static const yytype_int16 yydefgoto[]
Definition: c-exp.c:833
c_string_type_values
Definition: c-lang.h:38
static void yydestruct(const char *yymsg, int yytype, YYSTYPE *yyvaluep)
Definition: c-exp.c:1718
struct typed_stoken tsval
Definition: c-exp.c:285
#define INCREMENT
Definition: c-exp.c:258
struct fn_fieldlist * fn_field
Definition: symtab.h:1545
#define UNKNOWN_CPP_NAME
Definition: c-exp.c:211
struct type * lookup_typename(const struct language_defn *language, struct gdbarch *gdbarch, const char *name, const struct block *block, int noerr)
Definition: gdbtypes.c:1509
const char *const name
Definition: aarch64-tdep.c:76
void write_exp_elt_block(struct parser_state *ps, const struct block *b)
Definition: parse.c:235
#define SYMTAB_BLOCKVECTOR(symtab)
Definition: symtab.h:1334
static const yytype_uint8 yytranslate[]
Definition: c-exp.c:593
static int parse_string_or_char(const char *tokptr, const char **outptr, struct typed_stoken *value, int *host_chars)
Definition: c-exp.c:4753
void write_exp_elt_longcst(struct parser_state *ps, LONGEST expelt)
Definition: parse.c:255
#define ERROR
Definition: c-exp.c:226
#define VEC_iterate(T, V, I, P)
Definition: vec.h:181
struct type * check_typedef(struct type *type)
Definition: gdbtypes.c:2421
#define UNARY
Definition: c-exp.c:257
#define UNSIGNED
Definition: c-exp.c:223
int contained_in(const struct block *a, const struct block *b)
Definition: block.c:73
#define RSH
Definition: c-exp.c:256
#define NAME_OR_INT
Definition: c-exp.c:216
#define DECLTYPE
Definition: c-exp.c:235
static int type_aggregate_p(struct type *)
Definition: c-exp.c:4292
#define YY_SYMBOL_PRINT(Title, Type, Value, Location)
Definition: c-exp.c:1364
#define ANDAND
Definition: c-exp.c:250
struct type * follow_types(struct type *follow_type)
Definition: parse.c:1580
struct symtab_and_line find_pc_line(CORE_ADDR pc, int notcurrent)
Definition: symtab.c:3288
#define YYACCEPT
Definition: c-exp.c:1314
struct block_symbol sym
Definition: parser-defs.h:121
#define yyss
void start_msglist(void)
Definition: objc-lang.c:434
#define YYPOPSTACK(N)
static const yytype_uint8 yyr1[]
Definition: c-exp.c:1245
struct stoken_vector svec
Definition: c-exp.c:292
static struct obstack tempbuf
Definition: c-exp.c:4578
static VEC(token_and_value)
Definition: c-exp.c:5448
struct type * lookup_struct(const char *name, const struct block *block)
Definition: gdbtypes.c:1556
static const yytype_int16 yypgoto[]
Definition: c-exp.c:823
const char * oper
Definition: c-exp.c:4866
const struct block * block
Definition: symtab.h:1140
#define ENTRY
Definition: c-exp.c:233
struct YYSTYPE::@2 typed_val_float
#define ASSIGN_MODIFY
Definition: c-exp.c:245
void push_typelist(VEC(type_ptr) *list)
Definition: parse.c:1543
symbol * find_function_alias_target(bound_minimal_symbol msymbol)
Definition: symtab.c:3953
int symbol_read_needs_frame(struct symbol *sym)
Definition: findvar.c:392
#define YYSTACK_ALLOC_MAXIMUM
Definition: c-exp.c:483
token_flags flags
Definition: c-exp.c:4869
#define yypact_value_is_default(Yystate)
Definition: c-exp.c:715
void free_current_contents(void *ptr)
Definition: utils.c:199
#define CLASS
Definition: c-exp.c:219
#define VEC_length(T, V)
Definition: vec.h:140
struct type * lookup_enum(const char *name, const struct block *block)
Definition: gdbtypes.c:1602
#define CONST_CAST
Definition: c-exp.c:232
static void yy_reduce_print(yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
Definition: c-exp.c:1438
static struct obstack expansion_obstack
Definition: c-exp.c:4981
int yychar
Definition: c-exp.c:1734
struct cleanup * make_cleanup(make_cleanup_ftype *function, void *arg)
Definition: cleanups.c:116
#define BLOCKNAME
Definition: c-exp.c:263
void add_msglist(struct stoken *str, int addcolon)
Definition: objc-lang.c:448
yytype_int16 yyss_alloc
Definition: ada-exp.c:500
unsigned char yytype_uint8
Definition: c-exp.c:340
Definition: gdbtypes.h:749
#define VEC_index(T, V, I)
Definition: vec.h:167
int voidval
Definition: c-exp.c:288
yytokentype
Definition: ada-exp.c:178
static const yytype_uint16 yytoknum[]
Definition: c-exp.c:699
char * macro_expand_next(const char **lexptr, macro_lookup_ftype *lookup_func, void *lookup_baton)
Definition: macroexp.c:1521
void write_dollar_variable(struct parser_state *ps, struct stoken str)
Definition: parse.c:594
#define GEQ
Definition: c-exp.c:254
const char * find_template_name_end(const char *p)
Definition: parse.c:690
static const char * type
Definition: language.c:113
static const struct token ident_tokens[]
Definition: c-exp.c:4908
void mark_struct_expression(struct parser_state *ps)
Definition: parse.c:544
YYSTYPE value
Definition: c-exp.c:5441
struct type_stack * get_type_stack(void)
Definition: parse.c:1515
static struct parser_state * pstate
Definition: c-exp.c:96
unsigned dummy
Definition: go32-nat.c:1073
#define LEQ
Definition: c-exp.c:253
YYSTYPE yyvs_alloc
Definition: ada-exp.c:501
#define yyrule
struct type * lookup_union(const char *name, const struct block *block)
Definition: gdbtypes.c:1578
unsigned short int yytype_uint16
Definition: ada-exp.c:336
LONGEST lval
Definition: ada-exp.c:283
DEF_VEC_O(token_and_value)
static int yylex(void)
Definition: c-exp.c:5661
signed char yytype_int8
Definition: c-exp.c:346
static int classify_name(struct parser_state *par_state, const struct block *block)
Definition: go-exp.c:3017
#define STRUCT
Definition: c-exp.c:218
const struct block * bval
Definition: ada-exp.c:294
#define LONG
Definition: c-exp.c:238
#define YYEOF
Definition: c-exp.c:1312
#define FALSEKEYWORD
Definition: c-exp.c:247
#define UNION
Definition: c-exp.c:220
#define XRESIZEVEC(T, P, N)
Definition: poison.h:169
#define REINTERPRET_CAST
Definition: c-exp.c:229
int parser_debug
Definition: parse.c:104
#define TYPENAME
Definition: c-exp.c:213
int is_a_field_of_this
Definition: parser-defs.h:122
void write_exp_msymbol(struct parser_state *ps, struct bound_minimal_symbol bound_msym)
Definition: parse.c:531
int paren_depth
Definition: parse.c:76
int c_parse(struct parser_state *par_state)
Definition: c-exp.c:5809
static struct type_stack type_stack
Definition: parse.c:73
static int parse_number(struct parser_state *par_state, const char *, int, int, YYSTYPE *)
Definition: c-exp.c:4339
struct symbol * symbol
Definition: symtab.h:1136
int destructor_name_p(const char *name, struct type *type)
Definition: valops.c:3160
static void finished_macro_expansion(void)
Definition: c-exp.c:5010
std::string & string()
Definition: ui-file.h:132
#define gdb_assert(expr)
Definition: gdb_assert.h:32
Definition: block.h:60
struct type * type
Definition: symtab.h:1535
#define VEC_empty(T, V)
Definition: vec.h:148
Definition: value.c:169
static void write_destructor_name(struct parser_state *par_state, struct stoken)
Definition: c-exp.c:4256
static int scanning_macro_expansion(void)
Definition: c-exp.c:5004
#define CP_OPERATOR_STR
Definition: cp-support.h:51
#define SIZEOF
Definition: c-exp.c:222
#define CP_OPERATOR_LEN
Definition: cp-support.h:55
#define YYTERROR
Definition: c-exp.c:1339
LONGEST val
Definition: ada-exp.c:285
void write_exp_elt_opcode(struct parser_state *ps, enum exp_opcode expelt)
Definition: parse.c:205
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
Definition: c-exp.c:536
#define CLASSNAME
Definition: c-exp.c:214
static const char * lexptr
bfd_byte gdb_byte
Definition: common-types.h:38
void insert_type_address_space(struct parser_state *pstate, char *string)
Definition: parse.c:1430
#define YY_(Msgid)
Definition: c-exp.c:384
static void scan_macro_expansion(char *expansion)
Definition: c-exp.c:4984
unsigned char yytype_uint8
Definition: ada-exp.c:324
#define YY_REDUCE_PRINT(Rule)
Definition: c-exp.c:1457
#define TYPE_TARGET_TYPE(thistype)
Definition: gdbtypes.h:1226
static void yy_stack_print(yytype_int16 *yybottom, yytype_int16 *yytop)
Definition: c-exp.c:1415
static void c_print_token(FILE *file, int type, YYSTYPE value)
Definition: c-exp.c:5863
int yynerrs
Definition: c-exp.c:1739
#define YY_STACK_PRINT(Bottom, Top)
Definition: c-exp.c:1426
YYSTYPE yylval
Definition: c-exp.c:1737
struct type * lookup_template_type(char *name, struct type *type, const struct block *block)
Definition: gdbtypes.c:1623
struct ttype tsym
Definition: c-exp.c:286
#define SIGNED_KEYWORD
Definition: c-exp.c:237
#define yys
#define SYMBOL_BLOCK_VALUE(symbol)
Definition: symtab.h:467
#define TYPE_CODE(thistype)
Definition: gdbtypes.h:1238
const char * c_str() const
Definition: ui-file.h:137
#define DOTDOTDOT
Definition: c-exp.c:265
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Definition: c-exp.c:434
static const yytype_uint16 yydefact[]
Definition: c-exp.c:775
struct minimal_symbol * minsym
Definition: minsyms.h:34
void parser_fprintf(FILE *x, const char *y,...)
Definition: parse.c:1705
void c_print_type(struct type *, const char *, struct ui_file *, int, int, const struct type_print_options *)
Definition: c-typeprint.c:164
int gdbarch_long_long_bit(struct gdbarch *gdbarch)
Definition: gdbarch.c:1613
#define ENUM
Definition: c-exp.c:221
#define YY_NULLPTRPTR
Definition: c-exp.c:113
const char * symbol
Definition: signals.c:48
struct type * tval
Definition: ada-exp.c:292
struct bound_minimal_symbol lookup_bound_minimal_symbol(const char *name)
Definition: minsyms.c:430
#define OBJC_LBRAC
Definition: c-exp.c:215
#define VEC_free(T, V)
Definition: vec.h:196
#define CHAR
Definition: c-exp.c:209
#define yystate
exp_opcode
Definition: expression.h:42
enum exp_opcode opcode
Definition: c-exp.c:290
#define TRUEKEYWORD
Definition: c-exp.c:246
#define obstack_grow_str(OBSTACK, STRING)
Definition: gdb_obstack.h:46
std::string cp_canonicalize_string(const char *string)
Definition: cp-support.c:552
struct type * lookup_unsigned_typename(const struct language_defn *language, struct gdbarch *gdbarch, const char *name)
Definition: gdbtypes.c:1526
struct type_stack * append_type_stack(struct type_stack *to, struct type_stack *from)
Definition: parse.c:1489
int yydebug
Definition: c-exp.c:1465
#define VARIABLE
Definition: c-exp.c:244
void xfree(void *)
static int is_cast_operator(const char *token, int len)
Definition: c-exp.c:5032
static void scan_macro_cleanup(void *dummy)
Definition: c-exp.c:5021
int have_full_symbols(void)
Definition: objfiles.c:1040
#define TYPEID
Definition: c-exp.c:236
static void yy_symbol_print(FILE *yyoutput, int yytype, YYSTYPE const *const yyvaluep)
Definition: c-exp.c:1400
int yyparse(void)
Definition: c-exp.c:1747
const struct block * expression_context_block
Definition: parse.c:69
struct type * type
Definition: ada-exp.c:286
#define YYSTACK_ALLOC
Definition: c-exp.c:480
unsigned long long ULONGEST
Definition: common-types.h:53
struct typed_stoken * tokens
Definition: parser-defs.h:109
#define YYSIZE_T
Definition: c-exp.c:368
static int ignore(struct target_ops *ops, struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
Definition: corelow.c:879
#define SYMBOL_TYPE(symbol)
Definition: symtab.h:1161
#define yyval
struct type ** tvec
Definition: f-exp.c:243
#define NAME
Definition: c-exp.c:210
void mark_completion_tag(enum type_code tag, const char *ptr, int length)
Definition: parse.c:556
#define YYUSE(E)
Definition: c-exp.c:417
void start_arglist(void)
Definition: parse.c:133
#define COMPLETE
Definition: c-exp.c:212
#define TYPE_LENGTH(thistype)
Definition: gdbtypes.h:1235
#define TYPEOF
Definition: c-exp.c:234
static int saw_name_at_eof
Definition: c-exp.c:5046
short int yytype_int16
Definition: ada-exp.c:342
#define DYNAMIC_CAST
Definition: c-exp.c:230
#define HOST_CHAR_BIT
Definition: host-defs.h:40
static int last_was_structop
Definition: c-exp.c:5051
#define YYSTACK_BYTES(N)
Definition: c-exp.c:525
void * xmalloc(YYSIZE_T)
#define TYPE_FN_FIELD_CONSTRUCTOR(thisfn, n)
Definition: gdbtypes.h:1435
#define YYINITDEPTH
Definition: c-exp.c:1476
struct symbol * lookup_struct_typedef(const char *name, const struct block *block, int noerr)
Definition: objc-lang.c:84
#define DELETE
Definition: c-exp.c:228
#define OROR
Definition: c-exp.c:249
struct stoken sval
Definition: ada-exp.c:293
#define TYPE_DECLARED_CLASS(t)
Definition: gdbtypes.h:299
static const struct token tokentab2[]
Definition: c-exp.c:4880
#define TEMPLATE
Definition: c-exp.c:225
struct bound_minimal_symbol lookup_minimal_symbol(const char *name, const char *sfile, struct objfile *objf)
Definition: minsyms.c:311
static int lex_one_token(struct parser_state *par_state, int *is_quoted_name)
Definition: c-exp.c:5056
static const char * prev_lexptr
void write_exp_elt_floatcst(struct parser_state *ps, const gdb_byte expelt[16])
Definition: parse.c:265
#define YYFINAL
Definition: c-exp.c:570
void write_exp_string(struct parser_state *ps, struct stoken str)
Definition: parse.c:318
struct type * cp_find_type_baseclass_by_name(struct type *parent_type, const char *name)
Definition: cp-namespace.c:777
void write_exp_elt_type(struct parser_state *ps, struct type *expelt)
Definition: parse.c:277
static void check_parameter_typelist(VEC(type_ptr) *)
Definition: c-exp.c:4304
void clear()
Definition: gdb_obstack.h:77
#define yystacksize
static const yytype_int16 yytable[]
Definition: c-exp.c:845
#define OPERATOR
Definition: c-exp.c:217
#define EQUAL
Definition: c-exp.c:251
void error(const char *fmt,...)
Definition: errors.c:38
struct block_symbol cp_lookup_nested_symbol(struct type *parent_type, const char *nested_name, const struct block *block, const domain_enum domain)
Definition: cp-namespace.c:913
#define DOT_STAR
Definition: c-exp.c:262
void write_exp_string_vector(struct parser_state *ps, int type, struct stoken_vector *vec)
Definition: parse.c:360
struct stoken stoken
Definition: parser-defs.h:120
long long LONGEST
Definition: common-types.h:52
void do_cleanups(struct cleanup *old_chain)
Definition: cleanups.c:174
#define SYMBOL_IS_ARGUMENT(symbol)
Definition: symtab.h:1157
#define TYPE_SAFE_NAME(type)
Definition: gdbtypes.h:1483
int length
Definition: parser-defs.h:93
#define NEW
Definition: c-exp.c:227
char * copy_name(struct stoken token)
Definition: parse.c:761
#define YYSTACK_FREE
Definition: c-exp.c:481
static const char *const yytname[]
Definition: c-exp.c:666
#define ARROW
Definition: c-exp.c:260
struct macro_scope * user_macro_scope(void)
Definition: macroscope.c:91
#define VEC_ordered_remove(T, V, I)
Definition: vec.h:355
enum exp_opcode opcode
Definition: c-exp.c:4868
#define FLOAT
Definition: c-exp.c:205