OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gdb-7.2/] [gdb/] [cp-name-parser.c] - Blame information for rev 342

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.