OLD | NEW |
1 /* A Bison parser, made by GNU Bison 1.875c. */ | 1 /* A Bison parser, made by GNU Bison 1.875c. */ |
2 | 2 |
3 /* Skeleton parser for Yacc-like parsing with Bison, | 3 /* Skeleton parser for Yacc-like parsing with Bison, |
4 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundati
on, Inc. | 4 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundati
on, Inc. |
5 | 5 |
6 This program is free software; you can redistribute it and/or modify | 6 This program is free software; you can redistribute it and/or modify |
7 it under the terms of the GNU General Public License as published by | 7 it under the terms of the GNU General Public License as published by |
8 the Free Software Foundation; either version 2, or (at your option) | 8 the Free Software Foundation; either version 2, or (at your option) |
9 any later version. | 9 any later version. |
10 | 10 |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 #define yyrule cpname_rule /* With YYDEBUG defined */ | 297 #define yyrule cpname_rule /* With YYDEBUG defined */ |
298 #define yylhs cpname_yylhs | 298 #define yylhs cpname_yylhs |
299 #define yylen cpname_yylen | 299 #define yylen cpname_yylen |
300 #define yydefred cpname_yydefred | 300 #define yydefred cpname_yydefred |
301 #define yydgoto cpname_yydgoto | 301 #define yydgoto cpname_yydgoto |
302 #define yysindex cpname_yysindex | 302 #define yysindex cpname_yysindex |
303 #define yyrindex cpname_yyrindex | 303 #define yyrindex cpname_yyrindex |
304 #define yygindex cpname_yygindex | 304 #define yygindex cpname_yygindex |
305 #define yytable cpname_yytable | 305 #define yytable cpname_yytable |
306 #define yycheck cpname_yycheck | 306 #define yycheck cpname_yycheck |
| 307 #define yyss cpname_yyss |
| 308 #define yysslim cpname_yysslim |
| 309 #define yyssp cpname_yyssp |
| 310 #define yystacksize cpname_yystacksize |
| 311 #define yyvs cpname_yyvs |
| 312 #define yyvsp cpname_yyvsp |
307 | 313 |
308 int yyparse (void); | 314 int yyparse (void); |
309 static int yylex (void); | 315 static int yylex (void); |
310 static void yyerror (char *); | 316 static void yyerror (char *); |
311 | 317 |
312 /* Enable yydebug for the stand-alone parser. */ | 318 /* Enable yydebug for the stand-alone parser. */ |
313 #ifdef TEST_CPNAMES | 319 #ifdef TEST_CPNAMES |
314 # define YYDEBUG 1 | 320 # define YYDEBUG 1 |
315 #endif | 321 #endif |
316 | 322 |
317 /* Helper functions. These wrap the demangler tree interface, handle | 323 /* Helper functions. These wrap the demangler tree interface, handle |
318 allocation from our global store, and return the allocated component. */ | 324 allocation from our global store, and return the allocated component. */ |
319 | 325 |
320 static struct demangle_component * | 326 static struct demangle_component * |
321 fill_comp (enum demangle_component_type d_type, struct demangle_component *lhs, | 327 fill_comp (enum demangle_component_type d_type, struct demangle_component *lhs, |
322 struct demangle_component *rhs) | 328 struct demangle_component *rhs) |
323 { | 329 { |
324 struct demangle_component *ret = d_grab (); | 330 struct demangle_component *ret = d_grab (); |
325 cplus_demangle_fill_component (ret, d_type, lhs, rhs); | 331 int i; |
| 332 |
| 333 i = cplus_demangle_fill_component (ret, d_type, lhs, rhs); |
| 334 gdb_assert (i); |
| 335 |
326 return ret; | 336 return ret; |
327 } | 337 } |
328 | 338 |
329 static struct demangle_component * | 339 static struct demangle_component * |
330 make_empty (enum demangle_component_type d_type) | 340 make_empty (enum demangle_component_type d_type) |
331 { | 341 { |
332 struct demangle_component *ret = d_grab (); | 342 struct demangle_component *ret = d_grab (); |
333 ret->type = d_type; | 343 ret->type = d_type; |
334 return ret; | 344 return ret; |
335 } | 345 } |
336 | 346 |
337 static struct demangle_component * | 347 static struct demangle_component * |
338 make_operator (const char *name, int args) | 348 make_operator (const char *name, int args) |
339 { | 349 { |
340 struct demangle_component *ret = d_grab (); | 350 struct demangle_component *ret = d_grab (); |
341 cplus_demangle_fill_operator (ret, name, args); | 351 int i; |
| 352 |
| 353 i = cplus_demangle_fill_operator (ret, name, args); |
| 354 gdb_assert (i); |
| 355 |
342 return ret; | 356 return ret; |
343 } | 357 } |
344 | 358 |
345 static struct demangle_component * | 359 static struct demangle_component * |
346 make_dtor (enum gnu_v3_dtor_kinds kind, struct demangle_component *name) | 360 make_dtor (enum gnu_v3_dtor_kinds kind, struct demangle_component *name) |
347 { | 361 { |
348 struct demangle_component *ret = d_grab (); | 362 struct demangle_component *ret = d_grab (); |
349 cplus_demangle_fill_dtor (ret, kind, name); | 363 int i; |
| 364 |
| 365 i = cplus_demangle_fill_dtor (ret, kind, name); |
| 366 gdb_assert (i); |
| 367 |
350 return ret; | 368 return ret; |
351 } | 369 } |
352 | 370 |
353 static struct demangle_component * | 371 static struct demangle_component * |
354 make_builtin_type (const char *name) | 372 make_builtin_type (const char *name) |
355 { | 373 { |
356 struct demangle_component *ret = d_grab (); | 374 struct demangle_component *ret = d_grab (); |
357 cplus_demangle_fill_builtin_type (ret, name); | 375 int i; |
| 376 |
| 377 i = cplus_demangle_fill_builtin_type (ret, name); |
| 378 gdb_assert (i); |
| 379 |
358 return ret; | 380 return ret; |
359 } | 381 } |
360 | 382 |
361 static struct demangle_component * | 383 static struct demangle_component * |
362 make_name (const char *name, int len) | 384 make_name (const char *name, int len) |
363 { | 385 { |
364 struct demangle_component *ret = d_grab (); | 386 struct demangle_component *ret = d_grab (); |
365 cplus_demangle_fill_name (ret, name, len); | 387 int i; |
| 388 |
| 389 i = cplus_demangle_fill_name (ret, name, len); |
| 390 gdb_assert (i); |
| 391 |
366 return ret; | 392 return ret; |
367 } | 393 } |
368 | 394 |
369 #define d_left(dc) (dc)->u.s_binary.left | 395 #define d_left(dc) (dc)->u.s_binary.left |
370 #define d_right(dc) (dc)->u.s_binary.right | 396 #define d_right(dc) (dc)->u.s_binary.right |
371 | 397 |
372 | 398 |
373 | 399 |
374 /* Enabling traces. */ | 400 /* Enabling traces. */ |
375 #ifndef YYDEBUG | 401 #ifndef YYDEBUG |
376 # define YYDEBUG 0 | 402 # define YYDEBUG 0 |
377 #endif | 403 #endif |
378 | 404 |
379 /* Enabling verbose error messages. */ | 405 /* Enabling verbose error messages. */ |
380 #ifdef YYERROR_VERBOSE | 406 #ifdef YYERROR_VERBOSE |
381 # undef YYERROR_VERBOSE | 407 # undef YYERROR_VERBOSE |
382 # define YYERROR_VERBOSE 1 | 408 # define YYERROR_VERBOSE 1 |
383 #else | 409 #else |
384 # define YYERROR_VERBOSE 0 | 410 # define YYERROR_VERBOSE 0 |
385 #endif | 411 #endif |
386 | 412 |
387 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) | 413 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) |
388 #line 241 "cp-name-parser.y" | 414 #line 267 "cp-name-parser.y" |
389 typedef union YYSTYPE { | 415 typedef union YYSTYPE { |
390 struct demangle_component *comp; | 416 struct demangle_component *comp; |
391 struct nested { | 417 struct nested { |
392 struct demangle_component *comp; | 418 struct demangle_component *comp; |
393 struct demangle_component **last; | 419 struct demangle_component **last; |
394 } nested; | 420 } nested; |
395 struct { | 421 struct { |
396 struct demangle_component *comp, *last; | 422 struct demangle_component *comp, *last; |
397 } nested1; | 423 } nested1; |
398 struct { | 424 struct { |
399 struct demangle_component *comp, **last; | 425 struct demangle_component *comp, **last; |
400 struct nested fn; | 426 struct nested fn; |
401 struct demangle_component *start; | 427 struct demangle_component *start; |
402 int fold_flag; | 428 int fold_flag; |
403 } abstract; | 429 } abstract; |
404 int lval; | 430 int lval; |
405 const char *opname; | 431 const char *opname; |
406 } YYSTYPE; | 432 } YYSTYPE; |
407 /* Line 191 of yacc.c. */ | 433 /* Line 191 of yacc.c. */ |
408 #line 409 "cp-name-parser.c" | 434 #line 435 "cp-name-parser.c" |
409 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ | 435 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ |
410 # define YYSTYPE_IS_DECLARED 1 | 436 # define YYSTYPE_IS_DECLARED 1 |
411 # define YYSTYPE_IS_TRIVIAL 1 | 437 # define YYSTYPE_IS_TRIVIAL 1 |
412 #endif | 438 #endif |
413 | 439 |
414 | 440 |
415 | 441 |
416 /* Copy the second part of user declarations. */ | 442 /* Copy the second part of user declarations. */ |
417 | 443 |
418 | 444 |
419 /* Line 214 of yacc.c. */ | 445 /* Line 214 of yacc.c. */ |
420 #line 421 "cp-name-parser.c" | 446 #line 447 "cp-name-parser.c" |
421 | 447 |
422 #if ! defined (yyoverflow) || YYERROR_VERBOSE | 448 #if ! defined (yyoverflow) || YYERROR_VERBOSE |
423 | 449 |
424 # ifndef YYFREE | 450 # ifndef YYFREE |
425 # define YYFREE xfree | 451 # define YYFREE xfree |
426 # endif | 452 # endif |
427 # ifndef YYMALLOC | 453 # ifndef YYMALLOC |
428 # define YYMALLOC xmalloc | 454 # define YYMALLOC xmalloc |
429 # endif | 455 # endif |
430 | 456 |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
667 52, 113, -1, 113, 49, 113, -1, 113, 48, 113, | 693 52, 113, -1, 113, 49, 113, -1, 113, 48, 113, |
668 -1, 113, 47, 113, -1, 113, 46, 113, -1, 113, | 694 -1, 113, 47, 113, -1, 113, 46, 113, -1, 113, |
669 45, 113, -1, 113, 69, 5, -1, 113, 67, 5, | 695 45, 113, -1, 113, 69, 5, -1, 113, 67, 5, |
670 -1, 113, 44, 113, 74, 113, -1, 3, -1, 4, | 696 -1, 113, 44, 113, 74, 113, -1, 3, -1, 4, |
671 -1, 10, 73, 108, 41, -1, 36, -1, 37, -1 | 697 -1, 10, 73, 108, 41, -1, 36, -1, 37, -1 |
672 }; | 698 }; |
673 | 699 |
674 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ | 700 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ |
675 static const unsigned short yyrline[] = | 701 static const unsigned short yyrline[] = |
676 { | 702 { |
677 0, 355, 355, 359, 361, 363, 368, 369, 376, 385, | 703 0, 381, 381, 385, 387, 389, 394, 395, 402, 411, |
678 388, 392, 395, 414, 418, 422, 424, 426, 428, 430, | 704 414, 418, 421, 440, 444, 448, 450, 452, 454, 456, |
679 432, 434, 436, 438, 440, 442, 444, 446, 448, 450, | 705 458, 460, 462, 464, 466, 468, 470, 472, 474, 476, |
680 452, 454, 456, 458, 460, 462, 464, 466, 468, 470, | 706 478, 480, 482, 484, 486, 488, 490, 492, 494, 496, |
681 472, 474, 476, 478, 480, 482, 484, 486, 494, 499, | 707 498, 500, 502, 504, 506, 508, 510, 512, 520, 525, |
682 504, 508, 513, 521, 522, 524, 536, 537, 543, 545, | 708 530, 534, 539, 547, 548, 550, 562, 563, 569, 571, |
683 546, 548, 551, 552, 555, 556, 560, 562, 565, 571, | 709 572, 574, 577, 578, 581, 582, 586, 588, 591, 597, |
684 578, 584, 595, 599, 602, 613, 614, 618, 620, 622, | 710 604, 610, 621, 625, 628, 639, 640, 644, 646, 648, |
685 625, 629, 634, 639, 645, 655, 659, 663, 671, 672, | 711 651, 655, 660, 665, 671, 681, 685, 689, 697, 698, |
686 675, 677, 679, 683, 684, 691, 693, 695, 697, 699, | 712 701, 703, 705, 709, 710, 717, 719, 721, 723, 725, |
687 701, 705, 706, 710, 712, 714, 716, 718, 720, 722, | 713 727, 731, 732, 736, 738, 740, 742, 744, 746, 748, |
688 726, 732, 736, 744, 754, 758, 774, 776, 777, 779, | 714 752, 758, 762, 770, 780, 784, 800, 802, 803, 805, |
689 782, 784, 785, 787, 790, 792, 794, 796, 801, 804, | 715 808, 810, 811, 813, 816, 818, 820, 822, 827, 830, |
690 809, 816, 820, 831, 837, 855, 858, 866, 868, 879, | 716 835, 842, 846, 857, 863, 881, 884, 892, 894, 905, |
691 886, 887, 893, 897, 901, 903, 908, 913, 926, 930, | 717 912, 913, 919, 923, 927, 929, 934, 939, 952, 956, |
692 935, 943, 948, 957, 961, 966, 971, 975, 981, 987, | 718 961, 969, 974, 983, 987, 992, 997, 1001, 1007, 1013, |
693 990, 997, 999, 1004, 1008, 1012, 1019, 1035, 1042, 1049, | 719 1016, 1023, 1025, 1030, 1034, 1038, 1045, 1061, 1068, 1075, |
694 1068, 1072, 1076, 1080, 1084, 1088, 1092, 1096, 1100, 1104, | 720 1094, 1098, 1102, 1106, 1110, 1114, 1118, 1122, 1126, 1130, |
695 1108, 1112, 1116, 1120, 1124, 1128, 1132, 1137, 1141, 1145, | 721 1134, 1138, 1142, 1146, 1150, 1154, 1158, 1163, 1167, 1171, |
696 1152, 1156, 1159, 1164, 1173 | 722 1178, 1182, 1185, 1190, 1199 |
697 }; | 723 }; |
698 #endif | 724 #endif |
699 | 725 |
700 #if YYDEBUG || YYERROR_VERBOSE | 726 #if YYDEBUG || YYERROR_VERBOSE |
701 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. | 727 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. |
702 First, the terminals, then, starting at YYNTOKENS, nonterminals. */ | 728 First, the terminals, then, starting at YYNTOKENS, nonterminals. */ |
703 static const char *const yytname[] = | 729 static const char *const yytname[] = |
704 { | 730 { |
705 "$end", "error", "$undefined", "INT", "FLOAT", "NAME", "STRUCT", | 731 "$end", "error", "$undefined", "INT", "FLOAT", "NAME", "STRUCT", |
706 "CLASS", "UNION", "ENUM", "SIZEOF", "UNSIGNED", "COLONCOLON", "TEMPLATE", | 732 "CLASS", "UNION", "ENUM", "SIZEOF", "UNSIGNED", "COLONCOLON", "TEMPLATE", |
(...skipping 1053 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1760 | 1786 |
1761 /* If YYLEN is nonzero, implement the default value of the action: | 1787 /* If YYLEN is nonzero, implement the default value of the action: |
1762 `$$ = $1'. | 1788 `$$ = $1'. |
1763 | 1789 |
1764 Otherwise, the following line sets YYVAL to garbage. | 1790 Otherwise, the following line sets YYVAL to garbage. |
1765 This behavior is undocumented and Bison | 1791 This behavior is undocumented and Bison |
1766 users should not rely upon it. Assigning to YYVAL | 1792 users should not rely upon it. Assigning to YYVAL |
1767 unconditionally makes the parser a bit smaller, and it avoids a | 1793 unconditionally makes the parser a bit smaller, and it avoids a |
1768 GCC warning that YYVAL may be used uninitialized. */ | 1794 GCC warning that YYVAL may be used uninitialized. */ |
1769 yyval = yyvsp[1-yylen]; | 1795 yyval = yyvsp[1-yylen]; |
error: old chunk mismatch |
None
OLD | NEW |