GDB (API)
|
00001 /* A Bison parser, made by GNU Bison 2.5. */ 00002 00003 /* Bison implementation for Yacc-like parsers in C 00004 00005 Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. 00006 00007 This program is free software: you can redistribute it and/or modify 00008 it under the terms of the GNU General Public License as published by 00009 the Free Software Foundation, either version 3 of the License, or 00010 (at your option) any later version. 00011 00012 This program is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with this program. If not, see <http://www.gnu.org/licenses/>. */ 00019 00020 /* As a special exception, you may create a larger work that contains 00021 part or all of the Bison parser skeleton and distribute that work 00022 under terms of your choice, so long as that work isn't itself a 00023 parser generator using the skeleton or a modified version thereof 00024 as a parser skeleton. Alternatively, if you modify or redistribute 00025 the parser skeleton itself, you may (at your option) remove this 00026 special exception, which will cause the skeleton and the resulting 00027 Bison output files to be licensed under the GNU General Public 00028 License without this special exception. 00029 00030 This special exception was added by the Free Software Foundation in 00031 version 2.2 of Bison. */ 00032 00033 /* C LALR(1) parser skeleton written by Richard Stallman, by 00034 simplifying the original so-called "semantic" parser. */ 00035 00036 /* All symbols defined below should begin with yy or YY, to avoid 00037 infringing on user name space. This should be done even for local 00038 variables, as they might otherwise be expanded by user macros. 00039 There are some unavoidable exceptions within include files to 00040 define necessary library symbols; they are noted "INFRINGES ON 00041 USER NAME SPACE" below. */ 00042 00043 /* Identify Bison output. */ 00044 #define YYBISON 1 00045 00046 /* Bison version. */ 00047 #define YYBISON_VERSION "2.5" 00048 00049 /* Skeleton name. */ 00050 #define YYSKELETON_NAME "yacc.c" 00051 00052 /* Pure parsers. */ 00053 #define YYPURE 0 00054 00055 /* Push parsers. */ 00056 #define YYPUSH 0 00057 00058 /* Pull parsers. */ 00059 #define YYPULL 1 00060 00061 /* Using locations. */ 00062 #define YYLSP_NEEDED 0 00063 00064 00065 00066 /* Copy the first part of user declarations. */ 00067 00068 /* Line 268 of yacc.c */ 00069 #line 30 "../../src/gdb/cp-name-parser.y" 00070 00071 00072 #include "defs.h" 00073 00074 #include <stdio.h> 00075 #include <stdlib.h> 00076 #include <unistd.h> 00077 #include <string.h> 00078 00079 #include "safe-ctype.h" 00080 #include "libiberty.h" 00081 #include "demangle.h" 00082 #include "cp-support.h" 00083 #include "gdb_assert.h" 00084 00085 /* Bison does not make it easy to create a parser without global 00086 state, unfortunately. Here are all the global variables used 00087 in this parser. */ 00088 00089 /* LEXPTR is the current pointer into our lex buffer. PREV_LEXPTR 00090 is the start of the last token lexed, only used for diagnostics. 00091 ERROR_LEXPTR is the first place an error occurred. GLOBAL_ERRMSG 00092 is the first error message encountered. */ 00093 00094 static const char *lexptr, *prev_lexptr, *error_lexptr, *global_errmsg; 00095 00096 /* The components built by the parser are allocated ahead of time, 00097 and cached in this structure. */ 00098 00099 #define ALLOC_CHUNK 100 00100 00101 struct demangle_info { 00102 int used; 00103 struct demangle_info *next; 00104 struct demangle_component comps[ALLOC_CHUNK]; 00105 }; 00106 00107 static struct demangle_info *demangle_info; 00108 00109 static struct demangle_component * 00110 d_grab (void) 00111 { 00112 struct demangle_info *more; 00113 00114 if (demangle_info->used >= ALLOC_CHUNK) 00115 { 00116 if (demangle_info->next == NULL) 00117 { 00118 more = xmalloc (sizeof (struct demangle_info)); 00119 more->next = NULL; 00120 demangle_info->next = more; 00121 } 00122 else 00123 more = demangle_info->next; 00124 00125 more->used = 0; 00126 demangle_info = more; 00127 } 00128 return &demangle_info->comps[demangle_info->used++]; 00129 } 00130 00131 /* The parse tree created by the parser is stored here after a successful 00132 parse. */ 00133 00134 static struct demangle_component *global_result; 00135 00136 /* Prototypes for helper functions used when constructing the parse 00137 tree. */ 00138 00139 static struct demangle_component *d_qualify (struct demangle_component *, int, 00140 int); 00141 00142 static struct demangle_component *d_int_type (int); 00143 00144 static struct demangle_component *d_unary (const char *, 00145 struct demangle_component *); 00146 static struct demangle_component *d_binary (const char *, 00147 struct demangle_component *, 00148 struct demangle_component *); 00149 00150 /* Flags passed to d_qualify. */ 00151 00152 #define QUAL_CONST 1 00153 #define QUAL_RESTRICT 2 00154 #define QUAL_VOLATILE 4 00155 00156 /* Flags passed to d_int_type. */ 00157 00158 #define INT_CHAR (1 << 0) 00159 #define INT_SHORT (1 << 1) 00160 #define INT_LONG (1 << 2) 00161 #define INT_LLONG (1 << 3) 00162 00163 #define INT_SIGNED (1 << 4) 00164 #define INT_UNSIGNED (1 << 5) 00165 00166 /* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc), 00167 as well as gratuitiously global symbol names, so we can have multiple 00168 yacc generated parsers in gdb. Note that these are only the variables 00169 produced by yacc. If other parser generators (bison, byacc, etc) produce 00170 additional global names that conflict at link time, then those parser 00171 generators need to be fixed instead of adding those names to this list. */ 00172 00173 #define yymaxdepth cpname_maxdepth 00174 #define yyparse cpname_parse 00175 #define yylex cpname_lex 00176 #define yyerror cpname_error 00177 #define yylval cpname_lval 00178 #define yychar cpname_char 00179 #define yydebug cpname_debug 00180 #define yypact cpname_pact 00181 #define yyr1 cpname_r1 00182 #define yyr2 cpname_r2 00183 #define yydef cpname_def 00184 #define yychk cpname_chk 00185 #define yypgo cpname_pgo 00186 #define yyact cpname_act 00187 #define yyexca cpname_exca 00188 #define yyerrflag cpname_errflag 00189 #define yynerrs cpname_nerrs 00190 #define yyps cpname_ps 00191 #define yypv cpname_pv 00192 #define yys cpname_s 00193 #define yy_yys cpname_yys 00194 #define yystate cpname_state 00195 #define yytmp cpname_tmp 00196 #define yyv cpname_v 00197 #define yy_yyv cpname_yyv 00198 #define yyval cpname_val 00199 #define yylloc cpname_lloc 00200 #define yyreds cpname_reds /* With YYDEBUG defined */ 00201 #define yytoks cpname_toks /* With YYDEBUG defined */ 00202 #define yyname cpname_name /* With YYDEBUG defined */ 00203 #define yyrule cpname_rule /* With YYDEBUG defined */ 00204 #define yylhs cpname_yylhs 00205 #define yylen cpname_yylen 00206 #define yydefred cpname_yydefred 00207 #define yydgoto cpname_yydgoto 00208 #define yysindex cpname_yysindex 00209 #define yyrindex cpname_yyrindex 00210 #define yygindex cpname_yygindex 00211 #define yytable cpname_yytable 00212 #define yycheck cpname_yycheck 00213 #define yyss cpname_yyss 00214 #define yysslim cpname_yysslim 00215 #define yyssp cpname_yyssp 00216 #define yystacksize cpname_yystacksize 00217 #define yyvs cpname_yyvs 00218 #define yyvsp cpname_yyvsp 00219 00220 int yyparse (void); 00221 static int yylex (void); 00222 static void yyerror (char *); 00223 00224 /* Enable yydebug for the stand-alone parser. */ 00225 #ifdef TEST_CPNAMES 00226 # define YYDEBUG 1 00227 #endif 00228 00229 /* Helper functions. These wrap the demangler tree interface, handle 00230 allocation from our global store, and return the allocated component. */ 00231 00232 static struct demangle_component * 00233 fill_comp (enum demangle_component_type d_type, struct demangle_component *lhs, 00234 struct demangle_component *rhs) 00235 { 00236 struct demangle_component *ret = d_grab (); 00237 int i; 00238 00239 i = cplus_demangle_fill_component (ret, d_type, lhs, rhs); 00240 gdb_assert (i); 00241 00242 return ret; 00243 } 00244 00245 static struct demangle_component * 00246 make_empty (enum demangle_component_type d_type) 00247 { 00248 struct demangle_component *ret = d_grab (); 00249 ret->type = d_type; 00250 return ret; 00251 } 00252 00253 static struct demangle_component * 00254 make_operator (const char *name, int args) 00255 { 00256 struct demangle_component *ret = d_grab (); 00257 int i; 00258 00259 i = cplus_demangle_fill_operator (ret, name, args); 00260 gdb_assert (i); 00261 00262 return ret; 00263 } 00264 00265 static struct demangle_component * 00266 make_dtor (enum gnu_v3_dtor_kinds kind, struct demangle_component *name) 00267 { 00268 struct demangle_component *ret = d_grab (); 00269 int i; 00270 00271 i = cplus_demangle_fill_dtor (ret, kind, name); 00272 gdb_assert (i); 00273 00274 return ret; 00275 } 00276 00277 static struct demangle_component * 00278 make_builtin_type (const char *name) 00279 { 00280 struct demangle_component *ret = d_grab (); 00281 int i; 00282 00283 i = cplus_demangle_fill_builtin_type (ret, name); 00284 gdb_assert (i); 00285 00286 return ret; 00287 } 00288 00289 static struct demangle_component * 00290 make_name (const char *name, int len) 00291 { 00292 struct demangle_component *ret = d_grab (); 00293 int i; 00294 00295 i = cplus_demangle_fill_name (ret, name, len); 00296 gdb_assert (i); 00297 00298 return ret; 00299 } 00300 00301 #define d_left(dc) (dc)->u.s_binary.left 00302 #define d_right(dc) (dc)->u.s_binary.right 00303 00304 00305 00306 /* Line 268 of yacc.c */ 00307 #line 308 "cp-name-parser.c" 00308 00309 /* Enabling traces. */ 00310 #ifndef YYDEBUG 00311 # define YYDEBUG 0 00312 #endif 00313 00314 /* Enabling verbose error messages. */ 00315 #ifdef YYERROR_VERBOSE 00316 # undef YYERROR_VERBOSE 00317 # define YYERROR_VERBOSE 1 00318 #else 00319 # define YYERROR_VERBOSE 0 00320 #endif 00321 00322 /* Enabling the token table. */ 00323 #ifndef YYTOKEN_TABLE 00324 # define YYTOKEN_TABLE 0 00325 #endif 00326 00327 00328 /* Tokens. */ 00329 #ifndef YYTOKENTYPE 00330 # define YYTOKENTYPE 00331 /* Put the tokens into the symbol table, so that GDB and other debuggers 00332 know about them. */ 00333 enum yytokentype { 00334 INT = 258, 00335 FLOAT = 259, 00336 NAME = 260, 00337 STRUCT = 261, 00338 CLASS = 262, 00339 UNION = 263, 00340 ENUM = 264, 00341 SIZEOF = 265, 00342 UNSIGNED = 266, 00343 COLONCOLON = 267, 00344 TEMPLATE = 268, 00345 ERROR = 269, 00346 NEW = 270, 00347 DELETE = 271, 00348 OPERATOR = 272, 00349 STATIC_CAST = 273, 00350 REINTERPRET_CAST = 274, 00351 DYNAMIC_CAST = 275, 00352 SIGNED_KEYWORD = 276, 00353 LONG = 277, 00354 SHORT = 278, 00355 INT_KEYWORD = 279, 00356 CONST_KEYWORD = 280, 00357 VOLATILE_KEYWORD = 281, 00358 DOUBLE_KEYWORD = 282, 00359 BOOL = 283, 00360 ELLIPSIS = 284, 00361 RESTRICT = 285, 00362 VOID = 286, 00363 FLOAT_KEYWORD = 287, 00364 CHAR = 288, 00365 WCHAR_T = 289, 00366 ASSIGN_MODIFY = 290, 00367 TRUEKEYWORD = 291, 00368 FALSEKEYWORD = 292, 00369 DEMANGLER_SPECIAL = 293, 00370 CONSTRUCTION_VTABLE = 294, 00371 CONSTRUCTION_IN = 295, 00372 OROR = 296, 00373 ANDAND = 297, 00374 NOTEQUAL = 298, 00375 EQUAL = 299, 00376 GEQ = 300, 00377 LEQ = 301, 00378 RSH = 302, 00379 LSH = 303, 00380 DECREMENT = 304, 00381 INCREMENT = 305, 00382 UNARY = 306, 00383 ARROW = 307 00384 }; 00385 #endif 00386 /* Tokens. */ 00387 #define INT 258 00388 #define FLOAT 259 00389 #define NAME 260 00390 #define STRUCT 261 00391 #define CLASS 262 00392 #define UNION 263 00393 #define ENUM 264 00394 #define SIZEOF 265 00395 #define UNSIGNED 266 00396 #define COLONCOLON 267 00397 #define TEMPLATE 268 00398 #define ERROR 269 00399 #define NEW 270 00400 #define DELETE 271 00401 #define OPERATOR 272 00402 #define STATIC_CAST 273 00403 #define REINTERPRET_CAST 274 00404 #define DYNAMIC_CAST 275 00405 #define SIGNED_KEYWORD 276 00406 #define LONG 277 00407 #define SHORT 278 00408 #define INT_KEYWORD 279 00409 #define CONST_KEYWORD 280 00410 #define VOLATILE_KEYWORD 281 00411 #define DOUBLE_KEYWORD 282 00412 #define BOOL 283 00413 #define ELLIPSIS 284 00414 #define RESTRICT 285 00415 #define VOID 286 00416 #define FLOAT_KEYWORD 287 00417 #define CHAR 288 00418 #define WCHAR_T 289 00419 #define ASSIGN_MODIFY 290 00420 #define TRUEKEYWORD 291 00421 #define FALSEKEYWORD 292 00422 #define DEMANGLER_SPECIAL 293 00423 #define CONSTRUCTION_VTABLE 294 00424 #define CONSTRUCTION_IN 295 00425 #define OROR 296 00426 #define ANDAND 297 00427 #define NOTEQUAL 298 00428 #define EQUAL 299 00429 #define GEQ 300 00430 #define LEQ 301 00431 #define RSH 302 00432 #define LSH 303 00433 #define DECREMENT 304 00434 #define INCREMENT 305 00435 #define UNARY 306 00436 #define ARROW 307 00437 00438 00439 00440 00441 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED 00442 typedef union YYSTYPE 00443 { 00444 00445 /* Line 293 of yacc.c */ 00446 #line 267 "../../src/gdb/cp-name-parser.y" 00447 00448 struct demangle_component *comp; 00449 struct nested { 00450 struct demangle_component *comp; 00451 struct demangle_component **last; 00452 } nested; 00453 struct { 00454 struct demangle_component *comp, *last; 00455 } nested1; 00456 struct { 00457 struct demangle_component *comp, **last; 00458 struct nested fn; 00459 struct demangle_component *start; 00460 int fold_flag; 00461 } abstract; 00462 int lval; 00463 const char *opname; 00464 00465 00466 00467 /* Line 293 of yacc.c */ 00468 #line 469 "cp-name-parser.c" 00469 } YYSTYPE; 00470 # define YYSTYPE_IS_TRIVIAL 1 00471 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ 00472 # define YYSTYPE_IS_DECLARED 1 00473 #endif 00474 00475 00476 /* Copy the second part of user declarations. */ 00477 00478 00479 /* Line 343 of yacc.c */ 00480 #line 481 "cp-name-parser.c" 00481 00482 #ifdef short 00483 # undef short 00484 #endif 00485 00486 #ifdef YYTYPE_UINT8 00487 typedef YYTYPE_UINT8 yytype_uint8; 00488 #else 00489 typedef unsigned char yytype_uint8; 00490 #endif 00491 00492 #ifdef YYTYPE_INT8 00493 typedef YYTYPE_INT8 yytype_int8; 00494 #elif (defined __STDC__ || defined __C99__FUNC__ \ 00495 || defined __cplusplus || defined _MSC_VER) 00496 typedef signed char yytype_int8; 00497 #else 00498 typedef short int yytype_int8; 00499 #endif 00500 00501 #ifdef YYTYPE_UINT16 00502 typedef YYTYPE_UINT16 yytype_uint16; 00503 #else 00504 typedef unsigned short int yytype_uint16; 00505 #endif 00506 00507 #ifdef YYTYPE_INT16 00508 typedef YYTYPE_INT16 yytype_int16; 00509 #else 00510 typedef short int yytype_int16; 00511 #endif 00512 00513 #ifndef YYSIZE_T 00514 # ifdef __SIZE_TYPE__ 00515 # define YYSIZE_T __SIZE_TYPE__ 00516 # elif defined size_t 00517 # define YYSIZE_T size_t 00518 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ 00519 || defined __cplusplus || defined _MSC_VER) 00520 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ 00521 # define YYSIZE_T size_t 00522 # else 00523 # define YYSIZE_T unsigned int 00524 # endif 00525 #endif 00526 00527 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) 00528 00529 #ifndef YY_ 00530 # if defined YYENABLE_NLS && YYENABLE_NLS 00531 # if ENABLE_NLS 00532 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */ 00533 # define YY_(msgid) dgettext ("bison-runtime", msgid) 00534 # endif 00535 # endif 00536 # ifndef YY_ 00537 # define YY_(msgid) msgid 00538 # endif 00539 #endif 00540 00541 /* Suppress unused-variable warnings by "using" E. */ 00542 #if ! defined lint || defined __GNUC__ 00543 # define YYUSE(e) ((void) (e)) 00544 #else 00545 # define YYUSE(e) /* empty */ 00546 #endif 00547 00548 /* Identity function, used to suppress warnings about constant conditions. */ 00549 #ifndef lint 00550 # define YYID(n) (n) 00551 #else 00552 #if (defined __STDC__ || defined __C99__FUNC__ \ 00553 || defined __cplusplus || defined _MSC_VER) 00554 static int 00555 YYID (int yyi) 00556 #else 00557 static int 00558 YYID (yyi) 00559 int yyi; 00560 #endif 00561 { 00562 return yyi; 00563 } 00564 #endif 00565 00566 #if ! defined yyoverflow || YYERROR_VERBOSE 00567 00568 /* The parser invokes alloca or xmalloc; define the necessary symbols. */ 00569 00570 # ifdef YYSTACK_USE_ALLOCA 00571 # if YYSTACK_USE_ALLOCA 00572 # ifdef __GNUC__ 00573 # define YYSTACK_ALLOC __builtin_alloca 00574 # elif defined __BUILTIN_VA_ARG_INCR 00575 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */ 00576 # elif defined _AIX 00577 # define YYSTACK_ALLOC __alloca 00578 # elif defined _MSC_VER 00579 # define alloca _alloca 00580 # else 00581 # define YYSTACK_ALLOC alloca 00582 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ 00583 || defined __cplusplus || defined _MSC_VER) 00584 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 00585 # ifndef EXIT_SUCCESS 00586 # define EXIT_SUCCESS 0 00587 # endif 00588 # endif 00589 # endif 00590 # endif 00591 # endif 00592 00593 # ifdef YYSTACK_ALLOC 00594 /* Pacify GCC's `empty if-body' warning. */ 00595 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) 00596 # ifndef YYSTACK_ALLOC_MAXIMUM 00597 /* The OS might guarantee only one guard page at the bottom of the stack, 00598 and a page size can be as small as 4096 bytes. So we cannot safely 00599 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number 00600 to allow for a few compiler-allocated temporary stack slots. */ 00601 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ 00602 # endif 00603 # else 00604 # define YYSTACK_ALLOC YYMALLOC 00605 # define YYSTACK_FREE YYFREE 00606 # ifndef YYSTACK_ALLOC_MAXIMUM 00607 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM 00608 # endif 00609 # if (defined __cplusplus && ! defined EXIT_SUCCESS \ 00610 && ! ((defined YYMALLOC || defined xmalloc) \ 00611 && (defined YYFREE || defined xfree))) 00612 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 00613 # ifndef EXIT_SUCCESS 00614 # define EXIT_SUCCESS 0 00615 # endif 00616 # endif 00617 # ifndef YYMALLOC 00618 # define YYMALLOC xmalloc 00619 # if ! defined xmalloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ 00620 || defined __cplusplus || defined _MSC_VER) 00621 void *xmalloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ 00622 # endif 00623 # endif 00624 # ifndef YYFREE 00625 # define YYFREE xfree 00626 # if ! defined xfree && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ 00627 || defined __cplusplus || defined _MSC_VER) 00628 void xfree (void *); /* INFRINGES ON USER NAME SPACE */ 00629 # endif 00630 # endif 00631 # endif 00632 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ 00633 00634 00635 #if (! defined yyoverflow \ 00636 && (! defined __cplusplus \ 00637 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) 00638 00639 /* A type that is properly aligned for any stack member. */ 00640 union yyalloc 00641 { 00642 yytype_int16 yyss_alloc; 00643 YYSTYPE yyvs_alloc; 00644 }; 00645 00646 /* The size of the maximum gap between one aligned stack and the next. */ 00647 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) 00648 00649 /* The size of an array large to enough to hold all stacks, each with 00650 N elements. */ 00651 # define YYSTACK_BYTES(N) \ 00652 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ 00653 + YYSTACK_GAP_MAXIMUM) 00654 00655 # define YYCOPY_NEEDED 1 00656 00657 /* Relocate STACK from its old location to the new one. The 00658 local variables YYSIZE and YYSTACKSIZE give the old and new number of 00659 elements in the stack, and YYPTR gives the new location of the 00660 stack. Advance YYPTR to a properly aligned location for the next 00661 stack. */ 00662 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ 00663 do \ 00664 { \ 00665 YYSIZE_T yynewbytes; \ 00666 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ 00667 Stack = &yyptr->Stack_alloc; \ 00668 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ 00669 yyptr += yynewbytes / sizeof (*yyptr); \ 00670 } \ 00671 while (YYID (0)) 00672 00673 #endif 00674 00675 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED 00676 /* Copy COUNT objects from FROM to TO. The source and destination do 00677 not overlap. */ 00678 # ifndef YYCOPY 00679 # if defined __GNUC__ && 1 < __GNUC__ 00680 # define YYCOPY(To, From, Count) \ 00681 __builtin_memcpy (To, From, (Count) * sizeof (*(From))) 00682 # else 00683 # define YYCOPY(To, From, Count) \ 00684 do \ 00685 { \ 00686 YYSIZE_T yyi; \ 00687 for (yyi = 0; yyi < (Count); yyi++) \ 00688 (To)[yyi] = (From)[yyi]; \ 00689 } \ 00690 while (YYID (0)) 00691 # endif 00692 # endif 00693 #endif /* !YYCOPY_NEEDED */ 00694 00695 /* YYFINAL -- State number of the termination state. */ 00696 #define YYFINAL 84 00697 /* YYLAST -- Last index in YYTABLE. */ 00698 #define YYLAST 1097 00699 00700 /* YYNTOKENS -- Number of terminals. */ 00701 #define YYNTOKENS 75 00702 /* YYNNTS -- Number of nonterminals. */ 00703 #define YYNNTS 40 00704 /* YYNRULES -- Number of rules. */ 00705 #define YYNRULES 194 00706 /* YYNRULES -- Number of states. */ 00707 #define YYNSTATES 324 00708 00709 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ 00710 #define YYUNDEFTOK 2 00711 #define YYMAXUTOK 307 00712 00713 #define YYTRANSLATE(YYX) \ 00714 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) 00715 00716 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ 00717 static const yytype_uint8 yytranslate[] = 00718 { 00719 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00720 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00721 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00722 2, 2, 2, 72, 2, 2, 2, 63, 49, 2, 00723 73, 41, 61, 59, 42, 60, 67, 62, 2, 2, 00724 2, 2, 2, 2, 2, 2, 2, 2, 74, 2, 00725 52, 43, 53, 44, 58, 2, 2, 2, 2, 2, 00726 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00727 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00728 2, 68, 2, 70, 48, 2, 2, 2, 2, 2, 00729 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00730 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00731 2, 2, 2, 2, 47, 2, 71, 2, 2, 2, 00732 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00733 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00734 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00735 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00736 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00737 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00738 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00739 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00740 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00741 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00742 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00743 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00744 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 00745 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 00746 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 00747 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 00748 35, 36, 37, 38, 39, 40, 45, 46, 50, 51, 00749 54, 55, 56, 57, 64, 65, 66, 69 00750 }; 00751 00752 #if YYDEBUG 00753 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in 00754 YYRHS. */ 00755 static const yytype_uint16 yyprhs[] = 00756 { 00757 0, 0, 3, 5, 7, 9, 11, 12, 15, 18, 00758 22, 26, 29, 32, 35, 40, 43, 46, 51, 56, 00759 59, 62, 65, 68, 71, 74, 77, 80, 83, 86, 00760 89, 92, 95, 98, 101, 104, 107, 110, 113, 116, 00761 119, 122, 125, 128, 131, 135, 138, 142, 146, 149, 00762 152, 154, 158, 161, 163, 168, 171, 173, 176, 179, 00763 181, 184, 186, 188, 190, 192, 195, 198, 200, 203, 00764 207, 210, 214, 219, 221, 225, 227, 230, 233, 238, 00765 240, 242, 245, 249, 254, 258, 263, 268, 272, 273, 00766 275, 277, 279, 281, 283, 286, 288, 290, 292, 294, 00767 296, 298, 300, 303, 305, 307, 309, 312, 314, 316, 00768 318, 321, 323, 327, 332, 335, 339, 342, 344, 348, 00769 351, 354, 356, 360, 363, 367, 370, 375, 379, 381, 00770 384, 386, 390, 393, 396, 398, 400, 403, 405, 410, 00771 413, 415, 418, 421, 423, 427, 430, 433, 435, 438, 00772 440, 442, 447, 452, 457, 460, 463, 466, 469, 473, 00773 475, 479, 482, 487, 490, 493, 496, 501, 509, 517, 00774 525, 529, 533, 537, 541, 545, 549, 553, 557, 561, 00775 565, 569, 573, 577, 581, 585, 589, 593, 597, 601, 00776 607, 609, 611, 616, 618 00777 }; 00778 00779 /* YYRHS -- A `-1'-separated list of the rules' RHS. */ 00780 static const yytype_int8 yyrhs[] = 00781 { 00782 76, 0, -1, 77, -1, 108, -1, 80, -1, 79, 00783 -1, -1, 12, 77, -1, 104, 111, -1, 104, 95, 00784 78, -1, 88, 95, 78, -1, 83, 78, -1, 83, 00785 107, -1, 38, 77, -1, 39, 77, 40, 77, -1, 00786 17, 15, -1, 17, 16, -1, 17, 15, 68, 70, 00787 -1, 17, 16, 68, 70, -1, 17, 59, -1, 17, 00788 60, -1, 17, 61, -1, 17, 62, -1, 17, 63, 00789 -1, 17, 48, -1, 17, 49, -1, 17, 47, -1, 00790 17, 71, -1, 17, 72, -1, 17, 43, -1, 17, 00791 52, -1, 17, 53, -1, 17, 35, -1, 17, 57, 00792 -1, 17, 56, -1, 17, 51, -1, 17, 50, -1, 00793 17, 55, -1, 17, 54, -1, 17, 46, -1, 17, 00794 45, -1, 17, 65, -1, 17, 64, -1, 17, 42, 00795 -1, 17, 69, 61, -1, 17, 69, -1, 17, 73, 00796 41, -1, 17, 68, 70, -1, 17, 104, -1, 90, 00797 82, -1, 82, -1, 12, 90, 82, -1, 12, 82, 00798 -1, 81, -1, 81, 52, 92, 53, -1, 71, 5, 00799 -1, 86, -1, 12, 86, -1, 90, 5, -1, 5, 00800 -1, 90, 91, -1, 91, -1, 85, -1, 88, -1, 00801 89, -1, 12, 89, -1, 90, 84, -1, 84, -1, 00802 5, 12, -1, 90, 5, 12, -1, 91, 12, -1, 00803 90, 91, 12, -1, 5, 52, 92, 53, -1, 93, 00804 -1, 92, 42, 93, -1, 104, -1, 104, 105, -1, 00805 49, 77, -1, 49, 73, 77, 41, -1, 113, -1, 00806 104, -1, 104, 105, -1, 94, 42, 104, -1, 94, 00807 42, 104, 105, -1, 94, 42, 29, -1, 73, 94, 00808 41, 96, -1, 73, 31, 41, 96, -1, 73, 41, 00809 96, -1, -1, 98, -1, 30, -1, 26, -1, 25, 00810 -1, 97, -1, 97, 98, -1, 24, -1, 21, -1, 00811 11, -1, 33, -1, 22, -1, 23, -1, 99, -1, 00812 100, 99, -1, 100, -1, 32, -1, 27, -1, 22, 00813 27, -1, 28, -1, 34, -1, 31, -1, 61, 96, 00814 -1, 49, -1, 90, 61, 96, -1, 12, 90, 61, 00815 96, -1, 68, 70, -1, 68, 3, 70, -1, 101, 00816 98, -1, 101, -1, 98, 101, 98, -1, 98, 101, 00817 -1, 86, 98, -1, 86, -1, 98, 86, 98, -1, 00818 98, 86, -1, 12, 86, 98, -1, 12, 86, -1, 00819 98, 12, 86, 98, -1, 98, 12, 86, -1, 102, 00820 -1, 102, 105, -1, 106, -1, 73, 105, 41, -1, 00821 106, 95, -1, 106, 103, -1, 103, -1, 102, -1, 00822 102, 107, -1, 106, -1, 106, 95, 12, 77, -1, 00823 95, 78, -1, 104, -1, 104, 105, -1, 102, 109, 00824 -1, 110, -1, 73, 109, 41, -1, 110, 95, -1, 00825 110, 103, -1, 87, -1, 102, 111, -1, 87, -1, 00826 112, -1, 87, 95, 12, 77, -1, 112, 95, 12, 00827 77, -1, 73, 102, 109, 41, -1, 112, 95, -1, 00828 112, 103, -1, 87, 95, -1, 87, 103, -1, 73, 00829 114, 41, -1, 113, -1, 113, 53, 113, -1, 49, 00830 77, -1, 49, 73, 77, 41, -1, 60, 113, -1, 00831 72, 113, -1, 71, 113, -1, 73, 108, 41, 113, 00832 -1, 18, 52, 108, 53, 73, 114, 41, -1, 20, 00833 52, 108, 53, 73, 114, 41, -1, 19, 52, 108, 00834 53, 73, 114, 41, -1, 113, 61, 113, -1, 113, 00835 62, 113, -1, 113, 63, 113, -1, 113, 59, 113, 00836 -1, 113, 60, 113, -1, 113, 57, 113, -1, 113, 00837 56, 113, -1, 113, 51, 113, -1, 113, 50, 113, 00838 -1, 113, 55, 113, -1, 113, 54, 113, -1, 113, 00839 52, 113, -1, 113, 49, 113, -1, 113, 48, 113, 00840 -1, 113, 47, 113, -1, 113, 46, 113, -1, 113, 00841 45, 113, -1, 113, 69, 5, -1, 113, 67, 5, 00842 -1, 113, 44, 113, 74, 113, -1, 3, -1, 4, 00843 -1, 10, 73, 108, 41, -1, 36, -1, 37, -1 00844 }; 00845 00846 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ 00847 static const yytype_uint16 yyrline[] = 00848 { 00849 0, 381, 381, 385, 387, 389, 394, 395, 402, 411, 00850 414, 418, 421, 440, 444, 448, 454, 460, 466, 472, 00851 474, 476, 478, 480, 482, 484, 486, 488, 490, 492, 00852 494, 496, 498, 500, 502, 504, 506, 508, 510, 512, 00853 514, 516, 518, 520, 522, 524, 526, 528, 536, 541, 00854 546, 550, 555, 563, 564, 566, 578, 579, 585, 587, 00855 588, 590, 593, 594, 597, 598, 602, 604, 607, 613, 00856 620, 626, 637, 641, 644, 655, 656, 660, 662, 664, 00857 667, 671, 676, 681, 687, 697, 701, 705, 713, 714, 00858 717, 719, 721, 725, 726, 733, 735, 737, 739, 741, 00859 743, 747, 748, 752, 754, 756, 758, 760, 762, 764, 00860 768, 774, 778, 786, 796, 800, 816, 818, 819, 821, 00861 824, 826, 827, 829, 832, 834, 836, 838, 843, 846, 00862 851, 858, 862, 873, 879, 897, 900, 908, 910, 921, 00863 928, 929, 935, 939, 943, 945, 950, 955, 968, 972, 00864 977, 985, 990, 999, 1003, 1008, 1013, 1017, 1023, 1029, 00865 1032, 1039, 1041, 1046, 1050, 1054, 1061, 1077, 1084, 1091, 00866 1110, 1114, 1118, 1122, 1126, 1130, 1134, 1138, 1142, 1146, 00867 1150, 1154, 1158, 1162, 1166, 1170, 1174, 1179, 1183, 1187, 00868 1194, 1198, 1201, 1210, 1219 00869 }; 00870 #endif 00871 00872 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE 00873 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. 00874 First, the terminals, then, starting at YYNTOKENS, nonterminals. */ 00875 static const char *const yytname[] = 00876 { 00877 "$end", "error", "$undefined", "INT", "FLOAT", "NAME", "STRUCT", 00878 "CLASS", "UNION", "ENUM", "SIZEOF", "UNSIGNED", "COLONCOLON", "TEMPLATE", 00879 "ERROR", "NEW", "DELETE", "OPERATOR", "STATIC_CAST", "REINTERPRET_CAST", 00880 "DYNAMIC_CAST", "SIGNED_KEYWORD", "LONG", "SHORT", "INT_KEYWORD", 00881 "CONST_KEYWORD", "VOLATILE_KEYWORD", "DOUBLE_KEYWORD", "BOOL", 00882 "ELLIPSIS", "RESTRICT", "VOID", "FLOAT_KEYWORD", "CHAR", "WCHAR_T", 00883 "ASSIGN_MODIFY", "TRUEKEYWORD", "FALSEKEYWORD", "DEMANGLER_SPECIAL", 00884 "CONSTRUCTION_VTABLE", "CONSTRUCTION_IN", "')'", "','", "'='", "'?'", 00885 "OROR", "ANDAND", "'|'", "'^'", "'&'", "NOTEQUAL", "EQUAL", "'<'", "'>'", 00886 "GEQ", "LEQ", "RSH", "LSH", "'@'", "'+'", "'-'", "'*'", "'/'", "'%'", 00887 "DECREMENT", "INCREMENT", "UNARY", "'.'", "'['", "ARROW", "']'", "'~'", 00888 "'!'", "'('", "':'", "$accept", "result", "start", "start_opt", 00889 "function", "demangler_special", "operator", "conversion_op", 00890 "conversion_op_name", "unqualified_name", "colon_name", "name", 00891 "colon_ext_name", "colon_ext_only", "ext_only_name", "nested_name", 00892 "template", "template_params", "template_arg", "function_args", 00893 "function_arglist", "qualifiers_opt", "qualifier", "qualifiers", 00894 "int_part", "int_seq", "builtin_type", "ptr_operator", "array_indicator", 00895 "typespec_2", "abstract_declarator", "direct_abstract_declarator", 00896 "abstract_declarator_fn", "type", "declarator", "direct_declarator", 00897 "declarator_1", "direct_declarator_1", "exp", "exp1", 0 00898 }; 00899 #endif 00900 00901 # ifdef YYPRINT 00902 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to 00903 token YYLEX-NUM. */ 00904 static const yytype_uint16 yytoknum[] = 00905 { 00906 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 00907 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 00908 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 00909 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 00910 295, 41, 44, 61, 63, 296, 297, 124, 94, 38, 00911 298, 299, 60, 62, 300, 301, 302, 303, 64, 43, 00912 45, 42, 47, 37, 304, 305, 306, 46, 91, 307, 00913 93, 126, 33, 40, 58 00914 }; 00915 # endif 00916 00917 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ 00918 static const yytype_uint8 yyr1[] = 00919 { 00920 0, 75, 76, 77, 77, 77, 78, 78, 79, 79, 00921 79, 79, 79, 80, 80, 81, 81, 81, 81, 81, 00922 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 00923 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 00924 81, 81, 81, 81, 81, 81, 81, 81, 82, 83, 00925 83, 83, 83, 84, 84, 84, 85, 85, 86, 86, 00926 86, 86, 87, 87, 88, 88, 89, 89, 90, 90, 00927 90, 90, 91, 92, 92, 93, 93, 93, 93, 93, 00928 94, 94, 94, 94, 94, 95, 95, 95, 96, 96, 00929 97, 97, 97, 98, 98, 99, 99, 99, 99, 99, 00930 99, 100, 100, 101, 101, 101, 101, 101, 101, 101, 00931 102, 102, 102, 102, 103, 103, 104, 104, 104, 104, 00932 104, 104, 104, 104, 104, 104, 104, 104, 105, 105, 00933 105, 106, 106, 106, 106, 107, 107, 107, 107, 107, 00934 108, 108, 109, 109, 110, 110, 110, 110, 111, 111, 00935 111, 111, 111, 112, 112, 112, 112, 112, 113, 114, 00936 114, 114, 114, 113, 113, 113, 113, 113, 113, 113, 00937 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 00938 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 00939 113, 113, 113, 113, 113 00940 }; 00941 00942 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ 00943 static const yytype_uint8 yyr2[] = 00944 { 00945 0, 2, 1, 1, 1, 1, 0, 2, 2, 3, 00946 3, 2, 2, 2, 4, 2, 2, 4, 4, 2, 00947 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00948 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00949 2, 2, 2, 2, 3, 2, 3, 3, 2, 2, 00950 1, 3, 2, 1, 4, 2, 1, 2, 2, 1, 00951 2, 1, 1, 1, 1, 2, 2, 1, 2, 3, 00952 2, 3, 4, 1, 3, 1, 2, 2, 4, 1, 00953 1, 2, 3, 4, 3, 4, 4, 3, 0, 1, 00954 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 00955 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 00956 2, 1, 3, 4, 2, 3, 2, 1, 3, 2, 00957 2, 1, 3, 2, 3, 2, 4, 3, 1, 2, 00958 1, 3, 2, 2, 1, 1, 2, 1, 4, 2, 00959 1, 2, 2, 1, 3, 2, 2, 1, 2, 1, 00960 1, 4, 4, 4, 2, 2, 2, 2, 3, 1, 00961 3, 2, 4, 2, 2, 2, 4, 7, 7, 7, 00962 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 00963 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 00964 1, 1, 4, 1, 1 00965 }; 00966 00967 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. 00968 Performed when YYTABLE doesn't specify something else to do. Zero 00969 means the default is an error. */ 00970 static const yytype_uint8 yydefact[] = 00971 { 00972 0, 59, 97, 0, 0, 96, 99, 100, 95, 92, 00973 91, 105, 107, 90, 109, 104, 98, 108, 0, 0, 00974 0, 0, 2, 5, 4, 53, 50, 6, 67, 121, 00975 0, 64, 0, 61, 93, 0, 101, 103, 117, 140, 00976 3, 68, 0, 52, 125, 65, 0, 0, 15, 16, 00977 32, 43, 29, 40, 39, 26, 24, 25, 36, 35, 00978 30, 31, 38, 37, 34, 33, 19, 20, 21, 22, 00979 23, 42, 41, 0, 45, 27, 28, 0, 0, 48, 00980 106, 13, 0, 55, 1, 0, 0, 0, 111, 88, 00981 0, 0, 11, 0, 0, 6, 135, 134, 137, 12, 00982 120, 0, 6, 58, 49, 66, 60, 70, 94, 0, 00983 123, 119, 99, 102, 116, 0, 0, 0, 62, 56, 00984 149, 63, 0, 6, 128, 141, 130, 8, 150, 190, 00985 191, 0, 0, 0, 0, 193, 194, 0, 0, 0, 00986 0, 0, 0, 73, 75, 79, 124, 51, 0, 0, 00987 47, 44, 46, 0, 0, 7, 0, 110, 89, 0, 00988 114, 0, 109, 88, 0, 0, 0, 128, 80, 0, 00989 0, 88, 0, 0, 139, 0, 136, 132, 133, 10, 00990 69, 71, 127, 122, 118, 57, 0, 128, 156, 157, 00991 9, 0, 129, 148, 132, 154, 155, 0, 0, 0, 00992 0, 0, 77, 163, 165, 164, 0, 140, 0, 159, 00993 0, 0, 72, 76, 0, 0, 0, 0, 0, 0, 00994 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 00995 0, 0, 0, 0, 17, 18, 14, 54, 88, 115, 00996 0, 88, 87, 88, 0, 81, 131, 112, 0, 0, 00997 126, 0, 147, 128, 0, 143, 0, 0, 0, 0, 00998 0, 0, 0, 0, 161, 0, 0, 158, 74, 0, 00999 186, 185, 184, 183, 182, 178, 177, 181, 180, 179, 01000 176, 175, 173, 174, 170, 171, 172, 188, 187, 113, 01001 86, 85, 84, 82, 138, 0, 142, 153, 145, 146, 01002 151, 152, 192, 0, 0, 0, 78, 0, 166, 160, 01003 0, 83, 144, 0, 0, 0, 162, 189, 0, 0, 01004 0, 167, 169, 168 01005 }; 01006 01007 /* YYDEFGOTO[NTERM-NUM]. */ 01008 static const yytype_int16 yydefgoto[] = 01009 { 01010 -1, 21, 155, 92, 23, 24, 25, 26, 27, 28, 01011 118, 29, 252, 30, 31, 78, 33, 142, 143, 166, 01012 95, 157, 34, 35, 36, 37, 38, 167, 97, 39, 01013 169, 126, 99, 40, 254, 255, 127, 128, 209, 210 01014 }; 01015 01016 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 01017 STATE-NUM. */ 01018 #define YYPACT_NINF -193 01019 static const yytype_int16 yypact[] = 01020 { 01021 771, 28, -193, 45, 545, -193, -16, -193, -193, -193, 01022 -193, -193, -193, -193, -193, -193, -193, -193, 771, 771, 01023 15, 58, -193, -193, -193, -4, -193, 5, -193, 116, 01024 -22, -193, 48, 55, 116, 887, -193, 244, 116, 295, 01025 -193, -193, 390, -193, 116, -193, 48, 66, 31, 36, 01026 -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, 01027 -193, -193, -193, -193, -193, -193, -193, -193, -193, -193, 01028 -193, -193, -193, 13, 34, -193, -193, 70, 102, -193, 01029 -193, -193, 81, -193, -193, 390, 28, 771, -193, 116, 01030 6, 610, -193, 8, 55, 98, 52, -193, -38, -193, 01031 -193, 512, 98, 33, -193, -193, 115, -193, -193, 66, 01032 116, 116, -193, -193, -193, 65, 798, 610, -193, -193, 01033 -38, -193, 51, 98, 311, -193, -38, -193, -38, -193, 01034 -193, 56, 83, 87, 91, -193, -193, 663, 266, 266, 01035 266, 454, 7, -193, 285, 904, -193, -193, 75, 96, 01036 -193, -193, -193, 771, 10, -193, 67, -193, -193, 100, 01037 -193, 66, 110, 116, 285, 27, 106, 285, 285, 130, 01038 33, 116, 115, 771, -193, 169, -193, 167, -193, -193, 01039 -193, -193, 116, -193, -193, -193, 69, 718, 171, -193, 01040 -193, 285, -193, -193, -193, 172, -193, 863, 863, 863, 01041 863, 771, -193, -41, -41, -41, 687, 285, 140, 878, 01042 144, 390, -193, -193, 266, 266, 266, 266, 266, 266, 01043 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 01044 266, 266, 183, 185, -193, -193, -193, -193, 116, -193, 01045 32, 116, -193, 116, 795, -193, -193, -193, 37, 771, 01046 -193, 718, -193, 718, 152, -38, 771, 771, 153, 145, 01047 146, 147, 156, 771, -193, 266, 266, -193, -193, 694, 01048 928, 951, 973, 994, 1014, 593, 593, 1028, 1028, 1028, 01049 375, 375, 308, 308, -41, -41, -41, -193, -193, -193, 01050 -193, -193, -193, 285, -193, 161, -193, -193, -193, -193, 01051 -193, -193, -193, 131, 160, 164, -193, 162, -41, 904, 01052 266, -193, -193, 492, 492, 492, -193, 904, 193, 199, 01053 200, -193, -193, -193 01054 }; 01055 01056 /* YYPGOTO[NTERM-NUM]. */ 01057 static const yytype_int16 yypgoto[] = 01058 { 01059 -193, -193, 25, 57, -193, -193, -193, 1, -193, 9, 01060 -193, -1, -34, -24, 3, 0, 150, 157, 47, -193, 01061 -23, -149, -193, 210, 208, -193, 212, -15, -97, 188, 01062 -18, -19, 165, 151, -192, -193, 138, -193, -6, -159 01063 }; 01064 01065 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If 01066 positive, shift that token. If negative, reduce the rule which 01067 number is the opposite. If YYTABLE_NINF, syntax error. */ 01068 #define YYTABLE_NINF -1 01069 static const yytype_uint16 yytable[] = 01070 { 01071 32, 178, 44, 46, 43, 120, 45, 102, 98, 159, 01072 86, 80, 96, 170, 242, 121, 123, 87, 32, 32, 01073 83, 125, 247, 189, 124, 22, 232, 93, 233, 178, 01074 90, 196, 103, 104, 110, 101, 145, 103, 119, 122, 01075 41, 105, 170, 81, 82, 180, 44, 147, 85, 211, 01076 1, 101, 211, 103, 88, 105, 103, 86, 84, 295, 01077 212, 296, 4, 237, 175, 4, 89, 107, 116, 171, 01078 1, 1, 103, 90, 103, 177, 160, 98, 91, 145, 01079 42, 96, 116, 150, 4, 42, 116, 156, 171, 289, 01080 120, 165, 290, 238, 291, 151, 93, 188, 238, 148, 01081 121, 88, 187, 194, 149, 195, 192, 103, 182, 124, 01082 173, 152, 171, 89, 185, 186, 20, 165, 45, 20, 01083 90, 153, 20, 119, 122, 91, 213, 181, 238, 197, 01084 238, 105, 203, 204, 205, 198, 20, 32, 20, 199, 01085 20, 9, 10, 200, 93, 234, 13, 243, 244, 192, 01086 245, 241, 174, 32, 318, 319, 320, 104, 299, 179, 01087 44, 240, 202, 121, 93, 105, 235, 93, 93, 192, 01088 239, 246, 253, 32, 86, 248, 187, 94, 236, 249, 01089 190, 265, 106, 256, 257, 267, 119, 122, 287, 125, 01090 288, 93, 79, 297, 302, 105, 106, 306, 303, 304, 01091 305, 32, 312, 316, 313, 145, 32, 93, 269, 270, 01092 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 01093 281, 282, 283, 284, 285, 286, 262, 121, 106, 121, 01094 144, 264, 298, 314, 321, 192, 253, 315, 253, 100, 01095 322, 323, 154, 172, 108, 113, 94, 111, 114, 32, 01096 119, 122, 119, 122, 146, 2, 32, 32, 268, 308, 01097 309, 176, 193, 32, 0, 5, 112, 7, 8, 129, 01098 130, 0, 106, 144, 294, 311, 131, 16, 0, 168, 01099 0, 300, 301, 0, 132, 133, 134, 0, 307, 168, 01100 86, 0, 208, 93, 94, 0, 0, 175, 0, 158, 01101 1, 0, 135, 136, 317, 168, 106, 115, 0, 0, 01102 0, 0, 116, 0, 94, 106, 1, 94, 94, 0, 01103 183, 184, 0, 115, 0, 94, 138, 0, 116, 207, 01104 0, 0, 0, 0, 88, 0, 106, 139, 140, 141, 01105 0, 94, 0, 0, 88, 0, 89, 0, 258, 259, 01106 260, 261, 0, 90, 0, 0, 89, 94, 164, 0, 01107 88, 0, 0, 90, 0, 0, 20, 0, 117, 229, 01108 230, 231, 89, 158, 0, 232, 0, 233, 0, 90, 01109 0, 158, 20, 0, 191, 207, 207, 207, 207, 0, 01110 106, 0, 250, 129, 130, 1, 0, 0, 172, 144, 01111 131, 2, 47, 0, 0, 0, 0, 0, 132, 133, 01112 134, 5, 6, 7, 8, 9, 10, 11, 12, 0, 01113 13, 14, 15, 16, 17, 0, 135, 136, 0, 0, 01114 0, 0, 293, 0, 227, 228, 229, 230, 231, 137, 01115 0, 0, 232, 94, 233, 0, 0, 0, 158, 0, 01116 138, 158, 0, 158, 0, 0, 0, 129, 130, 1, 01117 0, 139, 140, 141, 131, 2, 47, 0, 0, 0, 01118 0, 0, 132, 133, 134, 5, 6, 7, 8, 9, 01119 10, 11, 12, 0, 13, 14, 15, 16, 17, 0, 01120 135, 136, 0, 0, 0, 129, 130, 0, 0, 0, 01121 0, 0, 131, 206, 0, 0, 0, 0, 0, 0, 01122 132, 133, 134, 0, 138, 0, 0, 1, 0, 0, 01123 0, 0, 0, 2, 47, 139, 140, 141, 135, 136, 01124 0, 0, 0, 5, 6, 7, 8, 9, 10, 11, 01125 12, 206, 13, 162, 15, 16, 17, 0, 0, 0, 01126 1, 0, 138, 163, 0, 0, 2, 47, 0, 0, 01127 48, 49, 0, 139, 140, 141, 5, 6, 7, 8, 01128 9, 10, 11, 12, 0, 13, 14, 15, 16, 17, 01129 50, 0, 0, 0, 0, 0, 0, 51, 52, 0, 01130 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 01131 63, 64, 65, 0, 66, 67, 68, 69, 70, 71, 01132 72, 0, 0, 73, 74, 1, 75, 76, 77, 0, 01133 0, 2, 161, 0, 0, 0, 0, 0, 0, 0, 01134 0, 5, 6, 7, 8, 9, 10, 11, 12, 0, 01135 13, 162, 15, 16, 17, 222, 0, 223, 224, 225, 01136 226, 163, 227, 228, 229, 230, 231, 0, 0, 88, 01137 232, 0, 233, 0, 0, 0, 0, 0, 1, 0, 01138 0, 89, 0, 0, 2, 3, 0, 0, 90, 0, 01139 4, 0, 0, 164, 5, 6, 7, 8, 9, 10, 01140 11, 12, 1, 13, 14, 15, 16, 17, 2, 3, 01141 0, 18, 19, 0, 4, 0, 0, 0, 5, 6, 01142 7, 8, 9, 10, 11, 12, 0, 13, 14, 15, 01143 16, 17, 0, 1, 0, 18, 19, 0, 0, 0, 01144 115, 0, 0, 0, 20, 116, 201, 0, 214, 215, 01145 216, 217, 218, 219, 220, 221, 222, 0, 223, 224, 01146 225, 226, 0, 227, 228, 229, 230, 231, 20, 0, 01147 263, 232, 0, 233, 0, 0, 0, 88, 310, 0, 01148 0, 0, 0, 0, 0, 0, 1, 0, 0, 89, 01149 0, 0, 2, 3, 0, 0, 90, 0, 4, 20, 01150 0, 251, 5, 6, 7, 8, 9, 10, 11, 12, 01151 1, 13, 14, 15, 16, 17, 2, 47, 0, 18, 01152 19, 0, 0, 48, 49, 0, 5, 6, 7, 8, 01153 9, 10, 11, 12, 292, 13, 14, 15, 16, 17, 01154 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 01155 51, 52, 20, 53, 54, 55, 56, 57, 58, 59, 01156 60, 61, 62, 63, 64, 65, 0, 66, 67, 68, 01157 69, 70, 71, 72, 0, 0, 73, 74, 1, 75, 01158 76, 77, 0, 0, 2, 47, 0, 0, 0, 0, 01159 0, 0, 0, 0, 5, 6, 7, 8, 9, 10, 01160 11, 12, 1, 13, 14, 15, 16, 17, 2, 109, 01161 0, 0, 0, 0, 0, 0, 0, 0, 5, 6, 01162 7, 8, 0, 0, 11, 12, 0, 0, 14, 15, 01163 16, 17, 214, 215, 216, 217, 218, 219, 220, 221, 01164 222, 266, 223, 224, 225, 226, 0, 227, 228, 229, 01165 230, 231, 0, 0, 0, 232, 0, 233, 214, 215, 01166 216, 217, 218, 219, 220, 221, 222, 0, 223, 224, 01167 225, 226, 0, 227, 228, 229, 230, 231, 0, 0, 01168 0, 232, 0, 233, 216, 217, 218, 219, 220, 221, 01169 222, 0, 223, 224, 225, 226, 0, 227, 228, 229, 01170 230, 231, 0, 0, 0, 232, 0, 233, 217, 218, 01171 219, 220, 221, 222, 0, 223, 224, 225, 226, 0, 01172 227, 228, 229, 230, 231, 0, 0, 0, 232, 0, 01173 233, 218, 219, 220, 221, 222, 0, 223, 224, 225, 01174 226, 0, 227, 228, 229, 230, 231, 0, 0, 0, 01175 232, 0, 233, 219, 220, 221, 222, 0, 223, 224, 01176 225, 226, 0, 227, 228, 229, 230, 231, 0, 0, 01177 0, 232, 0, 233, 220, 221, 222, 0, 223, 224, 01178 225, 226, 0, 227, 228, 229, 230, 231, 0, 0, 01179 0, 232, 0, 233, 225, 226, 0, 227, 228, 229, 01180 230, 231, 0, 0, 0, 232, 0, 233 01181 }; 01182 01183 #define yypact_value_is_default(yystate) \ 01184 ((yystate) == (-193)) 01185 01186 #define yytable_value_is_error(yytable_value) \ 01187 YYID (0) 01188 01189 static const yytype_int16 yycheck[] = 01190 { 01191 0, 98, 3, 3, 3, 39, 3, 30, 27, 3, 01192 5, 27, 27, 5, 163, 39, 39, 12, 18, 19, 01193 5, 39, 171, 120, 39, 0, 67, 27, 69, 126, 01194 68, 128, 5, 32, 35, 73, 42, 5, 39, 39, 01195 12, 32, 5, 18, 19, 12, 47, 46, 52, 42, 01196 5, 73, 42, 5, 49, 46, 5, 5, 0, 251, 01197 53, 253, 17, 53, 12, 17, 61, 12, 17, 61, 01198 5, 5, 5, 68, 5, 98, 70, 96, 73, 85, 01199 52, 96, 17, 70, 17, 52, 17, 87, 61, 238, 01200 124, 91, 241, 61, 243, 61, 96, 120, 61, 68, 01201 124, 49, 117, 126, 68, 128, 124, 5, 109, 124, 01202 12, 41, 61, 61, 115, 115, 71, 117, 115, 71, 01203 68, 40, 71, 124, 124, 73, 144, 12, 61, 73, 01204 61, 122, 138, 139, 140, 52, 71, 137, 71, 52, 01205 71, 25, 26, 52, 144, 70, 30, 41, 42, 167, 01206 168, 41, 95, 153, 313, 314, 315, 156, 255, 102, 01207 161, 161, 137, 187, 164, 156, 70, 167, 168, 187, 01208 70, 41, 187, 173, 5, 175, 191, 27, 153, 12, 01209 123, 41, 32, 12, 12, 41, 187, 187, 5, 207, 01210 5, 191, 4, 41, 41, 186, 46, 41, 53, 53, 01211 53, 201, 41, 41, 73, 211, 206, 207, 214, 215, 01212 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 01213 226, 227, 228, 229, 230, 231, 201, 251, 78, 253, 01214 42, 206, 255, 73, 41, 253, 251, 73, 253, 29, 01215 41, 41, 85, 93, 34, 37, 96, 35, 38, 249, 01216 251, 251, 253, 253, 44, 11, 256, 257, 211, 265, 01217 266, 96, 124, 263, -1, 21, 22, 23, 24, 3, 01218 4, -1, 122, 85, 249, 293, 10, 33, -1, 91, 01219 -1, 256, 257, -1, 18, 19, 20, -1, 263, 101, 01220 5, -1, 141, 293, 144, -1, -1, 12, -1, 89, 01221 5, -1, 36, 37, 310, 117, 156, 12, -1, -1, 01222 -1, -1, 17, -1, 164, 165, 5, 167, 168, -1, 01223 110, 111, -1, 12, -1, 175, 60, -1, 17, 141, 01224 -1, -1, -1, -1, 49, -1, 186, 71, 72, 73, 01225 -1, 191, -1, -1, 49, -1, 61, -1, 197, 198, 01226 199, 200, -1, 68, -1, -1, 61, 207, 73, -1, 01227 49, -1, -1, 68, -1, -1, 71, -1, 73, 61, 01228 62, 63, 61, 163, -1, 67, -1, 69, -1, 68, 01229 -1, 171, 71, -1, 73, 197, 198, 199, 200, -1, 01230 240, -1, 182, 3, 4, 5, -1, -1, 248, 211, 01231 10, 11, 12, -1, -1, -1, -1, -1, 18, 19, 01232 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, 01233 30, 31, 32, 33, 34, -1, 36, 37, -1, -1, 01234 -1, -1, 244, -1, 59, 60, 61, 62, 63, 49, 01235 -1, -1, 67, 293, 69, -1, -1, -1, 238, -1, 01236 60, 241, -1, 243, -1, -1, -1, 3, 4, 5, 01237 -1, 71, 72, 73, 10, 11, 12, -1, -1, -1, 01238 -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, 01239 26, 27, 28, -1, 30, 31, 32, 33, 34, -1, 01240 36, 37, -1, -1, -1, 3, 4, -1, -1, -1, 01241 -1, -1, 10, 49, -1, -1, -1, -1, -1, -1, 01242 18, 19, 20, -1, 60, -1, -1, 5, -1, -1, 01243 -1, -1, -1, 11, 12, 71, 72, 73, 36, 37, 01244 -1, -1, -1, 21, 22, 23, 24, 25, 26, 27, 01245 28, 49, 30, 31, 32, 33, 34, -1, -1, -1, 01246 5, -1, 60, 41, -1, -1, 11, 12, -1, -1, 01247 15, 16, -1, 71, 72, 73, 21, 22, 23, 24, 01248 25, 26, 27, 28, -1, 30, 31, 32, 33, 34, 01249 35, -1, -1, -1, -1, -1, -1, 42, 43, -1, 01250 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 01251 55, 56, 57, -1, 59, 60, 61, 62, 63, 64, 01252 65, -1, -1, 68, 69, 5, 71, 72, 73, -1, 01253 -1, 11, 12, -1, -1, -1, -1, -1, -1, -1, 01254 -1, 21, 22, 23, 24, 25, 26, 27, 28, -1, 01255 30, 31, 32, 33, 34, 52, -1, 54, 55, 56, 01256 57, 41, 59, 60, 61, 62, 63, -1, -1, 49, 01257 67, -1, 69, -1, -1, -1, -1, -1, 5, -1, 01258 -1, 61, -1, -1, 11, 12, -1, -1, 68, -1, 01259 17, -1, -1, 73, 21, 22, 23, 24, 25, 26, 01260 27, 28, 5, 30, 31, 32, 33, 34, 11, 12, 01261 -1, 38, 39, -1, 17, -1, -1, -1, 21, 22, 01262 23, 24, 25, 26, 27, 28, -1, 30, 31, 32, 01263 33, 34, -1, 5, -1, 38, 39, -1, -1, -1, 01264 12, -1, -1, -1, 71, 17, 73, -1, 44, 45, 01265 46, 47, 48, 49, 50, 51, 52, -1, 54, 55, 01266 56, 57, -1, 59, 60, 61, 62, 63, 71, -1, 01267 73, 67, -1, 69, -1, -1, -1, 49, 74, -1, 01268 -1, -1, -1, -1, -1, -1, 5, -1, -1, 61, 01269 -1, -1, 11, 12, -1, -1, 68, -1, 17, 71, 01270 -1, 73, 21, 22, 23, 24, 25, 26, 27, 28, 01271 5, 30, 31, 32, 33, 34, 11, 12, -1, 38, 01272 39, -1, -1, 15, 16, -1, 21, 22, 23, 24, 01273 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 01274 -1, -1, -1, 35, -1, -1, -1, -1, -1, -1, 01275 42, 43, 71, 45, 46, 47, 48, 49, 50, 51, 01276 52, 53, 54, 55, 56, 57, -1, 59, 60, 61, 01277 62, 63, 64, 65, -1, -1, 68, 69, 5, 71, 01278 72, 73, -1, -1, 11, 12, -1, -1, -1, -1, 01279 -1, -1, -1, -1, 21, 22, 23, 24, 25, 26, 01280 27, 28, 5, 30, 31, 32, 33, 34, 11, 12, 01281 -1, -1, -1, -1, -1, -1, -1, -1, 21, 22, 01282 23, 24, -1, -1, 27, 28, -1, -1, 31, 32, 01283 33, 34, 44, 45, 46, 47, 48, 49, 50, 51, 01284 52, 53, 54, 55, 56, 57, -1, 59, 60, 61, 01285 62, 63, -1, -1, -1, 67, -1, 69, 44, 45, 01286 46, 47, 48, 49, 50, 51, 52, -1, 54, 55, 01287 56, 57, -1, 59, 60, 61, 62, 63, -1, -1, 01288 -1, 67, -1, 69, 46, 47, 48, 49, 50, 51, 01289 52, -1, 54, 55, 56, 57, -1, 59, 60, 61, 01290 62, 63, -1, -1, -1, 67, -1, 69, 47, 48, 01291 49, 50, 51, 52, -1, 54, 55, 56, 57, -1, 01292 59, 60, 61, 62, 63, -1, -1, -1, 67, -1, 01293 69, 48, 49, 50, 51, 52, -1, 54, 55, 56, 01294 57, -1, 59, 60, 61, 62, 63, -1, -1, -1, 01295 67, -1, 69, 49, 50, 51, 52, -1, 54, 55, 01296 56, 57, -1, 59, 60, 61, 62, 63, -1, -1, 01297 -1, 67, -1, 69, 50, 51, 52, -1, 54, 55, 01298 56, 57, -1, 59, 60, 61, 62, 63, -1, -1, 01299 -1, 67, -1, 69, 56, 57, -1, 59, 60, 61, 01300 62, 63, -1, -1, -1, 67, -1, 69 01301 }; 01302 01303 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing 01304 symbol of state STATE-NUM. */ 01305 static const yytype_uint8 yystos[] = 01306 { 01307 0, 5, 11, 12, 17, 21, 22, 23, 24, 25, 01308 26, 27, 28, 30, 31, 32, 33, 34, 38, 39, 01309 71, 76, 77, 79, 80, 81, 82, 83, 84, 86, 01310 88, 89, 90, 91, 97, 98, 99, 100, 101, 104, 01311 108, 12, 52, 82, 86, 89, 90, 12, 15, 16, 01312 35, 42, 43, 45, 46, 47, 48, 49, 50, 51, 01313 52, 53, 54, 55, 56, 57, 59, 60, 61, 62, 01314 63, 64, 65, 68, 69, 71, 72, 73, 90, 104, 01315 27, 77, 77, 5, 0, 52, 5, 12, 49, 61, 01316 68, 73, 78, 90, 91, 95, 102, 103, 106, 107, 01317 98, 73, 95, 5, 82, 84, 91, 12, 98, 12, 01318 86, 101, 22, 99, 98, 12, 17, 73, 85, 86, 01319 87, 88, 90, 95, 102, 105, 106, 111, 112, 3, 01320 4, 10, 18, 19, 20, 36, 37, 49, 60, 71, 01321 72, 73, 92, 93, 104, 113, 98, 82, 68, 68, 01322 70, 61, 41, 40, 92, 77, 90, 96, 98, 3, 01323 70, 12, 31, 41, 73, 90, 94, 102, 104, 105, 01324 5, 61, 91, 12, 78, 12, 107, 95, 103, 78, 01325 12, 12, 86, 98, 98, 86, 90, 102, 95, 103, 01326 78, 73, 105, 111, 95, 95, 103, 73, 52, 52, 01327 52, 73, 77, 113, 113, 113, 49, 104, 108, 113, 01328 114, 42, 53, 105, 44, 45, 46, 47, 48, 49, 01329 50, 51, 52, 54, 55, 56, 57, 59, 60, 61, 01330 62, 63, 67, 69, 70, 70, 77, 53, 61, 70, 01331 90, 41, 96, 41, 42, 105, 41, 96, 90, 12, 01332 98, 73, 87, 102, 109, 110, 12, 12, 108, 108, 01333 108, 108, 77, 73, 77, 41, 53, 41, 93, 113, 01334 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 01335 113, 113, 113, 113, 113, 113, 113, 5, 5, 96, 01336 96, 96, 29, 104, 77, 109, 109, 41, 95, 103, 01337 77, 77, 41, 53, 53, 53, 41, 77, 113, 113, 01338 74, 105, 41, 73, 73, 73, 41, 113, 114, 114, 01339 114, 41, 41, 41 01340 }; 01341 01342 #define yyerrok (yyerrstatus = 0) 01343 #define yyclearin (yychar = YYEMPTY) 01344 #define YYEMPTY (-2) 01345 #define YYEOF 0 01346 01347 #define YYACCEPT goto yyacceptlab 01348 #define YYABORT goto yyabortlab 01349 #define YYERROR goto yyerrorlab 01350 01351 01352 /* Like YYERROR except do call yyerror. This remains here temporarily 01353 to ease the transition to the new meaning of YYERROR, for GCC. 01354 Once GCC version 2 has supplanted version 1, this can go. However, 01355 YYFAIL appears to be in use. Nevertheless, it is formally deprecated 01356 in Bison 2.4.2's NEWS entry, where a plan to phase it out is 01357 discussed. */ 01358 01359 #define YYFAIL goto yyerrlab 01360 #if defined YYFAIL 01361 /* This is here to suppress warnings from the GCC cpp's 01362 -Wunused-macros. Normally we don't worry about that warning, but 01363 some users do, and we want to make it easy for users to remove 01364 YYFAIL uses, which will produce warnings from Bison 2.5. */ 01365 #endif 01366 01367 #define YYRECOVERING() (!!yyerrstatus) 01368 01369 #define YYBACKUP(Token, Value) \ 01370 do \ 01371 if (yychar == YYEMPTY && yylen == 1) \ 01372 { \ 01373 yychar = (Token); \ 01374 yylval = (Value); \ 01375 YYPOPSTACK (1); \ 01376 goto yybackup; \ 01377 } \ 01378 else \ 01379 { \ 01380 yyerror (YY_("syntax error: cannot back up")); \ 01381 YYERROR; \ 01382 } \ 01383 while (YYID (0)) 01384 01385 01386 #define YYTERROR 1 01387 #define YYERRCODE 256 01388 01389 01390 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. 01391 If N is 0, then set CURRENT to the empty location which ends 01392 the previous symbol: RHS[0] (always defined). */ 01393 01394 #define YYRHSLOC(Rhs, K) ((Rhs)[K]) 01395 #ifndef YYLLOC_DEFAULT 01396 # define YYLLOC_DEFAULT(Current, Rhs, N) \ 01397 do \ 01398 if (YYID (N)) \ 01399 { \ 01400 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ 01401 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ 01402 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ 01403 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ 01404 } \ 01405 else \ 01406 { \ 01407 (Current).first_line = (Current).last_line = \ 01408 YYRHSLOC (Rhs, 0).last_line; \ 01409 (Current).first_column = (Current).last_column = \ 01410 YYRHSLOC (Rhs, 0).last_column; \ 01411 } \ 01412 while (YYID (0)) 01413 #endif 01414 01415 01416 /* This macro is provided for backward compatibility. */ 01417 01418 #ifndef YY_LOCATION_PRINT 01419 # define YY_LOCATION_PRINT(File, Loc) ((void) 0) 01420 #endif 01421 01422 01423 /* YYLEX -- calling `yylex' with the right arguments. */ 01424 01425 #ifdef YYLEX_PARAM 01426 # define YYLEX yylex (YYLEX_PARAM) 01427 #else 01428 # define YYLEX yylex () 01429 #endif 01430 01431 /* Enable debugging if requested. */ 01432 #if YYDEBUG 01433 01434 # ifndef YYFPRINTF 01435 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */ 01436 # define YYFPRINTF fprintf 01437 # endif 01438 01439 # define YYDPRINTF(Args) \ 01440 do { \ 01441 if (yydebug) \ 01442 YYFPRINTF Args; \ 01443 } while (YYID (0)) 01444 01445 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ 01446 do { \ 01447 if (yydebug) \ 01448 { \ 01449 YYFPRINTF (stderr, "%s ", Title); \ 01450 yy_symbol_print (stderr, \ 01451 Type, Value); \ 01452 YYFPRINTF (stderr, "\n"); \ 01453 } \ 01454 } while (YYID (0)) 01455 01456 01457 /*--------------------------------. 01458 | Print this symbol on YYOUTPUT. | 01459 `--------------------------------*/ 01460 01461 /*ARGSUSED*/ 01462 #if (defined __STDC__ || defined __C99__FUNC__ \ 01463 || defined __cplusplus || defined _MSC_VER) 01464 static void 01465 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) 01466 #else 01467 static void 01468 yy_symbol_value_print (yyoutput, yytype, yyvaluep) 01469 FILE *yyoutput; 01470 int yytype; 01471 YYSTYPE const * const yyvaluep; 01472 #endif 01473 { 01474 if (!yyvaluep) 01475 return; 01476 # ifdef YYPRINT 01477 if (yytype < YYNTOKENS) 01478 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); 01479 # else 01480 YYUSE (yyoutput); 01481 # endif 01482 switch (yytype) 01483 { 01484 default: 01485 break; 01486 } 01487 } 01488 01489 01490 /*--------------------------------. 01491 | Print this symbol on YYOUTPUT. | 01492 `--------------------------------*/ 01493 01494 #if (defined __STDC__ || defined __C99__FUNC__ \ 01495 || defined __cplusplus || defined _MSC_VER) 01496 static void 01497 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) 01498 #else 01499 static void 01500 yy_symbol_print (yyoutput, yytype, yyvaluep) 01501 FILE *yyoutput; 01502 int yytype; 01503 YYSTYPE const * const yyvaluep; 01504 #endif 01505 { 01506 if (yytype < YYNTOKENS) 01507 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); 01508 else 01509 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); 01510 01511 yy_symbol_value_print (yyoutput, yytype, yyvaluep); 01512 YYFPRINTF (yyoutput, ")"); 01513 } 01514 01515 /*------------------------------------------------------------------. 01516 | yy_stack_print -- Print the state stack from its BOTTOM up to its | 01517 | TOP (included). | 01518 `------------------------------------------------------------------*/ 01519 01520 #if (defined __STDC__ || defined __C99__FUNC__ \ 01521 || defined __cplusplus || defined _MSC_VER) 01522 static void 01523 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) 01524 #else 01525 static void 01526 yy_stack_print (yybottom, yytop) 01527 yytype_int16 *yybottom; 01528 yytype_int16 *yytop; 01529 #endif 01530 { 01531 YYFPRINTF (stderr, "Stack now"); 01532 for (; yybottom <= yytop; yybottom++) 01533 { 01534 int yybot = *yybottom; 01535 YYFPRINTF (stderr, " %d", yybot); 01536 } 01537 YYFPRINTF (stderr, "\n"); 01538 } 01539 01540 # define YY_STACK_PRINT(Bottom, Top) \ 01541 do { \ 01542 if (yydebug) \ 01543 yy_stack_print ((Bottom), (Top)); \ 01544 } while (YYID (0)) 01545 01546 01547 /*------------------------------------------------. 01548 | Report that the YYRULE is going to be reduced. | 01549 `------------------------------------------------*/ 01550 01551 #if (defined __STDC__ || defined __C99__FUNC__ \ 01552 || defined __cplusplus || defined _MSC_VER) 01553 static void 01554 yy_reduce_print (YYSTYPE *yyvsp, int yyrule) 01555 #else 01556 static void 01557 yy_reduce_print (yyvsp, yyrule) 01558 YYSTYPE *yyvsp; 01559 int yyrule; 01560 #endif 01561 { 01562 int yynrhs = yyr2[yyrule]; 01563 int yyi; 01564 unsigned long int yylno = yyrline[yyrule]; 01565 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", 01566 yyrule - 1, yylno); 01567 /* The symbols being reduced. */ 01568 for (yyi = 0; yyi < yynrhs; yyi++) 01569 { 01570 YYFPRINTF (stderr, " $%d = ", yyi + 1); 01571 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], 01572 &(yyvsp[(yyi + 1) - (yynrhs)]) 01573 ); 01574 YYFPRINTF (stderr, "\n"); 01575 } 01576 } 01577 01578 # define YY_REDUCE_PRINT(Rule) \ 01579 do { \ 01580 if (yydebug) \ 01581 yy_reduce_print (yyvsp, Rule); \ 01582 } while (YYID (0)) 01583 01584 /* Nonzero means print parse trace. It is left uninitialized so that 01585 multiple parsers can coexist. */ 01586 int yydebug; 01587 #else /* !YYDEBUG */ 01588 # define YYDPRINTF(Args) 01589 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) 01590 # define YY_STACK_PRINT(Bottom, Top) 01591 # define YY_REDUCE_PRINT(Rule) 01592 #endif /* !YYDEBUG */ 01593 01594 01595 /* YYINITDEPTH -- initial size of the parser's stacks. */ 01596 #ifndef YYINITDEPTH 01597 # define YYINITDEPTH 200 01598 #endif 01599 01600 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only 01601 if the built-in stack extension method is used). 01602 01603 Do not make this value too large; the results are undefined if 01604 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) 01605 evaluated with infinite-precision integer arithmetic. */ 01606 01607 #ifndef YYMAXDEPTH 01608 # define YYMAXDEPTH 10000 01609 #endif 01610 01611 01612 #if YYERROR_VERBOSE 01613 01614 # ifndef yystrlen 01615 # if defined __GLIBC__ && defined _STRING_H 01616 # define yystrlen strlen 01617 # else 01618 /* Return the length of YYSTR. */ 01619 #if (defined __STDC__ || defined __C99__FUNC__ \ 01620 || defined __cplusplus || defined _MSC_VER) 01621 static YYSIZE_T 01622 yystrlen (const char *yystr) 01623 #else 01624 static YYSIZE_T 01625 yystrlen (yystr) 01626 const char *yystr; 01627 #endif 01628 { 01629 YYSIZE_T yylen; 01630 for (yylen = 0; yystr[yylen]; yylen++) 01631 continue; 01632 return yylen; 01633 } 01634 # endif 01635 # endif 01636 01637 # ifndef yystpcpy 01638 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE 01639 # define yystpcpy stpcpy 01640 # else 01641 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in 01642 YYDEST. */ 01643 #if (defined __STDC__ || defined __C99__FUNC__ \ 01644 || defined __cplusplus || defined _MSC_VER) 01645 static char * 01646 yystpcpy (char *yydest, const char *yysrc) 01647 #else 01648 static char * 01649 yystpcpy (yydest, yysrc) 01650 char *yydest; 01651 const char *yysrc; 01652 #endif 01653 { 01654 char *yyd = yydest; 01655 const char *yys = yysrc; 01656 01657 while ((*yyd++ = *yys++) != '\0') 01658 continue; 01659 01660 return yyd - 1; 01661 } 01662 # endif 01663 # endif 01664 01665 # ifndef yytnamerr 01666 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary 01667 quotes and backslashes, so that it's suitable for yyerror. The 01668 heuristic is that double-quoting is unnecessary unless the string 01669 contains an apostrophe, a comma, or backslash (other than 01670 backslash-backslash). YYSTR is taken from yytname. If YYRES is 01671 null, do not copy; instead, return the length of what the result 01672 would have been. */ 01673 static YYSIZE_T 01674 yytnamerr (char *yyres, const char *yystr) 01675 { 01676 if (*yystr == '"') 01677 { 01678 YYSIZE_T yyn = 0; 01679 char const *yyp = yystr; 01680 01681 for (;;) 01682 switch (*++yyp) 01683 { 01684 case '\'': 01685 case ',': 01686 goto do_not_strip_quotes; 01687 01688 case '\\': 01689 if (*++yyp != '\\') 01690 goto do_not_strip_quotes; 01691 /* Fall through. */ 01692 default: 01693 if (yyres) 01694 yyres[yyn] = *yyp; 01695 yyn++; 01696 break; 01697 01698 case '"': 01699 if (yyres) 01700 yyres[yyn] = '\0'; 01701 return yyn; 01702 } 01703 do_not_strip_quotes: ; 01704 } 01705 01706 if (! yyres) 01707 return yystrlen (yystr); 01708 01709 return yystpcpy (yyres, yystr) - yyres; 01710 } 01711 # endif 01712 01713 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message 01714 about the unexpected token YYTOKEN for the state stack whose top is 01715 YYSSP. 01716 01717 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is 01718 not large enough to hold the message. In that case, also set 01719 *YYMSG_ALLOC to the required number of bytes. Return 2 if the 01720 required number of bytes is too large to store. */ 01721 static int 01722 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, 01723 yytype_int16 *yyssp, int yytoken) 01724 { 01725 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]); 01726 YYSIZE_T yysize = yysize0; 01727 YYSIZE_T yysize1; 01728 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; 01729 /* Internationalized format string. */ 01730 const char *yyformat = 0; 01731 /* Arguments of yyformat. */ 01732 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; 01733 /* Number of reported tokens (one for the "unexpected", one per 01734 "expected"). */ 01735 int yycount = 0; 01736 01737 /* There are many possibilities here to consider: 01738 - Assume YYFAIL is not used. It's too flawed to consider. See 01739 <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html> 01740 for details. YYERROR is fine as it does not invoke this 01741 function. 01742 - If this state is a consistent state with a default action, then 01743 the only way this function was invoked is if the default action 01744 is an error action. In that case, don't check for expected 01745 tokens because there are none. 01746 - The only way there can be no lookahead present (in yychar) is if 01747 this state is a consistent state with a default action. Thus, 01748 detecting the absence of a lookahead is sufficient to determine 01749 that there is no unexpected or expected token to report. In that 01750 case, just report a simple "syntax error". 01751 - Don't assume there isn't a lookahead just because this state is a 01752 consistent state with a default action. There might have been a 01753 previous inconsistent state, consistent state with a non-default 01754 action, or user semantic action that manipulated yychar. 01755 - Of course, the expected token list depends on states to have 01756 correct lookahead information, and it depends on the parser not 01757 to perform extra reductions after fetching a lookahead from the 01758 scanner and before detecting a syntax error. Thus, state merging 01759 (from LALR or IELR) and default reductions corrupt the expected 01760 token list. However, the list is correct for canonical LR with 01761 one exception: it will still contain any token that will not be 01762 accepted due to an error action in a later state. 01763 */ 01764 if (yytoken != YYEMPTY) 01765 { 01766 int yyn = yypact[*yyssp]; 01767 yyarg[yycount++] = yytname[yytoken]; 01768 if (!yypact_value_is_default (yyn)) 01769 { 01770 /* Start YYX at -YYN if negative to avoid negative indexes in 01771 YYCHECK. In other words, skip the first -YYN actions for 01772 this state because they are default actions. */ 01773 int yyxbegin = yyn < 0 ? -yyn : 0; 01774 /* Stay within bounds of both yycheck and yytname. */ 01775 int yychecklim = YYLAST - yyn + 1; 01776 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; 01777 int yyx; 01778 01779 for (yyx = yyxbegin; yyx < yyxend; ++yyx) 01780 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR 01781 && !yytable_value_is_error (yytable[yyx + yyn])) 01782 { 01783 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) 01784 { 01785 yycount = 1; 01786 yysize = yysize0; 01787 break; 01788 } 01789 yyarg[yycount++] = yytname[yyx]; 01790 yysize1 = yysize + yytnamerr (0, yytname[yyx]); 01791 if (! (yysize <= yysize1 01792 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) 01793 return 2; 01794 yysize = yysize1; 01795 } 01796 } 01797 } 01798 01799 switch (yycount) 01800 { 01801 # define YYCASE_(N, S) \ 01802 case N: \ 01803 yyformat = S; \ 01804 break 01805 YYCASE_(0, YY_("syntax error")); 01806 YYCASE_(1, YY_("syntax error, unexpected %s")); 01807 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); 01808 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); 01809 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); 01810 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); 01811 # undef YYCASE_ 01812 } 01813 01814 yysize1 = yysize + yystrlen (yyformat); 01815 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) 01816 return 2; 01817 yysize = yysize1; 01818 01819 if (*yymsg_alloc < yysize) 01820 { 01821 *yymsg_alloc = 2 * yysize; 01822 if (! (yysize <= *yymsg_alloc 01823 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) 01824 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; 01825 return 1; 01826 } 01827 01828 /* Avoid sprintf, as that infringes on the user's name space. 01829 Don't have undefined behavior even if the translation 01830 produced a string with the wrong number of "%s"s. */ 01831 { 01832 char *yyp = *yymsg; 01833 int yyi = 0; 01834 while ((*yyp = *yyformat) != '\0') 01835 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) 01836 { 01837 yyp += yytnamerr (yyp, yyarg[yyi++]); 01838 yyformat += 2; 01839 } 01840 else 01841 { 01842 yyp++; 01843 yyformat++; 01844 } 01845 } 01846 return 0; 01847 } 01848 #endif /* YYERROR_VERBOSE */ 01849 01850 /*-----------------------------------------------. 01851 | Release the memory associated to this symbol. | 01852 `-----------------------------------------------*/ 01853 01854 /*ARGSUSED*/ 01855 #if (defined __STDC__ || defined __C99__FUNC__ \ 01856 || defined __cplusplus || defined _MSC_VER) 01857 static void 01858 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) 01859 #else 01860 static void 01861 yydestruct (yymsg, yytype, yyvaluep) 01862 const char *yymsg; 01863 int yytype; 01864 YYSTYPE *yyvaluep; 01865 #endif 01866 { 01867 YYUSE (yyvaluep); 01868 01869 if (!yymsg) 01870 yymsg = "Deleting"; 01871 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); 01872 01873 switch (yytype) 01874 { 01875 01876 default: 01877 break; 01878 } 01879 } 01880 01881 01882 /* Prevent warnings from -Wmissing-prototypes. */ 01883 #ifdef YYPARSE_PARAM 01884 #if defined __STDC__ || defined __cplusplus 01885 int yyparse (void *YYPARSE_PARAM); 01886 #else 01887 int yyparse (); 01888 #endif 01889 #else /* ! YYPARSE_PARAM */ 01890 #if defined __STDC__ || defined __cplusplus 01891 int yyparse (void); 01892 #else 01893 int yyparse (); 01894 #endif 01895 #endif /* ! YYPARSE_PARAM */ 01896 01897 01898 /* The lookahead symbol. */ 01899 int yychar; 01900 01901 /* The semantic value of the lookahead symbol. */ 01902 YYSTYPE yylval; 01903 01904 /* Number of syntax errors so far. */ 01905 int yynerrs; 01906 01907 01908 /*----------. 01909 | yyparse. | 01910 `----------*/ 01911 01912 #ifdef YYPARSE_PARAM 01913 #if (defined __STDC__ || defined __C99__FUNC__ \ 01914 || defined __cplusplus || defined _MSC_VER) 01915 int 01916 yyparse (void *YYPARSE_PARAM) 01917 #else 01918 int 01919 yyparse (YYPARSE_PARAM) 01920 void *YYPARSE_PARAM; 01921 #endif 01922 #else /* ! YYPARSE_PARAM */ 01923 #if (defined __STDC__ || defined __C99__FUNC__ \ 01924 || defined __cplusplus || defined _MSC_VER) 01925 int 01926 yyparse (void) 01927 #else 01928 int 01929 yyparse () 01930 01931 #endif 01932 #endif 01933 { 01934 int yystate; 01935 /* Number of tokens to shift before error messages enabled. */ 01936 int yyerrstatus; 01937 01938 /* The stacks and their tools: 01939 `yyss': related to states. 01940 `yyvs': related to semantic values. 01941 01942 Refer to the stacks thru separate pointers, to allow yyoverflow 01943 to xreallocate them elsewhere. */ 01944 01945 /* The state stack. */ 01946 yytype_int16 yyssa[YYINITDEPTH]; 01947 yytype_int16 *yyss; 01948 yytype_int16 *yyssp; 01949 01950 /* The semantic value stack. */ 01951 YYSTYPE yyvsa[YYINITDEPTH]; 01952 YYSTYPE *yyvs; 01953 YYSTYPE *yyvsp; 01954 01955 YYSIZE_T yystacksize; 01956 01957 int yyn; 01958 int yyresult; 01959 /* Lookahead token as an internal (translated) token number. */ 01960 int yytoken; 01961 /* The variables used to return semantic value and location from the 01962 action routines. */ 01963 YYSTYPE yyval; 01964 01965 #if YYERROR_VERBOSE 01966 /* Buffer for error messages, and its allocated size. */ 01967 char yymsgbuf[128]; 01968 char *yymsg = yymsgbuf; 01969 YYSIZE_T yymsg_alloc = sizeof yymsgbuf; 01970 #endif 01971 01972 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) 01973 01974 /* The number of symbols on the RHS of the reduced rule. 01975 Keep to zero when no symbol should be popped. */ 01976 int yylen = 0; 01977 01978 yytoken = 0; 01979 yyss = yyssa; 01980 yyvs = yyvsa; 01981 yystacksize = YYINITDEPTH; 01982 01983 YYDPRINTF ((stderr, "Starting parse\n")); 01984 01985 yystate = 0; 01986 yyerrstatus = 0; 01987 yynerrs = 0; 01988 yychar = YYEMPTY; /* Cause a token to be read. */ 01989 01990 /* Initialize stack pointers. 01991 Waste one element of value and location stack 01992 so that they stay on the same level as the state stack. 01993 The wasted elements are never initialized. */ 01994 yyssp = yyss; 01995 yyvsp = yyvs; 01996 01997 goto yysetstate; 01998 01999 /*------------------------------------------------------------. 02000 | yynewstate -- Push a new state, which is found in yystate. | 02001 `------------------------------------------------------------*/ 02002 yynewstate: 02003 /* In all cases, when you get here, the value and location stacks 02004 have just been pushed. So pushing a state here evens the stacks. */ 02005 yyssp++; 02006 02007 yysetstate: 02008 *yyssp = yystate; 02009 02010 if (yyss + yystacksize - 1 <= yyssp) 02011 { 02012 /* Get the current used size of the three stacks, in elements. */ 02013 YYSIZE_T yysize = yyssp - yyss + 1; 02014 02015 #ifdef yyoverflow 02016 { 02017 /* Give user a chance to xreallocate the stack. Use copies of 02018 these so that the &'s don't force the real ones into 02019 memory. */ 02020 YYSTYPE *yyvs1 = yyvs; 02021 yytype_int16 *yyss1 = yyss; 02022 02023 /* Each stack pointer address is followed by the size of the 02024 data in use in that stack, in bytes. This used to be a 02025 conditional around just the two extra args, but that might 02026 be undefined if yyoverflow is a macro. */ 02027 yyoverflow (YY_("memory exhausted"), 02028 &yyss1, yysize * sizeof (*yyssp), 02029 &yyvs1, yysize * sizeof (*yyvsp), 02030 &yystacksize); 02031 02032 yyss = yyss1; 02033 yyvs = yyvs1; 02034 } 02035 #else /* no yyoverflow */ 02036 # ifndef YYSTACK_RELOCATE 02037 goto yyexhaustedlab; 02038 # else 02039 /* Extend the stack our own way. */ 02040 if (YYMAXDEPTH <= yystacksize) 02041 goto yyexhaustedlab; 02042 yystacksize *= 2; 02043 if (YYMAXDEPTH < yystacksize) 02044 yystacksize = YYMAXDEPTH; 02045 02046 { 02047 yytype_int16 *yyss1 = yyss; 02048 union yyalloc *yyptr = 02049 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); 02050 if (! yyptr) 02051 goto yyexhaustedlab; 02052 YYSTACK_RELOCATE (yyss_alloc, yyss); 02053 YYSTACK_RELOCATE (yyvs_alloc, yyvs); 02054 # undef YYSTACK_RELOCATE 02055 if (yyss1 != yyssa) 02056 YYSTACK_FREE (yyss1); 02057 } 02058 # endif 02059 #endif /* no yyoverflow */ 02060 02061 yyssp = yyss + yysize - 1; 02062 yyvsp = yyvs + yysize - 1; 02063 02064 YYDPRINTF ((stderr, "Stack size increased to %lu\n", 02065 (unsigned long int) yystacksize)); 02066 02067 if (yyss + yystacksize - 1 <= yyssp) 02068 YYABORT; 02069 } 02070 02071 YYDPRINTF ((stderr, "Entering state %d\n", yystate)); 02072 02073 if (yystate == YYFINAL) 02074 YYACCEPT; 02075 02076 goto yybackup; 02077 02078 /*-----------. 02079 | yybackup. | 02080 `-----------*/ 02081 yybackup: 02082 02083 /* Do appropriate processing given the current state. Read a 02084 lookahead token if we need one and don't already have one. */ 02085 02086 /* First try to decide what to do without reference to lookahead token. */ 02087 yyn = yypact[yystate]; 02088 if (yypact_value_is_default (yyn)) 02089 goto yydefault; 02090 02091 /* Not known => get a lookahead token if don't already have one. */ 02092 02093 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ 02094 if (yychar == YYEMPTY) 02095 { 02096 YYDPRINTF ((stderr, "Reading a token: ")); 02097 yychar = YYLEX; 02098 } 02099 02100 if (yychar <= YYEOF) 02101 { 02102 yychar = yytoken = YYEOF; 02103 YYDPRINTF ((stderr, "Now at end of input.\n")); 02104 } 02105 else 02106 { 02107 yytoken = YYTRANSLATE (yychar); 02108 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); 02109 } 02110 02111 /* If the proper action on seeing token YYTOKEN is to reduce or to 02112 detect an error, take that action. */ 02113 yyn += yytoken; 02114 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) 02115 goto yydefault; 02116 yyn = yytable[yyn]; 02117 if (yyn <= 0) 02118 { 02119 if (yytable_value_is_error (yyn)) 02120 goto yyerrlab; 02121 yyn = -yyn; 02122 goto yyreduce; 02123 } 02124 02125 /* Count tokens shifted since error; after three, turn off error 02126 status. */ 02127 if (yyerrstatus) 02128 yyerrstatus--; 02129 02130 /* Shift the lookahead token. */ 02131 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); 02132 02133 /* Discard the shifted token. */ 02134 yychar = YYEMPTY; 02135 02136 yystate = yyn; 02137 *++yyvsp = yylval; 02138 02139 goto yynewstate; 02140 02141 02142 /*-----------------------------------------------------------. 02143 | yydefault -- do the default action for the current state. | 02144 `-----------------------------------------------------------*/ 02145 yydefault: 02146 yyn = yydefact[yystate]; 02147 if (yyn == 0) 02148 goto yyerrlab; 02149 goto yyreduce; 02150 02151 02152 /*-----------------------------. 02153 | yyreduce -- Do a reduction. | 02154 `-----------------------------*/ 02155 yyreduce: 02156 /* yyn is the number of a rule to reduce with. */ 02157 yylen = yyr2[yyn]; 02158 02159 /* If YYLEN is nonzero, implement the default value of the action: 02160 `$$ = $1'. 02161 02162 Otherwise, the following line sets YYVAL to garbage. 02163 This behavior is undocumented and Bison 02164 users should not rely upon it. Assigning to YYVAL 02165 unconditionally makes the parser a bit smaller, and it avoids a 02166 GCC warning that YYVAL may be used uninitialized. */ 02167 yyval = yyvsp[1-yylen]; 02168 02169 02170 YY_REDUCE_PRINT (yyn); 02171 switch (yyn) 02172 { 02173 case 2: 02174 02175 /* Line 1806 of yacc.c */ 02176 #line 382 "../../src/gdb/cp-name-parser.y" 02177 { global_result = (yyvsp[(1) - (1)].comp); } 02178 break; 02179 02180 case 6: 02181 02182 /* Line 1806 of yacc.c */ 02183 #line 394 "../../src/gdb/cp-name-parser.y" 02184 { (yyval.comp) = NULL; } 02185 break; 02186 02187 case 7: 02188 02189 /* Line 1806 of yacc.c */ 02190 #line 396 "../../src/gdb/cp-name-parser.y" 02191 { (yyval.comp) = (yyvsp[(2) - (2)].comp); } 02192 break; 02193 02194 case 8: 02195 02196 /* Line 1806 of yacc.c */ 02197 #line 403 "../../src/gdb/cp-name-parser.y" 02198 { (yyval.comp) = (yyvsp[(2) - (2)].nested).comp; 02199 *(yyvsp[(2) - (2)].nested).last = (yyvsp[(1) - (2)].comp); 02200 } 02201 break; 02202 02203 case 9: 02204 02205 /* Line 1806 of yacc.c */ 02206 #line 412 "../../src/gdb/cp-name-parser.y" 02207 { (yyval.comp) = fill_comp (DEMANGLE_COMPONENT_TYPED_NAME, (yyvsp[(1) - (3)].comp), (yyvsp[(2) - (3)].nested).comp); 02208 if ((yyvsp[(3) - (3)].comp)) (yyval.comp) = fill_comp (DEMANGLE_COMPONENT_LOCAL_NAME, (yyval.comp), (yyvsp[(3) - (3)].comp)); } 02209 break; 02210 02211 case 10: 02212 02213 /* Line 1806 of yacc.c */ 02214 #line 415 "../../src/gdb/cp-name-parser.y" 02215 { (yyval.comp) = fill_comp (DEMANGLE_COMPONENT_TYPED_NAME, (yyvsp[(1) - (3)].comp), (yyvsp[(2) - (3)].nested).comp); 02216 if ((yyvsp[(3) - (3)].comp)) (yyval.comp) = fill_comp (DEMANGLE_COMPONENT_LOCAL_NAME, (yyval.comp), (yyvsp[(3) - (3)].comp)); } 02217 break; 02218 02219 case 11: 02220 02221 /* Line 1806 of yacc.c */ 02222 #line 419 "../../src/gdb/cp-name-parser.y" 02223 { (yyval.comp) = (yyvsp[(1) - (2)].nested).comp; 02224 if ((yyvsp[(2) - (2)].comp)) (yyval.comp) = fill_comp (DEMANGLE_COMPONENT_LOCAL_NAME, (yyval.comp), (yyvsp[(2) - (2)].comp)); } 02225 break; 02226 02227 case 12: 02228 02229 /* Line 1806 of yacc.c */ 02230 #line 422 "../../src/gdb/cp-name-parser.y" 02231 { if ((yyvsp[(2) - (2)].abstract).last) 02232 { 02233 /* First complete the abstract_declarator's type using 02234 the typespec from the conversion_op_name. */ 02235 *(yyvsp[(2) - (2)].abstract).last = *(yyvsp[(1) - (2)].nested).last; 02236 /* Then complete the conversion_op_name with the type. */ 02237 *(yyvsp[(1) - (2)].nested).last = (yyvsp[(2) - (2)].abstract).comp; 02238 } 02239 /* If we have an arglist, build a function type. */ 02240 if ((yyvsp[(2) - (2)].abstract).fn.comp) 02241 (yyval.comp) = fill_comp (DEMANGLE_COMPONENT_TYPED_NAME, (yyvsp[(1) - (2)].nested).comp, (yyvsp[(2) - (2)].abstract).fn.comp); 02242 else 02243 (yyval.comp) = (yyvsp[(1) - (2)].nested).comp; 02244 if ((yyvsp[(2) - (2)].abstract).start) (yyval.comp) = fill_comp (DEMANGLE_COMPONENT_LOCAL_NAME, (yyval.comp), (yyvsp[(2) - (2)].abstract).start); 02245 } 02246 break; 02247 02248 case 13: 02249 02250 /* Line 1806 of yacc.c */ 02251 #line 441 "../../src/gdb/cp-name-parser.y" 02252 { (yyval.comp) = make_empty ((yyvsp[(1) - (2)].lval)); 02253 d_left ((yyval.comp)) = (yyvsp[(2) - (2)].comp); 02254 d_right ((yyval.comp)) = NULL; } 02255 break; 02256 02257 case 14: 02258 02259 /* Line 1806 of yacc.c */ 02260 #line 445 "../../src/gdb/cp-name-parser.y" 02261 { (yyval.comp) = fill_comp (DEMANGLE_COMPONENT_CONSTRUCTION_VTABLE, (yyvsp[(2) - (4)].comp), (yyvsp[(4) - (4)].comp)); } 02262 break; 02263 02264 case 15: 02265 02266 /* Line 1806 of yacc.c */ 02267 #line 449 "../../src/gdb/cp-name-parser.y" 02268 { 02269 /* Match the whitespacing of cplus_demangle_operators. 02270 It would abort on unrecognized string otherwise. */ 02271 (yyval.comp) = make_operator ("new", 3); 02272 } 02273 break; 02274 02275 case 16: 02276 02277 /* Line 1806 of yacc.c */ 02278 #line 455 "../../src/gdb/cp-name-parser.y" 02279 { 02280 /* Match the whitespacing of cplus_demangle_operators. 02281 It would abort on unrecognized string otherwise. */ 02282 (yyval.comp) = make_operator ("delete ", 1); 02283 } 02284 break; 02285 02286 case 17: 02287 02288 /* Line 1806 of yacc.c */ 02289 #line 461 "../../src/gdb/cp-name-parser.y" 02290 { 02291 /* Match the whitespacing of cplus_demangle_operators. 02292 It would abort on unrecognized string otherwise. */ 02293 (yyval.comp) = make_operator ("new[]", 3); 02294 } 02295 break; 02296 02297 case 18: 02298 02299 /* Line 1806 of yacc.c */ 02300 #line 467 "../../src/gdb/cp-name-parser.y" 02301 { 02302 /* Match the whitespacing of cplus_demangle_operators. 02303 It would abort on unrecognized string otherwise. */ 02304 (yyval.comp) = make_operator ("delete[] ", 1); 02305 } 02306 break; 02307 02308 case 19: 02309 02310 /* Line 1806 of yacc.c */ 02311 #line 473 "../../src/gdb/cp-name-parser.y" 02312 { (yyval.comp) = make_operator ("+", 2); } 02313 break; 02314 02315 case 20: 02316 02317 /* Line 1806 of yacc.c */ 02318 #line 475 "../../src/gdb/cp-name-parser.y" 02319 { (yyval.comp) = make_operator ("-", 2); } 02320 break; 02321 02322 case 21: 02323 02324 /* Line 1806 of yacc.c */ 02325 #line 477 "../../src/gdb/cp-name-parser.y" 02326 { (yyval.comp) = make_operator ("*", 2); } 02327 break; 02328 02329 case 22: 02330 02331 /* Line 1806 of yacc.c */ 02332 #line 479 "../../src/gdb/cp-name-parser.y" 02333 { (yyval.comp) = make_operator ("/", 2); } 02334 break; 02335 02336 case 23: 02337 02338 /* Line 1806 of yacc.c */ 02339 #line 481 "../../src/gdb/cp-name-parser.y" 02340 { (yyval.comp) = make_operator ("%", 2); } 02341 break; 02342 02343 case 24: 02344 02345 /* Line 1806 of yacc.c */ 02346 #line 483 "../../src/gdb/cp-name-parser.y" 02347 { (yyval.comp) = make_operator ("^", 2); } 02348 break; 02349 02350 case 25: 02351 02352 /* Line 1806 of yacc.c */ 02353 #line 485 "../../src/gdb/cp-name-parser.y" 02354 { (yyval.comp) = make_operator ("&", 2); } 02355 break; 02356 02357 case 26: 02358 02359 /* Line 1806 of yacc.c */ 02360 #line 487 "../../src/gdb/cp-name-parser.y" 02361 { (yyval.comp) = make_operator ("|", 2); } 02362 break; 02363 02364 case 27: 02365 02366 /* Line 1806 of yacc.c */ 02367 #line 489 "../../src/gdb/cp-name-parser.y" 02368 { (yyval.comp) = make_operator ("~", 1); } 02369 break; 02370 02371 case 28: 02372 02373 /* Line 1806 of yacc.c */ 02374 #line 491 "../../src/gdb/cp-name-parser.y" 02375 { (yyval.comp) = make_operator ("!", 1); } 02376 break; 02377 02378 case 29: 02379 02380 /* Line 1806 of yacc.c */ 02381 #line 493 "../../src/gdb/cp-name-parser.y" 02382 { (yyval.comp) = make_operator ("=", 2); } 02383 break; 02384 02385 case 30: 02386 02387 /* Line 1806 of yacc.c */ 02388 #line 495 "../../src/gdb/cp-name-parser.y" 02389 { (yyval.comp) = make_operator ("<", 2); } 02390 break; 02391 02392 case 31: 02393 02394 /* Line 1806 of yacc.c */ 02395 #line 497 "../../src/gdb/cp-name-parser.y" 02396 { (yyval.comp) = make_operator (">", 2); } 02397 break; 02398 02399 case 32: 02400 02401 /* Line 1806 of yacc.c */ 02402 #line 499 "../../src/gdb/cp-name-parser.y" 02403 { (yyval.comp) = make_operator ((yyvsp[(2) - (2)].opname), 2); } 02404 break; 02405 02406 case 33: 02407 02408 /* Line 1806 of yacc.c */ 02409 #line 501 "../../src/gdb/cp-name-parser.y" 02410 { (yyval.comp) = make_operator ("<<", 2); } 02411 break; 02412 02413 case 34: 02414 02415 /* Line 1806 of yacc.c */ 02416 #line 503 "../../src/gdb/cp-name-parser.y" 02417 { (yyval.comp) = make_operator (">>", 2); } 02418 break; 02419 02420 case 35: 02421 02422 /* Line 1806 of yacc.c */ 02423 #line 505 "../../src/gdb/cp-name-parser.y" 02424 { (yyval.comp) = make_operator ("==", 2); } 02425 break; 02426 02427 case 36: 02428 02429 /* Line 1806 of yacc.c */ 02430 #line 507 "../../src/gdb/cp-name-parser.y" 02431 { (yyval.comp) = make_operator ("!=", 2); } 02432 break; 02433 02434 case 37: 02435 02436 /* Line 1806 of yacc.c */ 02437 #line 509 "../../src/gdb/cp-name-parser.y" 02438 { (yyval.comp) = make_operator ("<=", 2); } 02439 break; 02440 02441 case 38: 02442 02443 /* Line 1806 of yacc.c */ 02444 #line 511 "../../src/gdb/cp-name-parser.y" 02445 { (yyval.comp) = make_operator (">=", 2); } 02446 break; 02447 02448 case 39: 02449 02450 /* Line 1806 of yacc.c */ 02451 #line 513 "../../src/gdb/cp-name-parser.y" 02452 { (yyval.comp) = make_operator ("&&", 2); } 02453 break; 02454 02455 case 40: 02456 02457 /* Line 1806 of yacc.c */ 02458 #line 515 "../../src/gdb/cp-name-parser.y" 02459 { (yyval.comp) = make_operator ("||", 2); } 02460 break; 02461 02462 case 41: 02463 02464 /* Line 1806 of yacc.c */ 02465 #line 517 "../../src/gdb/cp-name-parser.y" 02466 { (yyval.comp) = make_operator ("++", 1); } 02467 break; 02468 02469 case 42: 02470 02471 /* Line 1806 of yacc.c */ 02472 #line 519 "../../src/gdb/cp-name-parser.y" 02473 { (yyval.comp) = make_operator ("--", 1); } 02474 break; 02475 02476 case 43: 02477 02478 /* Line 1806 of yacc.c */ 02479 #line 521 "../../src/gdb/cp-name-parser.y" 02480 { (yyval.comp) = make_operator (",", 2); } 02481 break; 02482 02483 case 44: 02484 02485 /* Line 1806 of yacc.c */ 02486 #line 523 "../../src/gdb/cp-name-parser.y" 02487 { (yyval.comp) = make_operator ("->*", 2); } 02488 break; 02489 02490 case 45: 02491 02492 /* Line 1806 of yacc.c */ 02493 #line 525 "../../src/gdb/cp-name-parser.y" 02494 { (yyval.comp) = make_operator ("->", 2); } 02495 break; 02496 02497 case 46: 02498 02499 /* Line 1806 of yacc.c */ 02500 #line 527 "../../src/gdb/cp-name-parser.y" 02501 { (yyval.comp) = make_operator ("()", 2); } 02502 break; 02503 02504 case 47: 02505 02506 /* Line 1806 of yacc.c */ 02507 #line 529 "../../src/gdb/cp-name-parser.y" 02508 { (yyval.comp) = make_operator ("[]", 2); } 02509 break; 02510 02511 case 48: 02512 02513 /* Line 1806 of yacc.c */ 02514 #line 537 "../../src/gdb/cp-name-parser.y" 02515 { (yyval.comp) = fill_comp (DEMANGLE_COMPONENT_CAST, (yyvsp[(2) - (2)].comp), NULL); } 02516 break; 02517 02518 case 49: 02519 02520 /* Line 1806 of yacc.c */ 02521 #line 542 "../../src/gdb/cp-name-parser.y" 02522 { (yyval.nested).comp = (yyvsp[(1) - (2)].nested1).comp; 02523 d_right ((yyvsp[(1) - (2)].nested1).last) = (yyvsp[(2) - (2)].comp); 02524 (yyval.nested).last = &d_left ((yyvsp[(2) - (2)].comp)); 02525 } 02526 break; 02527 02528 case 50: 02529 02530 /* Line 1806 of yacc.c */ 02531 #line 547 "../../src/gdb/cp-name-parser.y" 02532 { (yyval.nested).comp = (yyvsp[(1) - (1)].comp); 02533 (yyval.nested).last = &d_left ((yyvsp[(1) - (1)].comp)); 02534 } 02535 break; 02536 02537 case 51: 02538 02539 /* Line 1806 of yacc.c */ 02540 #line 551 "../../src/gdb/cp-name-parser.y" 02541 { (yyval.nested).comp = (yyvsp[(2) - (3)].nested1).comp; 02542 d_right ((yyvsp[(2) - (3)].nested1).last) = (yyvsp[(3) - (3)].comp); 02543 (yyval.nested).last = &d_left ((yyvsp[(3) - (3)].comp)); 02544 } 02545 break; 02546 02547 case 52: 02548 02549 /* Line 1806 of yacc.c */ 02550 #line 556 "../../src/gdb/cp-name-parser.y" 02551 { (yyval.nested).comp = (yyvsp[(2) - (2)].comp); 02552 (yyval.nested).last = &d_left ((yyvsp[(2) - (2)].comp)); 02553 } 02554 break; 02555 02556 case 54: 02557 02558 /* Line 1806 of yacc.c */ 02559 #line 565 "../../src/gdb/cp-name-parser.y" 02560 { (yyval.comp) = fill_comp (DEMANGLE_COMPONENT_TEMPLATE, (yyvsp[(1) - (4)].comp), (yyvsp[(3) - (4)].nested).comp); } 02561 break; 02562 02563 case 55: 02564 02565 /* Line 1806 of yacc.c */ 02566 #line 567 "../../src/gdb/cp-name-parser.y" 02567 { (yyval.comp) = make_dtor (gnu_v3_complete_object_dtor, (yyvsp[(2) - (2)].comp)); } 02568 break; 02569 02570 case 57: 02571 02572 /* Line 1806 of yacc.c */ 02573 #line 580 "../../src/gdb/cp-name-parser.y" 02574 { (yyval.comp) = (yyvsp[(2) - (2)].comp); } 02575 break; 02576 02577 case 58: 02578 02579 /* Line 1806 of yacc.c */ 02580 #line 586 "../../src/gdb/cp-name-parser.y" 02581 { (yyval.comp) = (yyvsp[(1) - (2)].nested1).comp; d_right ((yyvsp[(1) - (2)].nested1).last) = (yyvsp[(2) - (2)].comp); } 02582 break; 02583 02584 case 60: 02585 02586 /* Line 1806 of yacc.c */ 02587 #line 589 "../../src/gdb/cp-name-parser.y" 02588 { (yyval.comp) = (yyvsp[(1) - (2)].nested1).comp; d_right ((yyvsp[(1) - (2)].nested1).last) = (yyvsp[(2) - (2)].comp); } 02589 break; 02590 02591 case 65: 02592 02593 /* Line 1806 of yacc.c */ 02594 #line 599 "../../src/gdb/cp-name-parser.y" 02595 { (yyval.comp) = (yyvsp[(2) - (2)].comp); } 02596 break; 02597 02598 case 66: 02599 02600 /* Line 1806 of yacc.c */ 02601 #line 603 "../../src/gdb/cp-name-parser.y" 02602 { (yyval.comp) = (yyvsp[(1) - (2)].nested1).comp; d_right ((yyvsp[(1) - (2)].nested1).last) = (yyvsp[(2) - (2)].comp); } 02603 break; 02604 02605 case 68: 02606 02607 /* Line 1806 of yacc.c */ 02608 #line 608 "../../src/gdb/cp-name-parser.y" 02609 { (yyval.nested1).comp = make_empty (DEMANGLE_COMPONENT_QUAL_NAME); 02610 d_left ((yyval.nested1).comp) = (yyvsp[(1) - (2)].comp); 02611 d_right ((yyval.nested1).comp) = NULL; 02612 (yyval.nested1).last = (yyval.nested1).comp; 02613 } 02614 break; 02615 02616 case 69: 02617 02618 /* Line 1806 of yacc.c */ 02619 #line 614 "../../src/gdb/cp-name-parser.y" 02620 { (yyval.nested1).comp = (yyvsp[(1) - (3)].nested1).comp; 02621 d_right ((yyvsp[(1) - (3)].nested1).last) = make_empty (DEMANGLE_COMPONENT_QUAL_NAME); 02622 (yyval.nested1).last = d_right ((yyvsp[(1) - (3)].nested1).last); 02623 d_left ((yyval.nested1).last) = (yyvsp[(2) - (3)].comp); 02624 d_right ((yyval.nested1).last) = NULL; 02625 } 02626 break; 02627 02628 case 70: 02629 02630 /* Line 1806 of yacc.c */ 02631 #line 621 "../../src/gdb/cp-name-parser.y" 02632 { (yyval.nested1).comp = make_empty (DEMANGLE_COMPONENT_QUAL_NAME); 02633 d_left ((yyval.nested1).comp) = (yyvsp[(1) - (2)].comp); 02634 d_right ((yyval.nested1).comp) = NULL; 02635 (yyval.nested1).last = (yyval.nested1).comp; 02636 } 02637 break; 02638 02639 case 71: 02640 02641 /* Line 1806 of yacc.c */ 02642 #line 627 "../../src/gdb/cp-name-parser.y" 02643 { (yyval.nested1).comp = (yyvsp[(1) - (3)].nested1).comp; 02644 d_right ((yyvsp[(1) - (3)].nested1).last) = make_empty (DEMANGLE_COMPONENT_QUAL_NAME); 02645 (yyval.nested1).last = d_right ((yyvsp[(1) - (3)].nested1).last); 02646 d_left ((yyval.nested1).last) = (yyvsp[(2) - (3)].comp); 02647 d_right ((yyval.nested1).last) = NULL; 02648 } 02649 break; 02650 02651 case 72: 02652 02653 /* Line 1806 of yacc.c */ 02654 #line 638 "../../src/gdb/cp-name-parser.y" 02655 { (yyval.comp) = fill_comp (DEMANGLE_COMPONENT_TEMPLATE, (yyvsp[(1) - (4)].comp), (yyvsp[(3) - (4)].nested).comp); } 02656 break; 02657 02658 case 73: 02659 02660 /* Line 1806 of yacc.c */ 02661 #line 642 "../../src/gdb/cp-name-parser.y" 02662 { (yyval.nested).comp = fill_comp (DEMANGLE_COMPONENT_TEMPLATE_ARGLIST, (yyvsp[(1) - (1)].comp), NULL); 02663 (yyval.nested).last = &d_right ((yyval.nested).comp); } 02664 break; 02665 02666 case 74: 02667 02668 /* Line 1806 of yacc.c */ 02669 #line 645 "../../src/gdb/cp-name-parser.y" 02670 { (yyval.nested).comp = (yyvsp[(1) - (3)].nested).comp; 02671 *(yyvsp[(1) - (3)].nested).last = fill_comp (DEMANGLE_COMPONENT_TEMPLATE_ARGLIST, (yyvsp[(3) - (3)].comp), NULL); 02672 (yyval.nested).last = &d_right (*(yyvsp[(1) - (3)].nested).last); 02673 } 02674 break; 02675 02676 case 76: 02677 02678 /* Line 1806 of yacc.c */ 02679 #line 657 "../../src/gdb/cp-name-parser.y" 02680 { (yyval.comp) = (yyvsp[(2) - (2)].abstract).comp; 02681 *(yyvsp[(2) - (2)].abstract).last = (yyvsp[(1) - (2)].comp); 02682 } 02683 break; 02684 02685 case 77: 02686 02687 /* Line 1806 of yacc.c */ 02688 #line 661 "../../src/gdb/cp-name-parser.y" 02689 { (yyval.comp) = fill_comp (DEMANGLE_COMPONENT_UNARY, make_operator ("&", 1), (yyvsp[(2) - (2)].comp)); } 02690 break; 02691 02692 case 78: 02693 02694 /* Line 1806 of yacc.c */ 02695 #line 663 "../../src/gdb/cp-name-parser.y" 02696 { (yyval.comp) = fill_comp (DEMANGLE_COMPONENT_UNARY, make_operator ("&", 1), (yyvsp[(3) - (4)].comp)); } 02697 break; 02698 02699 case 80: 02700 02701 /* Line 1806 of yacc.c */ 02702 #line 668 "../../src/gdb/cp-name-parser.y" 02703 { (yyval.nested).comp = fill_comp (DEMANGLE_COMPONENT_ARGLIST, (yyvsp[(1) - (1)].comp), NULL); 02704 (yyval.nested).last = &d_right ((yyval.nested).comp); 02705 } 02706 break; 02707 02708 case 81: 02709 02710 /* Line 1806 of yacc.c */ 02711 #line 672 "../../src/gdb/cp-name-parser.y" 02712 { *(yyvsp[(2) - (2)].abstract).last = (yyvsp[(1) - (2)].comp); 02713 (yyval.nested).comp = fill_comp (DEMANGLE_COMPONENT_ARGLIST, (yyvsp[(2) - (2)].abstract).comp, NULL); 02714 (yyval.nested).last = &d_right ((yyval.nested).comp); 02715 } 02716 break; 02717 02718 case 82: 02719 02720 /* Line 1806 of yacc.c */ 02721 #line 677 "../../src/gdb/cp-name-parser.y" 02722 { *(yyvsp[(1) - (3)].nested).last = fill_comp (DEMANGLE_COMPONENT_ARGLIST, (yyvsp[(3) - (3)].comp), NULL); 02723 (yyval.nested).comp = (yyvsp[(1) - (3)].nested).comp; 02724 (yyval.nested).last = &d_right (*(yyvsp[(1) - (3)].nested).last); 02725 } 02726 break; 02727 02728 case 83: 02729 02730 /* Line 1806 of yacc.c */ 02731 #line 682 "../../src/gdb/cp-name-parser.y" 02732 { *(yyvsp[(4) - (4)].abstract).last = (yyvsp[(3) - (4)].comp); 02733 *(yyvsp[(1) - (4)].nested).last = fill_comp (DEMANGLE_COMPONENT_ARGLIST, (yyvsp[(4) - (4)].abstract).comp, NULL); 02734 (yyval.nested).comp = (yyvsp[(1) - (4)].nested).comp; 02735 (yyval.nested).last = &d_right (*(yyvsp[(1) - (4)].nested).last); 02736 } 02737 break; 02738 02739 case 84: 02740 02741 /* Line 1806 of yacc.c */ 02742 #line 688 "../../src/gdb/cp-name-parser.y" 02743 { *(yyvsp[(1) - (3)].nested).last 02744 = fill_comp (DEMANGLE_COMPONENT_ARGLIST, 02745 make_builtin_type ("..."), 02746 NULL); 02747 (yyval.nested).comp = (yyvsp[(1) - (3)].nested).comp; 02748 (yyval.nested).last = &d_right (*(yyvsp[(1) - (3)].nested).last); 02749 } 02750 break; 02751 02752 case 85: 02753 02754 /* Line 1806 of yacc.c */ 02755 #line 698 "../../src/gdb/cp-name-parser.y" 02756 { (yyval.nested).comp = fill_comp (DEMANGLE_COMPONENT_FUNCTION_TYPE, NULL, (yyvsp[(2) - (4)].nested).comp); 02757 (yyval.nested).last = &d_left ((yyval.nested).comp); 02758 (yyval.nested).comp = d_qualify ((yyval.nested).comp, (yyvsp[(4) - (4)].lval), 1); } 02759 break; 02760 02761 case 86: 02762 02763 /* Line 1806 of yacc.c */ 02764 #line 702 "../../src/gdb/cp-name-parser.y" 02765 { (yyval.nested).comp = fill_comp (DEMANGLE_COMPONENT_FUNCTION_TYPE, NULL, NULL); 02766 (yyval.nested).last = &d_left ((yyval.nested).comp); 02767 (yyval.nested).comp = d_qualify ((yyval.nested).comp, (yyvsp[(4) - (4)].lval), 1); } 02768 break; 02769 02770 case 87: 02771 02772 /* Line 1806 of yacc.c */ 02773 #line 706 "../../src/gdb/cp-name-parser.y" 02774 { (yyval.nested).comp = fill_comp (DEMANGLE_COMPONENT_FUNCTION_TYPE, NULL, NULL); 02775 (yyval.nested).last = &d_left ((yyval.nested).comp); 02776 (yyval.nested).comp = d_qualify ((yyval.nested).comp, (yyvsp[(3) - (3)].lval), 1); } 02777 break; 02778 02779 case 88: 02780 02781 /* Line 1806 of yacc.c */ 02782 #line 713 "../../src/gdb/cp-name-parser.y" 02783 { (yyval.lval) = 0; } 02784 break; 02785 02786 case 90: 02787 02788 /* Line 1806 of yacc.c */ 02789 #line 718 "../../src/gdb/cp-name-parser.y" 02790 { (yyval.lval) = QUAL_RESTRICT; } 02791 break; 02792 02793 case 91: 02794 02795 /* Line 1806 of yacc.c */ 02796 #line 720 "../../src/gdb/cp-name-parser.y" 02797 { (yyval.lval) = QUAL_VOLATILE; } 02798 break; 02799 02800 case 92: 02801 02802 /* Line 1806 of yacc.c */ 02803 #line 722 "../../src/gdb/cp-name-parser.y" 02804 { (yyval.lval) = QUAL_CONST; } 02805 break; 02806 02807 case 94: 02808 02809 /* Line 1806 of yacc.c */ 02810 #line 727 "../../src/gdb/cp-name-parser.y" 02811 { (yyval.lval) = (yyvsp[(1) - (2)].lval) | (yyvsp[(2) - (2)].lval); } 02812 break; 02813 02814 case 95: 02815 02816 /* Line 1806 of yacc.c */ 02817 #line 734 "../../src/gdb/cp-name-parser.y" 02818 { (yyval.lval) = 0; } 02819 break; 02820 02821 case 96: 02822 02823 /* Line 1806 of yacc.c */ 02824 #line 736 "../../src/gdb/cp-name-parser.y" 02825 { (yyval.lval) = INT_SIGNED; } 02826 break; 02827 02828 case 97: 02829 02830 /* Line 1806 of yacc.c */ 02831 #line 738 "../../src/gdb/cp-name-parser.y" 02832 { (yyval.lval) = INT_UNSIGNED; } 02833 break; 02834 02835 case 98: 02836 02837 /* Line 1806 of yacc.c */ 02838 #line 740 "../../src/gdb/cp-name-parser.y" 02839 { (yyval.lval) = INT_CHAR; } 02840 break; 02841 02842 case 99: 02843 02844 /* Line 1806 of yacc.c */ 02845 #line 742 "../../src/gdb/cp-name-parser.y" 02846 { (yyval.lval) = INT_LONG; } 02847 break; 02848 02849 case 100: 02850 02851 /* Line 1806 of yacc.c */ 02852 #line 744 "../../src/gdb/cp-name-parser.y" 02853 { (yyval.lval) = INT_SHORT; } 02854 break; 02855 02856 case 102: 02857 02858 /* Line 1806 of yacc.c */ 02859 #line 749 "../../src/gdb/cp-name-parser.y" 02860 { (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; } 02861 break; 02862 02863 case 103: 02864 02865 /* Line 1806 of yacc.c */ 02866 #line 753 "../../src/gdb/cp-name-parser.y" 02867 { (yyval.comp) = d_int_type ((yyvsp[(1) - (1)].lval)); } 02868 break; 02869 02870 case 104: 02871 02872 /* Line 1806 of yacc.c */ 02873 #line 755 "../../src/gdb/cp-name-parser.y" 02874 { (yyval.comp) = make_builtin_type ("float"); } 02875 break; 02876 02877 case 105: 02878 02879 /* Line 1806 of yacc.c */ 02880 #line 757 "../../src/gdb/cp-name-parser.y" 02881 { (yyval.comp) = make_builtin_type ("double"); } 02882 break; 02883 02884 case 106: 02885 02886 /* Line 1806 of yacc.c */ 02887 #line 759 "../../src/gdb/cp-name-parser.y" 02888 { (yyval.comp) = make_builtin_type ("long double"); } 02889 break; 02890 02891 case 107: 02892 02893 /* Line 1806 of yacc.c */ 02894 #line 761 "../../src/gdb/cp-name-parser.y" 02895 { (yyval.comp) = make_builtin_type ("bool"); } 02896 break; 02897 02898 case 108: 02899 02900 /* Line 1806 of yacc.c */ 02901 #line 763 "../../src/gdb/cp-name-parser.y" 02902 { (yyval.comp) = make_builtin_type ("wchar_t"); } 02903 break; 02904 02905 case 109: 02906 02907 /* Line 1806 of yacc.c */ 02908 #line 765 "../../src/gdb/cp-name-parser.y" 02909 { (yyval.comp) = make_builtin_type ("void"); } 02910 break; 02911 02912 case 110: 02913 02914 /* Line 1806 of yacc.c */ 02915 #line 769 "../../src/gdb/cp-name-parser.y" 02916 { (yyval.nested).comp = make_empty (DEMANGLE_COMPONENT_POINTER); 02917 (yyval.nested).comp->u.s_binary.left = (yyval.nested).comp->u.s_binary.right = NULL; 02918 (yyval.nested).last = &d_left ((yyval.nested).comp); 02919 (yyval.nested).comp = d_qualify ((yyval.nested).comp, (yyvsp[(2) - (2)].lval), 0); } 02920 break; 02921 02922 case 111: 02923 02924 /* Line 1806 of yacc.c */ 02925 #line 775 "../../src/gdb/cp-name-parser.y" 02926 { (yyval.nested).comp = make_empty (DEMANGLE_COMPONENT_REFERENCE); 02927 (yyval.nested).comp->u.s_binary.left = (yyval.nested).comp->u.s_binary.right = NULL; 02928 (yyval.nested).last = &d_left ((yyval.nested).comp); } 02929 break; 02930 02931 case 112: 02932 02933 /* Line 1806 of yacc.c */ 02934 #line 779 "../../src/gdb/cp-name-parser.y" 02935 { (yyval.nested).comp = make_empty (DEMANGLE_COMPONENT_PTRMEM_TYPE); 02936 (yyval.nested).comp->u.s_binary.left = (yyvsp[(1) - (3)].nested1).comp; 02937 /* Convert the innermost DEMANGLE_COMPONENT_QUAL_NAME to a DEMANGLE_COMPONENT_NAME. */ 02938 *(yyvsp[(1) - (3)].nested1).last = *d_left ((yyvsp[(1) - (3)].nested1).last); 02939 (yyval.nested).comp->u.s_binary.right = NULL; 02940 (yyval.nested).last = &d_right ((yyval.nested).comp); 02941 (yyval.nested).comp = d_qualify ((yyval.nested).comp, (yyvsp[(3) - (3)].lval), 0); } 02942 break; 02943 02944 case 113: 02945 02946 /* Line 1806 of yacc.c */ 02947 #line 787 "../../src/gdb/cp-name-parser.y" 02948 { (yyval.nested).comp = make_empty (DEMANGLE_COMPONENT_PTRMEM_TYPE); 02949 (yyval.nested).comp->u.s_binary.left = (yyvsp[(2) - (4)].nested1).comp; 02950 /* Convert the innermost DEMANGLE_COMPONENT_QUAL_NAME to a DEMANGLE_COMPONENT_NAME. */ 02951 *(yyvsp[(2) - (4)].nested1).last = *d_left ((yyvsp[(2) - (4)].nested1).last); 02952 (yyval.nested).comp->u.s_binary.right = NULL; 02953 (yyval.nested).last = &d_right ((yyval.nested).comp); 02954 (yyval.nested).comp = d_qualify ((yyval.nested).comp, (yyvsp[(4) - (4)].lval), 0); } 02955 break; 02956 02957 case 114: 02958 02959 /* Line 1806 of yacc.c */ 02960 #line 797 "../../src/gdb/cp-name-parser.y" 02961 { (yyval.comp) = make_empty (DEMANGLE_COMPONENT_ARRAY_TYPE); 02962 d_left ((yyval.comp)) = NULL; 02963 } 02964 break; 02965 02966 case 115: 02967 02968 /* Line 1806 of yacc.c */ 02969 #line 801 "../../src/gdb/cp-name-parser.y" 02970 { (yyval.comp) = make_empty (DEMANGLE_COMPONENT_ARRAY_TYPE); 02971 d_left ((yyval.comp)) = (yyvsp[(2) - (3)].comp); 02972 } 02973 break; 02974 02975 case 116: 02976 02977 /* Line 1806 of yacc.c */ 02978 #line 817 "../../src/gdb/cp-name-parser.y" 02979 { (yyval.comp) = d_qualify ((yyvsp[(1) - (2)].comp), (yyvsp[(2) - (2)].lval), 0); } 02980 break; 02981 02982 case 118: 02983 02984 /* Line 1806 of yacc.c */ 02985 #line 820 "../../src/gdb/cp-name-parser.y" 02986 { (yyval.comp) = d_qualify ((yyvsp[(2) - (3)].comp), (yyvsp[(1) - (3)].lval) | (yyvsp[(3) - (3)].lval), 0); } 02987 break; 02988 02989 case 119: 02990 02991 /* Line 1806 of yacc.c */ 02992 #line 822 "../../src/gdb/cp-name-parser.y" 02993 { (yyval.comp) = d_qualify ((yyvsp[(2) - (2)].comp), (yyvsp[(1) - (2)].lval), 0); } 02994 break; 02995 02996 case 120: 02997 02998 /* Line 1806 of yacc.c */ 02999 #line 825 "../../src/gdb/cp-name-parser.y" 03000 { (yyval.comp) = d_qualify ((yyvsp[(1) - (2)].comp), (yyvsp[(2) - (2)].lval), 0); } 03001 break; 03002 03003 case 122: 03004 03005 /* Line 1806 of yacc.c */ 03006 #line 828 "../../src/gdb/cp-name-parser.y" 03007 { (yyval.comp) = d_qualify ((yyvsp[(2) - (3)].comp), (yyvsp[(1) - (3)].lval) | (yyvsp[(3) - (3)].lval), 0); } 03008 break; 03009 03010 case 123: 03011 03012 /* Line 1806 of yacc.c */ 03013 #line 830 "../../src/gdb/cp-name-parser.y" 03014 { (yyval.comp) = d_qualify ((yyvsp[(2) - (2)].comp), (yyvsp[(1) - (2)].lval), 0); } 03015 break; 03016 03017 case 124: 03018 03019 /* Line 1806 of yacc.c */ 03020 #line 833 "../../src/gdb/cp-name-parser.y" 03021 { (yyval.comp) = d_qualify ((yyvsp[(2) - (3)].comp), (yyvsp[(3) - (3)].lval), 0); } 03022 break; 03023 03024 case 125: 03025 03026 /* Line 1806 of yacc.c */ 03027 #line 835 "../../src/gdb/cp-name-parser.y" 03028 { (yyval.comp) = (yyvsp[(2) - (2)].comp); } 03029 break; 03030 03031 case 126: 03032 03033 /* Line 1806 of yacc.c */ 03034 #line 837 "../../src/gdb/cp-name-parser.y" 03035 { (yyval.comp) = d_qualify ((yyvsp[(3) - (4)].comp), (yyvsp[(1) - (4)].lval) | (yyvsp[(4) - (4)].lval), 0); } 03036 break; 03037 03038 case 127: 03039 03040 /* Line 1806 of yacc.c */ 03041 #line 839 "../../src/gdb/cp-name-parser.y" 03042 { (yyval.comp) = d_qualify ((yyvsp[(3) - (3)].comp), (yyvsp[(1) - (3)].lval), 0); } 03043 break; 03044 03045 case 128: 03046 03047 /* Line 1806 of yacc.c */ 03048 #line 844 "../../src/gdb/cp-name-parser.y" 03049 { (yyval.abstract).comp = (yyvsp[(1) - (1)].nested).comp; (yyval.abstract).last = (yyvsp[(1) - (1)].nested).last; 03050 (yyval.abstract).fn.comp = NULL; (yyval.abstract).fn.last = NULL; } 03051 break; 03052 03053 case 129: 03054 03055 /* Line 1806 of yacc.c */ 03056 #line 847 "../../src/gdb/cp-name-parser.y" 03057 { (yyval.abstract) = (yyvsp[(2) - (2)].abstract); (yyval.abstract).fn.comp = NULL; (yyval.abstract).fn.last = NULL; 03058 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; } 03059 *(yyval.abstract).last = (yyvsp[(1) - (2)].nested).comp; 03060 (yyval.abstract).last = (yyvsp[(1) - (2)].nested).last; } 03061 break; 03062 03063 case 130: 03064 03065 /* Line 1806 of yacc.c */ 03066 #line 852 "../../src/gdb/cp-name-parser.y" 03067 { (yyval.abstract).fn.comp = NULL; (yyval.abstract).fn.last = NULL; 03068 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; } 03069 } 03070 break; 03071 03072 case 131: 03073 03074 /* Line 1806 of yacc.c */ 03075 #line 859 "../../src/gdb/cp-name-parser.y" 03076 { (yyval.abstract) = (yyvsp[(2) - (3)].abstract); (yyval.abstract).fn.comp = NULL; (yyval.abstract).fn.last = NULL; (yyval.abstract).fold_flag = 1; 03077 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; } 03078 } 03079 break; 03080 03081 case 132: 03082 03083 /* Line 1806 of yacc.c */ 03084 #line 863 "../../src/gdb/cp-name-parser.y" 03085 { (yyval.abstract).fold_flag = 0; 03086 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; } 03087 if ((yyvsp[(1) - (2)].abstract).fold_flag) 03088 { 03089 *(yyval.abstract).last = (yyvsp[(2) - (2)].nested).comp; 03090 (yyval.abstract).last = (yyvsp[(2) - (2)].nested).last; 03091 } 03092 else 03093 (yyval.abstract).fn = (yyvsp[(2) - (2)].nested); 03094 } 03095 break; 03096 03097 case 133: 03098 03099 /* Line 1806 of yacc.c */ 03100 #line 874 "../../src/gdb/cp-name-parser.y" 03101 { (yyval.abstract).fn.comp = NULL; (yyval.abstract).fn.last = NULL; (yyval.abstract).fold_flag = 0; 03102 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; } 03103 *(yyvsp[(1) - (2)].abstract).last = (yyvsp[(2) - (2)].comp); 03104 (yyval.abstract).last = &d_right ((yyvsp[(2) - (2)].comp)); 03105 } 03106 break; 03107 03108 case 134: 03109 03110 /* Line 1806 of yacc.c */ 03111 #line 880 "../../src/gdb/cp-name-parser.y" 03112 { (yyval.abstract).fn.comp = NULL; (yyval.abstract).fn.last = NULL; (yyval.abstract).fold_flag = 0; 03113 (yyval.abstract).comp = (yyvsp[(1) - (1)].comp); 03114 (yyval.abstract).last = &d_right ((yyvsp[(1) - (1)].comp)); 03115 } 03116 break; 03117 03118 case 135: 03119 03120 /* Line 1806 of yacc.c */ 03121 #line 898 "../../src/gdb/cp-name-parser.y" 03122 { (yyval.abstract).comp = (yyvsp[(1) - (1)].nested).comp; (yyval.abstract).last = (yyvsp[(1) - (1)].nested).last; 03123 (yyval.abstract).fn.comp = NULL; (yyval.abstract).fn.last = NULL; (yyval.abstract).start = NULL; } 03124 break; 03125 03126 case 136: 03127 03128 /* Line 1806 of yacc.c */ 03129 #line 901 "../../src/gdb/cp-name-parser.y" 03130 { (yyval.abstract) = (yyvsp[(2) - (2)].abstract); 03131 if ((yyvsp[(2) - (2)].abstract).last) 03132 *(yyval.abstract).last = (yyvsp[(1) - (2)].nested).comp; 03133 else 03134 (yyval.abstract).comp = (yyvsp[(1) - (2)].nested).comp; 03135 (yyval.abstract).last = (yyvsp[(1) - (2)].nested).last; 03136 } 03137 break; 03138 03139 case 137: 03140 03141 /* Line 1806 of yacc.c */ 03142 #line 909 "../../src/gdb/cp-name-parser.y" 03143 { (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; } 03144 break; 03145 03146 case 138: 03147 03148 /* Line 1806 of yacc.c */ 03149 #line 911 "../../src/gdb/cp-name-parser.y" 03150 { (yyval.abstract).start = (yyvsp[(4) - (4)].comp); 03151 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; } 03152 if ((yyvsp[(1) - (4)].abstract).fold_flag) 03153 { 03154 *(yyval.abstract).last = (yyvsp[(2) - (4)].nested).comp; 03155 (yyval.abstract).last = (yyvsp[(2) - (4)].nested).last; 03156 } 03157 else 03158 (yyval.abstract).fn = (yyvsp[(2) - (4)].nested); 03159 } 03160 break; 03161 03162 case 139: 03163 03164 /* Line 1806 of yacc.c */ 03165 #line 922 "../../src/gdb/cp-name-parser.y" 03166 { (yyval.abstract).fn = (yyvsp[(1) - (2)].nested); 03167 (yyval.abstract).start = (yyvsp[(2) - (2)].comp); 03168 (yyval.abstract).comp = NULL; (yyval.abstract).last = NULL; 03169 } 03170 break; 03171 03172 case 141: 03173 03174 /* Line 1806 of yacc.c */ 03175 #line 930 "../../src/gdb/cp-name-parser.y" 03176 { (yyval.comp) = (yyvsp[(2) - (2)].abstract).comp; 03177 *(yyvsp[(2) - (2)].abstract).last = (yyvsp[(1) - (2)].comp); 03178 } 03179 break; 03180 03181 case 142: 03182 03183 /* Line 1806 of yacc.c */ 03184 #line 936 "../../src/gdb/cp-name-parser.y" 03185 { (yyval.nested).comp = (yyvsp[(2) - (2)].nested).comp; 03186 (yyval.nested).last = (yyvsp[(1) - (2)].nested).last; 03187 *(yyvsp[(2) - (2)].nested).last = (yyvsp[(1) - (2)].nested).comp; } 03188 break; 03189 03190 case 144: 03191 03192 /* Line 1806 of yacc.c */ 03193 #line 944 "../../src/gdb/cp-name-parser.y" 03194 { (yyval.nested) = (yyvsp[(2) - (3)].nested); } 03195 break; 03196 03197 case 145: 03198 03199 /* Line 1806 of yacc.c */ 03200 #line 946 "../../src/gdb/cp-name-parser.y" 03201 { (yyval.nested).comp = (yyvsp[(1) - (2)].nested).comp; 03202 *(yyvsp[(1) - (2)].nested).last = (yyvsp[(2) - (2)].nested).comp; 03203 (yyval.nested).last = (yyvsp[(2) - (2)].nested).last; 03204 } 03205 break; 03206 03207 case 146: 03208 03209 /* Line 1806 of yacc.c */ 03210 #line 951 "../../src/gdb/cp-name-parser.y" 03211 { (yyval.nested).comp = (yyvsp[(1) - (2)].nested).comp; 03212 *(yyvsp[(1) - (2)].nested).last = (yyvsp[(2) - (2)].comp); 03213 (yyval.nested).last = &d_right ((yyvsp[(2) - (2)].comp)); 03214 } 03215 break; 03216 03217 case 147: 03218 03219 /* Line 1806 of yacc.c */ 03220 #line 956 "../../src/gdb/cp-name-parser.y" 03221 { (yyval.nested).comp = make_empty (DEMANGLE_COMPONENT_TYPED_NAME); 03222 d_left ((yyval.nested).comp) = (yyvsp[(1) - (1)].comp); 03223 (yyval.nested).last = &d_right ((yyval.nested).comp); 03224 } 03225 break; 03226 03227 case 148: 03228 03229 /* Line 1806 of yacc.c */ 03230 #line 969 "../../src/gdb/cp-name-parser.y" 03231 { (yyval.nested).comp = (yyvsp[(2) - (2)].nested).comp; 03232 (yyval.nested).last = (yyvsp[(1) - (2)].nested).last; 03233 *(yyvsp[(2) - (2)].nested).last = (yyvsp[(1) - (2)].nested).comp; } 03234 break; 03235 03236 case 149: 03237 03238 /* Line 1806 of yacc.c */ 03239 #line 973 "../../src/gdb/cp-name-parser.y" 03240 { (yyval.nested).comp = make_empty (DEMANGLE_COMPONENT_TYPED_NAME); 03241 d_left ((yyval.nested).comp) = (yyvsp[(1) - (1)].comp); 03242 (yyval.nested).last = &d_right ((yyval.nested).comp); 03243 } 03244 break; 03245 03246 case 151: 03247 03248 /* Line 1806 of yacc.c */ 03249 #line 986 "../../src/gdb/cp-name-parser.y" 03250 { (yyval.nested).comp = fill_comp (DEMANGLE_COMPONENT_TYPED_NAME, (yyvsp[(1) - (4)].comp), (yyvsp[(2) - (4)].nested).comp); 03251 (yyval.nested).last = (yyvsp[(2) - (4)].nested).last; 03252 (yyval.nested).comp = fill_comp (DEMANGLE_COMPONENT_LOCAL_NAME, (yyval.nested).comp, (yyvsp[(4) - (4)].comp)); 03253 } 03254 break; 03255 03256 case 152: 03257 03258 /* Line 1806 of yacc.c */ 03259 #line 991 "../../src/gdb/cp-name-parser.y" 03260 { (yyval.nested).comp = (yyvsp[(1) - (4)].nested).comp; 03261 *(yyvsp[(1) - (4)].nested).last = (yyvsp[(2) - (4)].nested).comp; 03262 (yyval.nested).last = (yyvsp[(2) - (4)].nested).last; 03263 (yyval.nested).comp = fill_comp (DEMANGLE_COMPONENT_LOCAL_NAME, (yyval.nested).comp, (yyvsp[(4) - (4)].comp)); 03264 } 03265 break; 03266 03267 case 153: 03268 03269 /* Line 1806 of yacc.c */ 03270 #line 1000 "../../src/gdb/cp-name-parser.y" 03271 { (yyval.nested).comp = (yyvsp[(3) - (4)].nested).comp; 03272 (yyval.nested).last = (yyvsp[(2) - (4)].nested).last; 03273 *(yyvsp[(3) - (4)].nested).last = (yyvsp[(2) - (4)].nested).comp; } 03274 break; 03275 03276 case 154: 03277 03278 /* Line 1806 of yacc.c */ 03279 #line 1004 "../../src/gdb/cp-name-parser.y" 03280 { (yyval.nested).comp = (yyvsp[(1) - (2)].nested).comp; 03281 *(yyvsp[(1) - (2)].nested).last = (yyvsp[(2) - (2)].nested).comp; 03282 (yyval.nested).last = (yyvsp[(2) - (2)].nested).last; 03283 } 03284 break; 03285 03286 case 155: 03287 03288 /* Line 1806 of yacc.c */ 03289 #line 1009 "../../src/gdb/cp-name-parser.y" 03290 { (yyval.nested).comp = (yyvsp[(1) - (2)].nested).comp; 03291 *(yyvsp[(1) - (2)].nested).last = (yyvsp[(2) - (2)].comp); 03292 (yyval.nested).last = &d_right ((yyvsp[(2) - (2)].comp)); 03293 } 03294 break; 03295 03296 case 156: 03297 03298 /* Line 1806 of yacc.c */ 03299 #line 1014 "../../src/gdb/cp-name-parser.y" 03300 { (yyval.nested).comp = fill_comp (DEMANGLE_COMPONENT_TYPED_NAME, (yyvsp[(1) - (2)].comp), (yyvsp[(2) - (2)].nested).comp); 03301 (yyval.nested).last = (yyvsp[(2) - (2)].nested).last; 03302 } 03303 break; 03304 03305 case 157: 03306 03307 /* Line 1806 of yacc.c */ 03308 #line 1018 "../../src/gdb/cp-name-parser.y" 03309 { (yyval.nested).comp = fill_comp (DEMANGLE_COMPONENT_TYPED_NAME, (yyvsp[(1) - (2)].comp), (yyvsp[(2) - (2)].comp)); 03310 (yyval.nested).last = &d_right ((yyvsp[(2) - (2)].comp)); 03311 } 03312 break; 03313 03314 case 158: 03315 03316 /* Line 1806 of yacc.c */ 03317 #line 1024 "../../src/gdb/cp-name-parser.y" 03318 { (yyval.comp) = (yyvsp[(2) - (3)].comp); } 03319 break; 03320 03321 case 160: 03322 03323 /* Line 1806 of yacc.c */ 03324 #line 1033 "../../src/gdb/cp-name-parser.y" 03325 { (yyval.comp) = d_binary (">", (yyvsp[(1) - (3)].comp), (yyvsp[(3) - (3)].comp)); } 03326 break; 03327 03328 case 161: 03329 03330 /* Line 1806 of yacc.c */ 03331 #line 1040 "../../src/gdb/cp-name-parser.y" 03332 { (yyval.comp) = fill_comp (DEMANGLE_COMPONENT_UNARY, make_operator ("&", 1), (yyvsp[(2) - (2)].comp)); } 03333 break; 03334 03335 case 162: 03336 03337 /* Line 1806 of yacc.c */ 03338 #line 1042 "../../src/gdb/cp-name-parser.y" 03339 { (yyval.comp) = fill_comp (DEMANGLE_COMPONENT_UNARY, make_operator ("&", 1), (yyvsp[(3) - (4)].comp)); } 03340 break; 03341 03342 case 163: 03343 03344 /* Line 1806 of yacc.c */ 03345 #line 1047 "../../src/gdb/cp-name-parser.y" 03346 { (yyval.comp) = d_unary ("-", (yyvsp[(2) - (2)].comp)); } 03347 break; 03348 03349 case 164: 03350 03351 /* Line 1806 of yacc.c */ 03352 #line 1051 "../../src/gdb/cp-name-parser.y" 03353 { (yyval.comp) = d_unary ("!", (yyvsp[(2) - (2)].comp)); } 03354 break; 03355 03356 case 165: 03357 03358 /* Line 1806 of yacc.c */ 03359 #line 1055 "../../src/gdb/cp-name-parser.y" 03360 { (yyval.comp) = d_unary ("~", (yyvsp[(2) - (2)].comp)); } 03361 break; 03362 03363 case 166: 03364 03365 /* Line 1806 of yacc.c */ 03366 #line 1062 "../../src/gdb/cp-name-parser.y" 03367 { if ((yyvsp[(4) - (4)].comp)->type == DEMANGLE_COMPONENT_LITERAL 03368 || (yyvsp[(4) - (4)].comp)->type == DEMANGLE_COMPONENT_LITERAL_NEG) 03369 { 03370 (yyval.comp) = (yyvsp[(4) - (4)].comp); 03371 d_left ((yyvsp[(4) - (4)].comp)) = (yyvsp[(2) - (4)].comp); 03372 } 03373 else 03374 (yyval.comp) = fill_comp (DEMANGLE_COMPONENT_UNARY, 03375 fill_comp (DEMANGLE_COMPONENT_CAST, (yyvsp[(2) - (4)].comp), NULL), 03376 (yyvsp[(4) - (4)].comp)); 03377 } 03378 break; 03379 03380 case 167: 03381 03382 /* Line 1806 of yacc.c */ 03383 #line 1078 "../../src/gdb/cp-name-parser.y" 03384 { (yyval.comp) = fill_comp (DEMANGLE_COMPONENT_UNARY, 03385 fill_comp (DEMANGLE_COMPONENT_CAST, (yyvsp[(3) - (7)].comp), NULL), 03386 (yyvsp[(6) - (7)].comp)); 03387 } 03388 break; 03389 03390 case 168: 03391 03392 /* Line 1806 of yacc.c */ 03393 #line 1085 "../../src/gdb/cp-name-parser.y" 03394 { (yyval.comp) = fill_comp (DEMANGLE_COMPONENT_UNARY, 03395 fill_comp (DEMANGLE_COMPONENT_CAST, (yyvsp[(3) - (7)].comp), NULL), 03396 (yyvsp[(6) - (7)].comp)); 03397 } 03398 break; 03399 03400 case 169: 03401 03402 /* Line 1806 of yacc.c */ 03403 #line 1092 "../../src/gdb/cp-name-parser.y" 03404 { (yyval.comp) = fill_comp (DEMANGLE_COMPONENT_UNARY, 03405 fill_comp (DEMANGLE_COMPONENT_CAST, (yyvsp[(3) - (7)].comp), NULL), 03406 (yyvsp[(6) - (7)].comp)); 03407 } 03408 break; 03409 03410 case 170: 03411 03412 /* Line 1806 of yacc.c */ 03413 #line 1111 "../../src/gdb/cp-name-parser.y" 03414 { (yyval.comp) = d_binary ("*", (yyvsp[(1) - (3)].comp), (yyvsp[(3) - (3)].comp)); } 03415 break; 03416 03417 case 171: 03418 03419 /* Line 1806 of yacc.c */ 03420 #line 1115 "../../src/gdb/cp-name-parser.y" 03421 { (yyval.comp) = d_binary ("/", (yyvsp[(1) - (3)].comp), (yyvsp[(3) - (3)].comp)); } 03422 break; 03423 03424 case 172: 03425 03426 /* Line 1806 of yacc.c */ 03427 #line 1119 "../../src/gdb/cp-name-parser.y" 03428 { (yyval.comp) = d_binary ("%", (yyvsp[(1) - (3)].comp), (yyvsp[(3) - (3)].comp)); } 03429 break; 03430 03431 case 173: 03432 03433 /* Line 1806 of yacc.c */ 03434 #line 1123 "../../src/gdb/cp-name-parser.y" 03435 { (yyval.comp) = d_binary ("+", (yyvsp[(1) - (3)].comp), (yyvsp[(3) - (3)].comp)); } 03436 break; 03437 03438 case 174: 03439 03440 /* Line 1806 of yacc.c */ 03441 #line 1127 "../../src/gdb/cp-name-parser.y" 03442 { (yyval.comp) = d_binary ("-", (yyvsp[(1) - (3)].comp), (yyvsp[(3) - (3)].comp)); } 03443 break; 03444 03445 case 175: 03446 03447 /* Line 1806 of yacc.c */ 03448 #line 1131 "../../src/gdb/cp-name-parser.y" 03449 { (yyval.comp) = d_binary ("<<", (yyvsp[(1) - (3)].comp), (yyvsp[(3) - (3)].comp)); } 03450 break; 03451 03452 case 176: 03453 03454 /* Line 1806 of yacc.c */ 03455 #line 1135 "../../src/gdb/cp-name-parser.y" 03456 { (yyval.comp) = d_binary (">>", (yyvsp[(1) - (3)].comp), (yyvsp[(3) - (3)].comp)); } 03457 break; 03458 03459 case 177: 03460 03461 /* Line 1806 of yacc.c */ 03462 #line 1139 "../../src/gdb/cp-name-parser.y" 03463 { (yyval.comp) = d_binary ("==", (yyvsp[(1) - (3)].comp), (yyvsp[(3) - (3)].comp)); } 03464 break; 03465 03466 case 178: 03467 03468 /* Line 1806 of yacc.c */ 03469 #line 1143 "../../src/gdb/cp-name-parser.y" 03470 { (yyval.comp) = d_binary ("!=", (yyvsp[(1) - (3)].comp), (yyvsp[(3) - (3)].comp)); } 03471 break; 03472 03473 case 179: 03474 03475 /* Line 1806 of yacc.c */ 03476 #line 1147 "../../src/gdb/cp-name-parser.y" 03477 { (yyval.comp) = d_binary ("<=", (yyvsp[(1) - (3)].comp), (yyvsp[(3) - (3)].comp)); } 03478 break; 03479 03480 case 180: 03481 03482 /* Line 1806 of yacc.c */ 03483 #line 1151 "../../src/gdb/cp-name-parser.y" 03484 { (yyval.comp) = d_binary (">=", (yyvsp[(1) - (3)].comp), (yyvsp[(3) - (3)].comp)); } 03485 break; 03486 03487 case 181: 03488 03489 /* Line 1806 of yacc.c */ 03490 #line 1155 "../../src/gdb/cp-name-parser.y" 03491 { (yyval.comp) = d_binary ("<", (yyvsp[(1) - (3)].comp), (yyvsp[(3) - (3)].comp)); } 03492 break; 03493 03494 case 182: 03495 03496 /* Line 1806 of yacc.c */ 03497 #line 1159 "../../src/gdb/cp-name-parser.y" 03498 { (yyval.comp) = d_binary ("&", (yyvsp[(1) - (3)].comp), (yyvsp[(3) - (3)].comp)); } 03499 break; 03500 03501 case 183: 03502 03503 /* Line 1806 of yacc.c */ 03504 #line 1163 "../../src/gdb/cp-name-parser.y" 03505 { (yyval.comp) = d_binary ("^", (yyvsp[(1) - (3)].comp), (yyvsp[(3) - (3)].comp)); } 03506 break; 03507 03508 case 184: 03509 03510 /* Line 1806 of yacc.c */ 03511 #line 1167 "../../src/gdb/cp-name-parser.y" 03512 { (yyval.comp) = d_binary ("|", (yyvsp[(1) - (3)].comp), (yyvsp[(3) - (3)].comp)); } 03513 break; 03514 03515 case 185: 03516 03517 /* Line 1806 of yacc.c */ 03518 #line 1171 "../../src/gdb/cp-name-parser.y" 03519 { (yyval.comp) = d_binary ("&&", (yyvsp[(1) - (3)].comp), (yyvsp[(3) - (3)].comp)); } 03520 break; 03521 03522 case 186: 03523 03524 /* Line 1806 of yacc.c */ 03525 #line 1175 "../../src/gdb/cp-name-parser.y" 03526 { (yyval.comp) = d_binary ("||", (yyvsp[(1) - (3)].comp), (yyvsp[(3) - (3)].comp)); } 03527 break; 03528 03529 case 187: 03530 03531 /* Line 1806 of yacc.c */ 03532 #line 1180 "../../src/gdb/cp-name-parser.y" 03533 { (yyval.comp) = d_binary ("->", (yyvsp[(1) - (3)].comp), (yyvsp[(3) - (3)].comp)); } 03534 break; 03535 03536 case 188: 03537 03538 /* Line 1806 of yacc.c */ 03539 #line 1184 "../../src/gdb/cp-name-parser.y" 03540 { (yyval.comp) = d_binary (".", (yyvsp[(1) - (3)].comp), (yyvsp[(3) - (3)].comp)); } 03541 break; 03542 03543 case 189: 03544 03545 /* Line 1806 of yacc.c */ 03546 #line 1188 "../../src/gdb/cp-name-parser.y" 03547 { (yyval.comp) = fill_comp (DEMANGLE_COMPONENT_TRINARY, make_operator ("?", 3), 03548 fill_comp (DEMANGLE_COMPONENT_TRINARY_ARG1, (yyvsp[(1) - (5)].comp), 03549 fill_comp (DEMANGLE_COMPONENT_TRINARY_ARG2, (yyvsp[(3) - (5)].comp), (yyvsp[(5) - (5)].comp)))); 03550 } 03551 break; 03552 03553 case 192: 03554 03555 /* Line 1806 of yacc.c */ 03556 #line 1202 "../../src/gdb/cp-name-parser.y" 03557 { 03558 /* Match the whitespacing of cplus_demangle_operators. 03559 It would abort on unrecognized string otherwise. */ 03560 (yyval.comp) = d_unary ("sizeof ", (yyvsp[(3) - (4)].comp)); 03561 } 03562 break; 03563 03564 case 193: 03565 03566 /* Line 1806 of yacc.c */ 03567 #line 1211 "../../src/gdb/cp-name-parser.y" 03568 { struct demangle_component *i; 03569 i = make_name ("1", 1); 03570 (yyval.comp) = fill_comp (DEMANGLE_COMPONENT_LITERAL, 03571 make_builtin_type ("bool"), 03572 i); 03573 } 03574 break; 03575 03576 case 194: 03577 03578 /* Line 1806 of yacc.c */ 03579 #line 1220 "../../src/gdb/cp-name-parser.y" 03580 { struct demangle_component *i; 03581 i = make_name ("0", 1); 03582 (yyval.comp) = fill_comp (DEMANGLE_COMPONENT_LITERAL, 03583 make_builtin_type ("bool"), 03584 i); 03585 } 03586 break; 03587 03588 03589 03590 /* Line 1806 of yacc.c */ 03591 #line 3593 "cp-name-parser.c" 03592 default: break; 03593 } 03594 /* User semantic actions sometimes alter yychar, and that requires 03595 that yytoken be updated with the new translation. We take the 03596 approach of translating immediately before every use of yytoken. 03597 One alternative is translating here after every semantic action, 03598 but that translation would be missed if the semantic action invokes 03599 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or 03600 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an 03601 incorrect destructor might then be invoked immediately. In the 03602 case of YYERROR or YYBACKUP, subsequent parser actions might lead 03603 to an incorrect destructor call or verbose syntax error message 03604 before the lookahead is translated. */ 03605 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); 03606 03607 YYPOPSTACK (yylen); 03608 yylen = 0; 03609 YY_STACK_PRINT (yyss, yyssp); 03610 03611 *++yyvsp = yyval; 03612 03613 /* Now `shift' the result of the reduction. Determine what state 03614 that goes to, based on the state we popped back to and the rule 03615 number reduced by. */ 03616 03617 yyn = yyr1[yyn]; 03618 03619 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; 03620 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) 03621 yystate = yytable[yystate]; 03622 else 03623 yystate = yydefgoto[yyn - YYNTOKENS]; 03624 03625 goto yynewstate; 03626 03627 03628 /*------------------------------------. 03629 | yyerrlab -- here on detecting error | 03630 `------------------------------------*/ 03631 yyerrlab: 03632 /* Make sure we have latest lookahead translation. See comments at 03633 user semantic actions for why this is necessary. */ 03634 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); 03635 03636 /* If not already recovering from an error, report this error. */ 03637 if (!yyerrstatus) 03638 { 03639 ++yynerrs; 03640 #if ! YYERROR_VERBOSE 03641 yyerror (YY_("syntax error")); 03642 #else 03643 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ 03644 yyssp, yytoken) 03645 { 03646 char const *yymsgp = YY_("syntax error"); 03647 int yysyntax_error_status; 03648 yysyntax_error_status = YYSYNTAX_ERROR; 03649 if (yysyntax_error_status == 0) 03650 yymsgp = yymsg; 03651 else if (yysyntax_error_status == 1) 03652 { 03653 if (yymsg != yymsgbuf) 03654 YYSTACK_FREE (yymsg); 03655 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); 03656 if (!yymsg) 03657 { 03658 yymsg = yymsgbuf; 03659 yymsg_alloc = sizeof yymsgbuf; 03660 yysyntax_error_status = 2; 03661 } 03662 else 03663 { 03664 yysyntax_error_status = YYSYNTAX_ERROR; 03665 yymsgp = yymsg; 03666 } 03667 } 03668 yyerror (yymsgp); 03669 if (yysyntax_error_status == 2) 03670 goto yyexhaustedlab; 03671 } 03672 # undef YYSYNTAX_ERROR 03673 #endif 03674 } 03675 03676 03677 03678 if (yyerrstatus == 3) 03679 { 03680 /* If just tried and failed to reuse lookahead token after an 03681 error, discard it. */ 03682 03683 if (yychar <= YYEOF) 03684 { 03685 /* Return failure if at end of input. */ 03686 if (yychar == YYEOF) 03687 YYABORT; 03688 } 03689 else 03690 { 03691 yydestruct ("Error: discarding", 03692 yytoken, &yylval); 03693 yychar = YYEMPTY; 03694 } 03695 } 03696 03697 /* Else will try to reuse lookahead token after shifting the error 03698 token. */ 03699 goto yyerrlab1; 03700 03701 03702 /*---------------------------------------------------. 03703 | yyerrorlab -- error raised explicitly by YYERROR. | 03704 `---------------------------------------------------*/ 03705 yyerrorlab: 03706 03707 /* Pacify compilers like GCC when the user code never invokes 03708 YYERROR and the label yyerrorlab therefore never appears in user 03709 code. */ 03710 if (/*CONSTCOND*/ 0) 03711 goto yyerrorlab; 03712 03713 /* Do not reclaim the symbols of the rule which action triggered 03714 this YYERROR. */ 03715 YYPOPSTACK (yylen); 03716 yylen = 0; 03717 YY_STACK_PRINT (yyss, yyssp); 03718 yystate = *yyssp; 03719 goto yyerrlab1; 03720 03721 03722 /*-------------------------------------------------------------. 03723 | yyerrlab1 -- common code for both syntax error and YYERROR. | 03724 `-------------------------------------------------------------*/ 03725 yyerrlab1: 03726 yyerrstatus = 3; /* Each real token shifted decrements this. */ 03727 03728 for (;;) 03729 { 03730 yyn = yypact[yystate]; 03731 if (!yypact_value_is_default (yyn)) 03732 { 03733 yyn += YYTERROR; 03734 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) 03735 { 03736 yyn = yytable[yyn]; 03737 if (0 < yyn) 03738 break; 03739 } 03740 } 03741 03742 /* Pop the current state because it cannot handle the error token. */ 03743 if (yyssp == yyss) 03744 YYABORT; 03745 03746 03747 yydestruct ("Error: popping", 03748 yystos[yystate], yyvsp); 03749 YYPOPSTACK (1); 03750 yystate = *yyssp; 03751 YY_STACK_PRINT (yyss, yyssp); 03752 } 03753 03754 *++yyvsp = yylval; 03755 03756 03757 /* Shift the error token. */ 03758 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); 03759 03760 yystate = yyn; 03761 goto yynewstate; 03762 03763 03764 /*-------------------------------------. 03765 | yyacceptlab -- YYACCEPT comes here. | 03766 `-------------------------------------*/ 03767 yyacceptlab: 03768 yyresult = 0; 03769 goto yyreturn; 03770 03771 /*-----------------------------------. 03772 | yyabortlab -- YYABORT comes here. | 03773 `-----------------------------------*/ 03774 yyabortlab: 03775 yyresult = 1; 03776 goto yyreturn; 03777 03778 #if !defined(yyoverflow) || YYERROR_VERBOSE 03779 /*-------------------------------------------------. 03780 | yyexhaustedlab -- memory exhaustion comes here. | 03781 `-------------------------------------------------*/ 03782 yyexhaustedlab: 03783 yyerror (YY_("memory exhausted")); 03784 yyresult = 2; 03785 /* Fall through. */ 03786 #endif 03787 03788 yyreturn: 03789 if (yychar != YYEMPTY) 03790 { 03791 /* Make sure we have latest lookahead translation. See comments at 03792 user semantic actions for why this is necessary. */ 03793 yytoken = YYTRANSLATE (yychar); 03794 yydestruct ("Cleanup: discarding lookahead", 03795 yytoken, &yylval); 03796 } 03797 /* Do not reclaim the symbols of the rule which action triggered 03798 this YYABORT or YYACCEPT. */ 03799 YYPOPSTACK (yylen); 03800 YY_STACK_PRINT (yyss, yyssp); 03801 while (yyssp != yyss) 03802 { 03803 yydestruct ("Cleanup: popping", 03804 yystos[*yyssp], yyvsp); 03805 YYPOPSTACK (1); 03806 } 03807 #ifndef yyoverflow 03808 if (yyss != yyssa) 03809 YYSTACK_FREE (yyss); 03810 #endif 03811 #if YYERROR_VERBOSE 03812 if (yymsg != yymsgbuf) 03813 YYSTACK_FREE (yymsg); 03814 #endif 03815 /* Make sure YYID is used. */ 03816 return YYID (yyresult); 03817 } 03818 03819 03820 03821 /* Line 2067 of yacc.c */ 03822 #line 1230 "../../src/gdb/cp-name-parser.y" 03823 03824 03825 /* Apply QUALIFIERS to LHS and return a qualified component. IS_METHOD 03826 is set if LHS is a method, in which case the qualifiers are logically 03827 applied to "this". We apply qualifiers in a consistent order; LHS 03828 may already be qualified; duplicate qualifiers are not created. */ 03829 03830 struct demangle_component * 03831 d_qualify (struct demangle_component *lhs, int qualifiers, int is_method) 03832 { 03833 struct demangle_component **inner_p; 03834 enum demangle_component_type type; 03835 03836 /* For now the order is CONST (innermost), VOLATILE, RESTRICT. */ 03837 03838 #define HANDLE_QUAL(TYPE, MTYPE, QUAL) \ 03839 if ((qualifiers & QUAL) && (type != TYPE) && (type != MTYPE)) \ 03840 { \ 03841 *inner_p = fill_comp (is_method ? MTYPE : TYPE, \ 03842 *inner_p, NULL); \ 03843 inner_p = &d_left (*inner_p); \ 03844 type = (*inner_p)->type; \ 03845 } \ 03846 else if (type == TYPE || type == MTYPE) \ 03847 { \ 03848 inner_p = &d_left (*inner_p); \ 03849 type = (*inner_p)->type; \ 03850 } 03851 03852 inner_p = &lhs; 03853 03854 type = (*inner_p)->type; 03855 03856 HANDLE_QUAL (DEMANGLE_COMPONENT_RESTRICT, DEMANGLE_COMPONENT_RESTRICT_THIS, QUAL_RESTRICT); 03857 HANDLE_QUAL (DEMANGLE_COMPONENT_VOLATILE, DEMANGLE_COMPONENT_VOLATILE_THIS, QUAL_VOLATILE); 03858 HANDLE_QUAL (DEMANGLE_COMPONENT_CONST, DEMANGLE_COMPONENT_CONST_THIS, QUAL_CONST); 03859 03860 return lhs; 03861 } 03862 03863 /* Return a builtin type corresponding to FLAGS. */ 03864 03865 static struct demangle_component * 03866 d_int_type (int flags) 03867 { 03868 const char *name; 03869 03870 switch (flags) 03871 { 03872 case INT_SIGNED | INT_CHAR: 03873 name = "signed char"; 03874 break; 03875 case INT_CHAR: 03876 name = "char"; 03877 break; 03878 case INT_UNSIGNED | INT_CHAR: 03879 name = "unsigned char"; 03880 break; 03881 case 0: 03882 case INT_SIGNED: 03883 name = "int"; 03884 break; 03885 case INT_UNSIGNED: 03886 name = "unsigned int"; 03887 break; 03888 case INT_LONG: 03889 case INT_SIGNED | INT_LONG: 03890 name = "long"; 03891 break; 03892 case INT_UNSIGNED | INT_LONG: 03893 name = "unsigned long"; 03894 break; 03895 case INT_SHORT: 03896 case INT_SIGNED | INT_SHORT: 03897 name = "short"; 03898 break; 03899 case INT_UNSIGNED | INT_SHORT: 03900 name = "unsigned short"; 03901 break; 03902 case INT_LLONG | INT_LONG: 03903 case INT_SIGNED | INT_LLONG | INT_LONG: 03904 name = "long long"; 03905 break; 03906 case INT_UNSIGNED | INT_LLONG | INT_LONG: 03907 name = "unsigned long long"; 03908 break; 03909 default: 03910 return NULL; 03911 } 03912 03913 return make_builtin_type (name); 03914 } 03915 03916 /* Wrapper to create a unary operation. */ 03917 03918 static struct demangle_component * 03919 d_unary (const char *name, struct demangle_component *lhs) 03920 { 03921 return fill_comp (DEMANGLE_COMPONENT_UNARY, make_operator (name, 1), lhs); 03922 } 03923 03924 /* Wrapper to create a binary operation. */ 03925 03926 static struct demangle_component * 03927 d_binary (const char *name, struct demangle_component *lhs, struct demangle_component *rhs) 03928 { 03929 return fill_comp (DEMANGLE_COMPONENT_BINARY, make_operator (name, 2), 03930 fill_comp (DEMANGLE_COMPONENT_BINARY_ARGS, lhs, rhs)); 03931 } 03932 03933 /* Find the end of a symbol name starting at LEXPTR. */ 03934 03935 static const char * 03936 symbol_end (const char *lexptr) 03937 { 03938 const char *p = lexptr; 03939 03940 while (*p && (ISALNUM (*p) || *p == '_' || *p == '$' || *p == '.')) 03941 p++; 03942 03943 return p; 03944 } 03945 03946 /* Take care of parsing a number (anything that starts with a digit). 03947 The number starts at P and contains LEN characters. Store the result in 03948 YYLVAL. */ 03949 03950 static int 03951 parse_number (const char *p, int len, int parsed_float) 03952 { 03953 int unsigned_p = 0; 03954 03955 /* Number of "L" suffixes encountered. */ 03956 int long_p = 0; 03957 03958 struct demangle_component *signed_type; 03959 struct demangle_component *unsigned_type; 03960 struct demangle_component *type, *name; 03961 enum demangle_component_type literal_type; 03962 03963 if (p[0] == '-') 03964 { 03965 literal_type = DEMANGLE_COMPONENT_LITERAL_NEG; 03966 p++; 03967 len--; 03968 } 03969 else 03970 literal_type = DEMANGLE_COMPONENT_LITERAL; 03971 03972 if (parsed_float) 03973 { 03974 /* It's a float since it contains a point or an exponent. */ 03975 char c; 03976 03977 /* The GDB lexer checks the result of scanf at this point. Not doing 03978 this leaves our error checking slightly weaker but only for invalid 03979 data. */ 03980 03981 /* See if it has `f' or `l' suffix (float or long double). */ 03982 03983 c = TOLOWER (p[len - 1]); 03984 03985 if (c == 'f') 03986 { 03987 len--; 03988 type = make_builtin_type ("float"); 03989 } 03990 else if (c == 'l') 03991 { 03992 len--; 03993 type = make_builtin_type ("long double"); 03994 } 03995 else if (ISDIGIT (c) || c == '.') 03996 type = make_builtin_type ("double"); 03997 else 03998 return ERROR; 03999 04000 name = make_name (p, len); 04001 yylval.comp = fill_comp (literal_type, type, name); 04002 04003 return FLOAT; 04004 } 04005 04006 /* This treats 0x1 and 1 as different literals. We also do not 04007 automatically generate unsigned types. */ 04008 04009 long_p = 0; 04010 unsigned_p = 0; 04011 while (len > 0) 04012 { 04013 if (p[len - 1] == 'l' || p[len - 1] == 'L') 04014 { 04015 len--; 04016 long_p++; 04017 continue; 04018 } 04019 if (p[len - 1] == 'u' || p[len - 1] == 'U') 04020 { 04021 len--; 04022 unsigned_p++; 04023 continue; 04024 } 04025 break; 04026 } 04027 04028 if (long_p == 0) 04029 { 04030 unsigned_type = make_builtin_type ("unsigned int"); 04031 signed_type = make_builtin_type ("int"); 04032 } 04033 else if (long_p == 1) 04034 { 04035 unsigned_type = make_builtin_type ("unsigned long"); 04036 signed_type = make_builtin_type ("long"); 04037 } 04038 else 04039 { 04040 unsigned_type = make_builtin_type ("unsigned long long"); 04041 signed_type = make_builtin_type ("long long"); 04042 } 04043 04044 if (unsigned_p) 04045 type = unsigned_type; 04046 else 04047 type = signed_type; 04048 04049 name = make_name (p, len); 04050 yylval.comp = fill_comp (literal_type, type, name); 04051 04052 return INT; 04053 } 04054 04055 static char backslashable[] = "abefnrtv"; 04056 static char represented[] = "\a\b\e\f\n\r\t\v"; 04057 04058 /* Translate the backslash the way we would in the host character set. */ 04059 static int 04060 c_parse_backslash (int host_char, int *target_char) 04061 { 04062 const char *ix; 04063 ix = strchr (backslashable, host_char); 04064 if (! ix) 04065 return 0; 04066 else 04067 *target_char = represented[ix - backslashable]; 04068 return 1; 04069 } 04070 04071 /* Parse a C escape sequence. STRING_PTR points to a variable 04072 containing a pointer to the string to parse. That pointer 04073 should point to the character after the \. That pointer 04074 is updated past the characters we use. The value of the 04075 escape sequence is returned. 04076 04077 A negative value means the sequence \ newline was seen, 04078 which is supposed to be equivalent to nothing at all. 04079 04080 If \ is followed by a null character, we return a negative 04081 value and leave the string pointer pointing at the null character. 04082 04083 If \ is followed by 000, we return 0 and leave the string pointer 04084 after the zeros. A value of 0 does not mean end of string. */ 04085 04086 static int 04087 cp_parse_escape (const char **string_ptr) 04088 { 04089 int target_char; 04090 int c = *(*string_ptr)++; 04091 if (c_parse_backslash (c, &target_char)) 04092 return target_char; 04093 else 04094 switch (c) 04095 { 04096 case '\n': 04097 return -2; 04098 case 0: 04099 (*string_ptr)--; 04100 return 0; 04101 case '^': 04102 { 04103 c = *(*string_ptr)++; 04104 04105 if (c == '?') 04106 return 0177; 04107 else if (c == '\\') 04108 target_char = cp_parse_escape (string_ptr); 04109 else 04110 target_char = c; 04111 04112 /* Now target_char is something like `c', and we want to find 04113 its control-character equivalent. */ 04114 target_char = target_char & 037; 04115 04116 return target_char; 04117 } 04118 04119 case '0': 04120 case '1': 04121 case '2': 04122 case '3': 04123 case '4': 04124 case '5': 04125 case '6': 04126 case '7': 04127 { 04128 int i = c - '0'; 04129 int count = 0; 04130 while (++count < 3) 04131 { 04132 c = (**string_ptr); 04133 if (c >= '0' && c <= '7') 04134 { 04135 (*string_ptr)++; 04136 i *= 8; 04137 i += c - '0'; 04138 } 04139 else 04140 { 04141 break; 04142 } 04143 } 04144 return i; 04145 } 04146 default: 04147 return c; 04148 } 04149 } 04150 04151 #define HANDLE_SPECIAL(string, comp) \ 04152 if (strncmp (tokstart, string, sizeof (string) - 1) == 0) \ 04153 { \ 04154 lexptr = tokstart + sizeof (string) - 1; \ 04155 yylval.lval = comp; \ 04156 return DEMANGLER_SPECIAL; \ 04157 } 04158 04159 #define HANDLE_TOKEN2(string, token) \ 04160 if (lexptr[1] == string[1]) \ 04161 { \ 04162 lexptr += 2; \ 04163 yylval.opname = string; \ 04164 return token; \ 04165 } 04166 04167 #define HANDLE_TOKEN3(string, token) \ 04168 if (lexptr[1] == string[1] && lexptr[2] == string[2]) \ 04169 { \ 04170 lexptr += 3; \ 04171 yylval.opname = string; \ 04172 return token; \ 04173 } 04174 04175 /* Read one token, getting characters through LEXPTR. */ 04176 04177 static int 04178 yylex (void) 04179 { 04180 int c; 04181 int namelen; 04182 const char *tokstart; 04183 04184 retry: 04185 prev_lexptr = lexptr; 04186 tokstart = lexptr; 04187 04188 switch (c = *tokstart) 04189 { 04190 case 0: 04191 return 0; 04192 04193 case ' ': 04194 case '\t': 04195 case '\n': 04196 lexptr++; 04197 goto retry; 04198 04199 case '\'': 04200 /* We either have a character constant ('0' or '\177' for example) 04201 or we have a quoted symbol reference ('foo(int,int)' in C++ 04202 for example). */ 04203 lexptr++; 04204 c = *lexptr++; 04205 if (c == '\\') 04206 c = cp_parse_escape (&lexptr); 04207 else if (c == '\'') 04208 { 04209 yyerror (_("empty character constant")); 04210 return ERROR; 04211 } 04212 04213 c = *lexptr++; 04214 if (c != '\'') 04215 { 04216 yyerror (_("invalid character constant")); 04217 return ERROR; 04218 } 04219 04220 /* FIXME: We should refer to a canonical form of the character, 04221 presumably the same one that appears in manglings - the decimal 04222 representation. But if that isn't in our input then we have to 04223 allocate memory for it somewhere. */ 04224 yylval.comp = fill_comp (DEMANGLE_COMPONENT_LITERAL, 04225 make_builtin_type ("char"), 04226 make_name (tokstart, lexptr - tokstart)); 04227 04228 return INT; 04229 04230 case '(': 04231 if (strncmp (tokstart, "(anonymous namespace)", 21) == 0) 04232 { 04233 lexptr += 21; 04234 yylval.comp = make_name ("(anonymous namespace)", 04235 sizeof "(anonymous namespace)" - 1); 04236 return NAME; 04237 } 04238 /* FALL THROUGH */ 04239 04240 case ')': 04241 case ',': 04242 lexptr++; 04243 return c; 04244 04245 case '.': 04246 if (lexptr[1] == '.' && lexptr[2] == '.') 04247 { 04248 lexptr += 3; 04249 return ELLIPSIS; 04250 } 04251 04252 /* Might be a floating point number. */ 04253 if (lexptr[1] < '0' || lexptr[1] > '9') 04254 goto symbol; /* Nope, must be a symbol. */ 04255 04256 goto try_number; 04257 04258 case '-': 04259 HANDLE_TOKEN2 ("-=", ASSIGN_MODIFY); 04260 HANDLE_TOKEN2 ("--", DECREMENT); 04261 HANDLE_TOKEN2 ("->", ARROW); 04262 04263 /* For construction vtables. This is kind of hokey. */ 04264 if (strncmp (tokstart, "-in-", 4) == 0) 04265 { 04266 lexptr += 4; 04267 return CONSTRUCTION_IN; 04268 } 04269 04270 if (lexptr[1] < '0' || lexptr[1] > '9') 04271 { 04272 lexptr++; 04273 return '-'; 04274 } 04275 /* FALL THRU into number case. */ 04276 04277 try_number: 04278 case '0': 04279 case '1': 04280 case '2': 04281 case '3': 04282 case '4': 04283 case '5': 04284 case '6': 04285 case '7': 04286 case '8': 04287 case '9': 04288 { 04289 /* It's a number. */ 04290 int got_dot = 0, got_e = 0, toktype; 04291 const char *p = tokstart; 04292 int hex = 0; 04293 04294 if (c == '-') 04295 p++; 04296 04297 if (c == '0' && (p[1] == 'x' || p[1] == 'X')) 04298 { 04299 p += 2; 04300 hex = 1; 04301 } 04302 else if (c == '0' && (p[1]=='t' || p[1]=='T' || p[1]=='d' || p[1]=='D')) 04303 { 04304 p += 2; 04305 hex = 0; 04306 } 04307 04308 for (;; ++p) 04309 { 04310 /* This test includes !hex because 'e' is a valid hex digit 04311 and thus does not indicate a floating point number when 04312 the radix is hex. */ 04313 if (!hex && !got_e && (*p == 'e' || *p == 'E')) 04314 got_dot = got_e = 1; 04315 /* This test does not include !hex, because a '.' always indicates 04316 a decimal floating point number regardless of the radix. 04317 04318 NOTE drow/2005-03-09: This comment is not accurate in C99; 04319 however, it's not clear that all the floating point support 04320 in this file is doing any good here. */ 04321 else if (!got_dot && *p == '.') 04322 got_dot = 1; 04323 else if (got_e && (p[-1] == 'e' || p[-1] == 'E') 04324 && (*p == '-' || *p == '+')) 04325 /* This is the sign of the exponent, not the end of the 04326 number. */ 04327 continue; 04328 /* We will take any letters or digits. parse_number will 04329 complain if past the radix, or if L or U are not final. */ 04330 else if (! ISALNUM (*p)) 04331 break; 04332 } 04333 toktype = parse_number (tokstart, p - tokstart, got_dot|got_e); 04334 if (toktype == ERROR) 04335 { 04336 char *err_copy = (char *) alloca (p - tokstart + 1); 04337 04338 memcpy (err_copy, tokstart, p - tokstart); 04339 err_copy[p - tokstart] = 0; 04340 yyerror (_("invalid number")); 04341 return ERROR; 04342 } 04343 lexptr = p; 04344 return toktype; 04345 } 04346 04347 case '+': 04348 HANDLE_TOKEN2 ("+=", ASSIGN_MODIFY); 04349 HANDLE_TOKEN2 ("++", INCREMENT); 04350 lexptr++; 04351 return c; 04352 case '*': 04353 HANDLE_TOKEN2 ("*=", ASSIGN_MODIFY); 04354 lexptr++; 04355 return c; 04356 case '/': 04357 HANDLE_TOKEN2 ("/=", ASSIGN_MODIFY); 04358 lexptr++; 04359 return c; 04360 case '%': 04361 HANDLE_TOKEN2 ("%=", ASSIGN_MODIFY); 04362 lexptr++; 04363 return c; 04364 case '|': 04365 HANDLE_TOKEN2 ("|=", ASSIGN_MODIFY); 04366 HANDLE_TOKEN2 ("||", OROR); 04367 lexptr++; 04368 return c; 04369 case '&': 04370 HANDLE_TOKEN2 ("&=", ASSIGN_MODIFY); 04371 HANDLE_TOKEN2 ("&&", ANDAND); 04372 lexptr++; 04373 return c; 04374 case '^': 04375 HANDLE_TOKEN2 ("^=", ASSIGN_MODIFY); 04376 lexptr++; 04377 return c; 04378 case '!': 04379 HANDLE_TOKEN2 ("!=", NOTEQUAL); 04380 lexptr++; 04381 return c; 04382 case '<': 04383 HANDLE_TOKEN3 ("<<=", ASSIGN_MODIFY); 04384 HANDLE_TOKEN2 ("<=", LEQ); 04385 HANDLE_TOKEN2 ("<<", LSH); 04386 lexptr++; 04387 return c; 04388 case '>': 04389 HANDLE_TOKEN3 (">>=", ASSIGN_MODIFY); 04390 HANDLE_TOKEN2 (">=", GEQ); 04391 HANDLE_TOKEN2 (">>", RSH); 04392 lexptr++; 04393 return c; 04394 case '=': 04395 HANDLE_TOKEN2 ("==", EQUAL); 04396 lexptr++; 04397 return c; 04398 case ':': 04399 HANDLE_TOKEN2 ("::", COLONCOLON); 04400 lexptr++; 04401 return c; 04402 04403 case '[': 04404 case ']': 04405 case '?': 04406 case '@': 04407 case '~': 04408 case '{': 04409 case '}': 04410 symbol: 04411 lexptr++; 04412 return c; 04413 04414 case '"': 04415 /* These can't occur in C++ names. */ 04416 yyerror (_("unexpected string literal")); 04417 return ERROR; 04418 } 04419 04420 if (!(c == '_' || c == '$' || ISALPHA (c))) 04421 { 04422 /* We must have come across a bad character (e.g. ';'). */ 04423 yyerror (_("invalid character")); 04424 return ERROR; 04425 } 04426 04427 /* It's a name. See how long it is. */ 04428 namelen = 0; 04429 do 04430 c = tokstart[++namelen]; 04431 while (ISALNUM (c) || c == '_' || c == '$'); 04432 04433 lexptr += namelen; 04434 04435 /* Catch specific keywords. Notice that some of the keywords contain 04436 spaces, and are sorted by the length of the first word. They must 04437 all include a trailing space in the string comparison. */ 04438 switch (namelen) 04439 { 04440 case 16: 04441 if (strncmp (tokstart, "reinterpret_cast", 16) == 0) 04442 return REINTERPRET_CAST; 04443 break; 04444 case 12: 04445 if (strncmp (tokstart, "construction vtable for ", 24) == 0) 04446 { 04447 lexptr = tokstart + 24; 04448 return CONSTRUCTION_VTABLE; 04449 } 04450 if (strncmp (tokstart, "dynamic_cast", 12) == 0) 04451 return DYNAMIC_CAST; 04452 break; 04453 case 11: 04454 if (strncmp (tokstart, "static_cast", 11) == 0) 04455 return STATIC_CAST; 04456 break; 04457 case 9: 04458 HANDLE_SPECIAL ("covariant return thunk to ", DEMANGLE_COMPONENT_COVARIANT_THUNK); 04459 HANDLE_SPECIAL ("reference temporary for ", DEMANGLE_COMPONENT_REFTEMP); 04460 break; 04461 case 8: 04462 HANDLE_SPECIAL ("typeinfo for ", DEMANGLE_COMPONENT_TYPEINFO); 04463 HANDLE_SPECIAL ("typeinfo fn for ", DEMANGLE_COMPONENT_TYPEINFO_FN); 04464 HANDLE_SPECIAL ("typeinfo name for ", DEMANGLE_COMPONENT_TYPEINFO_NAME); 04465 if (strncmp (tokstart, "operator", 8) == 0) 04466 return OPERATOR; 04467 if (strncmp (tokstart, "restrict", 8) == 0) 04468 return RESTRICT; 04469 if (strncmp (tokstart, "unsigned", 8) == 0) 04470 return UNSIGNED; 04471 if (strncmp (tokstart, "template", 8) == 0) 04472 return TEMPLATE; 04473 if (strncmp (tokstart, "volatile", 8) == 0) 04474 return VOLATILE_KEYWORD; 04475 break; 04476 case 7: 04477 HANDLE_SPECIAL ("virtual thunk to ", DEMANGLE_COMPONENT_VIRTUAL_THUNK); 04478 if (strncmp (tokstart, "wchar_t", 7) == 0) 04479 return WCHAR_T; 04480 break; 04481 case 6: 04482 if (strncmp (tokstart, "global constructors keyed to ", 29) == 0) 04483 { 04484 const char *p; 04485 lexptr = tokstart + 29; 04486 yylval.lval = DEMANGLE_COMPONENT_GLOBAL_CONSTRUCTORS; 04487 /* Find the end of the symbol. */ 04488 p = symbol_end (lexptr); 04489 yylval.comp = make_name (lexptr, p - lexptr); 04490 lexptr = p; 04491 return DEMANGLER_SPECIAL; 04492 } 04493 if (strncmp (tokstart, "global destructors keyed to ", 28) == 0) 04494 { 04495 const char *p; 04496 lexptr = tokstart + 28; 04497 yylval.lval = DEMANGLE_COMPONENT_GLOBAL_DESTRUCTORS; 04498 /* Find the end of the symbol. */ 04499 p = symbol_end (lexptr); 04500 yylval.comp = make_name (lexptr, p - lexptr); 04501 lexptr = p; 04502 return DEMANGLER_SPECIAL; 04503 } 04504 04505 HANDLE_SPECIAL ("vtable for ", DEMANGLE_COMPONENT_VTABLE); 04506 if (strncmp (tokstart, "delete", 6) == 0) 04507 return DELETE; 04508 if (strncmp (tokstart, "struct", 6) == 0) 04509 return STRUCT; 04510 if (strncmp (tokstart, "signed", 6) == 0) 04511 return SIGNED_KEYWORD; 04512 if (strncmp (tokstart, "sizeof", 6) == 0) 04513 return SIZEOF; 04514 if (strncmp (tokstart, "double", 6) == 0) 04515 return DOUBLE_KEYWORD; 04516 break; 04517 case 5: 04518 HANDLE_SPECIAL ("guard variable for ", DEMANGLE_COMPONENT_GUARD); 04519 if (strncmp (tokstart, "false", 5) == 0) 04520 return FALSEKEYWORD; 04521 if (strncmp (tokstart, "class", 5) == 0) 04522 return CLASS; 04523 if (strncmp (tokstart, "union", 5) == 0) 04524 return UNION; 04525 if (strncmp (tokstart, "float", 5) == 0) 04526 return FLOAT_KEYWORD; 04527 if (strncmp (tokstart, "short", 5) == 0) 04528 return SHORT; 04529 if (strncmp (tokstart, "const", 5) == 0) 04530 return CONST_KEYWORD; 04531 break; 04532 case 4: 04533 if (strncmp (tokstart, "void", 4) == 0) 04534 return VOID; 04535 if (strncmp (tokstart, "bool", 4) == 0) 04536 return BOOL; 04537 if (strncmp (tokstart, "char", 4) == 0) 04538 return CHAR; 04539 if (strncmp (tokstart, "enum", 4) == 0) 04540 return ENUM; 04541 if (strncmp (tokstart, "long", 4) == 0) 04542 return LONG; 04543 if (strncmp (tokstart, "true", 4) == 0) 04544 return TRUEKEYWORD; 04545 break; 04546 case 3: 04547 HANDLE_SPECIAL ("VTT for ", DEMANGLE_COMPONENT_VTT); 04548 HANDLE_SPECIAL ("non-virtual thunk to ", DEMANGLE_COMPONENT_THUNK); 04549 if (strncmp (tokstart, "new", 3) == 0) 04550 return NEW; 04551 if (strncmp (tokstart, "int", 3) == 0) 04552 return INT_KEYWORD; 04553 break; 04554 default: 04555 break; 04556 } 04557 04558 yylval.comp = make_name (tokstart, namelen); 04559 return NAME; 04560 } 04561 04562 static void 04563 yyerror (char *msg) 04564 { 04565 if (global_errmsg) 04566 return; 04567 04568 error_lexptr = prev_lexptr; 04569 global_errmsg = msg ? msg : "parse error"; 04570 } 04571 04572 /* Allocate a chunk of the components we'll need to build a tree. We 04573 generally allocate too many components, but the extra memory usage 04574 doesn't hurt because the trees are temporary and the storage is 04575 reused. More may be allocated later, by d_grab. */ 04576 static struct demangle_info * 04577 allocate_info (void) 04578 { 04579 struct demangle_info *info = xmalloc (sizeof (struct demangle_info)); 04580 04581 info->next = NULL; 04582 info->used = 0; 04583 return info; 04584 } 04585 04586 /* Convert RESULT to a string. The return value is allocated 04587 using xmalloc. ESTIMATED_LEN is used only as a guide to the 04588 length of the result. This functions handles a few cases that 04589 cplus_demangle_print does not, specifically the global destructor 04590 and constructor labels. */ 04591 04592 char * 04593 cp_comp_to_string (struct demangle_component *result, int estimated_len) 04594 { 04595 size_t err; 04596 04597 return cplus_demangle_print (DMGL_PARAMS | DMGL_ANSI, result, estimated_len, 04598 &err); 04599 } 04600 04601 /* A convenience function to allocate and initialize a new struct 04602 demangled_parse_info. */ 04603 04604 struct demangle_parse_info * 04605 cp_new_demangle_parse_info (void) 04606 { 04607 struct demangle_parse_info *info; 04608 04609 info = xmalloc (sizeof (struct demangle_parse_info)); 04610 info->info = NULL; 04611 info->tree = NULL; 04612 obstack_init (&info->obstack); 04613 04614 return info; 04615 } 04616 04617 /* Free any memory associated with the given PARSE_INFO. */ 04618 04619 void 04620 cp_demangled_name_parse_free (struct demangle_parse_info *parse_info) 04621 { 04622 struct demangle_info *info = parse_info->info; 04623 04624 /* Free any allocated chunks of memory for the parse. */ 04625 while (info != NULL) 04626 { 04627 struct demangle_info *next = info->next; 04628 04629 xfree (info); 04630 info = next; 04631 } 04632 04633 /* Free any memory allocated during typedef replacement. */ 04634 obstack_free (&parse_info->obstack, NULL); 04635 04636 /* Free the parser info. */ 04637 xfree (parse_info); 04638 } 04639 04640 /* Merge the two parse trees given by DEST and SRC. The parse tree 04641 in SRC is attached to DEST at the node represented by TARGET. 04642 SRC is then freed. 04643 04644 NOTE 1: Since there is no API to merge obstacks, this function does 04645 even attempt to try it. Fortunately, we do not (yet?) need this ability. 04646 The code will assert if SRC->obstack is not empty. 04647 04648 NOTE 2: The string from which SRC was parsed must not be freed, since 04649 this function will place pointers to that string into DEST. */ 04650 04651 void 04652 cp_merge_demangle_parse_infos (struct demangle_parse_info *dest, 04653 struct demangle_component *target, 04654 struct demangle_parse_info *src) 04655 04656 { 04657 struct demangle_info *di; 04658 04659 /* Copy the SRC's parse data into DEST. */ 04660 *target = *src->tree; 04661 di = dest->info; 04662 while (di->next != NULL) 04663 di = di->next; 04664 di->next = src->info; 04665 04666 /* Clear the (pointer to) SRC's parse data so that it is not freed when 04667 cp_demangled_parse_info_free is called. */ 04668 src->info = NULL; 04669 04670 /* Free SRC. */ 04671 cp_demangled_name_parse_free (src); 04672 } 04673 04674 /* Convert a demangled name to a demangle_component tree. On success, 04675 a structure containing the root of the new tree is returned; it must 04676 be freed by calling cp_demangled_name_parse_free. On error, NULL is 04677 returned, and an error message will be set in *ERRMSG (which does 04678 not need to be freed). */ 04679 04680 struct demangle_parse_info * 04681 cp_demangled_name_to_comp (const char *demangled_name, const char **errmsg) 04682 { 04683 static char errbuf[60]; 04684 struct demangle_parse_info *result; 04685 04686 prev_lexptr = lexptr = demangled_name; 04687 error_lexptr = NULL; 04688 global_errmsg = NULL; 04689 04690 demangle_info = allocate_info (); 04691 04692 result = cp_new_demangle_parse_info (); 04693 result->info = demangle_info; 04694 04695 if (yyparse ()) 04696 { 04697 if (global_errmsg && errmsg) 04698 { 04699 snprintf (errbuf, sizeof (errbuf) - 2, "%s, near `%s", 04700 global_errmsg, error_lexptr); 04701 strcat (errbuf, "'"); 04702 *errmsg = errbuf; 04703 } 04704 cp_demangled_name_parse_free (result); 04705 return NULL; 04706 } 04707 04708 result->tree = global_result; 04709 global_result = NULL; 04710 04711 return result; 04712 } 04713 04714 #ifdef TEST_CPNAMES 04715 04716 static void 04717 cp_print (struct demangle_component *result) 04718 { 04719 char *str; 04720 size_t err = 0; 04721 04722 str = cplus_demangle_print (DMGL_PARAMS | DMGL_ANSI, result, 64, &err); 04723 if (str == NULL) 04724 return; 04725 04726 fputs (str, stdout); 04727 04728 xfree (str); 04729 } 04730 04731 static char 04732 trim_chars (char *lexptr, char **extra_chars) 04733 { 04734 char *p = (char *) symbol_end (lexptr); 04735 char c = 0; 04736 04737 if (*p) 04738 { 04739 c = *p; 04740 *p = 0; 04741 *extra_chars = p + 1; 04742 } 04743 04744 return c; 04745 } 04746 04747 /* When this file is built as a standalone program, xmalloc comes from 04748 libiberty --- in which case we have to provide xfree ourselves. */ 04749 04750 void 04751 xfree (void *ptr) 04752 { 04753 if (ptr != NULL) 04754 { 04755 /* Literal `free' would get translated back to xfree again. */ 04756 CONCAT2 (fr,ee) (ptr); 04757 } 04758 } 04759 04760 /* GDB normally defines internal_error itself, but when this file is built 04761 as a standalone program, we must also provide an implementation. */ 04762 04763 void 04764 internal_error (const char *file, int line, const char *fmt, ...) 04765 { 04766 va_list ap; 04767 04768 va_start (ap, fmt); 04769 fprintf (stderr, "%s:%d: internal error: ", file, line); 04770 vfprintf (stderr, fmt, ap); 04771 exit (1); 04772 } 04773 04774 int 04775 main (int argc, char **argv) 04776 { 04777 char *str2, *extra_chars = "", c; 04778 char buf[65536]; 04779 int arg; 04780 const char *errmsg; 04781 struct demangle_parse_info *result; 04782 04783 arg = 1; 04784 if (argv[arg] && strcmp (argv[arg], "--debug") == 0) 04785 { 04786 yydebug = 1; 04787 arg++; 04788 } 04789 04790 if (argv[arg] == NULL) 04791 while (fgets (buf, 65536, stdin) != NULL) 04792 { 04793 int len; 04794 buf[strlen (buf) - 1] = 0; 04795 /* Use DMGL_VERBOSE to get expanded standard substitutions. */ 04796 c = trim_chars (buf, &extra_chars); 04797 str2 = cplus_demangle (buf, DMGL_PARAMS | DMGL_ANSI | DMGL_VERBOSE); 04798 if (str2 == NULL) 04799 { 04800 printf ("Demangling error\n"); 04801 if (c) 04802 printf ("%s%c%s\n", buf, c, extra_chars); 04803 else 04804 printf ("%s\n", buf); 04805 continue; 04806 } 04807 result = cp_demangled_name_to_comp (str2, &errmsg); 04808 if (result == NULL) 04809 { 04810 fputs (errmsg, stderr); 04811 fputc ('\n', stderr); 04812 continue; 04813 } 04814 04815 cp_print (result->tree); 04816 cp_demangled_name_parse_free (result); 04817 04818 xfree (str2); 04819 if (c) 04820 { 04821 putchar (c); 04822 fputs (extra_chars, stdout); 04823 } 04824 putchar ('\n'); 04825 } 04826 else 04827 { 04828 result = cp_demangled_name_to_comp (argv[arg], &errmsg); 04829 if (result == NULL) 04830 { 04831 fputs (errmsg, stderr); 04832 fputc ('\n', stderr); 04833 return 0; 04834 } 04835 cp_print (result->tree); 04836 cp_demangled_name_parse_free (result); 04837 putchar ('\n'); 04838 } 04839 return 0; 04840 } 04841 04842 #endif 04843