GDB (xrefs)
Loading...
Searching...
No Matches
cp-name-parser.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 1
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 38 "cp-name-parser.y"
71
72
73#include "defs.h"
74
75#include <unistd.h>
76#include "gdbsupport/gdb-safe-ctype.h"
77#include "demangle.h"
78#include "cp-support.h"
79#include "c-support.h"
80#include "parser-defs.h"
81
82#define GDB_YY_REMAP_PREFIX cpname
83#include "yy-remap.h"
84
85/* The components built by the parser are allocated ahead of time,
86 and cached in this structure. */
87
88#define ALLOC_CHUNK 100
89
91 int used;
93 struct demangle_component comps[ALLOC_CHUNK];
94};
95
96
97#line 98 "cp-name-parser.c.tmp"
98
99# ifndef YY_CAST
100# ifdef __cplusplus
101# define YY_CAST(Type, Val) static_cast<Type> (Val)
102# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
103# else
104# define YY_CAST(Type, Val) ((Type) (Val))
105# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
106# endif
107# endif
108# ifndef YY_NULLPTRPTR
109# if defined __cplusplus
110# if 201103L <= __cplusplus
111# define YY_NULLPTRPTR nullptr
112# else
113# define YY_NULLPTRPTR 0
114# endif
115# else
116# define YY_NULLPTRPTR ((void*)0)
117# endif
118# endif
119
120
121/* Debug traces. */
122#ifndef YYDEBUG
123# define YYDEBUG 0
124#endif
125#if YYDEBUG
126extern int yydebug;
127#endif
128
129/* Token kinds. */
130#ifndef YYTOKENTYPE
131# define YYTOKENTYPE
133 {
135 YYEOF = 0, /* "end of file" */
136 YYerror = 256, /* error */
137 YYUNDEF = 257, /* "invalid token" */
138 INT = 258, /* INT */
139 FLOAT = 259, /* FLOAT */
140 NAME = 260, /* NAME */
141 STRUCT = 261, /* STRUCT */
142 CLASS = 262, /* CLASS */
143 UNION = 263, /* UNION */
144 ENUM = 264, /* ENUM */
145 SIZEOF = 265, /* SIZEOF */
146 UNSIGNED = 266, /* UNSIGNED */
147 COLONCOLON = 267, /* COLONCOLON */
148 TEMPLATE = 268, /* TEMPLATE */
149 ERROR = 269, /* ERROR */
150 NEW = 270, /* NEW */
151 DELETE = 271, /* DELETE */
152 OPERATOR = 272, /* OPERATOR */
153 STATIC_CAST = 273, /* STATIC_CAST */
154 REINTERPRET_CAST = 274, /* REINTERPRET_CAST */
155 DYNAMIC_CAST = 275, /* DYNAMIC_CAST */
156 SIGNED_KEYWORD = 276, /* SIGNED_KEYWORD */
157 LONG = 277, /* LONG */
158 SHORT = 278, /* SHORT */
159 INT_KEYWORD = 279, /* INT_KEYWORD */
160 CONST_KEYWORD = 280, /* CONST_KEYWORD */
161 VOLATILE_KEYWORD = 281, /* VOLATILE_KEYWORD */
162 DOUBLE_KEYWORD = 282, /* DOUBLE_KEYWORD */
163 BOOL = 283, /* BOOL */
164 ELLIPSIS = 284, /* ELLIPSIS */
165 RESTRICT = 285, /* RESTRICT */
166 VOID = 286, /* VOID */
167 FLOAT_KEYWORD = 287, /* FLOAT_KEYWORD */
168 CHAR = 288, /* CHAR */
169 WCHAR_T = 289, /* WCHAR_T */
170 ASSIGN_MODIFY = 290, /* ASSIGN_MODIFY */
171 TRUEKEYWORD = 291, /* TRUEKEYWORD */
172 FALSEKEYWORD = 292, /* FALSEKEYWORD */
173 DEMANGLER_SPECIAL = 293, /* DEMANGLER_SPECIAL */
174 CONSTRUCTION_VTABLE = 294, /* CONSTRUCTION_VTABLE */
175 CONSTRUCTION_IN = 295, /* CONSTRUCTION_IN */
176 OROR = 296, /* OROR */
177 ANDAND = 297, /* ANDAND */
178 EQUAL = 298, /* EQUAL */
179 NOTEQUAL = 299, /* NOTEQUAL */
180 LEQ = 300, /* LEQ */
181 GEQ = 301, /* GEQ */
182 LSH = 302, /* LSH */
183 RSH = 303, /* RSH */
184 UNARY = 304, /* UNARY */
185 INCREMENT = 305, /* INCREMENT */
186 DECREMENT = 306, /* DECREMENT */
187 ARROW = 307 /* ARROW */
188 };
190#endif
191/* Token kinds. */
192#define YYEMPTY -2
193#define YYEOF 0
194#define YYerror 256
195#define YYUNDEF 257
196#define INT 258
197#define FLOAT 259
198#define NAME 260
199#define STRUCT 261
200#define CLASS 262
201#define UNION 263
202#define ENUM 264
203#define SIZEOF 265
204#define UNSIGNED 266
205#define COLONCOLON 267
206#define TEMPLATE 268
207#define ERROR 269
208#define NEW 270
209#define DELETE 271
210#define OPERATOR 272
211#define STATIC_CAST 273
212#define REINTERPRET_CAST 274
213#define DYNAMIC_CAST 275
214#define SIGNED_KEYWORD 276
215#define LONG 277
216#define SHORT 278
217#define INT_KEYWORD 279
218#define CONST_KEYWORD 280
219#define VOLATILE_KEYWORD 281
220#define DOUBLE_KEYWORD 282
221#define BOOL 283
222#define ELLIPSIS 284
223#define RESTRICT 285
224#define VOID 286
225#define FLOAT_KEYWORD 287
226#define CHAR 288
227#define WCHAR_T 289
228#define ASSIGN_MODIFY 290
229#define TRUEKEYWORD 291
230#define FALSEKEYWORD 292
231#define DEMANGLER_SPECIAL 293
232#define CONSTRUCTION_VTABLE 294
233#define CONSTRUCTION_IN 295
234#define OROR 296
235#define ANDAND 297
236#define EQUAL 298
237#define NOTEQUAL 299
238#define LEQ 300
239#define GEQ 301
240#define LSH 302
241#define RSH 303
242#define UNARY 304
243#define INCREMENT 305
244#define DECREMENT 306
245#define ARROW 307
246
247/* Value type. */
248#if ! defined cp_name_parser_YYSTYPE && ! defined cp_name_parser_YYSTYPE_IS_DECLARED
250{
251#line 66 "cp-name-parser.y"
252
253 struct demangle_component *comp;
254 struct nested {
255 struct demangle_component *comp;
256 struct demangle_component **last;
258 struct {
259 struct demangle_component *comp, *last;
261 struct {
262 struct demangle_component *comp, **last;
263 struct nested fn;
264 struct demangle_component *start;
267 int lval;
268 const char *opname;
269
270
271#line 272 "cp-name-parser.c.tmp"
272
273};
275# define cp_name_parser_YYSTYPE_IS_TRIVIAL 1
276# define cp_name_parser_YYSTYPE_IS_DECLARED 1
277#endif
278
279
280
281
282int yyparse (struct cpname_state *state);
283
284
285
286/* Symbol kind. */
288{
290 YYSYMBOL_YYEOF = 0, /* "end of file" */
291 YYSYMBOL_YYerror = 1, /* error */
292 YYSYMBOL_YYUNDEF = 2, /* "invalid token" */
293 YYSYMBOL_INT = 3, /* INT */
294 YYSYMBOL_FLOAT = 4, /* FLOAT */
295 YYSYMBOL_NAME = 5, /* NAME */
296 YYSYMBOL_STRUCT = 6, /* STRUCT */
297 YYSYMBOL_CLASS = 7, /* CLASS */
298 YYSYMBOL_UNION = 8, /* UNION */
299 YYSYMBOL_ENUM = 9, /* ENUM */
300 YYSYMBOL_SIZEOF = 10, /* SIZEOF */
301 YYSYMBOL_UNSIGNED = 11, /* UNSIGNED */
302 YYSYMBOL_COLONCOLON = 12, /* COLONCOLON */
303 YYSYMBOL_TEMPLATE = 13, /* TEMPLATE */
304 YYSYMBOL_ERROR = 14, /* ERROR */
305 YYSYMBOL_NEW = 15, /* NEW */
306 YYSYMBOL_DELETE = 16, /* DELETE */
307 YYSYMBOL_OPERATOR = 17, /* OPERATOR */
308 YYSYMBOL_STATIC_CAST = 18, /* STATIC_CAST */
309 YYSYMBOL_REINTERPRET_CAST = 19, /* REINTERPRET_CAST */
310 YYSYMBOL_DYNAMIC_CAST = 20, /* DYNAMIC_CAST */
311 YYSYMBOL_SIGNED_KEYWORD = 21, /* SIGNED_KEYWORD */
312 YYSYMBOL_LONG = 22, /* LONG */
313 YYSYMBOL_SHORT = 23, /* SHORT */
314 YYSYMBOL_INT_KEYWORD = 24, /* INT_KEYWORD */
315 YYSYMBOL_CONST_KEYWORD = 25, /* CONST_KEYWORD */
316 YYSYMBOL_VOLATILE_KEYWORD = 26, /* VOLATILE_KEYWORD */
317 YYSYMBOL_DOUBLE_KEYWORD = 27, /* DOUBLE_KEYWORD */
318 YYSYMBOL_BOOL = 28, /* BOOL */
319 YYSYMBOL_ELLIPSIS = 29, /* ELLIPSIS */
320 YYSYMBOL_RESTRICT = 30, /* RESTRICT */
321 YYSYMBOL_VOID = 31, /* VOID */
322 YYSYMBOL_FLOAT_KEYWORD = 32, /* FLOAT_KEYWORD */
323 YYSYMBOL_CHAR = 33, /* CHAR */
324 YYSYMBOL_WCHAR_T = 34, /* WCHAR_T */
325 YYSYMBOL_ASSIGN_MODIFY = 35, /* ASSIGN_MODIFY */
326 YYSYMBOL_TRUEKEYWORD = 36, /* TRUEKEYWORD */
327 YYSYMBOL_FALSEKEYWORD = 37, /* FALSEKEYWORD */
328 YYSYMBOL_DEMANGLER_SPECIAL = 38, /* DEMANGLER_SPECIAL */
329 YYSYMBOL_CONSTRUCTION_VTABLE = 39, /* CONSTRUCTION_VTABLE */
330 YYSYMBOL_CONSTRUCTION_IN = 40, /* CONSTRUCTION_IN */
331 YYSYMBOL_41_ = 41, /* ')' */
332 YYSYMBOL_42_ = 42, /* ',' */
333 YYSYMBOL_43_ = 43, /* '=' */
334 YYSYMBOL_44_ = 44, /* '?' */
335 YYSYMBOL_OROR = 45, /* OROR */
336 YYSYMBOL_ANDAND = 46, /* ANDAND */
337 YYSYMBOL_47_ = 47, /* '|' */
338 YYSYMBOL_48_ = 48, /* '^' */
339 YYSYMBOL_49_ = 49, /* '&' */
340 YYSYMBOL_EQUAL = 50, /* EQUAL */
341 YYSYMBOL_NOTEQUAL = 51, /* NOTEQUAL */
342 YYSYMBOL_52_ = 52, /* '<' */
343 YYSYMBOL_53_ = 53, /* '>' */
344 YYSYMBOL_LEQ = 54, /* LEQ */
345 YYSYMBOL_GEQ = 55, /* GEQ */
346 YYSYMBOL_LSH = 56, /* LSH */
347 YYSYMBOL_RSH = 57, /* RSH */
348 YYSYMBOL_58_ = 58, /* '@' */
349 YYSYMBOL_59_ = 59, /* '+' */
350 YYSYMBOL_60_ = 60, /* '-' */
351 YYSYMBOL_61_ = 61, /* '*' */
352 YYSYMBOL_62_ = 62, /* '/' */
353 YYSYMBOL_63_ = 63, /* '%' */
354 YYSYMBOL_UNARY = 64, /* UNARY */
355 YYSYMBOL_INCREMENT = 65, /* INCREMENT */
356 YYSYMBOL_DECREMENT = 66, /* DECREMENT */
357 YYSYMBOL_ARROW = 67, /* ARROW */
358 YYSYMBOL_68_ = 68, /* '.' */
359 YYSYMBOL_69_ = 69, /* '[' */
360 YYSYMBOL_70_ = 70, /* ']' */
361 YYSYMBOL_71_ = 71, /* '~' */
362 YYSYMBOL_72_ = 72, /* '!' */
363 YYSYMBOL_73_ = 73, /* '(' */
364 YYSYMBOL_74_ = 74, /* ':' */
365 YYSYMBOL_YYACCEPT = 75, /* $accept */
366 YYSYMBOL_result = 76, /* result */
367 YYSYMBOL_start = 77, /* start */
368 YYSYMBOL_start_opt = 78, /* start_opt */
369 YYSYMBOL_function = 79, /* function */
370 YYSYMBOL_demangler_special = 80, /* demangler_special */
371 YYSYMBOL_oper = 81, /* oper */
372 YYSYMBOL_conversion_op = 82, /* conversion_op */
373 YYSYMBOL_conversion_op_name = 83, /* conversion_op_name */
374 YYSYMBOL_unqualified_name = 84, /* unqualified_name */
375 YYSYMBOL_colon_name = 85, /* colon_name */
376 YYSYMBOL_name = 86, /* name */
377 YYSYMBOL_colon_ext_name = 87, /* colon_ext_name */
378 YYSYMBOL_colon_ext_only = 88, /* colon_ext_only */
379 YYSYMBOL_ext_only_name = 89, /* ext_only_name */
380 YYSYMBOL_nested_name = 90, /* nested_name */
381 YYSYMBOL_templ = 91, /* templ */
382 YYSYMBOL_template_params = 92, /* template_params */
383 YYSYMBOL_template_arg = 93, /* template_arg */
384 YYSYMBOL_function_args = 94, /* function_args */
385 YYSYMBOL_function_arglist = 95, /* function_arglist */
386 YYSYMBOL_qualifiers_opt = 96, /* qualifiers_opt */
387 YYSYMBOL_qualifier = 97, /* qualifier */
388 YYSYMBOL_qualifiers = 98, /* qualifiers */
389 YYSYMBOL_int_part = 99, /* int_part */
390 YYSYMBOL_int_seq = 100, /* int_seq */
391 YYSYMBOL_builtin_type = 101, /* builtin_type */
392 YYSYMBOL_ptr_operator = 102, /* ptr_operator */
393 YYSYMBOL_array_indicator = 103, /* array_indicator */
394 YYSYMBOL_typespec_2 = 104, /* typespec_2 */
395 YYSYMBOL_abstract_declarator = 105, /* abstract_declarator */
396 YYSYMBOL_direct_abstract_declarator = 106, /* direct_abstract_declarator */
397 YYSYMBOL_abstract_declarator_fn = 107, /* abstract_declarator_fn */
398 YYSYMBOL_type = 108, /* type */
399 YYSYMBOL_declarator = 109, /* declarator */
400 YYSYMBOL_direct_declarator = 110, /* direct_declarator */
401 YYSYMBOL_declarator_1 = 111, /* declarator_1 */
402 YYSYMBOL_direct_declarator_1 = 112, /* direct_declarator_1 */
403 YYSYMBOL_exp = 113, /* exp */
404 YYSYMBOL_exp1 = 114 /* exp1 */
407
408
409/* Second part of user prologue. */
410#line 85 "cp-name-parser.y"
411
412
414{
415 /* LEXPTR is the current pointer into our lex buffer. PREV_LEXPTR
416 is the start of the last token lexed, only used for diagnostics.
417 ERROR_LEXPTR is the first place an error occurred. GLOBAL_ERRMSG
418 is the first error message encountered. */
419
421
423
424 /* The parse tree created by the parser is stored here after a
425 successful parse. */
426
427 struct demangle_component *global_result;
428
429 struct demangle_component *d_grab ();
430
431 /* Helper functions. These wrap the demangler tree interface,
432 handle allocation from our global store, and return the allocated
433 component. */
434
435 struct demangle_component *fill_comp (enum demangle_component_type d_type,
436 struct demangle_component *lhs,
437 struct demangle_component *rhs);
438
439 struct demangle_component *make_operator (const char *name, int args);
440
441 struct demangle_component *make_dtor (enum gnu_v3_dtor_kinds kind,
442 struct demangle_component *name);
443
444 struct demangle_component *make_builtin_type (const char *name);
445
446 struct demangle_component *make_name (const char *name, int len);
447
448 struct demangle_component *d_qualify (struct demangle_component *lhs,
449 int qualifiers, int is_method);
450
451 struct demangle_component *d_int_type (int flags);
452
453 struct demangle_component *d_unary (const char *name,
454 struct demangle_component *lhs);
455
456 struct demangle_component *d_binary (const char *name,
457 struct demangle_component *lhs,
458 struct demangle_component *rhs);
459
460 int parse_number (const char *p, int len, int parsed_float, cp_name_parser_YYSTYPE *lvalp);
461};
462
463struct demangle_component *
465{
466 struct demangle_info *more;
467
469 {
470 if (demangle_info->next == NULL)
471 {
472 more = XNEW (struct demangle_info);
473 more->next = NULL;
474 demangle_info->next = more;
475 }
476 else
477 more = demangle_info->next;
478
479 more->used = 0;
480 demangle_info = more;
481 }
483}
484
485/* Flags passed to d_qualify. */
486
487#define QUAL_CONST 1
488#define QUAL_RESTRICT 2
489#define QUAL_VOLATILE 4
490
491/* Flags passed to d_int_type. */
492
493#define INT_CHAR (1 << 0)
494#define INT_SHORT (1 << 1)
495#define INT_LONG (1 << 2)
496#define INT_LLONG (1 << 3)
497
498#define INT_SIGNED (1 << 4)
499#define INT_UNSIGNED (1 << 5)
500
501/* Enable yydebug for the stand-alone parser. */
502#ifdef TEST_CPNAMES
503# define YYDEBUG 1
504#endif
505
506/* Helper functions. These wrap the demangler tree interface, handle
507 allocation from our global store, and return the allocated component. */
508
509struct demangle_component *
510cpname_state::fill_comp (enum demangle_component_type d_type,
511 struct demangle_component *lhs,
512 struct demangle_component *rhs)
513{
514 struct demangle_component *ret = d_grab ();
515 int i;
516
517 i = cplus_demangle_fill_component (ret, d_type, lhs, rhs);
518 gdb_assert (i);
519
520 return ret;
521}
522
523struct demangle_component *
524cpname_state::make_operator (const char *name, int args)
525{
526 struct demangle_component *ret = d_grab ();
527 int i;
528
529 i = cplus_demangle_fill_operator (ret, name, args);
530 gdb_assert (i);
531
532 return ret;
533}
534
535struct demangle_component *
536cpname_state::make_dtor (enum gnu_v3_dtor_kinds kind,
537 struct demangle_component *name)
538{
539 struct demangle_component *ret = d_grab ();
540 int i;
541
542 i = cplus_demangle_fill_dtor (ret, kind, name);
543 gdb_assert (i);
544
545 return ret;
546}
547
548struct demangle_component *
550{
551 struct demangle_component *ret = d_grab ();
552 int i;
553
554 i = cplus_demangle_fill_builtin_type (ret, name);
555 gdb_assert (i);
556
557 return ret;
558}
559
560struct demangle_component *
561cpname_state::make_name (const char *name, int len)
562{
563 struct demangle_component *ret = d_grab ();
564 int i;
565
566 i = cplus_demangle_fill_name (ret, name, len);
567 gdb_assert (i);
568
569 return ret;
570}
571
572#define d_left(dc) (dc)->u.s_binary.left
573#define d_right(dc) (dc)->u.s_binary.right
574
576static void yyerror (cpname_state *, const char *);
577
578#line 579 "cp-name-parser.c.tmp"
579
580
581#ifdef short
582# undef short
583#endif
584
585/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
586 <limits.h> and (if available) <stdint.h> are included
587 so that the code can choose integer types of a good width. */
588
589#ifndef __PTRDIFF_MAX__
590# include <limits.h> /* INFRINGES ON USER NAME SPACE */
591# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
592# include <stdint.h> /* INFRINGES ON USER NAME SPACE */
593# define YY_STDINT_H
594# endif
595#endif
596
597/* Narrow types that promote to a signed type and that can represent a
598 signed or unsigned integer of at least N bits. In tables they can
599 save space and decrease cache pressure. Promoting to a signed type
600 helps avoid bugs in integer arithmetic. */
601
602#ifdef __INT_LEAST8_MAX__
603typedef __INT_LEAST8_TYPE__ yytype_int8;
604#elif defined YY_STDINT_H
605typedef int_least8_t yytype_int8;
606#else
607typedef signed char yytype_int8;
608#endif
609
610#ifdef __INT_LEAST16_MAX__
611typedef __INT_LEAST16_TYPE__ yytype_int16;
612#elif defined YY_STDINT_H
613typedef int_least16_t yytype_int16;
614#else
615typedef short yytype_int16;
616#endif
617
618/* Work around bug in HP-UX 11.23, which defines these macros
619 incorrectly for preprocessor constants. This workaround can likely
620 be removed in 2023, as HPE has promised support for HP-UX 11.23
621 (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
622 <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */
623#ifdef __hpux
624# undef UINT_LEAST8_MAX
625# undef UINT_LEAST16_MAX
626# define UINT_LEAST8_MAX 255
627# define UINT_LEAST16_MAX 65535
628#endif
629
630#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
631typedef __UINT_LEAST8_TYPE__ yytype_uint8;
632#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
633 && UINT_LEAST8_MAX <= INT_MAX)
634typedef uint_least8_t yytype_uint8;
635#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
636typedef unsigned char yytype_uint8;
637#else
638typedef short yytype_uint8;
639#endif
640
641#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
642typedef __UINT_LEAST16_TYPE__ yytype_uint16;
643#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
644 && UINT_LEAST16_MAX <= INT_MAX)
645typedef uint_least16_t yytype_uint16;
646#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
647typedef unsigned short yytype_uint16;
648#else
649typedef int yytype_uint16;
650#endif
651
652#ifndef YYPTRDIFF_T
653# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
654# define YYPTRDIFF_T __PTRDIFF_TYPE__
655# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
656# elif defined PTRDIFF_MAX
657# ifndef ptrdiff_t
658# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
659# endif
660# define YYPTRDIFF_T ptrdiff_t
661# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
662# else
663# define YYPTRDIFF_T long
664# define YYPTRDIFF_MAXIMUM LONG_MAX
665# endif
666#endif
667
668#ifndef YYSIZE_T
669# ifdef __SIZE_TYPE__
670# define YYSIZE_T __SIZE_TYPE__
671# elif defined size_t
672# define YYSIZE_T size_t
673# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
674# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
675# define YYSIZE_T size_t
676# else
677# define YYSIZE_T unsigned
678# endif
679#endif
680
681#define YYSIZE_MAXIMUM \
682 YY_CAST (YYPTRDIFF_T, \
683 (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
684 ? YYPTRDIFF_MAXIMUM \
685 : YY_CAST (YYSIZE_T, -1)))
686
687#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
688
689
690/* Stored state numbers (used for stacks). */
692
693/* State numbers in computations. */
694typedef int yy_state_fast_t;
695
696#ifndef YY_
697# if defined YYENABLE_NLS && YYENABLE_NLS
698# if ENABLE_NLS
699# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
700# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
701# endif
702# endif
703# ifndef YY_
704# define YY_(Msgid) Msgid
705# endif
706#endif
707
708
709#ifndef YY_ATTRIBUTE_PURE
710# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
711# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
712# else
713# define YY_ATTRIBUTE_PURE
714# endif
715#endif
716
717#ifndef YY_ATTRIBUTE_UNUSED
718# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
719# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
720# else
721# define YY_ATTRIBUTE_UNUSED
722# endif
723#endif
724
725/* Suppress unused-variable warnings by "using" E. */
726#if ! defined lint || defined __GNUC__
727# define YY_USE(E) ((void) (E))
728#else
729# define YY_USE(E) /* empty */
730#endif
731
732/* Suppress an incorrect diagnostic about yylval being uninitialized. */
733#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
734# if __GNUC__ * 100 + __GNUC_MINOR__ < 407
735# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
736 _Pragma ("GCC diagnostic push") \
737 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
738# else
739# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
740 _Pragma ("GCC diagnostic push") \
741 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
742 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
743# endif
744# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
745 _Pragma ("GCC diagnostic pop")
746#else
747# define YY_INITIAL_VALUE(Value) Value
748#endif
749#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
750# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
751# define YY_IGNORE_MAYBE_UNINITIALIZED_END
752#endif
753#ifndef YY_INITIAL_VALUE
754# define YY_INITIAL_VALUE(Value) /* Nothing. */
755#endif
756
757#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
758# define YY_IGNORE_USELESS_CAST_BEGIN \
759 _Pragma ("GCC diagnostic push") \
760 _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
761# define YY_IGNORE_USELESS_CAST_END \
762 _Pragma ("GCC diagnostic pop")
763#endif
764#ifndef YY_IGNORE_USELESS_CAST_BEGIN
765# define YY_IGNORE_USELESS_CAST_BEGIN
766# define YY_IGNORE_USELESS_CAST_END
767#endif
768
769
770#define YY_ASSERT(E) ((void) (0 && (E)))
771
772#if !defined yyoverflow
773
774/* The parser invokes alloca or xmalloc; define the necessary symbols. */
775
776# ifdef YYSTACK_USE_ALLOCA
777# if YYSTACK_USE_ALLOCA
778# ifdef __GNUC__
779# define YYSTACK_ALLOC __builtin_alloca
780# elif defined __BUILTIN_VA_ARG_INCR
781# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
782# elif defined _AIX
783# define YYSTACK_ALLOC __alloca
784# elif defined _MSC_VER
785# define alloca _alloca
786# else
787# define YYSTACK_ALLOC alloca
788# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
789# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
790 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
791# ifndef EXIT_SUCCESS
792# define EXIT_SUCCESS 0
793# endif
794# endif
795# endif
796# endif
797# endif
798
799# ifdef YYSTACK_ALLOC
800 /* Pacify GCC's 'empty if-body' warning. */
801# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
802# ifndef YYSTACK_ALLOC_MAXIMUM
803 /* The OS might guarantee only one guard page at the bottom of the stack,
804 and a page size can be as small as 4096 bytes. So we cannot safely
805 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
806 to allow for a few compiler-allocated temporary stack slots. */
807# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
808# endif
809# else
810# define YYSTACK_ALLOC YYMALLOC
811# define YYSTACK_FREE YYFREE
812# ifndef YYSTACK_ALLOC_MAXIMUM
813# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
814# endif
815# if (defined __cplusplus && ! defined EXIT_SUCCESS \
816 && ! ((defined YYMALLOC || defined xmalloc) \
817 && (defined YYFREE || defined xfree)))
818# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
819# ifndef EXIT_SUCCESS
820# define EXIT_SUCCESS 0
821# endif
822# endif
823# ifndef YYMALLOC
824# define YYMALLOC xmalloc
825# if ! defined xmalloc && ! defined EXIT_SUCCESS
826void *xmalloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
827# endif
828# endif
829# ifndef YYFREE
830# define YYFREE xfree
831# if ! defined xfree && ! defined EXIT_SUCCESS
832void xfree (void *); /* INFRINGES ON USER NAME SPACE */
833# endif
834# endif
835# endif
836#endif /* !defined yyoverflow */
837
838#if (! defined yyoverflow \
839 && (! defined __cplusplus \
840 || (defined cp_name_parser_YYSTYPE_IS_TRIVIAL && cp_name_parser_YYSTYPE_IS_TRIVIAL)))
841
842/* A type that is properly aligned for any stack member. */
848
849/* The size of the maximum gap between one aligned stack and the next. */
850# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union cp_name_parser_yyalloc) - 1)
851
852/* The size of an array large to enough to hold all stacks, each with
853 N elements. */
854# define YYSTACK_BYTES(N) \
855 ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (cp_name_parser_YYSTYPE)) \
856 + YYSTACK_GAP_MAXIMUM)
857
858# define YYCOPY_NEEDED 1
859
860/* Relocate STACK from its old location to the new one. The
861 local variables YYSIZE and YYSTACKSIZE give the old and new number of
862 elements in the stack, and YYPTR gives the new location of the
863 stack. Advance YYPTR to a properly aligned location for the next
864 stack. */
865# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
866 do \
867 { \
868 YYPTRDIFF_T yynewbytes; \
869 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
870 Stack = &yyptr->Stack_alloc; \
871 yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
872 yyptr += yynewbytes / YYSIZEOF (*yyptr); \
873 } \
874 while (0)
875
876#endif
877
878#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
879/* Copy COUNT objects from SRC to DST. The source and destination do
880 not overlap. */
881# ifndef YYCOPY
882# if defined __GNUC__ && 1 < __GNUC__
883# define YYCOPY(Dst, Src, Count) \
884 __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
885# else
886# define YYCOPY(Dst, Src, Count) \
887 do \
888 { \
889 YYPTRDIFF_T yyi; \
890 for (yyi = 0; yyi < (Count); yyi++) \
891 (Dst)[yyi] = (Src)[yyi]; \
892 } \
893 while (0)
894# endif
895# endif
896#endif /* !YYCOPY_NEEDED */
897
898/* YYFINAL -- State number of the termination state. */
899#define YYFINAL 84
900/* YYLAST -- Last index in YYTABLE. */
901#define YYLAST 1137
902
903/* YYNTOKENS -- Number of terminals. */
904#define YYNTOKENS 75
905/* YYNNTS -- Number of nonterminals. */
906#define YYNNTS 40
907/* YYNRULES -- Number of rules. */
908#define YYNRULES 195
909/* YYNSTATES -- Number of states. */
910#define YYNSTATES 325
911
912/* YYMAXUTOK -- Last valid token kind. */
913#define YYMAXUTOK 307
914
915
916/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
917 as returned by yylex, with out-of-bounds checking. */
918#define YYTRANSLATE(YYX) \
919 (0 <= (YYX) && (YYX) <= YYMAXUTOK \
920 ? YY_CAST (cp_name_parser_yysymbol_kind_t, yytranslate[YYX]) \
921 : YYSYMBOL_YYUNDEF)
922
923/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
924 as returned by yylex. */
925static const yytype_int8 yytranslate[] =
926{
927 0, 2, 2, 2, 2, 2, 2, 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, 72, 2, 2, 2, 63, 49, 2,
931 73, 41, 61, 59, 42, 60, 68, 62, 2, 2,
932 2, 2, 2, 2, 2, 2, 2, 2, 74, 2,
933 52, 43, 53, 44, 58, 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, 69, 2, 70, 48, 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, 47, 2, 71, 2, 2, 2,
940 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
941 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
942 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
943 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
944 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
945 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
946 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
947 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
948 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
949 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
950 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
951 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
952 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
953 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
954 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
955 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
956 35, 36, 37, 38, 39, 40, 45, 46, 50, 51,
957 54, 55, 56, 57, 64, 65, 66, 67
958};
959
960#if YYDEBUG
961/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
962static const yytype_int16 yyrline[] =
963{
964 0, 348, 348, 357, 359, 361, 366, 367, 374, 383,
965 390, 394, 397, 416, 418, 422, 428, 434, 440, 446,
966 448, 450, 452, 454, 456, 458, 460, 462, 464, 466,
967 468, 470, 472, 474, 476, 478, 480, 482, 484, 486,
968 488, 490, 492, 494, 496, 498, 500, 502, 510, 515,
969 520, 524, 529, 537, 538, 540, 552, 553, 559, 561,
970 562, 564, 567, 568, 571, 572, 576, 578, 581, 585,
971 590, 594, 603, 607, 610, 621, 622, 626, 628, 630,
972 633, 637, 642, 647, 653, 663, 667, 671, 679, 680,
973 683, 685, 687, 691, 692, 699, 701, 703, 705, 707,
974 709, 713, 714, 718, 720, 722, 724, 726, 728, 730,
975 734, 739, 742, 745, 751, 759, 761, 775, 777, 778,
976 780, 783, 785, 786, 788, 791, 793, 795, 797, 802,
977 805, 810, 817, 821, 832, 838, 856, 859, 867, 869,
978 880, 887, 888, 894, 898, 902, 904, 909, 914, 926,
979 930, 934, 942, 947, 956, 960, 965, 970, 974, 980,
980 986, 989, 996, 998, 1003, 1007, 1011, 1018, 1034, 1041,
981 1048, 1067, 1071, 1075, 1079, 1083, 1087, 1091, 1095, 1099,
982 1103, 1107, 1111, 1115, 1119, 1123, 1127, 1131, 1136, 1140,
983 1144, 1151, 1155, 1158, 1167, 1176
984};
985#endif
986
988#define YY_ACCESSING_SYMBOL(State) YY_CAST (cp_name_parser_yysymbol_kind_t, yystos[State])
989
990#if YYDEBUG || 0
991/* The user-facing name of the symbol whose (internal) number is
992 YYSYMBOL. No bounds checking. */
994
995/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
996 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
997static const char *const yytname[] =
998{
999 "\"end of file\"", "error", "\"invalid token\"", "INT", "FLOAT", "NAME",
1000 "STRUCT", "CLASS", "UNION", "ENUM", "SIZEOF", "UNSIGNED", "COLONCOLON",
1001 "TEMPLATE", "ERROR", "NEW", "DELETE", "OPERATOR", "STATIC_CAST",
1002 "REINTERPRET_CAST", "DYNAMIC_CAST", "SIGNED_KEYWORD", "LONG", "SHORT",
1003 "INT_KEYWORD", "CONST_KEYWORD", "VOLATILE_KEYWORD", "DOUBLE_KEYWORD",
1004 "BOOL", "ELLIPSIS", "RESTRICT", "VOID", "FLOAT_KEYWORD", "CHAR",
1005 "WCHAR_T", "ASSIGN_MODIFY", "TRUEKEYWORD", "FALSEKEYWORD",
1006 "DEMANGLER_SPECIAL", "CONSTRUCTION_VTABLE", "CONSTRUCTION_IN", "')'",
1007 "','", "'='", "'?'", "OROR", "ANDAND", "'|'", "'^'", "'&'", "EQUAL",
1008 "NOTEQUAL", "'<'", "'>'", "LEQ", "GEQ", "LSH", "RSH", "'@'", "'+'",
1009 "'-'", "'*'", "'/'", "'%'", "UNARY", "INCREMENT", "DECREMENT", "ARROW",
1010 "'.'", "'['", "']'", "'~'", "'!'", "'('", "':'", "$accept", "result",
1011 "start", "start_opt", "function", "demangler_special", "oper",
1012 "conversion_op", "conversion_op_name", "unqualified_name", "colon_name",
1013 "name", "colon_ext_name", "colon_ext_only", "ext_only_name",
1014 "nested_name", "templ", "template_params", "template_arg",
1015 "function_args", "function_arglist", "qualifiers_opt", "qualifier",
1016 "qualifiers", "int_part", "int_seq", "builtin_type", "ptr_operator",
1017 "array_indicator", "typespec_2", "abstract_declarator",
1018 "direct_abstract_declarator", "abstract_declarator_fn", "type",
1019 "declarator", "direct_declarator", "declarator_1", "direct_declarator_1",
1020 "exp", "exp1", YY_NULLPTRPTR
1021};
1022
1023static const char *
1025{
1026 return yytname[yysymbol];
1027}
1028#endif
1029
1030#define YYPACT_NINF (-187)
1031
1032#define yypact_value_is_default(Yyn) \
1033 ((Yyn) == YYPACT_NINF)
1034
1035#define YYTABLE_NINF (-1)
1036
1037#define yytable_value_is_error(Yyn) \
1038 0
1039
1040/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1041 STATE-NUM. */
1042static const yytype_int16 yypact[] =
1043{
1044 833, 39, -187, 42, 540, -187, -12, -187, -187, -187,
1045 -187, -187, -187, -187, -187, -187, -187, -187, 833, 833,
1046 27, 41, -187, -187, -187, 5, -187, 710, -187, 36,
1047 -5, -187, 43, 65, 36, 506, -187, 120, 36, 711,
1048 -187, -187, 329, -187, 36, -187, 43, 73, 16, 21,
1049 -187, -187, -187, -187, -187, -187, -187, -187, -187, -187,
1050 -187, -187, -187, -187, -187, -187, -187, -187, -187, -187,
1051 -187, -187, -187, 34, 30, -187, -187, 64, 115, -187,
1052 -187, -187, 83, -187, -187, 329, 39, 833, -187, -187,
1053 36, 6, 603, -187, 12, 65, 98, 750, -187, -49,
1054 -187, -187, 857, 98, 70, -187, -187, 124, -187, -187,
1055 73, 36, 36, -187, -187, -187, 48, 860, 603, -187,
1056 -187, -49, -187, 23, 98, 720, -187, -49, -187, -49,
1057 -187, -187, 53, 80, 87, 95, -187, -187, 656, 476,
1058 476, 476, 428, 10, -187, 780, 325, -187, -187, 79,
1059 82, -187, -187, -187, 833, 22, -187, 28, -187, -187,
1060 89, -187, 73, 116, 36, 780, 37, 114, 780, 780,
1061 123, 70, 36, 124, 833, -187, 161, -187, 166, -187,
1062 -187, -187, -187, 36, -187, -187, -187, 50, 729, 168,
1063 -187, -187, 780, -187, -187, -187, 169, -187, 979, 979,
1064 979, 979, 833, -187, 105, 105, 105, 680, 780, 142,
1065 970, 143, 329, -187, -187, 476, 476, 476, 476, 476,
1066 476, 476, 476, 476, 476, 476, 476, 476, 476, 476,
1067 476, 476, 476, 180, 181, -187, -187, -187, -187, 36,
1068 -187, 45, 36, -187, 36, 949, -187, -187, -187, 51,
1069 833, -187, 729, -187, 729, 148, -49, 833, 833, 152,
1070 138, 141, 144, 154, 833, -187, 476, 476, -187, -187,
1071 890, 993, 1015, 1036, 1056, 359, 753, 753, 1069, 1069,
1072 1069, 241, 241, 178, 178, 105, 105, 105, -187, -187,
1073 -187, -187, -187, -187, 780, -187, 157, -187, -187, -187,
1074 -187, -187, -187, -187, 126, 128, 131, -187, 164, 105,
1075 325, 476, -187, -187, 471, 471, 471, -187, 325, 188,
1076 189, 192, -187, -187, -187
1077};
1078
1079/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
1080 Performed when YYTABLE does not specify something else to do. Zero
1081 means the default is an error. */
1082static const yytype_uint8 yydefact[] =
1083{
1084 0, 59, 97, 0, 0, 96, 99, 100, 95, 92,
1085 91, 105, 107, 90, 109, 104, 98, 108, 0, 0,
1086 0, 0, 2, 5, 4, 53, 50, 6, 67, 122,
1087 0, 64, 0, 61, 93, 0, 101, 103, 118, 141,
1088 3, 68, 0, 52, 126, 65, 0, 0, 15, 16,
1089 32, 43, 29, 40, 39, 26, 24, 25, 35, 36,
1090 30, 31, 37, 38, 33, 34, 19, 20, 21, 22,
1091 23, 41, 42, 45, 0, 27, 28, 0, 0, 48,
1092 106, 13, 0, 55, 1, 0, 0, 0, 112, 111,
1093 88, 0, 0, 11, 0, 0, 6, 136, 135, 138,
1094 12, 121, 0, 6, 58, 49, 66, 60, 70, 94,
1095 0, 124, 120, 99, 102, 117, 0, 0, 0, 62,
1096 56, 150, 63, 0, 6, 129, 142, 131, 8, 151,
1097 191, 192, 0, 0, 0, 0, 194, 195, 0, 0,
1098 0, 0, 0, 0, 73, 75, 79, 125, 51, 0,
1099 0, 44, 47, 46, 0, 0, 7, 0, 110, 89,
1100 0, 115, 0, 109, 88, 0, 0, 0, 129, 80,
1101 0, 0, 88, 0, 0, 140, 0, 137, 133, 134,
1102 10, 69, 71, 128, 123, 119, 57, 0, 129, 157,
1103 158, 9, 0, 130, 149, 133, 155, 156, 0, 0,
1104 0, 0, 0, 77, 164, 166, 165, 0, 141, 0,
1105 160, 0, 0, 72, 76, 0, 0, 0, 0, 0,
1106 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1107 0, 0, 0, 0, 0, 17, 18, 14, 54, 88,
1108 116, 0, 88, 87, 88, 0, 81, 132, 113, 0,
1109 0, 127, 0, 148, 129, 0, 144, 0, 0, 0,
1110 0, 0, 0, 0, 0, 162, 0, 0, 159, 74,
1111 0, 187, 186, 185, 184, 183, 178, 179, 182, 180,
1112 181, 176, 177, 174, 175, 171, 172, 173, 188, 189,
1113 114, 86, 85, 84, 82, 139, 0, 143, 154, 146,
1114 147, 152, 153, 193, 0, 0, 0, 78, 0, 167,
1115 161, 0, 83, 145, 0, 0, 0, 163, 190, 0,
1116 0, 0, 168, 170, 169
1117};
1118
1119/* YYPGOTO[NTERM-NUM]. */
1120static const yytype_int16 yypgoto[] =
1121{
1122 -187, -187, 25, -66, -187, -187, -187, 3, -187, -20,
1123 -187, -1, -32, 15, 1, 0, 150, 149, 31, -187,
1124 -25, -156, -187, 234, 205, -187, 213, -17, -98, 196,
1125 -18, -16, 158, -129, -106, -187, 134, -187, -6, -186
1126};
1127
1128/* YYDEFGOTO[NTERM-NUM]. */
1129static const yytype_int16 yydefgoto[] =
1130{
1131 0, 21, 156, 93, 23, 24, 25, 26, 27, 28,
1132 119, 29, 253, 30, 31, 78, 33, 143, 144, 167,
1133 96, 158, 34, 35, 36, 37, 38, 168, 98, 39,
1134 170, 127, 100, 40, 255, 256, 128, 129, 210, 211
1135};
1136
1137/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
1138 positive, shift that token. If negative, reduce the rule whose
1139 number is the opposite. If YYTABLE_NINF, syntax error. */
1140static const yytype_int16 yytable[] =
1141{
1142 32, 179, 44, 46, 45, 103, 43, 121, 243, 160,
1143 97, 99, 106, 209, 124, 80, 248, 171, 32, 32,
1144 91, 126, 125, 190, 102, 22, 106, 94, 104, 179,
1145 175, 197, 83, 104, 111, 105, 146, 180, 120, 123,
1146 117, 84, 104, 81, 82, 4, 44, 1, 104, 148,
1147 104, 41, 212, 1, 122, 104, 171, 85, 191, 4,
1148 4, 9, 10, 213, 212, 117, 13, 117, 102, 259,
1149 260, 261, 262, 172, 178, 238, 161, 108, 1, 146,
1150 97, 99, 181, 290, 172, 149, 291, 157, 292, 239,
1151 150, 42, 166, 121, 20, 151, 189, 94, 172, 20,
1152 152, 188, 195, 106, 196, 153, 239, 193, 125, 183,
1153 174, 239, 239, 20, 20, 186, 187, 45, 166, 20,
1154 104, 20, 42, 154, 120, 123, 198, 214, 319, 320,
1155 321, 2, 199, 204, 205, 206, 182, 106, 32, 200,
1156 122, 5, 113, 7, 8, 94, 296, 201, 297, 235,
1157 193, 246, 236, 16, 32, 244, 245, 242, 300, 240,
1158 105, 44, 241, 203, 247, 94, 86, 106, 94, 94,
1159 193, 254, 233, 234, 32, 188, 249, 95, 250, 237,
1160 257, 258, 107, 266, 268, 288, 289, 120, 123, 298,
1161 126, 304, 94, 303, 305, 307, 107, 306, 313, 314,
1162 79, 315, 32, 122, 316, 317, 146, 32, 94, 270,
1163 271, 272, 273, 274, 275, 276, 277, 278, 279, 280,
1164 281, 282, 283, 284, 285, 286, 287, 263, 107, 322,
1165 323, 299, 265, 324, 155, 254, 193, 254, 145, 230,
1166 231, 232, 114, 269, 173, 233, 234, 95, 112, 0,
1167 32, 120, 123, 120, 123, 177, 0, 32, 32, 194,
1168 309, 310, 0, 101, 32, 0, 0, 122, 109, 122,
1169 0, 0, 115, 107, 0, 295, 312, 0, 147, 0,
1170 0, 145, 301, 302, 0, 0, 0, 0, 169, 308,
1171 0, 0, 0, 0, 94, 95, 0, 0, 169, 0,
1172 228, 229, 230, 231, 232, 318, 0, 107, 233, 234,
1173 0, 0, 0, 0, 169, 95, 107, 0, 95, 95,
1174 0, 0, 0, 0, 159, 0, 95, 0, 0, 0,
1175 0, 0, 130, 131, 1, 0, 0, 107, 208, 132,
1176 2, 47, 95, 0, 0, 184, 185, 133, 134, 135,
1177 5, 6, 7, 8, 9, 10, 11, 12, 95, 13,
1178 14, 15, 16, 17, 0, 136, 137, 0, 0, 215,
1179 216, 217, 218, 219, 220, 221, 222, 223, 138, 224,
1180 225, 226, 227, 0, 228, 229, 230, 231, 232, 139,
1181 0, 107, 233, 234, 208, 208, 208, 208, 159, 173,
1182 140, 141, 142, 0, 0, 0, 159, 0, 145, 221,
1183 222, 223, 0, 224, 225, 226, 227, 251, 228, 229,
1184 230, 231, 232, 0, 0, 0, 233, 234, 0, 0,
1185 0, 130, 131, 1, 0, 0, 0, 0, 132, 2,
1186 47, 294, 0, 0, 95, 0, 133, 134, 135, 5,
1187 6, 7, 8, 9, 10, 11, 12, 0, 13, 14,
1188 15, 16, 17, 0, 136, 137, 0, 0, 0, 0,
1189 0, 0, 0, 159, 130, 131, 159, 207, 159, 130,
1190 131, 132, 0, 0, 0, 0, 132, 0, 139, 133,
1191 134, 135, 0, 0, 133, 134, 135, 0, 0, 140,
1192 141, 142, 0, 0, 0, 0, 0, 136, 137, 0,
1193 0, 1, 136, 137, 0, 0, 0, 2, 110, 0,
1194 207, 0, 0, 0, 0, 0, 0, 5, 6, 7,
1195 8, 139, 0, 11, 12, 0, 139, 14, 15, 16,
1196 17, 0, 140, 141, 142, 1, 0, 140, 141, 142,
1197 0, 2, 47, 0, 0, 48, 49, 0, 0, 0,
1198 0, 5, 6, 7, 8, 9, 10, 11, 12, 0,
1199 13, 14, 15, 16, 17, 50, 0, 0, 0, 0,
1200 0, 0, 51, 52, 0, 53, 54, 55, 56, 57,
1201 58, 59, 60, 61, 62, 63, 64, 65, 0, 66,
1202 67, 68, 69, 70, 0, 71, 72, 73, 1, 74,
1203 0, 75, 76, 77, 2, 162, 0, 0, 0, 0,
1204 0, 0, 0, 0, 5, 6, 7, 8, 9, 10,
1205 11, 12, 0, 13, 163, 15, 16, 17, 0, 0,
1206 0, 0, 0, 0, 164, 0, 0, 0, 0, 88,
1207 0, 0, 89, 0, 0, 0, 0, 0, 0, 0,
1208 0, 1, 0, 0, 90, 0, 0, 2, 3, 0,
1209 0, 0, 91, 4, 0, 0, 165, 5, 6, 7,
1210 8, 9, 10, 11, 12, 1, 13, 14, 15, 16,
1211 17, 2, 3, 0, 18, 19, 0, 4, 0, 0,
1212 0, 5, 6, 7, 8, 9, 10, 11, 12, 0,
1213 13, 14, 15, 16, 17, 86, 1, 0, 18, 19,
1214 0, 0, 87, 116, 0, 1, 0, 20, 117, 202,
1215 0, 0, 116, 0, 1, 0, 0, 117, 0, 0,
1216 0, 116, 0, 0, 0, 0, 117, 0, 0, 0,
1217 0, 20, 0, 264, 0, 86, 88, 88, 0, 89,
1218 89, 0, 176, 0, 0, 0, 88, 0, 0, 89,
1219 0, 90, 90, 0, 0, 88, 0, 0, 89, 91,
1220 91, 90, 20, 92, 118, 86, 0, 0, 0, 91,
1221 90, 20, 176, 192, 0, 0, 88, 0, 91, 89,
1222 20, 0, 252, 0, 0, 223, 0, 224, 225, 226,
1223 227, 90, 228, 229, 230, 231, 232, 0, 0, 91,
1224 233, 234, 0, 92, 0, 0, 88, 0, 0, 89,
1225 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
1226 0, 90, 0, 0, 2, 3, 0, 0, 0, 91,
1227 4, 0, 0, 165, 5, 6, 7, 8, 9, 10,
1228 11, 12, 1, 13, 14, 15, 16, 17, 2, 47,
1229 0, 18, 19, 0, 0, 48, 49, 0, 5, 6,
1230 7, 8, 9, 10, 11, 12, 0, 13, 163, 15,
1231 16, 17, 0, 0, 0, 50, 0, 0, 164, 0,
1232 0, 0, 51, 52, 20, 53, 54, 55, 56, 57,
1233 58, 59, 60, 61, 62, 63, 64, 65, 0, 66,
1234 67, 68, 69, 70, 0, 71, 72, 73, 0, 74,
1235 0, 75, 76, 77, 215, 216, 217, 218, 219, 220,
1236 221, 222, 223, 0, 224, 225, 226, 227, 0, 228,
1237 229, 230, 231, 232, 1, 0, 0, 233, 234, 0,
1238 2, 47, 0, 0, 311, 0, 0, 0, 0, 0,
1239 5, 6, 7, 8, 9, 10, 11, 12, 293, 13,
1240 14, 15, 16, 17, 1, 0, 0, 0, 0, 0,
1241 2, 47, 0, 0, 0, 0, 0, 0, 0, 0,
1242 5, 6, 7, 8, 9, 10, 11, 12, 0, 13,
1243 14, 15, 16, 17, 215, 216, 217, 218, 219, 220,
1244 221, 222, 223, 267, 224, 225, 226, 227, 0, 228,
1245 229, 230, 231, 232, 0, 0, 0, 233, 234, 217,
1246 218, 219, 220, 221, 222, 223, 0, 224, 225, 226,
1247 227, 0, 228, 229, 230, 231, 232, 0, 0, 0,
1248 233, 234, 218, 219, 220, 221, 222, 223, 0, 224,
1249 225, 226, 227, 0, 228, 229, 230, 231, 232, 0,
1250 0, 0, 233, 234, 219, 220, 221, 222, 223, 0,
1251 224, 225, 226, 227, 0, 228, 229, 230, 231, 232,
1252 0, 0, 0, 233, 234, 220, 221, 222, 223, 0,
1253 224, 225, 226, 227, 0, 228, 229, 230, 231, 232,
1254 0, 0, 0, 233, 234, 226, 227, 0, 228, 229,
1255 230, 231, 232, 0, 0, 0, 233, 234
1256};
1257
1258static const yytype_int16 yycheck[] =
1259{
1260 0, 99, 3, 3, 3, 30, 3, 39, 164, 3,
1261 27, 27, 32, 142, 39, 27, 172, 5, 18, 19,
1262 69, 39, 39, 121, 73, 0, 46, 27, 5, 127,
1263 96, 129, 5, 5, 35, 32, 42, 103, 39, 39,
1264 17, 0, 5, 18, 19, 17, 47, 5, 5, 46,
1265 5, 12, 42, 5, 39, 5, 5, 52, 124, 17,
1266 17, 25, 26, 53, 42, 17, 30, 17, 73, 198,
1267 199, 200, 201, 61, 99, 53, 70, 12, 5, 85,
1268 97, 97, 12, 239, 61, 69, 242, 87, 244, 61,
1269 69, 52, 92, 125, 71, 61, 121, 97, 61, 71,
1270 70, 118, 127, 123, 129, 41, 61, 125, 125, 110,
1271 12, 61, 61, 71, 71, 116, 116, 116, 118, 71,
1272 5, 71, 52, 40, 125, 125, 73, 145, 314, 315,
1273 316, 11, 52, 139, 140, 141, 12, 157, 138, 52,
1274 125, 21, 22, 23, 24, 145, 252, 52, 254, 70,
1275 168, 169, 70, 33, 154, 41, 42, 41, 256, 70,
1276 157, 162, 162, 138, 41, 165, 5, 187, 168, 169,
1277 188, 188, 67, 68, 174, 192, 176, 27, 12, 154,
1278 12, 12, 32, 41, 41, 5, 5, 188, 188, 41,
1279 208, 53, 192, 41, 53, 41, 46, 53, 41, 73,
1280 4, 73, 202, 188, 73, 41, 212, 207, 208, 215,
1281 216, 217, 218, 219, 220, 221, 222, 223, 224, 225,
1282 226, 227, 228, 229, 230, 231, 232, 202, 78, 41,
1283 41, 256, 207, 41, 85, 252, 254, 254, 42, 61,
1284 62, 63, 37, 212, 94, 67, 68, 97, 35, -1,
1285 250, 252, 252, 254, 254, 97, -1, 257, 258, 125,
1286 266, 267, -1, 29, 264, -1, -1, 252, 34, 254,
1287 -1, -1, 38, 123, -1, 250, 294, -1, 44, -1,
1288 -1, 85, 257, 258, -1, -1, -1, -1, 92, 264,
1289 -1, -1, -1, -1, 294, 145, -1, -1, 102, -1,
1290 59, 60, 61, 62, 63, 311, -1, 157, 67, 68,
1291 -1, -1, -1, -1, 118, 165, 166, -1, 168, 169,
1292 -1, -1, -1, -1, 90, -1, 176, -1, -1, -1,
1293 -1, -1, 3, 4, 5, -1, -1, 187, 142, 10,
1294 11, 12, 192, -1, -1, 111, 112, 18, 19, 20,
1295 21, 22, 23, 24, 25, 26, 27, 28, 208, 30,
1296 31, 32, 33, 34, -1, 36, 37, -1, -1, 44,
1297 45, 46, 47, 48, 49, 50, 51, 52, 49, 54,
1298 55, 56, 57, -1, 59, 60, 61, 62, 63, 60,
1299 -1, 241, 67, 68, 198, 199, 200, 201, 164, 249,
1300 71, 72, 73, -1, -1, -1, 172, -1, 212, 50,
1301 51, 52, -1, 54, 55, 56, 57, 183, 59, 60,
1302 61, 62, 63, -1, -1, -1, 67, 68, -1, -1,
1303 -1, 3, 4, 5, -1, -1, -1, -1, 10, 11,
1304 12, 245, -1, -1, 294, -1, 18, 19, 20, 21,
1305 22, 23, 24, 25, 26, 27, 28, -1, 30, 31,
1306 32, 33, 34, -1, 36, 37, -1, -1, -1, -1,
1307 -1, -1, -1, 239, 3, 4, 242, 49, 244, 3,
1308 4, 10, -1, -1, -1, -1, 10, -1, 60, 18,
1309 19, 20, -1, -1, 18, 19, 20, -1, -1, 71,
1310 72, 73, -1, -1, -1, -1, -1, 36, 37, -1,
1311 -1, 5, 36, 37, -1, -1, -1, 11, 12, -1,
1312 49, -1, -1, -1, -1, -1, -1, 21, 22, 23,
1313 24, 60, -1, 27, 28, -1, 60, 31, 32, 33,
1314 34, -1, 71, 72, 73, 5, -1, 71, 72, 73,
1315 -1, 11, 12, -1, -1, 15, 16, -1, -1, -1,
1316 -1, 21, 22, 23, 24, 25, 26, 27, 28, -1,
1317 30, 31, 32, 33, 34, 35, -1, -1, -1, -1,
1318 -1, -1, 42, 43, -1, 45, 46, 47, 48, 49,
1319 50, 51, 52, 53, 54, 55, 56, 57, -1, 59,
1320 60, 61, 62, 63, -1, 65, 66, 67, 5, 69,
1321 -1, 71, 72, 73, 11, 12, -1, -1, -1, -1,
1322 -1, -1, -1, -1, 21, 22, 23, 24, 25, 26,
1323 27, 28, -1, 30, 31, 32, 33, 34, -1, -1,
1324 -1, -1, -1, -1, 41, -1, -1, -1, -1, 46,
1325 -1, -1, 49, -1, -1, -1, -1, -1, -1, -1,
1326 -1, 5, -1, -1, 61, -1, -1, 11, 12, -1,
1327 -1, -1, 69, 17, -1, -1, 73, 21, 22, 23,
1328 24, 25, 26, 27, 28, 5, 30, 31, 32, 33,
1329 34, 11, 12, -1, 38, 39, -1, 17, -1, -1,
1330 -1, 21, 22, 23, 24, 25, 26, 27, 28, -1,
1331 30, 31, 32, 33, 34, 5, 5, -1, 38, 39,
1332 -1, -1, 12, 12, -1, 5, -1, 71, 17, 73,
1333 -1, -1, 12, -1, 5, -1, -1, 17, -1, -1,
1334 -1, 12, -1, -1, -1, -1, 17, -1, -1, -1,
1335 -1, 71, -1, 73, -1, 5, 46, 46, -1, 49,
1336 49, -1, 12, -1, -1, -1, 46, -1, -1, 49,
1337 -1, 61, 61, -1, -1, 46, -1, -1, 49, 69,
1338 69, 61, 71, 73, 73, 5, -1, -1, -1, 69,
1339 61, 71, 12, 73, -1, -1, 46, -1, 69, 49,
1340 71, -1, 73, -1, -1, 52, -1, 54, 55, 56,
1341 57, 61, 59, 60, 61, 62, 63, -1, -1, 69,
1342 67, 68, -1, 73, -1, -1, 46, -1, -1, 49,
1343 -1, -1, -1, -1, -1, -1, -1, -1, 5, -1,
1344 -1, 61, -1, -1, 11, 12, -1, -1, -1, 69,
1345 17, -1, -1, 73, 21, 22, 23, 24, 25, 26,
1346 27, 28, 5, 30, 31, 32, 33, 34, 11, 12,
1347 -1, 38, 39, -1, -1, 15, 16, -1, 21, 22,
1348 23, 24, 25, 26, 27, 28, -1, 30, 31, 32,
1349 33, 34, -1, -1, -1, 35, -1, -1, 41, -1,
1350 -1, -1, 42, 43, 71, 45, 46, 47, 48, 49,
1351 50, 51, 52, 53, 54, 55, 56, 57, -1, 59,
1352 60, 61, 62, 63, -1, 65, 66, 67, -1, 69,
1353 -1, 71, 72, 73, 44, 45, 46, 47, 48, 49,
1354 50, 51, 52, -1, 54, 55, 56, 57, -1, 59,
1355 60, 61, 62, 63, 5, -1, -1, 67, 68, -1,
1356 11, 12, -1, -1, 74, -1, -1, -1, -1, -1,
1357 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
1358 31, 32, 33, 34, 5, -1, -1, -1, -1, -1,
1359 11, 12, -1, -1, -1, -1, -1, -1, -1, -1,
1360 21, 22, 23, 24, 25, 26, 27, 28, -1, 30,
1361 31, 32, 33, 34, 44, 45, 46, 47, 48, 49,
1362 50, 51, 52, 53, 54, 55, 56, 57, -1, 59,
1363 60, 61, 62, 63, -1, -1, -1, 67, 68, 46,
1364 47, 48, 49, 50, 51, 52, -1, 54, 55, 56,
1365 57, -1, 59, 60, 61, 62, 63, -1, -1, -1,
1366 67, 68, 47, 48, 49, 50, 51, 52, -1, 54,
1367 55, 56, 57, -1, 59, 60, 61, 62, 63, -1,
1368 -1, -1, 67, 68, 48, 49, 50, 51, 52, -1,
1369 54, 55, 56, 57, -1, 59, 60, 61, 62, 63,
1370 -1, -1, -1, 67, 68, 49, 50, 51, 52, -1,
1371 54, 55, 56, 57, -1, 59, 60, 61, 62, 63,
1372 -1, -1, -1, 67, 68, 56, 57, -1, 59, 60,
1373 61, 62, 63, -1, -1, -1, 67, 68
1374};
1375
1376/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
1377 state STATE-NUM. */
1378static const yytype_int8 yystos[] =
1379{
1380 0, 5, 11, 12, 17, 21, 22, 23, 24, 25,
1381 26, 27, 28, 30, 31, 32, 33, 34, 38, 39,
1382 71, 76, 77, 79, 80, 81, 82, 83, 84, 86,
1383 88, 89, 90, 91, 97, 98, 99, 100, 101, 104,
1384 108, 12, 52, 82, 86, 89, 90, 12, 15, 16,
1385 35, 42, 43, 45, 46, 47, 48, 49, 50, 51,
1386 52, 53, 54, 55, 56, 57, 59, 60, 61, 62,
1387 63, 65, 66, 67, 69, 71, 72, 73, 90, 104,
1388 27, 77, 77, 5, 0, 52, 5, 12, 46, 49,
1389 61, 69, 73, 78, 90, 91, 95, 102, 103, 106,
1390 107, 98, 73, 95, 5, 82, 84, 91, 12, 98,
1391 12, 86, 101, 22, 99, 98, 12, 17, 73, 85,
1392 86, 87, 88, 90, 95, 102, 105, 106, 111, 112,
1393 3, 4, 10, 18, 19, 20, 36, 37, 49, 60,
1394 71, 72, 73, 92, 93, 104, 113, 98, 82, 69,
1395 69, 61, 70, 41, 40, 92, 77, 90, 96, 98,
1396 3, 70, 12, 31, 41, 73, 90, 94, 102, 104,
1397 105, 5, 61, 91, 12, 78, 12, 107, 95, 103,
1398 78, 12, 12, 86, 98, 98, 86, 90, 102, 95,
1399 103, 78, 73, 105, 111, 95, 95, 103, 73, 52,
1400 52, 52, 73, 77, 113, 113, 113, 49, 104, 108,
1401 113, 114, 42, 53, 105, 44, 45, 46, 47, 48,
1402 49, 50, 51, 52, 54, 55, 56, 57, 59, 60,
1403 61, 62, 63, 67, 68, 70, 70, 77, 53, 61,
1404 70, 90, 41, 96, 41, 42, 105, 41, 96, 90,
1405 12, 98, 73, 87, 102, 109, 110, 12, 12, 108,
1406 108, 108, 108, 77, 73, 77, 41, 53, 41, 93,
1407 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
1408 113, 113, 113, 113, 113, 113, 113, 113, 5, 5,
1409 96, 96, 96, 29, 104, 77, 109, 109, 41, 95,
1410 103, 77, 77, 41, 53, 53, 53, 41, 77, 113,
1411 113, 74, 105, 41, 73, 73, 73, 41, 113, 114,
1412 114, 114, 41, 41, 41
1413};
1414
1415/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */
1416static const yytype_int8 yyr1[] =
1417{
1418 0, 75, 76, 77, 77, 77, 78, 78, 79, 79,
1419 79, 79, 79, 80, 80, 81, 81, 81, 81, 81,
1420 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
1421 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
1422 81, 81, 81, 81, 81, 81, 81, 81, 82, 83,
1423 83, 83, 83, 84, 84, 84, 85, 85, 86, 86,
1424 86, 86, 87, 87, 88, 88, 89, 89, 90, 90,
1425 90, 90, 91, 92, 92, 93, 93, 93, 93, 93,
1426 94, 94, 94, 94, 94, 95, 95, 95, 96, 96,
1427 97, 97, 97, 98, 98, 99, 99, 99, 99, 99,
1428 99, 100, 100, 101, 101, 101, 101, 101, 101, 101,
1429 102, 102, 102, 102, 102, 103, 103, 104, 104, 104,
1430 104, 104, 104, 104, 104, 104, 104, 104, 104, 105,
1431 105, 105, 106, 106, 106, 106, 107, 107, 107, 107,
1432 107, 108, 108, 109, 109, 110, 110, 110, 110, 111,
1433 111, 111, 111, 111, 112, 112, 112, 112, 112, 113,
1434 114, 114, 114, 114, 113, 113, 113, 113, 113, 113,
1435 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
1436 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
1437 113, 113, 113, 113, 113, 113
1438};
1439
1440/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */
1441static const yytype_int8 yyr2[] =
1442{
1443 0, 2, 1, 1, 1, 1, 0, 2, 2, 3,
1444 3, 2, 2, 2, 4, 2, 2, 4, 4, 2,
1445 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1446 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1447 2, 2, 2, 2, 3, 2, 3, 3, 2, 2,
1448 1, 3, 2, 1, 4, 2, 1, 2, 2, 1,
1449 2, 1, 1, 1, 1, 2, 2, 1, 2, 3,
1450 2, 3, 4, 1, 3, 1, 2, 2, 4, 1,
1451 1, 2, 3, 4, 3, 4, 4, 3, 0, 1,
1452 1, 1, 1, 1, 2, 1, 1, 1, 1, 1,
1453 1, 1, 2, 1, 1, 1, 2, 1, 1, 1,
1454 2, 1, 1, 3, 4, 2, 3, 2, 1, 3,
1455 2, 2, 1, 3, 2, 3, 2, 4, 3, 1,
1456 2, 1, 3, 2, 2, 1, 1, 2, 1, 4,
1457 2, 1, 2, 2, 1, 3, 2, 2, 1, 2,
1458 1, 1, 4, 4, 4, 2, 2, 2, 2, 3,
1459 1, 3, 2, 4, 2, 2, 2, 4, 7, 7,
1460 7, 3, 3, 3, 3, 3, 3, 3, 3, 3,
1461 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
1462 5, 1, 1, 4, 1, 1
1463};
1464
1465
1466enum { YYENOMEM = -2 };
1467
1468#define yyerrok (yyerrstatus = 0)
1469#define yyclearin (yychar = YYEMPTY)
1470
1471#define YYACCEPT goto yyacceptlab
1472#define YYABORT goto yyabortlab
1473#define YYERROR goto yyerrorlab
1474#define YYNOMEM goto yyexhaustedlab
1475
1476
1477#define YYRECOVERING() (!!yyerrstatus)
1478
1479#define YYBACKUP(Token, Value) \
1480 do \
1481 if (yychar == YYEMPTY) \
1482 { \
1483 yychar = (Token); \
1484 yylval = (Value); \
1485 YYPOPSTACK (yylen); \
1486 yystate = *yyssp; \
1487 goto yybackup; \
1488 } \
1489 else \
1490 { \
1491 yyerror (state, YY_("syntax error: cannot back up")); \
1492 YYERROR; \
1493 } \
1494 while (0)
1495
1496/* Backward compatibility with an undocumented macro.
1497 Use YYerror or YYUNDEF. */
1498#define YYERRCODE YYUNDEF
1499
1500
1501/* Enable debugging if requested. */
1502#if YYDEBUG
1503
1504# ifndef YYFPRINTF
1505# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1506# define YYFPRINTF fprintf
1507# endif
1508
1509# define YYDPRINTF(Args) \
1510do { \
1511 if (yydebug) \
1512 YYFPRINTF Args; \
1513} while (0)
1514
1515
1516
1517
1518# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
1519do { \
1520 if (yydebug) \
1521 { \
1522 YYFPRINTF (stderr, "%s ", Title); \
1523 yy_symbol_print (stderr, \
1524 Kind, Value, state); \
1525 YYFPRINTF (stderr, "\n"); \
1526 } \
1527} while (0)
1528
1529
1530/*-----------------------------------.
1531| Print this symbol's value on YYO. |
1532`-----------------------------------*/
1533
1534static void
1536 cp_name_parser_yysymbol_kind_t yykind, cp_name_parser_YYSTYPE const * const yyvaluep, struct cpname_state *state)
1537{
1538 FILE *yyoutput = yyo;
1539 YY_USE (yyoutput);
1540 YY_USE (state);
1541 if (!yyvaluep)
1542 return;
1544 YY_USE (yykind);
1546}
1547
1548
1549/*---------------------------.
1550| Print this symbol on YYO. |
1551`---------------------------*/
1552
1553static void
1555 cp_name_parser_yysymbol_kind_t yykind, cp_name_parser_YYSTYPE const * const yyvaluep, struct cpname_state *state)
1556{
1557 YYFPRINTF (yyo, "%s %s (",
1558 yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
1559
1560 yy_symbol_value_print (yyo, yykind, yyvaluep, state);
1561 YYFPRINTF (yyo, ")");
1562}
1563
1564/*------------------------------------------------------------------.
1565| yy_stack_print -- Print the state stack from its BOTTOM up to its |
1566| TOP (included). |
1567`------------------------------------------------------------------*/
1568
1569static void
1571{
1572 YYFPRINTF (stderr, "Stack now");
1573 for (; yybottom <= yytop; yybottom++)
1574 {
1575 int yybot = *yybottom;
1576 YYFPRINTF (stderr, " %d", yybot);
1577 }
1578 YYFPRINTF (stderr, "\n");
1579}
1580
1581# define YY_STACK_PRINT(Bottom, Top) \
1582do { \
1583 if (yydebug) \
1584 yy_stack_print ((Bottom), (Top)); \
1585} while (0)
1586
1587
1588/*------------------------------------------------.
1589| Report that the YYRULE is going to be reduced. |
1590`------------------------------------------------*/
1591
1592static void
1594 int yyrule, struct cpname_state *state)
1595{
1596 int yylno = yyrline[yyrule];
1597 int yynrhs = yyr2[yyrule];
1598 int yyi;
1599 YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
1600 yyrule - 1, yylno);
1601 /* The symbols being reduced. */
1602 for (yyi = 0; yyi < yynrhs; yyi++)
1603 {
1604 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1605 yy_symbol_print (stderr,
1606 YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
1607 &yyvsp[(yyi + 1) - (yynrhs)], state);
1608 YYFPRINTF (stderr, "\n");
1609 }
1610}
1611
1612# define YY_REDUCE_PRINT(Rule) \
1613do { \
1614 if (yydebug) \
1615 yy_reduce_print (yyssp, yyvsp, Rule, state); \
1616} while (0)
1617
1618/* Nonzero means print parse trace. It is left uninitialized so that
1619 multiple parsers can coexist. */
1621#else /* !YYDEBUG */
1622# define YYDPRINTF(Args) ((void) 0)
1623# define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
1624# define YY_STACK_PRINT(Bottom, Top)
1625# define YY_REDUCE_PRINT(Rule)
1626#endif /* !YYDEBUG */
1627
1628
1629/* YYINITDEPTH -- initial size of the parser's stacks. */
1630#ifndef YYINITDEPTH
1631# define YYINITDEPTH 200
1632#endif
1633
1634/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1635 if the built-in stack extension method is used).
1636
1637 Do not make this value too large; the results are undefined if
1638 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1639 evaluated with infinite-precision integer arithmetic. */
1640
1641#ifndef YYMAXDEPTH
1642# define YYMAXDEPTH 10000
1643#endif
1644
1645
1646
1647
1648
1649
1650/*-----------------------------------------------.
1651| Release the memory associated to this symbol. |
1652`-----------------------------------------------*/
1653
1654static void
1655yydestruct (const char *yymsg,
1657{
1658 YY_USE (yyvaluep);
1659 YY_USE (state);
1660 if (!yymsg)
1661 yymsg = "Deleting";
1662 YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
1663
1665 YY_USE (yykind);
1667}
1668
1669
1670
1671
1672
1673
1674/*----------.
1675| yyparse. |
1676`----------*/
1677
1678int
1679yyparse (struct cpname_state *state)
1680{
1681/* Lookahead token kind. */
1682int yychar;
1683
1684
1685/* The semantic value of the lookahead symbol. */
1686/* Default value used for initialization, for pacifying older GCCs
1687 or non-GCC compilers. */
1688YY_INITIAL_VALUE (static cp_name_parser_YYSTYPE yyval_default;)
1690
1691 /* Number of syntax errors so far. */
1692 int yynerrs = 0;
1693
1695 /* Number of tokens to shift before error messages enabled. */
1696 int yyerrstatus = 0;
1697
1698 /* Refer to the stacks through separate pointers, to allow yyoverflow
1699 to xreallocate them elsewhere. */
1700
1701 /* Their size. */
1703
1704 /* The state stack: array, bottom, top. */
1705 yy_state_t yyssa[YYINITDEPTH];
1706 yy_state_t *yyss = yyssa;
1708
1709 /* The semantic value stack: array, bottom, top. */
1713
1714 int yyn;
1715 /* The return value of yyparse. */
1716 int yyresult;
1717 /* Lookahead symbol kind. */
1719 /* The variables used to return semantic value and location from the
1720 action routines. */
1722
1723
1724
1725#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1726
1727 /* The number of symbols on the RHS of the reduced rule.
1728 Keep to zero when no symbol should be popped. */
1729 int yylen = 0;
1730
1731 YYDPRINTF ((stderr, "Starting parse\n"));
1732
1733 yychar = YYEMPTY; /* Cause a token to be read. */
1734
1735 goto yysetstate;
1736
1737
1738/*------------------------------------------------------------.
1739| yynewstate -- push a new state, which is found in yystate. |
1740`------------------------------------------------------------*/
1741yynewstate:
1742 /* In all cases, when you get here, the value and location stacks
1743 have just been pushed. So pushing a state here evens the stacks. */
1744 yyssp++;
1745
1746
1747/*--------------------------------------------------------------------.
1748| yysetstate -- set current state (the top of the stack) to yystate. |
1749`--------------------------------------------------------------------*/
1750yysetstate:
1751 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1752 YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1757
1758 if (yyss + yystacksize - 1 <= yyssp)
1759#if !defined yyoverflow && !defined YYSTACK_RELOCATE
1760 YYNOMEM;
1761#else
1762 {
1763 /* Get the current used size of the three stacks, in elements. */
1764 YYPTRDIFF_T yysize = yyssp - yyss + 1;
1765
1766# if defined yyoverflow
1767 {
1768 /* Give user a chance to xreallocate the stack. Use copies of
1769 these so that the &'s don't force the real ones into
1770 memory. */
1771 yy_state_t *yyss1 = yyss;
1773
1774 /* Each stack pointer address is followed by the size of the
1775 data in use in that stack, in bytes. This used to be a
1776 conditional around just the two extra args, but that might
1777 be undefined if yyoverflow is a macro. */
1778 yyoverflow (YY_("memory exhausted"),
1779 &yyss1, yysize * YYSIZEOF (*yyssp),
1780 &yyvs1, yysize * YYSIZEOF (*yyvsp),
1781 &yystacksize);
1782 yyss = yyss1;
1783 yyvs = yyvs1;
1784 }
1785# else /* defined YYSTACK_RELOCATE */
1786 /* Extend the stack our own way. */
1787 if (YYMAXDEPTH <= yystacksize)
1788 YYNOMEM;
1789 yystacksize *= 2;
1790 if (YYMAXDEPTH < yystacksize)
1792
1793 {
1794 yy_state_t *yyss1 = yyss;
1795 union cp_name_parser_yyalloc *yyptr =
1798 if (! yyptr)
1799 YYNOMEM;
1802# undef YYSTACK_RELOCATE
1803 if (yyss1 != yyssa)
1804 YYSTACK_FREE (yyss1);
1805 }
1806# endif
1807
1808 yyssp = yyss + yysize - 1;
1809 yyvsp = yyvs + yysize - 1;
1810
1812 YYDPRINTF ((stderr, "Stack size increased to %ld\n",
1813 YY_CAST (long, yystacksize)));
1815
1816 if (yyss + yystacksize - 1 <= yyssp)
1817 YYABORT;
1818 }
1819#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1820
1821
1822 if (yystate == YYFINAL)
1823 YYACCEPT;
1824
1825 goto yybackup;
1826
1827
1828/*-----------.
1829| yybackup. |
1830`-----------*/
1831yybackup:
1832 /* Do appropriate processing given the current state. Read a
1833 lookahead token if we need one and don't already have one. */
1834
1835 /* First try to decide what to do without reference to lookahead token. */
1836 yyn = yypact[yystate];
1837 if (yypact_value_is_default (yyn))
1838 goto yydefault;
1839
1840 /* Not known => get a lookahead token if don't already have one. */
1841
1842 /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
1843 if (yychar == YYEMPTY)
1844 {
1845 YYDPRINTF ((stderr, "Reading a token\n"));
1846 yychar = yylex (&yylval, state);
1847 }
1848
1849 if (yychar <= YYEOF)
1850 {
1851 yychar = YYEOF;
1852 yytoken = YYSYMBOL_YYEOF;
1853 YYDPRINTF ((stderr, "Now at end of input.\n"));
1854 }
1855 else if (yychar == YYerror)
1856 {
1857 /* The scanner already issued an error message, process directly
1858 to error recovery. But do not keep the error token as
1859 lookahead, it is too special and may lead us to an endless
1860 loop in error recovery. */
1861 yychar = YYUNDEF;
1862 yytoken = YYSYMBOL_YYerror;
1863 goto yyerrlab1;
1864 }
1865 else
1866 {
1867 yytoken = YYTRANSLATE (yychar);
1868 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1869 }
1870
1871 /* If the proper action on seeing token YYTOKEN is to reduce or to
1872 detect an error, take that action. */
1873 yyn += yytoken;
1874 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1875 goto yydefault;
1876 yyn = yytable[yyn];
1877 if (yyn <= 0)
1878 {
1879 if (yytable_value_is_error (yyn))
1880 goto yyerrlab;
1881 yyn = -yyn;
1882 goto yyreduce;
1883 }
1884
1885 /* Count tokens shifted since error; after three, turn off error
1886 status. */
1887 if (yyerrstatus)
1888 yyerrstatus--;
1889
1890 /* Shift the lookahead token. */
1891 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1892 yystate = yyn;
1894 *++yyvsp = yylval;
1896
1897 /* Discard the shifted token. */
1898 yychar = YYEMPTY;
1899 goto yynewstate;
1900
1901
1902/*-----------------------------------------------------------.
1903| yydefault -- do the default action for the current state. |
1904`-----------------------------------------------------------*/
1905yydefault:
1906 yyn = yydefact[yystate];
1907 if (yyn == 0)
1908 goto yyerrlab;
1909 goto yyreduce;
1910
1911
1912/*-----------------------------.
1913| yyreduce -- do a reduction. |
1914`-----------------------------*/
1915yyreduce:
1916 /* yyn is the number of a rule to reduce with. */
1917 yylen = yyr2[yyn];
1918
1919 /* If YYLEN is nonzero, implement the default value of the action:
1920 '$$ = $1'.
1921
1922 Otherwise, the following line sets YYVAL to garbage.
1923 This behavior is undocumented and Bison
1924 users should not rely upon it. Assigning to YYVAL
1925 unconditionally makes the parser a bit smaller, and it avoids a
1926 GCC warning that YYVAL may be used uninitialized. */
1927 yyval = yyvsp[1-yylen];
1928
1929
1930 YY_REDUCE_PRINT (yyn);
1931 switch (yyn)
1932 {
1933 case 2: /* result: start */
1934#line 349 "cp-name-parser.y"
1935 {
1936 state->global_result = (yyvsp[0].comp);
1937
1938 /* Avoid warning about "yynerrs" being unused. */
1939 (void) yynerrs;
1940 }
1941#line 1943 "cp-name-parser.c.tmp"
1942 break;
1943
1944 case 6: /* start_opt: %empty */
1945#line 366 "cp-name-parser.y"
1946 { (yyval.comp) = NULL; }
1947#line 1949 "cp-name-parser.c.tmp"
1948 break;
1949
1950 case 7: /* start_opt: COLONCOLON start */
1951#line 368 "cp-name-parser.y"
1952 { (yyval.comp) = (yyvsp[0].comp); }
1953#line 1955 "cp-name-parser.c.tmp"
1954 break;
1955
1956 case 8: /* function: typespec_2 declarator_1 */
1957#line 375 "cp-name-parser.y"
1958 { (yyval.comp) = (yyvsp[0].nested).comp;
1959 *(yyvsp[0].nested).last = (yyvsp[-1].comp);
1960 }
1961#line 1963 "cp-name-parser.c.tmp"
1962 break;
1963
1964 case 9: /* function: typespec_2 function_arglist start_opt */
1965#line 384 "cp-name-parser.y"
1966 { (yyval.comp) = state->fill_comp (DEMANGLE_COMPONENT_TYPED_NAME,
1967 (yyvsp[-2].comp), (yyvsp[-1].nested).comp);
1968 if ((yyvsp[0].comp))
1969 (yyval.comp) = state->fill_comp (DEMANGLE_COMPONENT_LOCAL_NAME,
1970 (yyval.comp), (yyvsp[0].comp));
1971 }
1972#line 1974 "cp-name-parser.c.tmp"
1973 break;
1974
1975 case 10: /* function: colon_ext_only function_arglist start_opt */
1976#line 391 "cp-name-parser.y"
1977 { (yyval.comp) = state->fill_comp (DEMANGLE_COMPONENT_TYPED_NAME, (yyvsp[-2].comp), (yyvsp[-1].nested).comp);
1978 if ((yyvsp[0].comp)) (yyval.comp) = state->fill_comp (DEMANGLE_COMPONENT_LOCAL_NAME, (yyval.comp), (yyvsp[0].comp)); }
1979#line 1981 "cp-name-parser.c.tmp"
1980 break;
1981
1982 case 11: /* function: conversion_op_name start_opt */
1983#line 395 "cp-name-parser.y"
1984 { (yyval.comp) = (yyvsp[-1].nested).comp;
1985 if ((yyvsp[0].comp)) (yyval.comp) = state->fill_comp (DEMANGLE_COMPONENT_LOCAL_NAME, (yyval.comp), (yyvsp[0].comp)); }
1986#line 1988 "cp-name-parser.c.tmp"
1987 break;
1988
1989 case 12: /* function: conversion_op_name abstract_declarator_fn */
1990#line 398 "cp-name-parser.y"
1991 { if ((yyvsp[0].abstract).last)
1992 {
1993 /* First complete the abstract_declarator's type using
1994 the typespec from the conversion_op_name. */
1995 *(yyvsp[0].abstract).last = *(yyvsp[-1].nested).last;
1996 /* Then complete the conversion_op_name with the type. */
1997 *(yyvsp[-1].nested).last = (yyvsp[0].abstract).comp;
1998 }
1999 /* If we have an arglist, build a function type. */
2000 if ((yyvsp[0].abstract).fn.comp)
2001 (yyval.comp) = state->fill_comp (DEMANGLE_COMPONENT_TYPED_NAME, (yyvsp[-1].nested).comp, (yyvsp[0].abstract).fn.comp);
2002 else
2003 (yyval.comp) = (yyvsp[-1].nested).comp;
2004 if ((yyvsp[0].abstract).start) (yyval.comp) = state->fill_comp (DEMANGLE_COMPONENT_LOCAL_NAME, (yyval.comp), (yyvsp[0].abstract).start);
2005 }
2006#line 2008 "cp-name-parser.c.tmp"
2007 break;
2008
2009 case 13: /* demangler_special: DEMANGLER_SPECIAL start */
2010#line 417 "cp-name-parser.y"
2011 { (yyval.comp) = state->fill_comp ((enum demangle_component_type) (yyvsp[-1].lval), (yyvsp[0].comp), NULL); }
2012#line 2014 "cp-name-parser.c.tmp"
2013 break;
2014
2015 case 14: /* demangler_special: CONSTRUCTION_VTABLE start CONSTRUCTION_IN start */
2016#line 419 "cp-name-parser.y"
2017 { (yyval.comp) = state->fill_comp (DEMANGLE_COMPONENT_CONSTRUCTION_VTABLE, (yyvsp[-2].comp), (yyvsp[0].comp)); }
2018#line 2020 "cp-name-parser.c.tmp"
2019 break;
2020
2021 case 15: /* oper: OPERATOR NEW */
2022#line 423 "cp-name-parser.y"
2023 {
2024 /* Match the whitespacing of cplus_demangle_operators.
2025 It would abort on unrecognized string otherwise. */
2026 (yyval.comp) = state->make_operator ("new", 3);
2027 }
2028#line 2030 "cp-name-parser.c.tmp"
2029 break;
2030
2031 case 16: /* oper: OPERATOR DELETE */
2032#line 429 "cp-name-parser.y"
2033 {
2034 /* Match the whitespacing of cplus_demangle_operators.
2035 It would abort on unrecognized string otherwise. */
2036 (yyval.comp) = state->make_operator ("delete ", 1);
2037 }
2038#line 2040 "cp-name-parser.c.tmp"
2039 break;
2040
2041 case 17: /* oper: OPERATOR NEW '[' ']' */
2042#line 435 "cp-name-parser.y"
2043 {
2044 /* Match the whitespacing of cplus_demangle_operators.
2045 It would abort on unrecognized string otherwise. */
2046 (yyval.comp) = state->make_operator ("new[]", 3);
2047 }
2048#line 2050 "cp-name-parser.c.tmp"
2049 break;
2050
2051 case 18: /* oper: OPERATOR DELETE '[' ']' */
2052#line 441 "cp-name-parser.y"
2053 {
2054 /* Match the whitespacing of cplus_demangle_operators.
2055 It would abort on unrecognized string otherwise. */
2056 (yyval.comp) = state->make_operator ("delete[] ", 1);
2057 }
2058#line 2060 "cp-name-parser.c.tmp"
2059 break;
2060
2061 case 19: /* oper: OPERATOR '+' */
2062#line 447 "cp-name-parser.y"
2063 { (yyval.comp) = state->make_operator ("+", 2); }
2064#line 2066 "cp-name-parser.c.tmp"
2065 break;
2066
2067 case 20: /* oper: OPERATOR '-' */
2068#line 449 "cp-name-parser.y"
2069 { (yyval.comp) = state->make_operator ("-", 2); }
2070#line 2072 "cp-name-parser.c.tmp"
2071 break;
2072
2073 case 21: /* oper: OPERATOR '*' */
2074#line 451 "cp-name-parser.y"
2075 { (yyval.comp) = state->make_operator ("*", 2); }
2076#line 2078 "cp-name-parser.c.tmp"
2077 break;
2078
2079 case 22: /* oper: OPERATOR '/' */
2080#line 453 "cp-name-parser.y"
2081 { (yyval.comp) = state->make_operator ("/", 2); }
2082#line 2084 "cp-name-parser.c.tmp"
2083 break;
2084
2085 case 23: /* oper: OPERATOR '%' */
2086#line 455 "cp-name-parser.y"
2087 { (yyval.comp) = state->make_operator ("%", 2); }
2088#line 2090 "cp-name-parser.c.tmp"
2089 break;
2090
2091 case 24: /* oper: OPERATOR '^' */
2092#line 457 "cp-name-parser.y"
2093 { (yyval.comp) = state->make_operator ("^", 2); }
2094#line 2096 "cp-name-parser.c.tmp"
2095 break;
2096
2097 case 25: /* oper: OPERATOR '&' */
2098#line 459 "cp-name-parser.y"
2099 { (yyval.comp) = state->make_operator ("&", 2); }
2100#line 2102 "cp-name-parser.c.tmp"
2101 break;
2102
2103 case 26: /* oper: OPERATOR '|' */
2104#line 461 "cp-name-parser.y"
2105 { (yyval.comp) = state->make_operator ("|", 2); }
2106#line 2108 "cp-name-parser.c.tmp"
2107 break;
2108
2109 case 27: /* oper: OPERATOR '~' */
2110#line 463 "cp-name-parser.y"
2111 { (yyval.comp) = state->make_operator ("~", 1); }
2112#line 2114 "cp-name-parser.c.tmp"
2113 break;
2114
2115 case 28: /* oper: OPERATOR '!' */
2116#line 465 "cp-name-parser.y"
2117 { (yyval.comp) = state->make_operator ("!", 1); }
2118#line 2120 "cp-name-parser.c.tmp"
2119 break;
2120
2121 case 29: /* oper: OPERATOR '=' */
2122#line 467 "cp-name-parser.y"
2123 { (yyval.comp) = state->make_operator ("=", 2); }
2124#line 2126 "cp-name-parser.c.tmp"
2125 break;
2126
2127 case 30: /* oper: OPERATOR '<' */
2128#line 469 "cp-name-parser.y"
2129 { (yyval.comp) = state->make_operator ("<", 2); }
2130#line 2132 "cp-name-parser.c.tmp"
2131 break;
2132
2133 case 31: /* oper: OPERATOR '>' */
2134#line 471 "cp-name-parser.y"
2135 { (yyval.comp) = state->make_operator (">", 2); }
2136#line 2138 "cp-name-parser.c.tmp"
2137 break;
2138
2139 case 32: /* oper: OPERATOR ASSIGN_MODIFY */
2140#line 473 "cp-name-parser.y"
2141 { (yyval.comp) = state->make_operator ((yyvsp[0].opname), 2); }
2142#line 2144 "cp-name-parser.c.tmp"
2143 break;
2144
2145 case 33: /* oper: OPERATOR LSH */
2146#line 475 "cp-name-parser.y"
2147 { (yyval.comp) = state->make_operator ("<<", 2); }
2148#line 2150 "cp-name-parser.c.tmp"
2149 break;
2150
2151 case 34: /* oper: OPERATOR RSH */
2152#line 477 "cp-name-parser.y"
2153 { (yyval.comp) = state->make_operator (">>", 2); }
2154#line 2156 "cp-name-parser.c.tmp"
2155 break;
2156
2157 case 35: /* oper: OPERATOR EQUAL */
2158#line 479 "cp-name-parser.y"
2159 { (yyval.comp) = state->make_operator ("==", 2); }
2160#line 2162 "cp-name-parser.c.tmp"
2161 break;
2162
2163 case 36: /* oper: OPERATOR NOTEQUAL */
2164#line 481 "cp-name-parser.y"
2165 { (yyval.comp) = state->make_operator ("!=", 2); }
2166#line 2168 "cp-name-parser.c.tmp"
2167 break;
2168
2169 case 37: /* oper: OPERATOR LEQ */
2170#line 483 "cp-name-parser.y"
2171 { (yyval.comp) = state->make_operator ("<=", 2); }
2172#line 2174 "cp-name-parser.c.tmp"
2173 break;
2174
2175 case 38: /* oper: OPERATOR GEQ */
2176#line 485 "cp-name-parser.y"
2177 { (yyval.comp) = state->make_operator (">=", 2); }
2178#line 2180 "cp-name-parser.c.tmp"
2179 break;
2180
2181 case 39: /* oper: OPERATOR ANDAND */
2182#line 487 "cp-name-parser.y"
2183 { (yyval.comp) = state->make_operator ("&&", 2); }
2184#line 2186 "cp-name-parser.c.tmp"
2185 break;
2186
2187 case 40: /* oper: OPERATOR OROR */
2188#line 489 "cp-name-parser.y"
2189 { (yyval.comp) = state->make_operator ("||", 2); }
2190#line 2192 "cp-name-parser.c.tmp"
2191 break;
2192
2193 case 41: /* oper: OPERATOR INCREMENT */
2194#line 491 "cp-name-parser.y"
2195 { (yyval.comp) = state->make_operator ("++", 1); }
2196#line 2198 "cp-name-parser.c.tmp"
2197 break;
2198
2199 case 42: /* oper: OPERATOR DECREMENT */
2200#line 493 "cp-name-parser.y"
2201 { (yyval.comp) = state->make_operator ("--", 1); }
2202#line 2204 "cp-name-parser.c.tmp"
2203 break;
2204
2205 case 43: /* oper: OPERATOR ',' */
2206#line 495 "cp-name-parser.y"
2207 { (yyval.comp) = state->make_operator (",", 2); }
2208#line 2210 "cp-name-parser.c.tmp"
2209 break;
2210
2211 case 44: /* oper: OPERATOR ARROW '*' */
2212#line 497 "cp-name-parser.y"
2213 { (yyval.comp) = state->make_operator ("->*", 2); }
2214#line 2216 "cp-name-parser.c.tmp"
2215 break;
2216
2217 case 45: /* oper: OPERATOR ARROW */
2218#line 499 "cp-name-parser.y"
2219 { (yyval.comp) = state->make_operator ("->", 2); }
2220#line 2222 "cp-name-parser.c.tmp"
2221 break;
2222
2223 case 46: /* oper: OPERATOR '(' ')' */
2224#line 501 "cp-name-parser.y"
2225 { (yyval.comp) = state->make_operator ("()", 2); }
2226#line 2228 "cp-name-parser.c.tmp"
2227 break;
2228
2229 case 47: /* oper: OPERATOR '[' ']' */
2230#line 503 "cp-name-parser.y"
2231 { (yyval.comp) = state->make_operator ("[]", 2); }
2232#line 2234 "cp-name-parser.c.tmp"
2233 break;
2234
2235 case 48: /* conversion_op: OPERATOR typespec_2 */
2236#line 511 "cp-name-parser.y"
2237 { (yyval.comp) = state->fill_comp (DEMANGLE_COMPONENT_CONVERSION, (yyvsp[0].comp), NULL); }
2238#line 2240 "cp-name-parser.c.tmp"
2239 break;
2240
2241 case 49: /* conversion_op_name: nested_name conversion_op */
2242#line 516 "cp-name-parser.y"
2243 { (yyval.nested).comp = (yyvsp[-1].nested1).comp;
2244 d_right ((yyvsp[-1].nested1).last) = (yyvsp[0].comp);
2245 (yyval.nested).last = &d_left ((yyvsp[0].comp));
2246 }
2247#line 2249 "cp-name-parser.c.tmp"
2248 break;
2249
2250 case 50: /* conversion_op_name: conversion_op */
2251#line 521 "cp-name-parser.y"
2252 { (yyval.nested).comp = (yyvsp[0].comp);
2253 (yyval.nested).last = &d_left ((yyvsp[0].comp));
2254 }
2255#line 2257 "cp-name-parser.c.tmp"
2256 break;
2257
2258 case 51: /* conversion_op_name: COLONCOLON nested_name conversion_op */
2259#line 525 "cp-name-parser.y"
2260 { (yyval.nested).comp = (yyvsp[-1].nested1).comp;
2261 d_right ((yyvsp[-1].nested1).last) = (yyvsp[0].comp);
2262 (yyval.nested).last = &d_left ((yyvsp[0].comp));
2263 }
2264#line 2266 "cp-name-parser.c.tmp"
2265 break;
2266
2267 case 52: /* conversion_op_name: COLONCOLON conversion_op */
2268#line 530 "cp-name-parser.y"
2269 { (yyval.nested).comp = (yyvsp[0].comp);
2270 (yyval.nested).last = &d_left ((yyvsp[0].comp));
2271 }
2272#line 2274 "cp-name-parser.c.tmp"
2273 break;
2274
2275 case 54: /* unqualified_name: oper '<' template_params '>' */
2276#line 539 "cp-name-parser.y"
2277 { (yyval.comp) = state->fill_comp (DEMANGLE_COMPONENT_TEMPLATE, (yyvsp[-3].comp), (yyvsp[-1].nested).comp); }
2278#line 2280 "cp-name-parser.c.tmp"
2279 break;
2280
2281 case 55: /* unqualified_name: '~' NAME */
2282#line 541 "cp-name-parser.y"
2283 { (yyval.comp) = state->make_dtor (gnu_v3_complete_object_dtor, (yyvsp[0].comp)); }
2284#line 2286 "cp-name-parser.c.tmp"
2285 break;
2286
2287 case 57: /* colon_name: COLONCOLON name */
2288#line 554 "cp-name-parser.y"
2289 { (yyval.comp) = (yyvsp[0].comp); }
2290#line 2292 "cp-name-parser.c.tmp"
2291 break;
2292
2293 case 58: /* name: nested_name NAME */
2294#line 560 "cp-name-parser.y"
2295 { (yyval.comp) = (yyvsp[-1].nested1).comp; d_right ((yyvsp[-1].nested1).last) = (yyvsp[0].comp); }
2296#line 2298 "cp-name-parser.c.tmp"
2297 break;
2298
2299 case 60: /* name: nested_name templ */
2300#line 563 "cp-name-parser.y"
2301 { (yyval.comp) = (yyvsp[-1].nested1).comp; d_right ((yyvsp[-1].nested1).last) = (yyvsp[0].comp); }
2302#line 2304 "cp-name-parser.c.tmp"
2303 break;
2304
2305 case 65: /* colon_ext_only: COLONCOLON ext_only_name */
2306#line 573 "cp-name-parser.y"
2307 { (yyval.comp) = (yyvsp[0].comp); }
2308#line 2310 "cp-name-parser.c.tmp"
2309 break;
2310
2311 case 66: /* ext_only_name: nested_name unqualified_name */
2312#line 577 "cp-name-parser.y"
2313 { (yyval.comp) = (yyvsp[-1].nested1).comp; d_right ((yyvsp[-1].nested1).last) = (yyvsp[0].comp); }
2314#line 2316 "cp-name-parser.c.tmp"
2315 break;
2316
2317 case 68: /* nested_name: NAME COLONCOLON */
2318#line 582 "cp-name-parser.y"
2319 { (yyval.nested1).comp = state->fill_comp (DEMANGLE_COMPONENT_QUAL_NAME, (yyvsp[-1].comp), NULL);
2320 (yyval.nested1).last = (yyval.nested1).comp;
2321 }
2322#line 2324 "cp-name-parser.c.tmp"
2323 break;
2324
2325 case 69: /* nested_name: nested_name NAME COLONCOLON */
2326#line 586 "cp-name-parser.y"
2327 { (yyval.nested1).comp = (yyvsp[-2].nested1).comp;
2328 d_right ((yyvsp[-2].nested1).last) = state->fill_comp (DEMANGLE_COMPONENT_QUAL_NAME, (yyvsp[-1].comp), NULL);
2329 (yyval.nested1).last = d_right ((yyvsp[-2].nested1).last);
2330 }
2331#line 2333 "cp-name-parser.c.tmp"
2332 break;
2333
2334 case 70: /* nested_name: templ COLONCOLON */
2335#line 591 "cp-name-parser.y"
2336 { (yyval.nested1).comp = state->fill_comp (DEMANGLE_COMPONENT_QUAL_NAME, (yyvsp[-1].comp), NULL);
2337 (yyval.nested1).last = (yyval.nested1).comp;
2338 }
2339#line 2341 "cp-name-parser.c.tmp"
2340 break;
2341
2342 case 71: /* nested_name: nested_name templ COLONCOLON */
2343#line 595 "cp-name-parser.y"
2344 { (yyval.nested1).comp = (yyvsp[-2].nested1).comp;
2345 d_right ((yyvsp[-2].nested1).last) = state->fill_comp (DEMANGLE_COMPONENT_QUAL_NAME, (yyvsp[-1].comp), NULL);
2346 (yyval.nested1).last = d_right ((yyvsp[-2].nested1).last);
2347 }
2348#line 2350 "cp-name-parser.c.tmp"
2349 break;
2350
2351 case 72: /* templ: NAME '<' template_params '>' */
2352#line 604 "cp-name-parser.y"
2353 { (yyval.comp) = state->fill_comp (DEMANGLE_COMPONENT_TEMPLATE, (yyvsp[-3].comp), (yyvsp[-1].nested).comp); }
2354#line 2356 "cp-name-parser.c.tmp"
2355 break;
2356
2357 case 73: /* template_params: template_arg */
2358#line 608 "cp-name-parser.y"
2359 { (yyval.nested).comp = state->fill_comp (DEMANGLE_COMPONENT_TEMPLATE_ARGLIST, (yyvsp[0].comp), NULL);
2360 (yyval.nested).last = &d_right ((yyval.nested).comp); }
2361#line 2363 "cp-name-parser.c.tmp"
2362 break;
2363
2364 case 74: /* template_params: template_params ',' template_arg */
2365#line 611 "cp-name-parser.y"
2366 { (yyval.nested).comp = (yyvsp[-2].nested).comp;
2367 *(yyvsp[-2].nested).last = state->fill_comp (DEMANGLE_COMPONENT_TEMPLATE_ARGLIST, (yyvsp[0].comp), NULL);
2368 (yyval.nested).last = &d_right (*(yyvsp[-2].nested).last);
2369 }
2370#line 2372 "cp-name-parser.c.tmp"
2371 break;
2372
2373 case 76: /* template_arg: typespec_2 abstract_declarator */
2374#line 623 "cp-name-parser.y"
2375 { (yyval.comp) = (yyvsp[0].abstract).comp;
2376 *(yyvsp[0].abstract).last = (yyvsp[-1].comp);
2377 }
2378#line 2380 "cp-name-parser.c.tmp"
2379 break;
2380
2381 case 77: /* template_arg: '&' start */
2382#line 627 "cp-name-parser.y"
2383 { (yyval.comp) = state->fill_comp (DEMANGLE_COMPONENT_UNARY, state->make_operator ("&", 1), (yyvsp[0].comp)); }
2384#line 2386 "cp-name-parser.c.tmp"
2385 break;
2386
2387 case 78: /* template_arg: '&' '(' start ')' */
2388#line 629 "cp-name-parser.y"
2389 { (yyval.comp) = state->fill_comp (DEMANGLE_COMPONENT_UNARY, state->make_operator ("&", 1), (yyvsp[-1].comp)); }
2390#line 2392 "cp-name-parser.c.tmp"
2391 break;
2392
2393 case 80: /* function_args: typespec_2 */
2394#line 634 "cp-name-parser.y"
2395 { (yyval.nested).comp = state->fill_comp (DEMANGLE_COMPONENT_ARGLIST, (yyvsp[0].comp), NULL);
2396 (yyval.nested).last = &d_right ((yyval.nested).comp);
2397 }
2398#line 2400 "cp-name-parser.c.tmp"
2399 break;
2400
2401 case 81: /* function_args: typespec_2 abstract_declarator */
2402#line 638 "cp-name-parser.y"
2403 { *(yyvsp[0].abstract).last = (yyvsp[-1].comp);
2404 (yyval.nested).comp = state->fill_comp (DEMANGLE_COMPONENT_ARGLIST, (yyvsp[0].abstract).comp, NULL);
2405 (yyval.nested).last = &d_right ((yyval.nested).comp);
2406 }
2407#line 2409 "cp-name-parser.c.tmp"
2408 break;
2409
2410 case 82: /* function_args: function_args ',' typespec_2 */
2411#line 643 "cp-name-parser.y"
2412 { *(yyvsp[-2].nested).last = state->fill_comp (DEMANGLE_COMPONENT_ARGLIST, (yyvsp[0].comp), NULL);
2413 (yyval.nested).comp = (yyvsp[-2].nested).comp;
2414 (yyval.nested).last = &d_right (*(yyvsp[-2].nested).last);
2415 }
2416#line 2418 "cp-name-parser.c.tmp"
2417 break;
2418
2419 case 83: /* function_args: function_args ',' typespec_2 abstract_declarator */
2420#line 648 "cp-name-parser.y"
2421 { *(yyvsp[0].abstract).last = (yyvsp[-1].comp);
2422 *(yyvsp[-3].nested).last = state->fill_comp (DEMANGLE_COMPONENT_ARGLIST, (yyvsp[0].abstract).comp, NULL);
2423 (yyval.nested).comp = (yyvsp[-3].nested).comp;
2424 (yyval.nested).last = &d_right (*(yyvsp[-3].nested).last);
2425 }
2426#line 2428 "cp-name-parser.c.tmp"
2427 break;
2428
2429 case 84: /* function_args: function_args ',' ELLIPSIS */
2430#line 654 "cp-name-parser.y"
2431 { *(yyvsp[-2].nested).last
2432 = state->fill_comp (DEMANGLE_COMPONENT_ARGLIST,
2433 state->make_builtin_type ("..."),
2434 NULL);
2435 (yyval.nested).comp = (yyvsp[-2].nested).comp;
2436 (yyval.nested).last = &d_right (*(yyvsp[-2].nested).last);
2437 }
2438#line 2440 "cp-name-parser.c.tmp"
2439 break;
2440
2441 case 85: /* function_arglist: '(' function_args ')' qualifiers_opt */
2442#line 664 "cp-name-parser.y"
2443 { (yyval.nested).comp = state->fill_comp (DEMANGLE_COMPONENT_FUNCTION_TYPE, NULL, (yyvsp[-2].nested).comp);
2444 (yyval.nested).last = &d_left ((yyval.nested).comp);
2445 (yyval.nested).comp = state->d_qualify ((yyval.nested).comp, (yyvsp[0].lval), 1); }
2446#line 2448 "cp-name-parser.c.tmp"
2447 break;
2448
2449 case 86: /* function_arglist: '(' VOID ')' qualifiers_opt */
2450#line 668 "cp-name-parser.y"
2451 { (yyval.nested).comp = state->fill_comp (DEMANGLE_COMPONENT_FUNCTION_TYPE, NULL, NULL);
2452 (yyval.nested).last = &d_left ((yyval.nested).comp);
2453 (yyval.nested).comp = state->d_qualify ((yyval.nested).comp, (yyvsp[0].lval), 1); }
2454#line 2456 "cp-name-parser.c.tmp"
2455 break;
2456
2457 case 87: /* function_arglist: '(' ')' qualifiers_opt */
2458#line 672 "cp-name-parser.y"
2459 { (yyval.nested).comp = state->fill_comp (DEMANGLE_COMPONENT_FUNCTION_TYPE, NULL, NULL);
2460 (yyval.nested).last = &d_left ((yyval.nested).comp);
2461 (yyval.nested).comp = state->d_qualify ((yyval.nested).comp, (yyvsp[0].lval), 1); }
2462#line 2464 "cp-name-parser.c.tmp"
2463 break;
2464
2465 case 88: /* qualifiers_opt: %empty */
2466#line 679 "cp-name-parser.y"
2467 { (yyval.lval) = 0; }
2468#line 2470 "cp-name-parser.c.tmp"
2469 break;
2470
2471 case 90: /* qualifier: RESTRICT */
2472#line 684 "cp-name-parser.y"
2473 { (yyval.lval) = QUAL_RESTRICT; }
2474#line 2476 "cp-name-parser.c.tmp"
2475 break;
2476
2477 case 91: /* qualifier: VOLATILE_KEYWORD */
2478#line 686 "cp-name-parser.y"
2479 { (yyval.lval) = QUAL_VOLATILE; }
2480#line 2482 "cp-name-parser.c.tmp"
2481 break;
2482
2483 case 92: /* qualifier: CONST_KEYWORD */
2484#line 688 "cp-name-parser.y"
2485 { (yyval.lval) = QUAL_CONST; }
2486#line 2488 "cp-name-parser.c.tmp"
2487 break;
2488
2489 case 94: /* qualifiers: qualifier qualifiers */
2490#line 693 "cp-name-parser.y"
2491 { (yyval.lval) = (yyvsp[-1].lval) | (yyvsp[0].lval); }
2492#line 2494 "cp-name-parser.c.tmp"
2493 break;
2494
2495 case 95: /* int_part: INT_KEYWORD */
2496#line 700 "cp-name-parser.y"
2497 { (yyval.lval) = 0; }
2498#line 2500 "cp-name-parser.c.tmp"
2499 break;
2500
2501 case 96: /* int_part: SIGNED_KEYWORD */
2502#line 702 "cp-name-parser.y"
2503 { (yyval.lval) = INT_SIGNED; }
2504#line 2506 "cp-name-parser.c.tmp"
2505 break;
2506
2507 case 97: /* int_part: UNSIGNED */
2508#line 704 "cp-name-parser.y"
2509 { (yyval.lval) = INT_UNSIGNED; }
2510#line 2512 "cp-name-parser.c.tmp"
2511 break;
2512
2513 case 98: /* int_part: CHAR */
2514#line 706 "cp-name-parser.y"
2515 { (yyval.lval) = INT_CHAR; }
2516#line 2518 "cp-name-parser.c.tmp"
2517 break;
2518
2519 case 99: /* int_part: LONG */
2520#line 708 "cp-name-parser.y"
2521 { (yyval.lval) = INT_LONG; }
2522#line 2524 "cp-name-parser.c.tmp"
2523 break;
2524
2525 case 100: /* int_part: SHORT */
2526#line 710 "cp-name-parser.y"
2527 { (yyval.lval) = INT_SHORT; }
2528#line 2530 "cp-name-parser.c.tmp"
2529 break;
2530
2531 case 102: /* int_seq: int_seq int_part */
2532#line 715 "cp-name-parser.y"
2533 { (yyval.lval) = (yyvsp[-1].lval) | (yyvsp[0].lval); if ((yyvsp[-1].lval) & (yyvsp[0].lval) & INT_LONG) (yyval.lval) = (yyvsp[-1].lval) | INT_LLONG; }
2534#line 2536 "cp-name-parser.c.tmp"
2535 break;
2536
2537 case 103: /* builtin_type: int_seq */
2538#line 719 "cp-name-parser.y"
2539 { (yyval.comp) = state->d_int_type ((yyvsp[0].lval)); }
2540#line 2542 "cp-name-parser.c.tmp"
2541 break;
2542
2543 case 104: /* builtin_type: FLOAT_KEYWORD */
2544#line 721 "cp-name-parser.y"
2545 { (yyval.comp) = state->make_builtin_type ("float"); }
2546#line 2548 "cp-name-parser.c.tmp"
2547 break;
2548
2549 case 105: /* builtin_type: DOUBLE_KEYWORD */
2550#line 723 "cp-name-parser.y"
2551 { (yyval.comp) = state->make_builtin_type ("double"); }
2552#line 2554 "cp-name-parser.c.tmp"
2553 break;
2554
2555 case 106: /* builtin_type: LONG DOUBLE_KEYWORD */
2556#line 725 "cp-name-parser.y"
2557 { (yyval.comp) = state->make_builtin_type ("long double"); }
2558#line 2560 "cp-name-parser.c.tmp"
2559 break;
2560
2561 case 107: /* builtin_type: BOOL */
2562#line 727 "cp-name-parser.y"
2563 { (yyval.comp) = state->make_builtin_type ("bool"); }
2564#line 2566 "cp-name-parser.c.tmp"
2565 break;
2566
2567 case 108: /* builtin_type: WCHAR_T */
2568#line 729 "cp-name-parser.y"
2569 { (yyval.comp) = state->make_builtin_type ("wchar_t"); }
2570#line 2572 "cp-name-parser.c.tmp"
2571 break;
2572
2573 case 109: /* builtin_type: VOID */
2574#line 731 "cp-name-parser.y"
2575 { (yyval.comp) = state->make_builtin_type ("void"); }
2576#line 2578 "cp-name-parser.c.tmp"
2577 break;
2578
2579 case 110: /* ptr_operator: '*' qualifiers_opt */
2580#line 735 "cp-name-parser.y"
2581 { (yyval.nested).comp = state->fill_comp (DEMANGLE_COMPONENT_POINTER, NULL, NULL);
2582 (yyval.nested).last = &d_left ((yyval.nested).comp);
2583 (yyval.nested).comp = state->d_qualify ((yyval.nested).comp, (yyvsp[0].lval), 0); }
2584#line 2586 "cp-name-parser.c.tmp"
2585 break;
2586
2587 case 111: /* ptr_operator: '&' */
2588#line 740 "cp-name-parser.y"
2589 { (yyval.nested).comp = state->fill_comp (DEMANGLE_COMPONENT_REFERENCE, NULL, NULL);
2590 (yyval.nested).last = &d_left ((yyval.nested).comp); }
2591#line 2593 "cp-name-parser.c.tmp"
2592 break;
2593
2594 case 112: /* ptr_operator: ANDAND */
2595#line 743 "cp-name-parser.y"
2596 { (yyval.nested).comp = state->fill_comp (DEMANGLE_COMPONENT_RVALUE_REFERENCE, NULL, NULL);
2597 (yyval.nested).last = &d_left ((yyval.nested).comp); }
2598#line 2600 "cp-name-parser.c.tmp"
2599 break;
2600
2601 case 113: /* ptr_operator: nested_name '*' qualifiers_opt */
2602#line 746 "cp-name-parser.y"
2603 { (yyval.nested).comp = state->fill_comp (DEMANGLE_COMPONENT_PTRMEM_TYPE, (yyvsp[-2].nested1).comp, NULL);
2604 /* Convert the innermost DEMANGLE_COMPONENT_QUAL_NAME to a DEMANGLE_COMPONENT_NAME. */
2605 *(yyvsp[-2].nested1).last = *d_left ((yyvsp[-2].nested1).last);
2606 (yyval.nested).last = &d_right ((yyval.nested).comp);
2607 (yyval.nested).comp = state->d_qualify ((yyval.nested).comp, (yyvsp[0].lval), 0); }
2608#line 2610 "cp-name-parser.c.tmp"
2609 break;
2610
2611 case 114: /* ptr_operator: COLONCOLON nested_name '*' qualifiers_opt */
2612#line 752 "cp-name-parser.y"
2613 { (yyval.nested).comp = state->fill_comp (DEMANGLE_COMPONENT_PTRMEM_TYPE, (yyvsp[-2].nested1).comp, NULL);
2614 /* Convert the innermost DEMANGLE_COMPONENT_QUAL_NAME to a DEMANGLE_COMPONENT_NAME. */
2615 *(yyvsp[-2].nested1).last = *d_left ((yyvsp[-2].nested1).last);
2616 (yyval.nested).last = &d_right ((yyval.nested).comp);
2617 (yyval.nested).comp = state->d_qualify ((yyval.nested).comp, (yyvsp[0].lval), 0); }
2618#line 2620 "cp-name-parser.c.tmp"
2619 break;
2620
2621 case 115: /* array_indicator: '[' ']' */
2622#line 760 "cp-name-parser.y"
2623 { (yyval.comp) = state->fill_comp (DEMANGLE_COMPONENT_ARRAY_TYPE, NULL, NULL); }
2624#line 2626 "cp-name-parser.c.tmp"
2625 break;
2626
2627 case 116: /* array_indicator: '[' INT ']' */
2628#line 762 "cp-name-parser.y"
2629 { (yyval.comp) = state->fill_comp (DEMANGLE_COMPONENT_ARRAY_TYPE, (yyvsp[-1].comp), NULL); }
2630#line 2632 "cp-name-parser.c.tmp"
2631 break;
2632
2633 case 117: /* typespec_2: builtin_type qualifiers */
2634#line 776 "cp-name-parser.y"
2635 { (yyval.comp) = state->d_qualify ((yyvsp[-1].comp), (yyvsp[0].lval), 0); }
2636#line 2638 "cp-name-parser.c.tmp"
2637 break;
2638
2639 case 119: /* typespec_2: qualifiers builtin_type qualifiers */
2640#line 779 "cp-name-parser.y"
2641 { (yyval.comp) = state->d_qualify ((yyvsp[-1].comp), (yyvsp[-2].lval) | (yyvsp[0].lval), 0); }
2642#line 2644 "cp-name-parser.c.tmp"
2643 break;
2644
2645 case 120: /* typespec_2: qualifiers builtin_type */
2646#line 781 "cp-name-parser.y"
2647 { (yyval.comp) = state->d_qualify ((yyvsp[0].comp), (yyvsp[-1].lval), 0); }
2648#line 2650 "cp-name-parser.c.tmp"
2649 break;
2650
2651 case 121: /* typespec_2: name qualifiers */
2652#line 784 "cp-name-parser.y"
2653 { (yyval.comp) = state->d_qualify ((yyvsp[-1].comp), (yyvsp[0].lval), 0); }
2654#line 2656 "cp-name-parser.c.tmp"
2655 break;
2656
2657 case 123: /* typespec_2: qualifiers name qualifiers */
2658#line 787 "cp-name-parser.y"
2659 { (yyval.comp) = state->d_qualify ((yyvsp[-1].comp), (yyvsp[-2].lval) | (yyvsp[0].lval), 0); }
2660#line 2662 "cp-name-parser.c.tmp"
2661 break;
2662
2663 case 124: /* typespec_2: qualifiers name */
2664#line 789 "cp-name-parser.y"
2665 { (yyval.comp) = state->d_qualify ((yyvsp[0].comp), (yyvsp[-1].lval), 0); }
2666#line 2668 "cp-name-parser.c.tmp"
2667 break;
2668
2669 case 125: /* typespec_2: COLONCOLON name qualifiers */
2670#line 792 "cp-name-parser.y"
2671 { (yyval.comp) = state->d_qualify ((yyvsp[-1].comp), (yyvsp[0].lval), 0); }
2672#line 2674 "cp-name-parser.c.tmp"
2673 break;
2674
2675 case 126: /* typespec_2: COLONCOLON name */
2676#line 794 "cp-name-parser.y"
2677 { (yyval.comp) = (yyvsp[0].comp); }
2678#line 2680 "cp-name-parser.c.tmp"
2679 break;
2680
2681 case 127: /* typespec_2: qualifiers COLONCOLON name qualifiers */
2682#line 796 "cp-name-parser.y"
2683 { (yyval.comp) = state->d_qualify ((yyvsp[-1].comp), (yyvsp[-3].lval) | (yyvsp[0].lval), 0); }
2684#line 2686 "cp-name-parser.c.tmp"
2685 break;
2686
2687 case 128: /* typespec_2: qualifiers COLONCOLON name */
2688#line 798 "cp-name-parser.y"
2689 { (yyval.comp) = state->d_qualify ((yyvsp[0].comp), (yyvsp[-2].lval), 0); }
2690#line 2692 "cp-name-parser.c.tmp"
2691 break;
2692
2693 case 129: /* abstract_declarator: ptr_operator */
2694#line 803 "cp-name-parser.y"
2695 { (yyval.abstract).comp = (yyvsp[0].nested).comp; (yyval.abstract).last = (yyvsp[0].nested).last;
2696 (yyval.abstract).fn.comp = NULL; (yyval.abstract).fn.last = NULL; }
2697#line 2699 "cp-name-parser.c.tmp"
2698 break;
2699
2700 case 130: /* abstract_declarator: ptr_operator abstract_declarator */
2701#line 806 "cp-name-parser.y"
2702 { (yyval.abstract) = (yyvsp[0].abstract); (yyval.abstract).fn.comp = NULL; (yyval.abstract).fn.last = NULL;
2703 if ((yyvsp[0].abstract).fn.comp) { (yyval.abstract).last = (yyvsp[0].abstract).fn.last; *(yyvsp[0].abstract).last = (yyvsp[0].abstract).fn.comp; }
2704 *(yyval.abstract).last = (yyvsp[-1].nested).comp;
2705 (yyval.abstract).last = (yyvsp[-1].nested).last; }
2706#line 2708 "cp-name-parser.c.tmp"
2707 break;
2708
2709 case 131: /* abstract_declarator: direct_abstract_declarator */
2710#line 811 "cp-name-parser.y"
2711 { (yyval.abstract).fn.comp = NULL; (yyval.abstract).fn.last = NULL;
2712 if ((yyvsp[0].abstract).fn.comp) { (yyval.abstract).last = (yyvsp[0].abstract).fn.last; *(yyvsp[0].abstract).last = (yyvsp[0].abstract).fn.comp; }
2713 }
2714#line 2716 "cp-name-parser.c.tmp"
2715 break;
2716
2717 case 132: /* direct_abstract_declarator: '(' abstract_declarator ')' */
2718#line 818 "cp-name-parser.y"
2719 { (yyval.abstract) = (yyvsp[-1].abstract); (yyval.abstract).fn.comp = NULL; (yyval.abstract).fn.last = NULL; (yyval.abstract).fold_flag = 1;
2720 if ((yyvsp[-1].abstract).fn.comp) { (yyval.abstract).last = (yyvsp[-1].abstract).fn.last; *(yyvsp[-1].abstract).last = (yyvsp[-1].abstract).fn.comp; }
2721 }
2722#line 2724 "cp-name-parser.c.tmp"
2723 break;
2724
2725 case 133: /* direct_abstract_declarator: direct_abstract_declarator function_arglist */
2726#line 822 "cp-name-parser.y"
2727 { (yyval.abstract).fold_flag = 0;
2728 if ((yyvsp[-1].abstract).fn.comp) { (yyval.abstract).last = (yyvsp[-1].abstract).fn.last; *(yyvsp[-1].abstract).last = (yyvsp[-1].abstract).fn.comp; }
2729 if ((yyvsp[-1].abstract).fold_flag)
2730 {
2731 *(yyval.abstract).last = (yyvsp[0].nested).comp;
2732 (yyval.abstract).last = (yyvsp[0].nested).last;
2733 }
2734 else
2735 (yyval.abstract).fn = (yyvsp[0].nested);
2736 }
2737#line 2739 "cp-name-parser.c.tmp"
2738 break;
2739
2740 case 134: /* direct_abstract_declarator: direct_abstract_declarator array_indicator */
2741#line 833 "cp-name-parser.y"
2742 { (yyval.abstract).fn.comp = NULL; (yyval.abstract).fn.last = NULL; (yyval.abstract).fold_flag = 0;
2743 if ((yyvsp[-1].abstract).fn.comp) { (yyval.abstract).last = (yyvsp[-1].abstract).fn.last; *(yyvsp[-1].abstract).last = (yyvsp[-1].abstract).fn.comp; }
2744 *(yyvsp[-1].abstract).last = (yyvsp[0].comp);
2745 (yyval.abstract).last = &d_right ((yyvsp[0].comp));
2746 }
2747#line 2749 "cp-name-parser.c.tmp"
2748 break;
2749
2750 case 135: /* direct_abstract_declarator: array_indicator */
2751#line 839 "cp-name-parser.y"
2752 { (yyval.abstract).fn.comp = NULL; (yyval.abstract).fn.last = NULL; (yyval.abstract).fold_flag = 0;
2753 (yyval.abstract).comp = (yyvsp[0].comp);
2754 (yyval.abstract).last = &d_right ((yyvsp[0].comp));
2755 }
2756#line 2758 "cp-name-parser.c.tmp"
2757 break;
2758
2759 case 136: /* abstract_declarator_fn: ptr_operator */
2760#line 857 "cp-name-parser.y"
2761 { (yyval.abstract).comp = (yyvsp[0].nested).comp; (yyval.abstract).last = (yyvsp[0].nested).last;
2762 (yyval.abstract).fn.comp = NULL; (yyval.abstract).fn.last = NULL; (yyval.abstract).start = NULL; }
2763#line 2765 "cp-name-parser.c.tmp"
2764 break;
2765
2766 case 137: /* abstract_declarator_fn: ptr_operator abstract_declarator_fn */
2767#line 860 "cp-name-parser.y"
2768 { (yyval.abstract) = (yyvsp[0].abstract);
2769 if ((yyvsp[0].abstract).last)
2770 *(yyval.abstract).last = (yyvsp[-1].nested).comp;
2771 else
2772 (yyval.abstract).comp = (yyvsp[-1].nested).comp;
2773 (yyval.abstract).last = (yyvsp[-1].nested).last;
2774 }
2775#line 2777 "cp-name-parser.c.tmp"
2776 break;
2777
2778 case 138: /* abstract_declarator_fn: direct_abstract_declarator */
2779#line 868 "cp-name-parser.y"
2780 { (yyval.abstract).comp = (yyvsp[0].abstract).comp; (yyval.abstract).last = (yyvsp[0].abstract).last; (yyval.abstract).fn = (yyvsp[0].abstract).fn; (yyval.abstract).start = NULL; }
2781#line 2783 "cp-name-parser.c.tmp"
2782 break;
2783
2784 case 139: /* abstract_declarator_fn: direct_abstract_declarator function_arglist COLONCOLON start */
2785#line 870 "cp-name-parser.y"
2786 { (yyval.abstract).start = (yyvsp[0].comp);
2787 if ((yyvsp[-3].abstract).fn.comp) { (yyval.abstract).last = (yyvsp[-3].abstract).fn.last; *(yyvsp[-3].abstract).last = (yyvsp[-3].abstract).fn.comp; }
2788 if ((yyvsp[-3].abstract).fold_flag)
2789 {
2790 *(yyval.abstract).last = (yyvsp[-2].nested).comp;
2791 (yyval.abstract).last = (yyvsp[-2].nested).last;
2792 }
2793 else
2794 (yyval.abstract).fn = (yyvsp[-2].nested);
2795 }
2796#line 2798 "cp-name-parser.c.tmp"
2797 break;
2798
2799 case 140: /* abstract_declarator_fn: function_arglist start_opt */
2800#line 881 "cp-name-parser.y"
2801 { (yyval.abstract).fn = (yyvsp[-1].nested);
2802 (yyval.abstract).start = (yyvsp[0].comp);
2803 (yyval.abstract).comp = NULL; (yyval.abstract).last = NULL;
2804 }
2805#line 2807 "cp-name-parser.c.tmp"
2806 break;
2807
2808 case 142: /* type: typespec_2 abstract_declarator */
2809#line 889 "cp-name-parser.y"
2810 { (yyval.comp) = (yyvsp[0].abstract).comp;
2811 *(yyvsp[0].abstract).last = (yyvsp[-1].comp);
2812 }
2813#line 2815 "cp-name-parser.c.tmp"
2814 break;
2815
2816 case 143: /* declarator: ptr_operator declarator */
2817#line 895 "cp-name-parser.y"
2818 { (yyval.nested).comp = (yyvsp[0].nested).comp;
2819 (yyval.nested).last = (yyvsp[-1].nested).last;
2820 *(yyvsp[0].nested).last = (yyvsp[-1].nested).comp; }
2821#line 2823 "cp-name-parser.c.tmp"
2822 break;
2823
2824 case 145: /* direct_declarator: '(' declarator ')' */
2825#line 903 "cp-name-parser.y"
2826 { (yyval.nested) = (yyvsp[-1].nested); }
2827#line 2829 "cp-name-parser.c.tmp"
2828 break;
2829
2830 case 146: /* direct_declarator: direct_declarator function_arglist */
2831#line 905 "cp-name-parser.y"
2832 { (yyval.nested).comp = (yyvsp[-1].nested).comp;
2833 *(yyvsp[-1].nested).last = (yyvsp[0].nested).comp;
2834 (yyval.nested).last = (yyvsp[0].nested).last;
2835 }
2836#line 2838 "cp-name-parser.c.tmp"
2837 break;
2838
2839 case 147: /* direct_declarator: direct_declarator array_indicator */
2840#line 910 "cp-name-parser.y"
2841 { (yyval.nested).comp = (yyvsp[-1].nested).comp;
2842 *(yyvsp[-1].nested).last = (yyvsp[0].comp);
2843 (yyval.nested).last = &d_right ((yyvsp[0].comp));
2844 }
2845#line 2847 "cp-name-parser.c.tmp"
2846 break;
2847
2848 case 148: /* direct_declarator: colon_ext_name */
2849#line 915 "cp-name-parser.y"
2850 { (yyval.nested).comp = state->fill_comp (DEMANGLE_COMPONENT_TYPED_NAME, (yyvsp[0].comp), NULL);
2851 (yyval.nested).last = &d_right ((yyval.nested).comp);
2852 }
2853#line 2855 "cp-name-parser.c.tmp"
2854 break;
2855
2856 case 149: /* declarator_1: ptr_operator declarator_1 */
2857#line 927 "cp-name-parser.y"
2858 { (yyval.nested).comp = (yyvsp[0].nested).comp;
2859 (yyval.nested).last = (yyvsp[-1].nested).last;
2860 *(yyvsp[0].nested).last = (yyvsp[-1].nested).comp; }
2861#line 2863 "cp-name-parser.c.tmp"
2862 break;
2863
2864 case 150: /* declarator_1: colon_ext_name */
2865#line 931 "cp-name-parser.y"
2866 { (yyval.nested).comp = state->fill_comp (DEMANGLE_COMPONENT_TYPED_NAME, (yyvsp[0].comp), NULL);
2867 (yyval.nested).last = &d_right ((yyval.nested).comp);
2868 }
2869#line 2871 "cp-name-parser.c.tmp"
2870 break;
2871
2872 case 152: /* declarator_1: colon_ext_name function_arglist COLONCOLON start */
2873#line 943 "cp-name-parser.y"
2874 { (yyval.nested).comp = state->fill_comp (DEMANGLE_COMPONENT_TYPED_NAME, (yyvsp[-3].comp), (yyvsp[-2].nested).comp);
2875 (yyval.nested).last = (yyvsp[-2].nested).last;
2876 (yyval.nested).comp = state->fill_comp (DEMANGLE_COMPONENT_LOCAL_NAME, (yyval.nested).comp, (yyvsp[0].comp));
2877 }
2878#line 2880 "cp-name-parser.c.tmp"
2879 break;
2880
2881 case 153: /* declarator_1: direct_declarator_1 function_arglist COLONCOLON start */
2882#line 948 "cp-name-parser.y"
2883 { (yyval.nested).comp = (yyvsp[-3].nested).comp;
2884 *(yyvsp[-3].nested).last = (yyvsp[-2].nested).comp;
2885 (yyval.nested).last = (yyvsp[-2].nested).last;
2886 (yyval.nested).comp = state->fill_comp (DEMANGLE_COMPONENT_LOCAL_NAME, (yyval.nested).comp, (yyvsp[0].comp));
2887 }
2888#line 2890 "cp-name-parser.c.tmp"
2889 break;
2890
2891 case 154: /* direct_declarator_1: '(' ptr_operator declarator ')' */
2892#line 957 "cp-name-parser.y"
2893 { (yyval.nested).comp = (yyvsp[-1].nested).comp;
2894 (yyval.nested).last = (yyvsp[-2].nested).last;
2895 *(yyvsp[-1].nested).last = (yyvsp[-2].nested).comp; }
2896#line 2898 "cp-name-parser.c.tmp"
2897 break;
2898
2899 case 155: /* direct_declarator_1: direct_declarator_1 function_arglist */
2900#line 961 "cp-name-parser.y"
2901 { (yyval.nested).comp = (yyvsp[-1].nested).comp;
2902 *(yyvsp[-1].nested).last = (yyvsp[0].nested).comp;
2903 (yyval.nested).last = (yyvsp[0].nested).last;
2904 }
2905#line 2907 "cp-name-parser.c.tmp"
2906 break;
2907
2908 case 156: /* direct_declarator_1: direct_declarator_1 array_indicator */
2909#line 966 "cp-name-parser.y"
2910 { (yyval.nested).comp = (yyvsp[-1].nested).comp;
2911 *(yyvsp[-1].nested).last = (yyvsp[0].comp);
2912 (yyval.nested).last = &d_right ((yyvsp[0].comp));
2913 }
2914#line 2916 "cp-name-parser.c.tmp"
2915 break;
2916
2917 case 157: /* direct_declarator_1: colon_ext_name function_arglist */
2918#line 971 "cp-name-parser.y"
2919 { (yyval.nested).comp = state->fill_comp (DEMANGLE_COMPONENT_TYPED_NAME, (yyvsp[-1].comp), (yyvsp[0].nested).comp);
2920 (yyval.nested).last = (yyvsp[0].nested).last;
2921 }
2922#line 2924 "cp-name-parser.c.tmp"
2923 break;
2924
2925 case 158: /* direct_declarator_1: colon_ext_name array_indicator */
2926#line 975 "cp-name-parser.y"
2927 { (yyval.nested).comp = state->fill_comp (DEMANGLE_COMPONENT_TYPED_NAME, (yyvsp[-1].comp), (yyvsp[0].comp));
2928 (yyval.nested).last = &d_right ((yyvsp[0].comp));
2929 }
2930#line 2932 "cp-name-parser.c.tmp"
2931 break;
2932
2933 case 159: /* exp: '(' exp1 ')' */
2934#line 981 "cp-name-parser.y"
2935 { (yyval.comp) = (yyvsp[-1].comp); }
2936#line 2938 "cp-name-parser.c.tmp"
2937 break;
2938
2939 case 161: /* exp1: exp '>' exp */
2940#line 990 "cp-name-parser.y"
2941 { (yyval.comp) = state->d_binary (">", (yyvsp[-2].comp), (yyvsp[0].comp)); }
2942#line 2944 "cp-name-parser.c.tmp"
2943 break;
2944
2945 case 162: /* exp1: '&' start */
2946#line 997 "cp-name-parser.y"
2947 { (yyval.comp) = state->fill_comp (DEMANGLE_COMPONENT_UNARY, state->make_operator ("&", 1), (yyvsp[0].comp)); }
2948#line 2950 "cp-name-parser.c.tmp"
2949 break;
2950
2951 case 163: /* exp1: '&' '(' start ')' */
2952#line 999 "cp-name-parser.y"
2953 { (yyval.comp) = state->fill_comp (DEMANGLE_COMPONENT_UNARY, state->make_operator ("&", 1), (yyvsp[-1].comp)); }
2954#line 2956 "cp-name-parser.c.tmp"
2955 break;
2956
2957 case 164: /* exp: '-' exp */
2958#line 1004 "cp-name-parser.y"
2959 { (yyval.comp) = state->d_unary ("-", (yyvsp[0].comp)); }
2960#line 2962 "cp-name-parser.c.tmp"
2961 break;
2962
2963 case 165: /* exp: '!' exp */
2964#line 1008 "cp-name-parser.y"
2965 { (yyval.comp) = state->d_unary ("!", (yyvsp[0].comp)); }
2966#line 2968 "cp-name-parser.c.tmp"
2967 break;
2968
2969 case 166: /* exp: '~' exp */
2970#line 1012 "cp-name-parser.y"
2971 { (yyval.comp) = state->d_unary ("~", (yyvsp[0].comp)); }
2972#line 2974 "cp-name-parser.c.tmp"
2973 break;
2974
2975 case 167: /* exp: '(' type ')' exp */
2976#line 1019 "cp-name-parser.y"
2977 { if ((yyvsp[0].comp)->type == DEMANGLE_COMPONENT_LITERAL
2978 || (yyvsp[0].comp)->type == DEMANGLE_COMPONENT_LITERAL_NEG)
2979 {
2980 (yyval.comp) = (yyvsp[0].comp);
2981 d_left ((yyvsp[0].comp)) = (yyvsp[-2].comp);
2982 }
2983 else
2984 (yyval.comp) = state->fill_comp (DEMANGLE_COMPONENT_UNARY,
2985 state->fill_comp (DEMANGLE_COMPONENT_CAST, (yyvsp[-2].comp), NULL),
2986 (yyvsp[0].comp));
2987 }
2988#line 2990 "cp-name-parser.c.tmp"
2989 break;
2990
2991 case 168: /* exp: STATIC_CAST '<' type '>' '(' exp1 ')' */
2992#line 1035 "cp-name-parser.y"
2993 { (yyval.comp) = state->fill_comp (DEMANGLE_COMPONENT_UNARY,
2994 state->fill_comp (DEMANGLE_COMPONENT_CAST, (yyvsp[-4].comp), NULL),
2995 (yyvsp[-1].comp));
2996 }
2997#line 2999 "cp-name-parser.c.tmp"
2998 break;
2999
3000 case 169: /* exp: DYNAMIC_CAST '<' type '>' '(' exp1 ')' */
3001#line 1042 "cp-name-parser.y"
3002 { (yyval.comp) = state->fill_comp (DEMANGLE_COMPONENT_UNARY,
3003 state->fill_comp (DEMANGLE_COMPONENT_CAST, (yyvsp[-4].comp), NULL),
3004 (yyvsp[-1].comp));
3005 }
3006#line 3008 "cp-name-parser.c.tmp"
3007 break;
3008
3009 case 170: /* exp: REINTERPRET_CAST '<' type '>' '(' exp1 ')' */
3010#line 1049 "cp-name-parser.y"
3011 { (yyval.comp) = state->fill_comp (DEMANGLE_COMPONENT_UNARY,
3012 state->fill_comp (DEMANGLE_COMPONENT_CAST, (yyvsp[-4].comp), NULL),
3013 (yyvsp[-1].comp));
3014 }
3015#line 3017 "cp-name-parser.c.tmp"
3016 break;
3017
3018 case 171: /* exp: exp '*' exp */
3019#line 1068 "cp-name-parser.y"
3020 { (yyval.comp) = state->d_binary ("*", (yyvsp[-2].comp), (yyvsp[0].comp)); }
3021#line 3023 "cp-name-parser.c.tmp"
3022 break;
3023
3024 case 172: /* exp: exp '/' exp */
3025#line 1072 "cp-name-parser.y"
3026 { (yyval.comp) = state->d_binary ("/", (yyvsp[-2].comp), (yyvsp[0].comp)); }
3027#line 3029 "cp-name-parser.c.tmp"
3028 break;
3029
3030 case 173: /* exp: exp '%' exp */
3031#line 1076 "cp-name-parser.y"
3032 { (yyval.comp) = state->d_binary ("%", (yyvsp[-2].comp), (yyvsp[0].comp)); }
3033#line 3035 "cp-name-parser.c.tmp"
3034 break;
3035
3036 case 174: /* exp: exp '+' exp */
3037#line 1080 "cp-name-parser.y"
3038 { (yyval.comp) = state->d_binary ("+", (yyvsp[-2].comp), (yyvsp[0].comp)); }
3039#line 3041 "cp-name-parser.c.tmp"
3040 break;
3041
3042 case 175: /* exp: exp '-' exp */
3043#line 1084 "cp-name-parser.y"
3044 { (yyval.comp) = state->d_binary ("-", (yyvsp[-2].comp), (yyvsp[0].comp)); }
3045#line 3047 "cp-name-parser.c.tmp"
3046 break;
3047
3048 case 176: /* exp: exp LSH exp */
3049#line 1088 "cp-name-parser.y"
3050 { (yyval.comp) = state->d_binary ("<<", (yyvsp[-2].comp), (yyvsp[0].comp)); }
3051#line 3053 "cp-name-parser.c.tmp"
3052 break;
3053
3054 case 177: /* exp: exp RSH exp */
3055#line 1092 "cp-name-parser.y"
3056 { (yyval.comp) = state->d_binary (">>", (yyvsp[-2].comp), (yyvsp[0].comp)); }
3057#line 3059 "cp-name-parser.c.tmp"
3058 break;
3059
3060 case 178: /* exp: exp EQUAL exp */
3061#line 1096 "cp-name-parser.y"
3062 { (yyval.comp) = state->d_binary ("==", (yyvsp[-2].comp), (yyvsp[0].comp)); }
3063#line 3065 "cp-name-parser.c.tmp"
3064 break;
3065
3066 case 179: /* exp: exp NOTEQUAL exp */
3067#line 1100 "cp-name-parser.y"
3068 { (yyval.comp) = state->d_binary ("!=", (yyvsp[-2].comp), (yyvsp[0].comp)); }
3069#line 3071 "cp-name-parser.c.tmp"
3070 break;
3071
3072 case 180: /* exp: exp LEQ exp */
3073#line 1104 "cp-name-parser.y"
3074 { (yyval.comp) = state->d_binary ("<=", (yyvsp[-2].comp), (yyvsp[0].comp)); }
3075#line 3077 "cp-name-parser.c.tmp"
3076 break;
3077
3078 case 181: /* exp: exp GEQ exp */
3079#line 1108 "cp-name-parser.y"
3080 { (yyval.comp) = state->d_binary (">=", (yyvsp[-2].comp), (yyvsp[0].comp)); }
3081#line 3083 "cp-name-parser.c.tmp"
3082 break;
3083
3084 case 182: /* exp: exp '<' exp */
3085#line 1112 "cp-name-parser.y"
3086 { (yyval.comp) = state->d_binary ("<", (yyvsp[-2].comp), (yyvsp[0].comp)); }
3087#line 3089 "cp-name-parser.c.tmp"
3088 break;
3089
3090 case 183: /* exp: exp '&' exp */
3091#line 1116 "cp-name-parser.y"
3092 { (yyval.comp) = state->d_binary ("&", (yyvsp[-2].comp), (yyvsp[0].comp)); }
3093#line 3095 "cp-name-parser.c.tmp"
3094 break;
3095
3096 case 184: /* exp: exp '^' exp */
3097#line 1120 "cp-name-parser.y"
3098 { (yyval.comp) = state->d_binary ("^", (yyvsp[-2].comp), (yyvsp[0].comp)); }
3099#line 3101 "cp-name-parser.c.tmp"
3100 break;
3101
3102 case 185: /* exp: exp '|' exp */
3103#line 1124 "cp-name-parser.y"
3104 { (yyval.comp) = state->d_binary ("|", (yyvsp[-2].comp), (yyvsp[0].comp)); }
3105#line 3107 "cp-name-parser.c.tmp"
3106 break;
3107
3108 case 186: /* exp: exp ANDAND exp */
3109#line 1128 "cp-name-parser.y"
3110 { (yyval.comp) = state->d_binary ("&&", (yyvsp[-2].comp), (yyvsp[0].comp)); }
3111#line 3113 "cp-name-parser.c.tmp"
3112 break;
3113
3114 case 187: /* exp: exp OROR exp */
3115#line 1132 "cp-name-parser.y"
3116 { (yyval.comp) = state->d_binary ("||", (yyvsp[-2].comp), (yyvsp[0].comp)); }
3117#line 3119 "cp-name-parser.c.tmp"
3118 break;
3119
3120 case 188: /* exp: exp ARROW NAME */
3121#line 1137 "cp-name-parser.y"
3122 { (yyval.comp) = state->d_binary ("->", (yyvsp[-2].comp), (yyvsp[0].comp)); }
3123#line 3125 "cp-name-parser.c.tmp"
3124 break;
3125
3126 case 189: /* exp: exp '.' NAME */
3127#line 1141 "cp-name-parser.y"
3128 { (yyval.comp) = state->d_binary (".", (yyvsp[-2].comp), (yyvsp[0].comp)); }
3129#line 3131 "cp-name-parser.c.tmp"
3130 break;
3131
3132 case 190: /* exp: exp '?' exp ':' exp */
3133#line 1145 "cp-name-parser.y"
3134 { (yyval.comp) = state->fill_comp (DEMANGLE_COMPONENT_TRINARY, state->make_operator ("?", 3),
3135 state->fill_comp (DEMANGLE_COMPONENT_TRINARY_ARG1, (yyvsp[-4].comp),
3136 state->fill_comp (DEMANGLE_COMPONENT_TRINARY_ARG2, (yyvsp[-2].comp), (yyvsp[0].comp))));
3137 }
3138#line 3140 "cp-name-parser.c.tmp"
3139 break;
3140
3141 case 193: /* exp: SIZEOF '(' type ')' */
3142#line 1159 "cp-name-parser.y"
3143 {
3144 /* Match the whitespacing of cplus_demangle_operators.
3145 It would abort on unrecognized string otherwise. */
3146 (yyval.comp) = state->d_unary ("sizeof ", (yyvsp[-1].comp));
3147 }
3148#line 3150 "cp-name-parser.c.tmp"
3149 break;
3150
3151 case 194: /* exp: TRUEKEYWORD */
3152#line 1168 "cp-name-parser.y"
3153 { struct demangle_component *i;
3154 i = state->make_name ("1", 1);
3155 (yyval.comp) = state->fill_comp (DEMANGLE_COMPONENT_LITERAL,
3156 state->make_builtin_type ( "bool"),
3157 i);
3158 }
3159#line 3161 "cp-name-parser.c.tmp"
3160 break;
3161
3162 case 195: /* exp: FALSEKEYWORD */
3163#line 1177 "cp-name-parser.y"
3164 { struct demangle_component *i;
3165 i = state->make_name ("0", 1);
3166 (yyval.comp) = state->fill_comp (DEMANGLE_COMPONENT_LITERAL,
3167 state->make_builtin_type ("bool"),
3168 i);
3169 }
3170#line 3172 "cp-name-parser.c.tmp"
3171 break;
3172
3173
3174#line 3176 "cp-name-parser.c.tmp"
3175
3176 default: break;
3177 }
3178 /* User semantic actions sometimes alter yychar, and that requires
3179 that yytoken be updated with the new translation. We take the
3180 approach of translating immediately before every use of yytoken.
3181 One alternative is translating here after every semantic action,
3182 but that translation would be missed if the semantic action invokes
3183 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
3184 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
3185 incorrect destructor might then be invoked immediately. In the
3186 case of YYERROR or YYBACKUP, subsequent parser actions might lead
3187 to an incorrect destructor call or verbose syntax error message
3188 before the lookahead is translated. */
3189 YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (cp_name_parser_yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
3190
3191 YYPOPSTACK (yylen);
3192 yylen = 0;
3193
3194 *++yyvsp = yyval;
3195
3196 /* Now 'shift' the result of the reduction. Determine what state
3197 that goes to, based on the state we popped back to and the rule
3198 number reduced by. */
3199 {
3200 const int yylhs = yyr1[yyn] - YYNTOKENS;
3201 const int yyi = yypgoto[yylhs] + *yyssp;
3202 yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
3203 ? yytable[yyi]
3204 : yydefgoto[yylhs]);
3205 }
3206
3207 goto yynewstate;
3208
3209
3210/*--------------------------------------.
3211| yyerrlab -- here on detecting error. |
3212`--------------------------------------*/
3213yyerrlab:
3214 /* Make sure we have latest lookahead translation. See comments at
3215 user semantic actions for why this is necessary. */
3217 /* If not already recovering from an error, report this error. */
3218 if (!yyerrstatus)
3219 {
3220 ++yynerrs;
3221 yyerror (state, YY_("syntax error"));
3222 }
3223
3224 if (yyerrstatus == 3)
3225 {
3226 /* If just tried and failed to reuse lookahead token after an
3227 error, discard it. */
3228
3229 if (yychar <= YYEOF)
3230 {
3231 /* Return failure if at end of input. */
3232 if (yychar == YYEOF)
3233 YYABORT;
3234 }
3235 else
3236 {
3237 yydestruct ("Error: discarding",
3238 yytoken, &yylval, state);
3239 yychar = YYEMPTY;
3240 }
3241 }
3242
3243 /* Else will try to reuse lookahead token after shifting the error
3244 token. */
3245 goto yyerrlab1;
3246
3247
3248/*---------------------------------------------------.
3249| yyerrorlab -- error raised explicitly by YYERROR. |
3250`---------------------------------------------------*/
3251yyerrorlab:
3252 /* Pacify compilers when the user code never invokes YYERROR and the
3253 label yyerrorlab therefore never appears in user code. */
3254 if (0)
3255 YYERROR;
3256 ++yynerrs;
3257
3258 /* Do not reclaim the symbols of the rule whose action triggered
3259 this YYERROR. */
3260 YYPOPSTACK (yylen);
3261 yylen = 0;
3263 yystate = *yyssp;
3264 goto yyerrlab1;
3265
3266
3267/*-------------------------------------------------------------.
3268| yyerrlab1 -- common code for both syntax error and YYERROR. |
3269`-------------------------------------------------------------*/
3270yyerrlab1:
3271 yyerrstatus = 3; /* Each real token shifted decrements this. */
3272
3273 /* Pop stack until we find a state that shifts the error token. */
3274 for (;;)
3275 {
3276 yyn = yypact[yystate];
3277 if (!yypact_value_is_default (yyn))
3278 {
3279 yyn += YYSYMBOL_YYerror;
3280 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
3281 {
3282 yyn = yytable[yyn];
3283 if (0 < yyn)
3284 break;
3285 }
3286 }
3287
3288 /* Pop the current state because it cannot handle the error token. */
3289 if (yyssp == yyss)
3290 YYABORT;
3291
3292
3293 yydestruct ("Error: popping",
3295 YYPOPSTACK (1);
3296 yystate = *yyssp;
3298 }
3299
3301 *++yyvsp = yylval;
3303
3304
3305 /* Shift the error token. */
3306 YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
3307
3308 yystate = yyn;
3309 goto yynewstate;
3310
3311
3312/*-------------------------------------.
3313| yyacceptlab -- YYACCEPT comes here. |
3314`-------------------------------------*/
3315yyacceptlab:
3316 yyresult = 0;
3317 goto yyreturnlab;
3318
3319
3320/*-----------------------------------.
3321| yyabortlab -- YYABORT comes here. |
3322`-----------------------------------*/
3323yyabortlab:
3324 yyresult = 1;
3325 goto yyreturnlab;
3326
3327
3328/*-----------------------------------------------------------.
3329| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. |
3330`-----------------------------------------------------------*/
3331yyexhaustedlab:
3332 yyerror (state, YY_("memory exhausted"));
3333 yyresult = 2;
3334 goto yyreturnlab;
3335
3336
3337/*----------------------------------------------------------.
3338| yyreturnlab -- parsing is finished, clean up and return. |
3339`----------------------------------------------------------*/
3340yyreturnlab:
3341 if (yychar != YYEMPTY)
3342 {
3343 /* Make sure we have latest lookahead translation. See comments at
3344 user semantic actions for why this is necessary. */
3345 yytoken = YYTRANSLATE (yychar);
3346 yydestruct ("Cleanup: discarding lookahead",
3347 yytoken, &yylval, state);
3348 }
3349 /* Do not reclaim the symbols of the rule whose action triggered
3350 this YYABORT or YYACCEPT. */
3351 YYPOPSTACK (yylen);
3353 while (yyssp != yyss)
3354 {
3355 yydestruct ("Cleanup: popping",
3356 YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, state);
3357 YYPOPSTACK (1);
3358 }
3359#ifndef yyoverflow
3360 if (yyss != yyssa)
3362#endif
3363
3364 return yyresult;
3365}
3366
3367#line 1187 "cp-name-parser.y"
3368
3369
3370/* Apply QUALIFIERS to LHS and return a qualified component. IS_METHOD
3371 is set if LHS is a method, in which case the qualifiers are logically
3372 applied to "this". We apply qualifiers in a consistent order; LHS
3373 may already be qualified; duplicate qualifiers are not created. */
3374
3375struct demangle_component *
3376cpname_state::d_qualify (struct demangle_component *lhs, int qualifiers,
3377 int is_method)
3378{
3379 struct demangle_component **inner_p;
3380 enum demangle_component_type type;
3381
3382 /* For now the order is CONST (innermost), VOLATILE, RESTRICT. */
3383
3384#define HANDLE_QUAL(TYPE, MTYPE, QUAL) \
3385 if ((qualifiers & QUAL) && (type != TYPE) && (type != MTYPE)) \
3386 { \
3387 *inner_p = fill_comp (is_method ? MTYPE : TYPE, \
3388 *inner_p, NULL); \
3389 inner_p = &d_left (*inner_p); \
3390 type = (*inner_p)->type; \
3391 } \
3392 else if (type == TYPE || type == MTYPE) \
3393 { \
3394 inner_p = &d_left (*inner_p); \
3395 type = (*inner_p)->type; \
3396 }
3397
3398 inner_p = &lhs;
3399
3400 type = (*inner_p)->type;
3401
3402 HANDLE_QUAL (DEMANGLE_COMPONENT_RESTRICT, DEMANGLE_COMPONENT_RESTRICT_THIS, QUAL_RESTRICT);
3403 HANDLE_QUAL (DEMANGLE_COMPONENT_VOLATILE, DEMANGLE_COMPONENT_VOLATILE_THIS, QUAL_VOLATILE);
3404 HANDLE_QUAL (DEMANGLE_COMPONENT_CONST, DEMANGLE_COMPONENT_CONST_THIS, QUAL_CONST);
3405
3406 return lhs;
3407}
3408
3409/* Return a builtin type corresponding to FLAGS. */
3410
3411struct demangle_component *
3413{
3414 const char *name;
3415
3416 switch (flags)
3417 {
3418 case INT_SIGNED | INT_CHAR:
3419 name = "signed char";
3420 break;
3421 case INT_CHAR:
3422 name = "char";
3423 break;
3424 case INT_UNSIGNED | INT_CHAR:
3425 name = "unsigned char";
3426 break;
3427 case 0:
3428 case INT_SIGNED:
3429 name = "int";
3430 break;
3431 case INT_UNSIGNED:
3432 name = "unsigned int";
3433 break;
3434 case INT_LONG:
3435 case INT_SIGNED | INT_LONG:
3436 name = "long";
3437 break;
3438 case INT_UNSIGNED | INT_LONG:
3439 name = "unsigned long";
3440 break;
3441 case INT_SHORT:
3442 case INT_SIGNED | INT_SHORT:
3443 name = "short";
3444 break;
3445 case INT_UNSIGNED | INT_SHORT:
3446 name = "unsigned short";
3447 break;
3448 case INT_LLONG | INT_LONG:
3449 case INT_SIGNED | INT_LLONG | INT_LONG:
3450 name = "long long";
3451 break;
3453 name = "unsigned long long";
3454 break;
3455 default:
3456 return NULL;
3457 }
3458
3459 return make_builtin_type (name);
3460}
3461
3462/* Wrapper to create a unary operation. */
3463
3464struct demangle_component *
3465cpname_state::d_unary (const char *name, struct demangle_component *lhs)
3466{
3467 return fill_comp (DEMANGLE_COMPONENT_UNARY, make_operator (name, 1), lhs);
3468}
3469
3470/* Wrapper to create a binary operation. */
3471
3472struct demangle_component *
3473cpname_state::d_binary (const char *name, struct demangle_component *lhs,
3474 struct demangle_component *rhs)
3475{
3476 return fill_comp (DEMANGLE_COMPONENT_BINARY, make_operator (name, 2),
3477 fill_comp (DEMANGLE_COMPONENT_BINARY_ARGS, lhs, rhs));
3478}
3479
3480/* Find the end of a symbol name starting at LEXPTR. */
3481
3482static const char *
3483symbol_end (const char *lexptr)
3484{
3485 const char *p = lexptr;
3486
3487 while (*p && (c_ident_is_alnum (*p) || *p == '_' || *p == '$' || *p == '.'))
3488 p++;
3489
3490 return p;
3491}
3492
3493/* Take care of parsing a number (anything that starts with a digit).
3494 The number starts at P and contains LEN characters. Store the result in
3495 YYLVAL. */
3496
3497int
3498cpname_state::parse_number (const char *p, int len, int parsed_float,
3500{
3501 int unsigned_p = 0;
3502
3503 /* Number of "L" suffixes encountered. */
3504 int long_p = 0;
3505
3506 struct demangle_component *signed_type;
3507 struct demangle_component *unsigned_type;
3508 struct demangle_component *type, *name;
3509 enum demangle_component_type literal_type;
3510
3511 if (p[0] == '-')
3512 {
3513 literal_type = DEMANGLE_COMPONENT_LITERAL_NEG;
3514 p++;
3515 len--;
3516 }
3517 else
3518 literal_type = DEMANGLE_COMPONENT_LITERAL;
3519
3520 if (parsed_float)
3521 {
3522 /* It's a float since it contains a point or an exponent. */
3523 char c;
3524
3525 /* The GDB lexer checks the result of scanf at this point. Not doing
3526 this leaves our error checking slightly weaker but only for invalid
3527 data. */
3528
3529 /* See if it has `f' or `l' suffix (float or long double). */
3530
3531 c = TOLOWER (p[len - 1]);
3532
3533 if (c == 'f')
3534 {
3535 len--;
3536 type = make_builtin_type ("float");
3537 }
3538 else if (c == 'l')
3539 {
3540 len--;
3541 type = make_builtin_type ("long double");
3542 }
3543 else if (ISDIGIT (c) || c == '.')
3544 type = make_builtin_type ("double");
3545 else
3546 return ERROR;
3547
3548 name = make_name (p, len);
3549 lvalp->comp = fill_comp (literal_type, type, name);
3550
3551 return FLOAT;
3552 }
3553
3554 /* This treats 0x1 and 1 as different literals. We also do not
3555 automatically generate unsigned types. */
3556
3557 long_p = 0;
3558 unsigned_p = 0;
3559 while (len > 0)
3560 {
3561 if (p[len - 1] == 'l' || p[len - 1] == 'L')
3562 {
3563 len--;
3564 long_p++;
3565 continue;
3566 }
3567 if (p[len - 1] == 'u' || p[len - 1] == 'U')
3568 {
3569 len--;
3570 unsigned_p++;
3571 continue;
3572 }
3573 break;
3574 }
3575
3576 if (long_p == 0)
3577 {
3578 unsigned_type = make_builtin_type ("unsigned int");
3579 signed_type = make_builtin_type ("int");
3580 }
3581 else if (long_p == 1)
3582 {
3583 unsigned_type = make_builtin_type ("unsigned long");
3584 signed_type = make_builtin_type ("long");
3585 }
3586 else
3587 {
3588 unsigned_type = make_builtin_type ("unsigned long long");
3589 signed_type = make_builtin_type ("long long");
3590 }
3591
3592 if (unsigned_p)
3593 type = unsigned_type;
3594 else
3595 type = signed_type;
3596
3597 name = make_name (p, len);
3598 lvalp->comp = fill_comp (literal_type, type, name);
3599
3600 return INT;
3601}
3602
3603static const char backslashable[] = "abefnrtv";
3604static const char represented[] = "\a\b\e\f\n\r\t\v";
3605
3606/* Translate the backslash the way we would in the host character set. */
3607static int
3608c_parse_backslash (int host_char, int *target_char)
3609{
3610 const char *ix;
3611 ix = strchr (backslashable, host_char);
3612 if (! ix)
3613 return 0;
3614 else
3615 *target_char = represented[ix - backslashable];
3616 return 1;
3617}
3618
3619/* Parse a C escape sequence. STRING_PTR points to a variable
3620 containing a pointer to the string to parse. That pointer
3621 should point to the character after the \. That pointer
3622 is updated past the characters we use. The value of the
3623 escape sequence is returned.
3624
3625 A negative value means the sequence \ newline was seen,
3626 which is supposed to be equivalent to nothing at all.
3627
3628 If \ is followed by a null character, we return a negative
3629 value and leave the string pointer pointing at the null character.
3630
3631 If \ is followed by 000, we return 0 and leave the string pointer
3632 after the zeros. A value of 0 does not mean end of string. */
3633
3634static int
3635cp_parse_escape (const char **string_ptr)
3636{
3637 int target_char;
3638 int c = *(*string_ptr)++;
3639 if (c_parse_backslash (c, &target_char))
3640 return target_char;
3641 else
3642 switch (c)
3643 {
3644 case '\n':
3645 return -2;
3646 case 0:
3647 (*string_ptr)--;
3648 return 0;
3649 case '^':
3650 {
3651 c = *(*string_ptr)++;
3652
3653 if (c == '?')
3654 return 0177;
3655 else if (c == '\\')
3656 target_char = cp_parse_escape (string_ptr);
3657 else
3658 target_char = c;
3659
3660 /* Now target_char is something like `c', and we want to find
3661 its control-character equivalent. */
3662 target_char = target_char & 037;
3663
3664 return target_char;
3665 }
3666
3667 case '0':
3668 case '1':
3669 case '2':
3670 case '3':
3671 case '4':
3672 case '5':
3673 case '6':
3674 case '7':
3675 {
3676 int i = c - '0';
3677 int count = 0;
3678 while (++count < 3)
3679 {
3680 c = (**string_ptr);
3681 if (c >= '0' && c <= '7')
3682 {
3683 (*string_ptr)++;
3684 i *= 8;
3685 i += c - '0';
3686 }
3687 else
3688 {
3689 break;
3690 }
3691 }
3692 return i;
3693 }
3694 default:
3695 return c;
3696 }
3697}
3698
3699#define HANDLE_SPECIAL(string, comp) \
3700 if (startswith (tokstart, string)) \
3701 { \
3702 state->lexptr = tokstart + sizeof (string) - 1; \
3703 lvalp->lval = comp; \
3704 return DEMANGLER_SPECIAL; \
3705 }
3706
3707#define HANDLE_TOKEN2(string, token) \
3708 if (state->lexptr[1] == string[1]) \
3709 { \
3710 state->lexptr += 2; \
3711 lvalp->opname = string; \
3712 return token; \
3713 }
3714
3715#define HANDLE_TOKEN3(string, token) \
3716 if (state->lexptr[1] == string[1] && state->lexptr[2] == string[2]) \
3717 { \
3718 state->lexptr += 3; \
3719 lvalp->opname = string; \
3720 return token; \
3721 }
3722
3723/* Read one token, getting characters through LEXPTR. */
3724
3725static int
3727{
3728 int c;
3729 int namelen;
3730 const char *tokstart;
3731
3732 retry:
3733 state->prev_lexptr = state->lexptr;
3734 tokstart = state->lexptr;
3735
3736 switch (c = *tokstart)
3737 {
3738 case 0:
3739 return 0;
3740
3741 case ' ':
3742 case '\t':
3743 case '\n':
3744 state->lexptr++;
3745 goto retry;
3746
3747 case '\'':
3748 /* We either have a character constant ('0' or '\177' for example)
3749 or we have a quoted symbol reference ('foo(int,int)' in C++
3750 for example). */
3751 state->lexptr++;
3752 c = *state->lexptr++;
3753 if (c == '\\')
3754 c = cp_parse_escape (&state->lexptr);
3755 else if (c == '\'')
3756 {
3757 yyerror (state, _("empty character constant"));
3758 return ERROR;
3759 }
3760
3761 c = *state->lexptr++;
3762 if (c != '\'')
3763 {
3764 yyerror (state, _("invalid character constant"));
3765 return ERROR;
3766 }
3767
3768 /* FIXME: We should refer to a canonical form of the character,
3769 presumably the same one that appears in manglings - the decimal
3770 representation. But if that isn't in our input then we have to
3771 allocate memory for it somewhere. */
3772 lvalp->comp
3773 = state->fill_comp (DEMANGLE_COMPONENT_LITERAL,
3774 state->make_builtin_type ("char"),
3775 state->make_name (tokstart,
3776 state->lexptr - tokstart));
3777
3778 return INT;
3779
3780 case '(':
3781 if (startswith (tokstart, "(anonymous namespace)"))
3782 {
3783 state->lexptr += 21;
3784 lvalp->comp = state->make_name ("(anonymous namespace)",
3785 sizeof "(anonymous namespace)" - 1);
3786 return NAME;
3787 }
3788 /* FALL THROUGH */
3789
3790 case ')':
3791 case ',':
3792 state->lexptr++;
3793 return c;
3794
3795 case '.':
3796 if (state->lexptr[1] == '.' && state->lexptr[2] == '.')
3797 {
3798 state->lexptr += 3;
3799 return ELLIPSIS;
3800 }
3801
3802 /* Might be a floating point number. */
3803 if (state->lexptr[1] < '0' || state->lexptr[1] > '9')
3804 goto symbol; /* Nope, must be a symbol. */
3805
3806 goto try_number;
3807
3808 case '-':
3810 HANDLE_TOKEN2 ("--", DECREMENT);
3811 HANDLE_TOKEN2 ("->", ARROW);
3812
3813 /* For construction vtables. This is kind of hokey. */
3814 if (startswith (tokstart, "-in-"))
3815 {
3816 state->lexptr += 4;
3817 return CONSTRUCTION_IN;
3818 }
3819
3820 if (state->lexptr[1] < '0' || state->lexptr[1] > '9')
3821 {
3822 state->lexptr++;
3823 return '-';
3824 }
3825 /* FALL THRU. */
3826
3827 try_number:
3828 case '0':
3829 case '1':
3830 case '2':
3831 case '3':
3832 case '4':
3833 case '5':
3834 case '6':
3835 case '7':
3836 case '8':
3837 case '9':
3838 {
3839 /* It's a number. */
3840 int got_dot = 0, got_e = 0, toktype;
3841 const char *p = tokstart;
3842 int hex = 0;
3843
3844 if (c == '-')
3845 p++;
3846
3847 if (c == '0' && (p[1] == 'x' || p[1] == 'X'))
3848 {
3849 p += 2;
3850 hex = 1;
3851 }
3852 else if (c == '0' && (p[1]=='t' || p[1]=='T' || p[1]=='d' || p[1]=='D'))
3853 {
3854 p += 2;
3855 hex = 0;
3856 }
3857
3858 for (;; ++p)
3859 {
3860 /* This test includes !hex because 'e' is a valid hex digit
3861 and thus does not indicate a floating point number when
3862 the radix is hex. */
3863 if (!hex && !got_e && (*p == 'e' || *p == 'E'))
3864 got_dot = got_e = 1;
3865 /* This test does not include !hex, because a '.' always indicates
3866 a decimal floating point number regardless of the radix.
3867
3868 NOTE drow/2005-03-09: This comment is not accurate in C99;
3869 however, it's not clear that all the floating point support
3870 in this file is doing any good here. */
3871 else if (!got_dot && *p == '.')
3872 got_dot = 1;
3873 else if (got_e && (p[-1] == 'e' || p[-1] == 'E')
3874 && (*p == '-' || *p == '+'))
3875 /* This is the sign of the exponent, not the end of the
3876 number. */
3877 continue;
3878 /* We will take any letters or digits. parse_number will
3879 complain if past the radix, or if L or U are not final. */
3880 else if (! ISALNUM (*p))
3881 break;
3882 }
3883 toktype = state->parse_number (tokstart, p - tokstart, got_dot|got_e,
3884 lvalp);
3885 if (toktype == ERROR)
3886 {
3887 char *err_copy = (char *) alloca (p - tokstart + 1);
3888
3889 memcpy (err_copy, tokstart, p - tokstart);
3890 err_copy[p - tokstart] = 0;
3891 yyerror (state, _("invalid number"));
3892 return ERROR;
3893 }
3894 state->lexptr = p;
3895 return toktype;
3896 }
3897
3898 case '+':
3900 HANDLE_TOKEN2 ("++", INCREMENT);
3901 state->lexptr++;
3902 return c;
3903 case '*':
3905 state->lexptr++;
3906 return c;
3907 case '/':
3909 state->lexptr++;
3910 return c;
3911 case '%':
3913 state->lexptr++;
3914 return c;
3915 case '|':
3917 HANDLE_TOKEN2 ("||", OROR);
3918 state->lexptr++;
3919 return c;
3920 case '&':
3922 HANDLE_TOKEN2 ("&&", ANDAND);
3923 state->lexptr++;
3924 return c;
3925 case '^':
3927 state->lexptr++;
3928 return c;
3929 case '!':
3930 HANDLE_TOKEN2 ("!=", NOTEQUAL);
3931 state->lexptr++;
3932 return c;
3933 case '<':
3935 HANDLE_TOKEN2 ("<=", LEQ);
3936 HANDLE_TOKEN2 ("<<", LSH);
3937 state->lexptr++;
3938 return c;
3939 case '>':
3941 HANDLE_TOKEN2 (">=", GEQ);
3942 HANDLE_TOKEN2 (">>", RSH);
3943 state->lexptr++;
3944 return c;
3945 case '=':
3946 HANDLE_TOKEN2 ("==", EQUAL);
3947 state->lexptr++;
3948 return c;
3949 case ':':
3950 HANDLE_TOKEN2 ("::", COLONCOLON);
3951 state->lexptr++;
3952 return c;
3953
3954 case '[':
3955 case ']':
3956 case '?':
3957 case '@':
3958 case '~':
3959 case '{':
3960 case '}':
3961 symbol:
3962 state->lexptr++;
3963 return c;
3964
3965 case '"':
3966 /* These can't occur in C++ names. */
3967 yyerror (state, _("unexpected string literal"));
3968 return ERROR;
3969 }
3970
3971 if (!(c == '_' || c == '$' || c_ident_is_alpha (c)))
3972 {
3973 /* We must have come across a bad character (e.g. ';'). */
3974 yyerror (state, _("invalid character"));
3975 return ERROR;
3976 }
3977
3978 /* It's a name. See how long it is. */
3979 namelen = 0;
3980 do
3981 c = tokstart[++namelen];
3982 while (c_ident_is_alnum (c) || c == '_' || c == '$');
3983
3984 state->lexptr += namelen;
3985
3986 /* Catch specific keywords. Notice that some of the keywords contain
3987 spaces, and are sorted by the length of the first word. They must
3988 all include a trailing space in the string comparison. */
3989 switch (namelen)
3990 {
3991 case 16:
3992 if (startswith (tokstart, "reinterpret_cast"))
3993 return REINTERPRET_CAST;
3994 break;
3995 case 12:
3996 if (startswith (tokstart, "construction vtable for "))
3997 {
3998 state->lexptr = tokstart + 24;
3999 return CONSTRUCTION_VTABLE;
4000 }
4001 if (startswith (tokstart, "dynamic_cast"))
4002 return DYNAMIC_CAST;
4003 break;
4004 case 11:
4005 if (startswith (tokstart, "static_cast"))
4006 return STATIC_CAST;
4007 break;
4008 case 9:
4009 HANDLE_SPECIAL ("covariant return thunk to ", DEMANGLE_COMPONENT_COVARIANT_THUNK);
4010 HANDLE_SPECIAL ("reference temporary for ", DEMANGLE_COMPONENT_REFTEMP);
4011 break;
4012 case 8:
4013 HANDLE_SPECIAL ("typeinfo for ", DEMANGLE_COMPONENT_TYPEINFO);
4014 HANDLE_SPECIAL ("typeinfo fn for ", DEMANGLE_COMPONENT_TYPEINFO_FN);
4015 HANDLE_SPECIAL ("typeinfo name for ", DEMANGLE_COMPONENT_TYPEINFO_NAME);
4016 if (startswith (tokstart, "operator"))
4017 return OPERATOR;
4018 if (startswith (tokstart, "restrict"))
4019 return RESTRICT;
4020 if (startswith (tokstart, "unsigned"))
4021 return UNSIGNED;
4022 if (startswith (tokstart, "template"))
4023 return TEMPLATE;
4024 if (startswith (tokstart, "volatile"))
4025 return VOLATILE_KEYWORD;
4026 break;
4027 case 7:
4028 HANDLE_SPECIAL ("virtual thunk to ", DEMANGLE_COMPONENT_VIRTUAL_THUNK);
4029 if (startswith (tokstart, "wchar_t"))
4030 return WCHAR_T;
4031 break;
4032 case 6:
4033 if (startswith (tokstart, "global constructors keyed to "))
4034 {
4035 const char *p;
4036 state->lexptr = tokstart + 29;
4037 lvalp->lval = DEMANGLE_COMPONENT_GLOBAL_CONSTRUCTORS;
4038 /* Find the end of the symbol. */
4039 p = symbol_end (state->lexptr);
4040 lvalp->comp = state->make_name (state->lexptr, p - state->lexptr);
4041 state->lexptr = p;
4042 return DEMANGLER_SPECIAL;
4043 }
4044 if (startswith (tokstart, "global destructors keyed to "))
4045 {
4046 const char *p;
4047 state->lexptr = tokstart + 28;
4048 lvalp->lval = DEMANGLE_COMPONENT_GLOBAL_DESTRUCTORS;
4049 /* Find the end of the symbol. */
4050 p = symbol_end (state->lexptr);
4051 lvalp->comp = state->make_name (state->lexptr, p - state->lexptr);
4052 state->lexptr = p;
4053 return DEMANGLER_SPECIAL;
4054 }
4055
4056 HANDLE_SPECIAL ("vtable for ", DEMANGLE_COMPONENT_VTABLE);
4057 if (startswith (tokstart, "delete"))
4058 return DELETE;
4059 if (startswith (tokstart, "struct"))
4060 return STRUCT;
4061 if (startswith (tokstart, "signed"))
4062 return SIGNED_KEYWORD;
4063 if (startswith (tokstart, "sizeof"))
4064 return SIZEOF;
4065 if (startswith (tokstart, "double"))
4066 return DOUBLE_KEYWORD;
4067 break;
4068 case 5:
4069 HANDLE_SPECIAL ("guard variable for ", DEMANGLE_COMPONENT_GUARD);
4070 if (startswith (tokstart, "false"))
4071 return FALSEKEYWORD;
4072 if (startswith (tokstart, "class"))
4073 return CLASS;
4074 if (startswith (tokstart, "union"))
4075 return UNION;
4076 if (startswith (tokstart, "float"))
4077 return FLOAT_KEYWORD;
4078 if (startswith (tokstart, "short"))
4079 return SHORT;
4080 if (startswith (tokstart, "const"))
4081 return CONST_KEYWORD;
4082 break;
4083 case 4:
4084 if (startswith (tokstart, "void"))
4085 return VOID;
4086 if (startswith (tokstart, "bool"))
4087 return BOOL;
4088 if (startswith (tokstart, "char"))
4089 return CHAR;
4090 if (startswith (tokstart, "enum"))
4091 return ENUM;
4092 if (startswith (tokstart, "long"))
4093 return LONG;
4094 if (startswith (tokstart, "true"))
4095 return TRUEKEYWORD;
4096 break;
4097 case 3:
4098 HANDLE_SPECIAL ("VTT for ", DEMANGLE_COMPONENT_VTT);
4099 HANDLE_SPECIAL ("non-virtual thunk to ", DEMANGLE_COMPONENT_THUNK);
4100 if (startswith (tokstart, "new"))
4101 return NEW;
4102 if (startswith (tokstart, "int"))
4103 return INT_KEYWORD;
4104 break;
4105 default:
4106 break;
4107 }
4108
4109 lvalp->comp = state->make_name (tokstart, namelen);
4110 return NAME;
4111}
4112
4113static void
4114yyerror (cpname_state *state, const char *msg)
4115{
4116 if (state->global_errmsg)
4117 return;
4118
4119 state->error_lexptr = state->prev_lexptr;
4120 state->global_errmsg = msg ? msg : "parse error";
4121}
4122
4123/* Allocate a chunk of the components we'll need to build a tree. We
4124 generally allocate too many components, but the extra memory usage
4125 doesn't hurt because the trees are temporary and the storage is
4126 reused. More may be allocated later, by d_grab. */
4127static struct demangle_info *
4129{
4130 struct demangle_info *info = XNEW (struct demangle_info);
4131
4132 info->next = NULL;
4133 info->used = 0;
4134 return info;
4135}
4136
4137/* See cp-support.h. */
4138
4139gdb::unique_xmalloc_ptr<char>
4140cp_comp_to_string (struct demangle_component *result, int estimated_len)
4141{
4142 size_t err;
4143
4144 char *res = gdb_cplus_demangle_print (DMGL_PARAMS | DMGL_ANSI,
4145 result, estimated_len, &err);
4146 return gdb::unique_xmalloc_ptr<char> (res);
4147}
4148
4149/* Constructor for demangle_parse_info. */
4150
4152: info (NULL),
4153 tree (NULL)
4154{
4155 obstack_init (&obstack);
4156}
4157
4158/* Destructor for demangle_parse_info. */
4159
4161{
4162 /* Free any allocated chunks of memory for the parse. */
4163 while (info != NULL)
4164 {
4165 struct demangle_info *next = info->next;
4166
4167 xfree (info);
4168 info = next;
4169 }
4170
4171 /* Free any memory allocated during typedef replacement. */
4172 obstack_free (&obstack, NULL);
4173}
4174
4175/* Merge the two parse trees given by DEST and SRC. The parse tree
4176 in SRC is attached to DEST at the node represented by TARGET.
4177
4178 NOTE 1: Since there is no API to merge obstacks, this function does
4179 even attempt to try it. Fortunately, we do not (yet?) need this ability.
4180 The code will assert if SRC->obstack is not empty.
4181
4182 NOTE 2: The string from which SRC was parsed must not be freed, since
4183 this function will place pointers to that string into DEST. */
4184
4185void
4187 struct demangle_component *target,
4188 struct demangle_parse_info *src)
4189
4190{
4191 struct demangle_info *di;
4192
4193 /* Copy the SRC's parse data into DEST. */
4194 *target = *src->tree;
4195 di = dest->info;
4196 while (di->next != NULL)
4197 di = di->next;
4198 di->next = src->info;
4199
4200 /* Clear the (pointer to) SRC's parse data so that it is not freed when
4201 cp_demangled_parse_info_free is called. */
4202 src->info = NULL;
4203}
4204
4205/* Convert a demangled name to a demangle_component tree. On success,
4206 a structure containing the root of the new tree is returned. On
4207 error, NULL is returned, and an error message will be set in
4208 *ERRMSG. */
4209
4210struct std::unique_ptr<demangle_parse_info>
4211cp_demangled_name_to_comp (const char *demangled_name,
4212 std::string *errmsg)
4213{
4214 cpname_state state;
4215
4216 state.prev_lexptr = state.lexptr = demangled_name;
4217 state.error_lexptr = NULL;
4218 state.global_errmsg = NULL;
4219
4220 state.demangle_info = allocate_info ();
4221
4222 auto result = gdb::make_unique<demangle_parse_info> ();
4223 result->info = state.demangle_info;
4224
4225 if (yyparse (&state))
4226 {
4227 if (state.global_errmsg && errmsg)
4228 *errmsg = state.global_errmsg;
4229 return NULL;
4230 }
4231
4232 result->tree = state.global_result;
4233
4234 return result;
4235}
4236
4237#ifdef TEST_CPNAMES
4238
4239static void
4240cp_print (struct demangle_component *result)
4241{
4242 char *str;
4243 size_t err = 0;
4244
4245 str = gdb_cplus_demangle_print (DMGL_PARAMS | DMGL_ANSI, result, 64, &err);
4246 if (str == NULL)
4247 return;
4248
4249 fputs (str, stdout);
4250
4251 xfree (str);
4252}
4253
4254static char
4255trim_chars (char *lexptr, char **extra_chars)
4256{
4257 char *p = (char *) symbol_end (lexptr);
4258 char c = 0;
4259
4260 if (*p)
4261 {
4262 c = *p;
4263 *p = 0;
4264 *extra_chars = p + 1;
4265 }
4266
4267 return c;
4268}
4269
4270/* When this file is built as a standalone program, xmalloc comes from
4271 libiberty --- in which case we have to provide xfree ourselves. */
4272
4273void
4274xfree (void *ptr)
4275{
4276 if (ptr != NULL)
4277 {
4278 /* Literal `free' would get translated back to xfree again. */
4279 CONCAT2 (fr,ee) (ptr);
4280 }
4281}
4282
4283/* GDB normally defines internal_error itself, but when this file is built
4284 as a standalone program, we must also provide an implementation. */
4285
4286void
4287internal_error (const char *file, int line, const char *fmt, ...)
4288{
4289 va_list ap;
4290
4291 va_start (ap, fmt);
4292 fprintf (stderr, "%s:%d: internal error: ", file, line);
4293 vfprintf (stderr, fmt, ap);
4294 exit (1);
4295}
4296
4297int
4298main (int argc, char **argv)
4299{
4300 char *str2, *extra_chars, c;
4301 char buf[65536];
4302 int arg;
4303
4304 arg = 1;
4305 if (argv[arg] && strcmp (argv[arg], "--debug") == 0)
4306 {
4307 yydebug = 1;
4308 arg++;
4309 }
4310
4311 if (argv[arg] == NULL)
4312 while (fgets (buf, 65536, stdin) != NULL)
4313 {
4314 buf[strlen (buf) - 1] = 0;
4315 /* Use DMGL_VERBOSE to get expanded standard substitutions. */
4316 c = trim_chars (buf, &extra_chars);
4317 str2 = cplus_demangle (buf, DMGL_PARAMS | DMGL_ANSI | DMGL_VERBOSE);
4318 if (str2 == NULL)
4319 {
4320 printf ("Demangling error\n");
4321 if (c)
4322 printf ("%s%c%s\n", buf, c, extra_chars);
4323 else
4324 printf ("%s\n", buf);
4325 continue;
4326 }
4327
4328 std::string errmsg;
4329 std::unique_ptr<demangle_parse_info> result
4330 = cp_demangled_name_to_comp (str2, &errmsg);
4331 if (result == NULL)
4332 {
4333 fputs (errmsg.c_str (), stderr);
4334 fputc ('\n', stderr);
4335 continue;
4336 }
4337
4338 cp_print (result->tree);
4339
4340 xfree (str2);
4341 if (c)
4342 {
4343 putchar (c);
4344 fputs (extra_chars, stdout);
4345 }
4346 putchar ('\n');
4347 }
4348 else
4349 {
4350 std::string errmsg;
4351 std::unique_ptr<demangle_parse_info> result
4352 = cp_demangled_name_to_comp (argv[arg], &errmsg);
4353 if (result == NULL)
4354 {
4355 fputs (errmsg.c_str (), stderr);
4356 fputc ('\n', stderr);
4357 return 0;
4358 }
4359 cp_print (result->tree);
4360 putchar ('\n');
4361 }
4362 return 0;
4363}
4364
4365#endif
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
void xfree(void *)
int main()
Definition 1.cc:63
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
struct std::unique_ptr< demangle_parse_info > cp_demangled_name_to_comp(const char *demangled_name, std::string *errmsg)
#define UNSIGNED
#define LEQ
#define TRUEKEYWORD
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
#define YYMAXDEPTH
#define HANDLE_TOKEN3(string, token)
#define NOTEQUAL
static int c_parse_backslash(int host_char, int *target_char)
#define QUAL_RESTRICT
#define QUAL_CONST
#define YYSTACK_FREE
static const yytype_int8 yytranslate[]
static const char represented[]
#define EQUAL
#define YY_ASSERT(E)
#define YY_(Msgid)
#define RSH
#define INT_SIGNED
#define REINTERPRET_CAST
#define YYNOMEM
#define HANDLE_SPECIAL(string, comp)
#define SIZEOF
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
#define YYNSTATES
static const char * symbol_end(const char *lexptr)
#define YY_IGNORE_USELESS_CAST_END
short yytype_int16
#define FALSEKEYWORD
#define CHAR
#define ENUM
void * xmalloc(YYSIZE_T)
#define INT_CHAR
#define YYEOF
#define YYABORT
#define WCHAR_T
#define VOLATILE_KEYWORD
#define ELLIPSIS
static const yytype_int16 yyrline[]
#define d_right(dc)
#define YYSTACK_BYTES(N)
cp_name_parser_yysymbol_kind_t
@ YYSYMBOL_74_
@ YYSYMBOL_exp1
@ YYSYMBOL_68_
@ YYSYMBOL_qualifiers_opt
@ YYSYMBOL_CONSTRUCTION_IN
@ YYSYMBOL_ELLIPSIS
@ YYSYMBOL_CONST_KEYWORD
@ YYSYMBOL_41_
@ YYSYMBOL_BOOL
@ YYSYMBOL_YYUNDEF
@ YYSYMBOL_71_
@ YYSYMBOL_FLOAT_KEYWORD
@ YYSYMBOL_52_
@ YYSYMBOL_STRUCT
@ YYSYMBOL_ASSIGN_MODIFY
@ YYSYMBOL_start_opt
@ YYSYMBOL_47_
@ YYSYMBOL_INT
@ YYSYMBOL_53_
@ YYSYMBOL_60_
@ YYSYMBOL_VOLATILE_KEYWORD
@ YYSYMBOL_CONSTRUCTION_VTABLE
@ YYSYMBOL_58_
@ YYSYMBOL_result
@ YYSYMBOL_int_seq
@ YYSYMBOL_RESTRICT
@ YYSYMBOL_INT_KEYWORD
@ YYSYMBOL_conversion_op_name
@ YYSYMBOL_NOTEQUAL
@ YYSYMBOL_declarator_1
@ YYSYMBOL_TEMPLATE
@ YYSYMBOL_function_args
@ YYSYMBOL_SIZEOF
@ YYSYMBOL_SIGNED_KEYWORD
@ YYSYMBOL_UNSIGNED
@ YYSYMBOL_UNARY
@ YYSYMBOL_LEQ
@ YYSYMBOL_array_indicator
@ YYSYMBOL_colon_ext_name
@ YYSYMBOL_YYerror
@ YYSYMBOL_OPERATOR
@ YYSYMBOL_GEQ
@ YYSYMBOL_start
@ YYSYMBOL_exp
@ YYSYMBOL_type
@ YYSYMBOL_49_
@ YYSYMBOL_abstract_declarator_fn
@ YYSYMBOL_ext_only_name
@ YYSYMBOL_function_arglist
@ YYSYMBOL_CLASS
@ YYSYMBOL_44_
@ YYSYMBOL_qualifiers
@ YYSYMBOL_int_part
@ YYSYMBOL_DYNAMIC_CAST
@ YYSYMBOL_63_
@ YYSYMBOL_typespec_2
@ YYSYMBOL_function
@ YYSYMBOL_template_params
@ YYSYMBOL_declarator
@ YYSYMBOL_direct_declarator_1
@ YYSYMBOL_demangler_special
@ YYSYMBOL_59_
@ YYSYMBOL_ARROW
@ YYSYMBOL_42_
@ YYSYMBOL_VOID
@ YYSYMBOL_LSH
@ YYSYMBOL_SHORT
@ YYSYMBOL_48_
@ YYSYMBOL_DECREMENT
@ YYSYMBOL_61_
@ YYSYMBOL_abstract_declarator
@ YYSYMBOL_conversion_op
@ YYSYMBOL_43_
@ YYSYMBOL_ANDAND
@ YYSYMBOL_70_
@ YYSYMBOL_STATIC_CAST
@ YYSYMBOL_RSH
@ YYSYMBOL_name
@ YYSYMBOL_DOUBLE_KEYWORD
@ YYSYMBOL_CHAR
@ YYSYMBOL_COLONCOLON
@ YYSYMBOL_DEMANGLER_SPECIAL
@ YYSYMBOL_YYACCEPT
@ YYSYMBOL_oper
@ YYSYMBOL_ptr_operator
@ YYSYMBOL_ERROR
@ YYSYMBOL_WCHAR_T
@ YYSYMBOL_TRUEKEYWORD
@ YYSYMBOL_YYEOF
@ YYSYMBOL_REINTERPRET_CAST
@ YYSYMBOL_62_
@ YYSYMBOL_builtin_type
@ YYSYMBOL_UNION
@ YYSYMBOL_templ
@ YYSYMBOL_73_
@ YYSYMBOL_YYEMPTY
@ YYSYMBOL_72_
@ YYSYMBOL_EQUAL
@ YYSYMBOL_direct_abstract_declarator
@ YYSYMBOL_DELETE
@ YYSYMBOL_colon_ext_only
@ YYSYMBOL_nested_name
@ YYSYMBOL_69_
@ YYSYMBOL_INCREMENT
@ YYSYMBOL_ENUM
@ YYSYMBOL_template_arg
@ YYSYMBOL_FLOAT
@ YYSYMBOL_FALSEKEYWORD
@ YYSYMBOL_OROR
@ YYSYMBOL_unqualified_name
@ YYSYMBOL_NAME
@ YYSYMBOL_qualifier
@ YYSYMBOL_direct_declarator
@ YYSYMBOL_NEW
@ YYSYMBOL_colon_name
@ YYSYMBOL_LONG
static const char backslashable[]
#define DOUBLE_KEYWORD
yytype_int16 yy_state_t
static struct demangle_info * allocate_info(void)
@ YYENOMEM
#define NAME
static int cp_parse_escape(const char **string_ptr)
#define TEMPLATE
static const yytype_int16 yydefgoto[]
#define YY_REDUCE_PRINT(Rule)
#define YY_CAST(Type, Val)
#define SIGNED_KEYWORD
static const yytype_int16 yypact[]
#define INT_LONG
#define YYerror
#define YYUNDEF
#define INT_UNSIGNED
gdb::unique_xmalloc_ptr< char > cp_comp_to_string(struct demangle_component *result, int estimated_len)
#define ARROW
#define YYFINAL
#define LSH
#define YY_ACCESSING_SYMBOL(State)
#define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
static const yytype_int16 yypgoto[]
#define YY_INITIAL_VALUE(Value)
#define CONSTRUCTION_IN
#define STATIC_CAST
#define YYNTOKENS
#define OROR
unsigned char yytype_uint8
#define YY_STACK_PRINT(Bottom, Top)
#define CONST_KEYWORD
#define CONSTRUCTION_VTABLE
#define YYSIZE_T
#define VOID
#define YY_IGNORE_USELESS_CAST_BEGIN
static void yydestruct(const char *yymsg, cp_name_parser_yysymbol_kind_t yykind, cp_name_parser_YYSTYPE *yyvaluep, struct cpname_state *state)
#define STRUCT
static const yytype_int8 yyr2[]
#define d_left(dc)
static void yy_reduce_print(yy_state_t *yyssp, cp_name_parser_YYSTYPE *yyvsp, int yyrule, struct cpname_state *state)
#define ERROR
void cp_merge_demangle_parse_infos(struct demangle_parse_info *dest, struct demangle_component *target, struct demangle_parse_info *src)
#define DECREMENT
#define YYPTRDIFF_T
static const char * yysymbol_name(cp_name_parser_yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED
#define SHORT
#define ASSIGN_MODIFY
static const yytype_int16 yytable[]
#define GEQ
#define YY_NULLPTRPTR
#define HANDLE_TOKEN2(string, token)
#define YYACCEPT
#define INT_SHORT
#define yytable_value_is_error(Yyn)
#define COLONCOLON
#define YYTRANSLATE(YYX)
static const yytype_int8 yystos[]
#define RESTRICT
#define UNARY
#define DEMANGLER_SPECIAL
int yydebug
#define DYNAMIC_CAST
#define YY_ATTRIBUTE_UNUSED
#define NEW
static const char *const yytname[]
#define INT_KEYWORD
#define ANDAND
#define DELETE
static const yytype_int8 yyr1[]
#define LONG
#define HANDLE_QUAL(TYPE, MTYPE, QUAL)
#define INT_LLONG
enum yytokentype yytoken_kind_t
#define YYPOPSTACK(N)
int yy_state_fast_t
#define INCREMENT
static void yy_symbol_print(FILE *yyo, cp_name_parser_yysymbol_kind_t yykind, cp_name_parser_YYSTYPE const *const yyvaluep, struct cpname_state *state)
static void yy_symbol_value_print(FILE *yyo, cp_name_parser_yysymbol_kind_t yykind, cp_name_parser_YYSTYPE const *const yyvaluep, struct cpname_state *state)
#define UNION
#define OPERATOR
unsigned short yytype_uint16
#define BOOL
#define ALLOC_CHUNK
#define YYEMPTY
#define YYLAST
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
#define FLOAT
#define yypact_value_is_default(Yyn)
#define CLASS
#define YYINITDEPTH
#define FLOAT_KEYWORD
signed char yytype_int8
#define QUAL_VOLATILE
#define YYERROR
static void yy_stack_print(yy_state_t *yybottom, yy_state_t *yytop)
#define YYSIZEOF(X)
static const yytype_int16 yycheck[]
#define YYSTACK_ALLOC
#define YYDPRINTF(Args)
static const yytype_uint8 yydefact[]
void xfree(void *)
#define YY_USE(E)
#define INT
char * gdb_cplus_demangle_print(int options, struct demangle_component *tree, int estimated_length, size_t *p_allocated_size)
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t err
Definition gnu-nat.c:1789
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
enum var_types type
Definition scm-param.c:142
struct demangle_component * comp
struct demangle_component ** last
const char * prev_lexptr
struct demangle_component * d_qualify(struct demangle_component *lhs, int qualifiers, int is_method)
struct demangle_info * demangle_info
struct demangle_component * d_binary(const char *name, struct demangle_component *lhs, struct demangle_component *rhs)
struct demangle_component * make_name(const char *name, int len)
struct demangle_component * make_builtin_type(const char *name)
struct demangle_component * make_dtor(enum gnu_v3_dtor_kinds kind, struct demangle_component *name)
const char * error_lexptr
struct demangle_component * d_grab()
struct demangle_component * d_unary(const char *name, struct demangle_component *lhs)
int parse_number(const char *p, int len, int parsed_float, cp_name_parser_YYSTYPE *lvalp)
struct demangle_component * d_int_type(int flags)
struct demangle_component * fill_comp(enum demangle_component_type d_type, struct demangle_component *lhs, struct demangle_component *rhs)
struct demangle_component * global_result
const char * global_errmsg
struct demangle_component * make_operator(const char *name, int args)
const char * lexptr
struct demangle_component comps[ALLOC_CHUNK]
struct demangle_info * next
struct obstack obstack
Definition cp-support.h:72
struct demangle_component * tree
Definition cp-support.h:69
struct demangle_info * info
Definition cp-support.h:66
struct demangle_component * comp
struct cp_name_parser_YYSTYPE::nested nested
struct cp_name_parser_YYSTYPE::@34 abstract
struct cp_name_parser_YYSTYPE::@33 nested1
struct demangle_component * start
struct demangle_component * last
struct demangle_component ** last
cp_name_parser_YYSTYPE yyvs_alloc
#define yylloc
Definition yy-remap.h:68
#define yyss
Definition yy-remap.h:82
#define yyval
Definition yy-remap.h:67
#define yychar
Definition yy-remap.h:47
#define yyrule
Definition yy-remap.h:72
#define yylex
Definition yy-remap.h:44
#define yynerrs
Definition yy-remap.h:58
#define yylhs
Definition yy-remap.h:73
#define yyvsp
Definition yy-remap.h:87
#define yyparse
Definition yy-remap.h:43
#define yylen
Definition yy-remap.h:74
#define yylval
Definition yy-remap.h:46
#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