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