Author: ekohl
Date: Wed Nov 19 17:13:05 2008
New Revision: 37476
URL:
http://svn.reactos.org/svn/reactos?rev=37476&view=rev
Log:
Sync to wine-1.1.1 (Patch 4 of 10):
ATTENTION: You MUST run "clean" before building ReactOS, otherwise WIDL will
crash when it is run.
- Dan Hipschman <dsh(a)linux.ucla.edu> Tue, 1 Jul 2008
widl: Implement type redefinition checks.
This allows widl to catch type redefinitions and report an error, like MIDL.
However, this does a better job than MIDL since it also reports the location
of the originial definition, like GCC.
Modified:
trunk/reactos/tools/widl/parser.tab.c
trunk/reactos/tools/widl/parser.tab.h
trunk/reactos/tools/widl/parser.y
trunk/reactos/tools/widl/typelib.c
trunk/reactos/tools/widl/widltypes.h
Modified: trunk/reactos/tools/widl/parser.tab.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/widl/parser.tab.c?re…
==============================================================================
--- trunk/reactos/tools/widl/parser.tab.c [iso-8859-1] (original)
+++ trunk/reactos/tools/widl/parser.tab.c [iso-8859-1] Wed Nov 19 17:13:05 2008
@@ -529,6 +529,8 @@
static attr_list_t *check_coclass_attrs(const char *name, attr_list_t *attrs);
const char *get_attr_display_name(enum attr_type type);
static void add_explicit_handle_if_necessary(func_t *func);
+static type_t *find_type_helper(const char *name, int t);
+static void check_def(const type_t *t);
static statement_t *make_statement(enum statement_type type);
static statement_t *make_statement_type_decl(type_t *type);
@@ -567,7 +569,7 @@
#endif
#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
-#line 177 "parser.y"
+#line 179 "parser.y"
typedef union YYSTYPE {
attr_t *attr;
attr_list_t *attr_list;
@@ -597,7 +599,7 @@
enum storage_class stgclass;
} YYSTYPE;
/* Line 196 of yacc.c. */
-#line 601 "parser.tab.c"
+#line 603 "parser.tab.c"
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
@@ -609,7 +611,7 @@
/* Line 219 of yacc.c. */
-#line 613 "parser.tab.c"
+#line 615 "parser.tab.c"
#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
# define YYSIZE_T __SIZE_TYPE__
@@ -964,37 +966,37 @@
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const unsigned short int yyrline[] =
{
- 0, 349, 349, 358, 359, 360, 361, 365, 370, 373,
- 374, 377, 378, 379, 380, 381, 386, 387, 388, 389,
- 392, 393, 396, 397, 401, 402, 408, 411, 412, 418,
- 419, 427, 429, 437, 444, 448, 450, 457, 465, 466,
- 469, 472, 473, 474, 478, 485, 493, 494, 497, 498,
- 502, 508, 509, 510, 513, 514, 517, 518, 519, 520,
- 521, 522, 523, 524, 525, 526, 527, 528, 529, 530,
- 531, 532, 533, 534, 535, 536, 537, 538, 539, 540,
- 541, 542, 543, 544, 545, 546, 547, 548, 549, 550,
- 551, 552, 553, 554, 555, 556, 557, 558, 559, 560,
- 561, 562, 563, 564, 565, 566, 567, 568, 569, 570,
- 574, 575, 576, 577, 578, 579, 580, 581, 582, 583,
- 584, 585, 586, 587, 588, 589, 590, 594, 595, 600,
- 601, 602, 603, 606, 607, 610, 614, 620, 621, 622,
- 625, 629, 638, 642, 647, 656, 657, 670, 671, 674,
- 675, 676, 677, 678, 679, 680, 681, 682, 683, 684,
- 685, 686, 687, 688, 689, 690, 691, 692, 693, 694,
- 695, 696, 697, 698, 699, 700, 701, 702, 703, 704,
- 705, 706, 707, 708, 709, 710, 711, 712, 713, 716,
- 717, 720, 726, 732, 733, 736, 741, 748, 749, 752,
- 753, 757, 758, 761, 769, 778, 784, 790, 791, 794,
- 795, 796, 799, 801, 804, 805, 806, 807, 808, 824,
- 825, 826, 827, 828, 829, 830, 833, 834, 837, 838,
- 839, 840, 841, 842, 843, 846, 847, 853, 862, 869,
- 870, 874, 877, 878, 881, 895, 896, 899, 900, 903,
- 913, 923, 924, 927, 928, 931, 944, 958, 971, 975,
- 976, 979, 980, 983, 988, 996, 997, 998, 1002, 1006,
- 1009, 1010, 1013, 1014, 1018, 1019, 1023, 1024, 1025, 1029,
- 1031, 1032, 1036, 1037, 1038, 1039, 1046, 1047, 1051, 1052,
- 1056, 1057, 1058, 1061, 1072, 1073, 1074, 1075, 1076, 1077,
- 1078, 1079, 1080, 1081, 1084, 1090, 1096, 1113, 1114
+ 0, 351, 351, 360, 361, 362, 363, 367, 372, 375,
+ 376, 379, 380, 381, 382, 383, 388, 389, 390, 391,
+ 394, 395, 398, 399, 403, 404, 410, 413, 414, 420,
+ 421, 429, 431, 439, 446, 450, 452, 459, 467, 468,
+ 471, 474, 475, 476, 480, 487, 495, 496, 499, 500,
+ 504, 510, 511, 512, 515, 516, 519, 520, 521, 522,
+ 523, 524, 525, 526, 527, 528, 529, 530, 531, 532,
+ 533, 534, 535, 536, 537, 538, 539, 540, 541, 542,
+ 543, 544, 545, 546, 547, 548, 549, 550, 551, 552,
+ 553, 554, 555, 556, 557, 558, 559, 560, 561, 562,
+ 563, 564, 565, 566, 567, 568, 569, 570, 571, 572,
+ 576, 577, 578, 579, 580, 581, 582, 583, 584, 585,
+ 586, 587, 588, 589, 590, 591, 592, 596, 597, 602,
+ 603, 604, 605, 608, 609, 612, 616, 622, 623, 624,
+ 627, 631, 640, 644, 649, 658, 659, 672, 673, 676,
+ 677, 678, 679, 680, 681, 682, 683, 684, 685, 686,
+ 687, 688, 689, 690, 691, 692, 693, 694, 695, 696,
+ 697, 698, 699, 700, 701, 702, 703, 704, 705, 706,
+ 707, 708, 709, 710, 711, 712, 713, 714, 715, 718,
+ 719, 722, 728, 734, 735, 738, 743, 750, 751, 754,
+ 755, 759, 760, 763, 771, 780, 786, 792, 793, 796,
+ 797, 798, 801, 803, 806, 807, 808, 809, 810, 826,
+ 827, 828, 829, 830, 831, 832, 835, 836, 839, 840,
+ 841, 842, 843, 844, 845, 848, 849, 857, 867, 874,
+ 875, 879, 882, 883, 886, 900, 901, 904, 905, 908,
+ 918, 928, 929, 932, 933, 936, 949, 963, 976, 980,
+ 981, 984, 985, 988, 993, 1001, 1002, 1003, 1007, 1011,
+ 1014, 1015, 1018, 1019, 1023, 1024, 1028, 1029, 1030, 1034,
+ 1036, 1037, 1041, 1042, 1043, 1044, 1051, 1052, 1056, 1057,
+ 1061, 1062, 1063, 1066, 1078, 1079, 1080, 1081, 1082, 1083,
+ 1084, 1085, 1086, 1087, 1090, 1096, 1103, 1121, 1122
};
#endif
@@ -2450,7 +2452,7 @@
switch (yyn)
{
case 2:
-#line 349 "parser.y"
+#line 351 "parser.y"
{ fix_incomplete();
check_all_user_types((yyvsp[0].stmt_list));
write_proxies((yyvsp[0].stmt_list));
@@ -2461,22 +2463,22 @@
break;
case 3:
-#line 358 "parser.y"
+#line 360 "parser.y"
{ (yyval.stmt_list) = NULL; ;}
break;
case 4:
-#line 359 "parser.y"
+#line 361 "parser.y"
{ (yyval.stmt_list) = (yyvsp[-1].stmt_list); ;}
break;
case 5:
-#line 360 "parser.y"
+#line 362 "parser.y"
{ (yyval.stmt_list) = append_statement((yyvsp[-1].stmt_list),
make_statement_type_decl((yyvsp[0].type))); ;}
break;
case 6:
-#line 361 "parser.y"
+#line 363 "parser.y"
{ (yyval.stmt_list) = (yyvsp[-2].stmt_list);
reg_type((yyvsp[-1].type), (yyvsp[-1].type)->name, 0);
if (!parse_only && do_header) write_coclass_forward((yyvsp[-1].type));
@@ -2484,7 +2486,7 @@
break;
case 7:
-#line 365 "parser.y"
+#line 367 "parser.y"
{ (yyval.stmt_list) = append_statement((yyvsp[-1].stmt_list),
make_statement_type_decl((yyvsp[0].type)));
add_typelib_entry((yyvsp[0].type));
reg_type((yyvsp[0].type), (yyvsp[0].type)->name, 0);
@@ -2493,44 +2495,44 @@
break;
case 8:
-#line 370 "parser.y"
+#line 372 "parser.y"
{ (yyval.stmt_list) = append_statement((yyvsp[-1].stmt_list),
make_statement_module((yyvsp[0].type)));
add_typelib_entry((yyvsp[0].type));
;}
break;
case 9:
-#line 373 "parser.y"
+#line 375 "parser.y"
{ (yyval.stmt_list) = append_statement((yyvsp[-1].stmt_list),
make_statement_library((yyvsp[0].typelib))); ;}
break;
case 10:
-#line 374 "parser.y"
+#line 376 "parser.y"
{ (yyval.stmt_list) = append_statement((yyvsp[-1].stmt_list), (yyvsp[0].statement));
;}
break;
case 11:
-#line 377 "parser.y"
+#line 379 "parser.y"
{ (yyval.stmt_list) = NULL; ;}
break;
case 12:
-#line 378 "parser.y"
+#line 380 "parser.y"
{ (yyval.stmt_list) = append_statement((yyvsp[-1].stmt_list),
make_statement_reference((yyvsp[0].type))); if (!parse_only)
add_typelib_entry((yyvsp[0].type)); ;}
break;
case 13:
-#line 379 "parser.y"
+#line 381 "parser.y"
{ (yyval.stmt_list) = append_statement((yyvsp[-1].stmt_list),
make_statement_type_decl((yyvsp[0].type))); if (!parse_only)
add_typelib_entry((yyvsp[0].type)); ;}
break;
case 14:
-#line 380 "parser.y"
+#line 382 "parser.y"
{ (yyval.stmt_list) = (yyvsp[-2].stmt_list); reg_type((yyvsp[-1].type),
(yyvsp[-1].type)->name, 0); if (!parse_only && do_header)
write_coclass_forward((yyvsp[-1].type)); ;}
break;
case 15:
-#line 381 "parser.y"
+#line 383 "parser.y"
{ (yyval.stmt_list) = append_statement((yyvsp[-1].stmt_list),
make_statement_type_decl((yyvsp[0].type)));
if (!parse_only) add_typelib_entry((yyvsp[0].type));
reg_type((yyvsp[0].type), (yyvsp[0].type)->name, 0);
@@ -2539,42 +2541,42 @@
break;
case 16:
-#line 386 "parser.y"
+#line 388 "parser.y"
{ (yyval.stmt_list) = append_statement((yyvsp[-1].stmt_list),
make_statement_module((yyvsp[0].type))); if (!parse_only)
add_typelib_entry((yyvsp[0].type)); ;}
break;
case 17:
-#line 387 "parser.y"
+#line 389 "parser.y"
{ (yyval.stmt_list) = append_statement((yyvsp[-1].stmt_list), (yyvsp[0].statement));
;}
break;
case 18:
-#line 388 "parser.y"
+#line 390 "parser.y"
{ (yyval.stmt_list) = append_statement((yyvsp[-1].stmt_list),
make_statement_importlib((yyvsp[0].str))); ;}
break;
case 19:
-#line 389 "parser.y"
+#line 391 "parser.y"
{ (yyval.stmt_list) = append_statement((yyvsp[-1].stmt_list),
make_statement_library((yyvsp[0].typelib))); ;}
break;
case 20:
-#line 392 "parser.y"
+#line 394 "parser.y"
{ (yyval.func_list) = NULL; ;}
break;
case 21:
-#line 393 "parser.y"
+#line 395 "parser.y"
{ (yyval.func_list) = append_func_from_statement( (yyvsp[-1].func_list),
(yyvsp[0].statement) ); ;}
break;
case 24:
-#line 401 "parser.y"
+#line 403 "parser.y"
{ (yyval.statement) = make_statement_cppquote((yyvsp[0].str)); ;}
break;
case 25:
-#line 402 "parser.y"
+#line 404 "parser.y"
{ (yyval.statement) = make_statement_type_decl((yyvsp[-1].type));
if (!parse_only && do_header) {
write_type_def_or_decl(header, (yyvsp[-1].type), FALSE, NULL);
@@ -2584,19 +2586,19 @@
break;
case 26:
-#line 408 "parser.y"
+#line 410 "parser.y"
{ (yyval.statement) = make_statement_declaration((yyvsp[-1].var));
if (!parse_only && do_header) write_declaration((yyvsp[-1].var),
is_in_interface);
;}
break;
case 27:
-#line 411 "parser.y"
+#line 413 "parser.y"
{ (yyval.statement) = make_statement_import((yyvsp[0].str)); ;}
break;
case 28:
-#line 412 "parser.y"
+#line 414 "parser.y"
{ (yyval.statement) = make_statement_type_decl((yyvsp[-1].type));
if (!parse_only && do_header) {
write_type_def_or_decl(header, (yyvsp[-1].type), FALSE, NULL);
@@ -2606,12 +2608,12 @@
break;
case 29:
-#line 418 "parser.y"
+#line 420 "parser.y"
{ (yyval.statement) = (yyvsp[-1].statement); ;}
break;
case 30:
-#line 419 "parser.y"
+#line 421 "parser.y"
{ (yyval.statement) = make_statement_type_decl((yyvsp[-1].type));
if (!parse_only && do_header) {
write_type_def_or_decl(header, (yyvsp[-1].type), FALSE, NULL);
@@ -2621,12 +2623,12 @@
break;
case 31:
-#line 427 "parser.y"
+#line 429 "parser.y"
{ (yyval.str) = (yyvsp[-1].str); if (!parse_only && do_header)
fprintf(header, "%s\n", (yyvsp[-1].str)); ;}
break;
case 32:
-#line 429 "parser.y"
+#line 431 "parser.y"
{ assert(yychar == YYEMPTY);
(yyval.import) = xmalloc(sizeof(struct _import_t));
(yyval.import)->name = (yyvsp[-1].str);
@@ -2636,7 +2638,7 @@
break;
case 33:
-#line 437 "parser.y"
+#line 439 "parser.y"
{ (yyval.str) = (yyvsp[-2].import)->name;
if ((yyvsp[-2].import)->import_performed) pop_import();
free((yyvsp[-2].import));
@@ -2645,17 +2647,17 @@
break;
case 34:
-#line 445 "parser.y"
+#line 447 "parser.y"
{ (yyval.str) = (yyvsp[-2].str); if(!parse_only) add_importlib((yyvsp[-2].str)); ;}
break;
case 35:
-#line 448 "parser.y"
+#line 450 "parser.y"
{ (yyval.str) = (yyvsp[0].str); ;}
break;
case 36:
-#line 450 "parser.y"
+#line 452 "parser.y"
{ (yyval.typelib) = make_library((yyvsp[-1].str),
check_library_attrs((yyvsp[-1].str), (yyvsp[-2].attr_list)));
if (!parse_only) start_typelib((yyval.typelib));
if (!parse_only && do_header) write_library((yyval.typelib));
@@ -2665,7 +2667,7 @@
break;
case 37:
-#line 458 "parser.y"
+#line 460 "parser.y"
{ (yyval.typelib) = (yyvsp[-3].typelib);
(yyval.typelib)->stmts = (yyvsp[-2].stmt_list);
if (!parse_only) end_typelib();
@@ -2674,27 +2676,27 @@
break;
case 38:
-#line 465 "parser.y"
+#line 467 "parser.y"
{ (yyval.var_list) = NULL; ;}
break;
case 40:
-#line 469 "parser.y"
+#line 471 "parser.y"
{ (yyval.var_list) = NULL; ;}
break;
case 41:
-#line 472 "parser.y"
+#line 474 "parser.y"
{ check_arg((yyvsp[0].var)); (yyval.var_list) = append_var( NULL, (yyvsp[0].var) );
;}
break;
case 42:
-#line 473 "parser.y"
+#line 475 "parser.y"
{ check_arg((yyvsp[0].var)); (yyval.var_list) = append_var( (yyvsp[-2].var_list),
(yyvsp[0].var)); ;}
break;
case 44:
-#line 478 "parser.y"
+#line 480 "parser.y"
{ (yyval.var) = (yyvsp[0].declarator)->var;
(yyval.var)->attrs = (yyvsp[-2].attr_list);
if ((yyvsp[-1].declspec)->stgclass != STG_NONE &&
(yyvsp[-1].declspec)->stgclass != STG_REGISTER)
@@ -2705,7 +2707,7 @@
break;
case 45:
-#line 485 "parser.y"
+#line 487 "parser.y"
{ (yyval.var) = (yyvsp[0].declarator)->var;
if ((yyvsp[-1].declspec)->stgclass != STG_NONE &&
(yyvsp[-1].declspec)->stgclass != STG_REGISTER)
error_loc("invalid storage class for function parameter\n");
@@ -2715,22 +2717,22 @@
break;
case 46:
-#line 493 "parser.y"
+#line 495 "parser.y"
{ (yyval.expr) = (yyvsp[-1].expr); ;}
break;
case 47:
-#line 494 "parser.y"
+#line 496 "parser.y"
{ (yyval.expr) = make_expr(EXPR_VOID); ;}
break;
case 48:
-#line 497 "parser.y"
+#line 499 "parser.y"
{ (yyval.attr_list) = NULL; ;}
break;
case 50:
-#line 502 "parser.y"
+#line 504 "parser.y"
{ (yyval.attr_list) = (yyvsp[-1].attr_list);
if (!(yyval.attr_list))
error_loc("empty attribute lists unsupported\n");
@@ -2738,426 +2740,426 @@
break;
case 51:
-#line 508 "parser.y"
+#line 510 "parser.y"
{ (yyval.attr_list) = append_attr( NULL, (yyvsp[0].attr) ); ;}
break;
case 52:
-#line 509 "parser.y"
+#line 511 "parser.y"
{ (yyval.attr_list) = append_attr( (yyvsp[-2].attr_list), (yyvsp[0].attr) ); ;}
break;
case 53:
-#line 510 "parser.y"
+#line 512 "parser.y"
{ (yyval.attr_list) = append_attr( (yyvsp[-3].attr_list), (yyvsp[0].attr) ); ;}
break;
case 54:
-#line 513 "parser.y"
+#line 515 "parser.y"
{ (yyval.str_list) = append_str( NULL, (yyvsp[0].str) ); ;}
break;
case 55:
-#line 514 "parser.y"
+#line 516 "parser.y"
{ (yyval.str_list) = append_str( (yyvsp[-2].str_list), (yyvsp[0].str) ); ;}
break;
case 56:
-#line 517 "parser.y"
+#line 519 "parser.y"
{ (yyval.attr) = NULL; ;}
break;
case 57:
-#line 518 "parser.y"
+#line 520 "parser.y"
{ (yyval.attr) = make_attr(ATTR_AGGREGATABLE); ;}
break;
case 58:
-#line 519 "parser.y"
+#line 521 "parser.y"
{ (yyval.attr) = make_attr(ATTR_APPOBJECT); ;}
break;
case 59:
-#line 520 "parser.y"
+#line 522 "parser.y"
{ (yyval.attr) = make_attr(ATTR_ASYNC); ;}
break;
case 60:
-#line 521 "parser.y"
+#line 523 "parser.y"
{ (yyval.attr) = make_attr(ATTR_AUTO_HANDLE); ;}
break;
case 61:
-#line 522 "parser.y"
+#line 524 "parser.y"
{ (yyval.attr) = make_attr(ATTR_BINDABLE); ;}
break;
case 62:
-#line 523 "parser.y"
+#line 525 "parser.y"
{ (yyval.attr) = make_attr(ATTR_BROADCAST); ;}
break;
case 63:
-#line 524 "parser.y"
+#line 526 "parser.y"
{ (yyval.attr) = make_attrp(ATTR_CALLAS, (yyvsp[-1].var)); ;}
break;
case 64:
-#line 525 "parser.y"
+#line 527 "parser.y"
{ (yyval.attr) = make_attrp(ATTR_CASE, (yyvsp[-1].expr_list)); ;}
break;
case 65:
-#line 526 "parser.y"
+#line 528 "parser.y"
{ (yyval.attr) = make_attrv(ATTR_CONTEXTHANDLE, 0); ;}
break;
case 66:
-#line 527 "parser.y"
+#line 529 "parser.y"
{ (yyval.attr) = make_attrv(ATTR_CONTEXTHANDLE, 0); /*
RPC_CONTEXT_HANDLE_DONT_SERIALIZE */ ;}
break;
case 67:
-#line 528 "parser.y"
+#line 530 "parser.y"
{ (yyval.attr) = make_attrv(ATTR_CONTEXTHANDLE, 0); /* RPC_CONTEXT_HANDLE_SERIALIZE
*/ ;}
break;
case 68:
-#line 529 "parser.y"
+#line 531 "parser.y"
{ (yyval.attr) = make_attr(ATTR_CONTROL); ;}
break;
case 69:
-#line 530 "parser.y"
+#line 532 "parser.y"
{ (yyval.attr) = make_attr(ATTR_DEFAULT); ;}
break;
case 70:
-#line 531 "parser.y"
+#line 533 "parser.y"
{ (yyval.attr) = make_attr(ATTR_DEFAULTCOLLELEM); ;}
break;
case 71:
-#line 532 "parser.y"
+#line 534 "parser.y"
{ (yyval.attr) = make_attrp(ATTR_DEFAULTVALUE, (yyvsp[-1].expr)); ;}
break;
case 72:
-#line 533 "parser.y"
+#line 535 "parser.y"
{ (yyval.attr) = make_attr(ATTR_DEFAULTVTABLE); ;}
break;
case 73:
-#line 534 "parser.y"
+#line 536 "parser.y"
{ (yyval.attr) = make_attr(ATTR_DISPLAYBIND); ;}
break;
case 74:
-#line 535 "parser.y"
+#line 537 "parser.y"
{ (yyval.attr) = make_attrp(ATTR_DLLNAME, (yyvsp[-1].str)); ;}
break;
case 75:
-#line 536 "parser.y"
+#line 538 "parser.y"
{ (yyval.attr) = make_attr(ATTR_DUAL); ;}
break;
case 76:
-#line 537 "parser.y"
+#line 539 "parser.y"
{ (yyval.attr) = make_attrp(ATTR_ENDPOINT, (yyvsp[-1].str_list)); ;}
break;
case 77:
-#line 538 "parser.y"
+#line 540 "parser.y"
{ (yyval.attr) = make_attrp(ATTR_ENTRY, (yyvsp[-1].expr)); ;}
break;
case 78:
-#line 539 "parser.y"
+#line 541 "parser.y"
{ (yyval.attr) = make_attr(ATTR_EXPLICIT_HANDLE); ;}
break;
case 79:
-#line 540 "parser.y"
+#line 542 "parser.y"
{ (yyval.attr) = make_attr(ATTR_HANDLE); ;}
break;
case 80:
-#line 541 "parser.y"
+#line 543 "parser.y"
{ (yyval.attr) = make_attrp(ATTR_HELPCONTEXT, (yyvsp[-1].expr)); ;}
break;
case 81:
-#line 542 "parser.y"
+#line 544 "parser.y"
{ (yyval.attr) = make_attrp(ATTR_HELPFILE, (yyvsp[-1].str)); ;}
break;
case 82:
-#line 543 "parser.y"
+#line 545 "parser.y"
{ (yyval.attr) = make_attrp(ATTR_HELPSTRING, (yyvsp[-1].str)); ;}
break;
case 83:
-#line 544 "parser.y"
+#line 546 "parser.y"
{ (yyval.attr) = make_attrp(ATTR_HELPSTRINGCONTEXT, (yyvsp[-1].expr)); ;}
break;
case 84:
-#line 545 "parser.y"
+#line 547 "parser.y"
{ (yyval.attr) = make_attrp(ATTR_HELPSTRINGDLL, (yyvsp[-1].str)); ;}
break;
case 85:
-#line 546 "parser.y"
+#line 548 "parser.y"
{ (yyval.attr) = make_attr(ATTR_HIDDEN); ;}
break;
case 86:
-#line 547 "parser.y"
+#line 549 "parser.y"
{ (yyval.attr) = make_attrp(ATTR_ID, (yyvsp[-1].expr)); ;}
break;
case 87:
-#line 548 "parser.y"
+#line 550 "parser.y"
{ (yyval.attr) = make_attr(ATTR_IDEMPOTENT); ;}
break;
case 88:
-#line 549 "parser.y"
+#line 551 "parser.y"
{ (yyval.attr) = make_attrp(ATTR_IIDIS, (yyvsp[-1].expr)); ;}
break;
case 89:
-#line 550 "parser.y"
+#line 552 "parser.y"
{ (yyval.attr) = make_attr(ATTR_IMMEDIATEBIND); ;}
break;
case 90:
-#line 551 "parser.y"
+#line 553 "parser.y"
{ (yyval.attr) = make_attrp(ATTR_IMPLICIT_HANDLE, (yyvsp[-1].str)); ;}
break;
case 91:
-#line 552 "parser.y"
+#line 554 "parser.y"
{ (yyval.attr) = make_attr(ATTR_IN); ;}
break;
case 92:
-#line 553 "parser.y"
+#line 555 "parser.y"
{ (yyval.attr) = make_attr(ATTR_INPUTSYNC); ;}
break;
case 93:
-#line 554 "parser.y"
+#line 556 "parser.y"
{ (yyval.attr) = make_attrp(ATTR_LENGTHIS, (yyvsp[-1].expr_list)); ;}
break;
case 94:
-#line 555 "parser.y"
+#line 557 "parser.y"
{ (yyval.attr) = make_attrp(ATTR_LIBLCID, (yyvsp[-1].expr)); ;}
break;
case 95:
-#line 556 "parser.y"
+#line 558 "parser.y"
{ (yyval.attr) = make_attr(ATTR_LOCAL); ;}
break;
case 96:
-#line 557 "parser.y"
+#line 559 "parser.y"
{ (yyval.attr) = make_attr(ATTR_NONBROWSABLE); ;}
break;
case 97:
-#line 558 "parser.y"
+#line 560 "parser.y"
{ (yyval.attr) = make_attr(ATTR_NONCREATABLE); ;}
break;
case 98:
-#line 559 "parser.y"
+#line 561 "parser.y"
{ (yyval.attr) = make_attr(ATTR_NONEXTENSIBLE); ;}
break;
case 99:
-#line 560 "parser.y"
+#line 562 "parser.y"
{ (yyval.attr) = make_attr(ATTR_OBJECT); ;}
break;
case 100:
-#line 561 "parser.y"
+#line 563 "parser.y"
{ (yyval.attr) = make_attr(ATTR_ODL); ;}
break;
case 101:
-#line 562 "parser.y"
+#line 564 "parser.y"
{ (yyval.attr) = make_attr(ATTR_OLEAUTOMATION); ;}
break;
case 102:
-#line 563 "parser.y"
+#line 565 "parser.y"
{ (yyval.attr) = make_attr(ATTR_OPTIONAL); ;}
break;
case 103:
-#line 564 "parser.y"
+#line 566 "parser.y"
{ (yyval.attr) = make_attr(ATTR_OUT); ;}
break;
case 104:
-#line 565 "parser.y"
+#line 567 "parser.y"
{ (yyval.attr) = make_attrv(ATTR_POINTERDEFAULT, (yyvsp[-1].num)); ;}
break;
case 105:
-#line 566 "parser.y"
+#line 568 "parser.y"
{ (yyval.attr) = make_attr(ATTR_PROPGET); ;}
break;
case 106:
-#line 567 "parser.y"
+#line 569 "parser.y"
{ (yyval.attr) = make_attr(ATTR_PROPPUT); ;}
break;
case 107:
-#line 568 "parser.y"
+#line 570 "parser.y"
{ (yyval.attr) = make_attr(ATTR_PROPPUTREF); ;}
break;
case 108:
-#line 569 "parser.y"
+#line 571 "parser.y"
{ (yyval.attr) = make_attr(ATTR_PUBLIC); ;}
break;
case 109:
-#line 571 "parser.y"
+#line 573 "parser.y"
{ expr_list_t *list = append_expr( NULL, (yyvsp[-3].expr) );
list = append_expr( list, (yyvsp[-1].expr) );
(yyval.attr) = make_attrp(ATTR_RANGE, list); ;}
break;
case 110:
-#line 574 "parser.y"
+#line 576 "parser.y"
{ (yyval.attr) = make_attr(ATTR_READONLY); ;}
break;
case 111:
-#line 575 "parser.y"
+#line 577 "parser.y"
{ (yyval.attr) = make_attr(ATTR_REQUESTEDIT); ;}
break;
case 112:
-#line 576 "parser.y"
+#line 578 "parser.y"
{ (yyval.attr) = make_attr(ATTR_RESTRICTED); ;}
break;
case 113:
-#line 577 "parser.y"
+#line 579 "parser.y"
{ (yyval.attr) = make_attr(ATTR_RETVAL); ;}
break;
case 114:
-#line 578 "parser.y"
+#line 580 "parser.y"
{ (yyval.attr) = make_attrp(ATTR_SIZEIS, (yyvsp[-1].expr_list)); ;}
break;
case 115:
-#line 579 "parser.y"
+#line 581 "parser.y"
{ (yyval.attr) = make_attr(ATTR_SOURCE); ;}
break;
case 116:
-#line 580 "parser.y"
+#line 582 "parser.y"
{ (yyval.attr) = make_attr(ATTR_STRICTCONTEXTHANDLE); ;}
break;
case 117:
-#line 581 "parser.y"
+#line 583 "parser.y"
{ (yyval.attr) = make_attr(ATTR_STRING); ;}
break;
case 118:
-#line 582 "parser.y"
+#line 584 "parser.y"
{ (yyval.attr) = make_attrp(ATTR_SWITCHIS, (yyvsp[-1].expr)); ;}
break;
case 119:
-#line 583 "parser.y"
+#line 585 "parser.y"
{ (yyval.attr) = make_attrp(ATTR_SWITCHTYPE, (yyvsp[-1].type)); ;}
break;
case 120:
-#line 584 "parser.y"
+#line 586 "parser.y"
{ (yyval.attr) = make_attrp(ATTR_TRANSMITAS, (yyvsp[-1].type)); ;}
break;
case 121:
-#line 585 "parser.y"
+#line 587 "parser.y"
{ (yyval.attr) = make_attrp(ATTR_UUID, (yyvsp[-1].uuid)); ;}
break;
case 122:
-#line 586 "parser.y"
+#line 588 "parser.y"
{ (yyval.attr) = make_attr(ATTR_V1ENUM); ;}
break;
case 123:
-#line 587 "parser.y"
+#line 589 "parser.y"
{ (yyval.attr) = make_attr(ATTR_VARARG); ;}
break;
case 124:
-#line 588 "parser.y"
+#line 590 "parser.y"
{ (yyval.attr) = make_attrv(ATTR_VERSION, (yyvsp[-1].num)); ;}
break;
case 125:
-#line 589 "parser.y"
+#line 591 "parser.y"
{ (yyval.attr) = make_attrp(ATTR_WIREMARSHAL, (yyvsp[-1].type)); ;}
break;
case 126:
-#line 590 "parser.y"
+#line 592 "parser.y"
{ (yyval.attr) = make_attrv(ATTR_POINTERTYPE, (yyvsp[0].num)); ;}
break;
case 128:
-#line 595 "parser.y"
+#line 597 "parser.y"
{ if (!is_valid_uuid((yyvsp[0].str)))
error_loc("invalid UUID: %s\n", (yyvsp[0].str));
(yyval.uuid) = parse_uuid((yyvsp[0].str)); ;}
break;
case 129:
-#line 600 "parser.y"
- { (yyval.str) = (yyvsp[0].str); ;}
- break;
-
- case 130:
-#line 601 "parser.y"
- { (yyval.str) = (yyvsp[0].str); ;}
- break;
-
- case 131:
#line 602 "parser.y"
{ (yyval.str) = (yyvsp[0].str); ;}
break;
- case 132:
+ case 130:
#line 603 "parser.y"
{ (yyval.str) = (yyvsp[0].str); ;}
break;
+ case 131:
+#line 604 "parser.y"
+ { (yyval.str) = (yyvsp[0].str); ;}
+ break;
+
+ case 132:
+#line 605 "parser.y"
+ { (yyval.str) = (yyvsp[0].str); ;}
+ break;
+
case 133:
-#line 606 "parser.y"
+#line 608 "parser.y"
{ (yyval.var_list) = NULL; ;}
break;
case 134:
-#line 607 "parser.y"
+#line 609 "parser.y"
{ (yyval.var_list) = append_var( (yyvsp[-1].var_list), (yyvsp[0].var) ); ;}
break;
case 135:
-#line 610 "parser.y"
+#line 612 "parser.y"
{ attr_t *a = make_attrp(ATTR_CASE, append_expr( NULL, (yyvsp[-2].expr) ));
(yyval.var) = (yyvsp[0].var); if (!(yyval.var)) (yyval.var) = make_var(NULL);
(yyval.var)->attrs = append_attr( (yyval.var)->attrs, a );
@@ -3165,7 +3167,7 @@
break;
case 136:
-#line 614 "parser.y"
+#line 616 "parser.y"
{ attr_t *a = make_attr(ATTR_DEFAULT);
(yyval.var) = (yyvsp[0].var); if (!(yyval.var)) (yyval.var) = make_var(NULL);
(yyval.var)->attrs = append_attr( (yyval.var)->attrs, a );
@@ -3173,17 +3175,17 @@
break;
case 137:
-#line 620 "parser.y"
+#line 622 "parser.y"
{ (yyval.var_list) = NULL; ;}
break;
case 138:
-#line 621 "parser.y"
+#line 623 "parser.y"
{ (yyval.var_list) = (yyvsp[-1].var_list); ;}
break;
case 140:
-#line 625 "parser.y"
+#line 627 "parser.y"
{ if (!(yyvsp[0].var)->eval)
(yyvsp[0].var)->eval = make_exprl(EXPR_NUM, 0 /* default for first enum
entry */);
(yyval.var_list) = append_var( NULL,
(yyvsp[0].var) );
@@ -3191,7 +3193,7 @@
break;
case 141:
-#line 629 "parser.y"
+#line 631 "parser.y"
{ if (!(yyvsp[0].var)->eval)
{
var_t *last = LIST_ENTRY(
list_tail((yyval.var_list)), var_t, entry );
@@ -3202,7 +3204,7 @@
break;
case 142:
-#line 638 "parser.y"
+#line 640 "parser.y"
{ (yyval.var) = reg_const((yyvsp[-2].var));
(yyval.var)->eval = (yyvsp[0].expr);
(yyval.var)->type = make_int(0);
@@ -3210,14 +3212,14 @@
break;
case 143:
-#line 642 "parser.y"
+#line 644 "parser.y"
{ (yyval.var) = reg_const((yyvsp[0].var));
(yyval.var)->type = make_int(0);
;}
break;
case 144:
-#line 647 "parser.y"
+#line 649 "parser.y"
{ (yyval.type) = get_typev(RPC_FC_ENUM16, (yyvsp[-3].var), tsENUM);
(yyval.type)->kind = TKIND_ENUM;
(yyval.type)->fields_or_args = (yyvsp[-1].var_list);
@@ -3228,232 +3230,232 @@
break;
case 145:
-#line 656 "parser.y"
+#line 658 "parser.y"
{ (yyval.expr_list) = append_expr( NULL, (yyvsp[0].expr) ); ;}
break;
case 146:
-#line 657 "parser.y"
+#line 659 "parser.y"
{ (yyval.expr_list) = append_expr( (yyvsp[-2].expr_list), (yyvsp[0].expr) ); ;}
break;
case 147:
-#line 670 "parser.y"
+#line 672 "parser.y"
{ (yyval.expr) = make_expr(EXPR_VOID); ;}
break;
case 149:
-#line 674 "parser.y"
+#line 676 "parser.y"
{ (yyval.expr) = make_exprl(EXPR_NUM, (yyvsp[0].num)); ;}
break;
case 150:
-#line 675 "parser.y"
+#line 677 "parser.y"
{ (yyval.expr) = make_exprl(EXPR_HEXNUM, (yyvsp[0].num)); ;}
break;
case 151:
-#line 676 "parser.y"
+#line 678 "parser.y"
{ (yyval.expr) = make_exprd(EXPR_DOUBLE, (yyvsp[0].dbl)); ;}
break;
case 152:
-#line 677 "parser.y"
+#line 679 "parser.y"
{ (yyval.expr) = make_exprl(EXPR_TRUEFALSE, 0); ;}
break;
case 153:
-#line 678 "parser.y"
+#line 680 "parser.y"
{ (yyval.expr) = make_exprl(EXPR_NUM, 0); ;}
break;
case 154:
-#line 679 "parser.y"
+#line 681 "parser.y"
{ (yyval.expr) = make_exprl(EXPR_TRUEFALSE, 1); ;}
break;
case 155:
-#line 680 "parser.y"
+#line 682 "parser.y"
{ (yyval.expr) = make_exprs(EXPR_STRLIT, (yyvsp[0].str)); ;}
break;
case 156:
-#line 681 "parser.y"
+#line 683 "parser.y"
{ (yyval.expr) = make_exprs(EXPR_WSTRLIT, (yyvsp[0].str)); ;}
break;
case 157:
-#line 682 "parser.y"
+#line 684 "parser.y"
{ (yyval.expr) = make_exprs(EXPR_IDENTIFIER, (yyvsp[0].str)); ;}
break;
case 158:
-#line 683 "parser.y"
+#line 685 "parser.y"
{ (yyval.expr) = make_expr3(EXPR_COND, (yyvsp[-4].expr), (yyvsp[-2].expr),
(yyvsp[0].expr)); ;}
break;
case 159:
-#line 684 "parser.y"
+#line 686 "parser.y"
{ (yyval.expr) = make_expr2(EXPR_LOGOR, (yyvsp[-2].expr), (yyvsp[0].expr)); ;}
break;
case 160:
-#line 685 "parser.y"
+#line 687 "parser.y"
{ (yyval.expr) = make_expr2(EXPR_LOGAND, (yyvsp[-2].expr), (yyvsp[0].expr)); ;}
break;
case 161:
-#line 686 "parser.y"
+#line 688 "parser.y"
{ (yyval.expr) = make_expr2(EXPR_OR , (yyvsp[-2].expr), (yyvsp[0].expr)); ;}
break;
case 162:
-#line 687 "parser.y"
+#line 689 "parser.y"
{ (yyval.expr) = make_expr2(EXPR_XOR, (yyvsp[-2].expr), (yyvsp[0].expr)); ;}
break;
case 163:
-#line 688 "parser.y"
+#line 690 "parser.y"
{ (yyval.expr) = make_expr2(EXPR_AND, (yyvsp[-2].expr), (yyvsp[0].expr)); ;}
break;
case 164:
-#line 689 "parser.y"
+#line 691 "parser.y"
{ (yyval.expr) = make_expr2(EXPR_EQUALITY, (yyvsp[-2].expr), (yyvsp[0].expr)); ;}
break;
case 165:
-#line 690 "parser.y"
+#line 692 "parser.y"
{ (yyval.expr) = make_expr2(EXPR_INEQUALITY, (yyvsp[-2].expr), (yyvsp[0].expr)); ;}
break;
case 166:
-#line 691 "parser.y"
+#line 693 "parser.y"
{ (yyval.expr) = make_expr2(EXPR_GTR, (yyvsp[-2].expr), (yyvsp[0].expr)); ;}
break;
case 167:
-#line 692 "parser.y"
+#line 694 "parser.y"
{ (yyval.expr) = make_expr2(EXPR_LESS, (yyvsp[-2].expr), (yyvsp[0].expr)); ;}
break;
case 168:
-#line 693 "parser.y"
+#line 695 "parser.y"
{ (yyval.expr) = make_expr2(EXPR_GTREQL, (yyvsp[-2].expr), (yyvsp[0].expr)); ;}
break;
case 169:
-#line 694 "parser.y"
+#line 696 "parser.y"
{ (yyval.expr) = make_expr2(EXPR_LESSEQL, (yyvsp[-2].expr), (yyvsp[0].expr)); ;}
break;
case 170:
-#line 695 "parser.y"
+#line 697 "parser.y"
{ (yyval.expr) = make_expr2(EXPR_SHL, (yyvsp[-2].expr), (yyvsp[0].expr)); ;}
break;
case 171:
-#line 696 "parser.y"
+#line 698 "parser.y"
{ (yyval.expr) = make_expr2(EXPR_SHR, (yyvsp[-2].expr), (yyvsp[0].expr)); ;}
break;
case 172:
-#line 697 "parser.y"
+#line 699 "parser.y"
{ (yyval.expr) = make_expr2(EXPR_ADD, (yyvsp[-2].expr), (yyvsp[0].expr)); ;}
break;
case 173:
-#line 698 "parser.y"
+#line 700 "parser.y"
{ (yyval.expr) = make_expr2(EXPR_SUB, (yyvsp[-2].expr), (yyvsp[0].expr)); ;}
break;
case 174:
-#line 699 "parser.y"
+#line 701 "parser.y"
{ (yyval.expr) = make_expr2(EXPR_MOD, (yyvsp[-2].expr), (yyvsp[0].expr)); ;}
break;
case 175:
-#line 700 "parser.y"
+#line 702 "parser.y"
{ (yyval.expr) = make_expr2(EXPR_MUL, (yyvsp[-2].expr), (yyvsp[0].expr)); ;}
break;
case 176:
-#line 701 "parser.y"
+#line 703 "parser.y"
{ (yyval.expr) = make_expr2(EXPR_DIV, (yyvsp[-2].expr), (yyvsp[0].expr)); ;}
break;
case 177:
-#line 702 "parser.y"
+#line 704 "parser.y"
{ (yyval.expr) = make_expr1(EXPR_LOGNOT, (yyvsp[0].expr)); ;}
break;
case 178:
-#line 703 "parser.y"
+#line 705 "parser.y"
{ (yyval.expr) = make_expr1(EXPR_NOT, (yyvsp[0].expr)); ;}
break;
case 179:
-#line 704 "parser.y"
+#line 706 "parser.y"
{ (yyval.expr) = make_expr1(EXPR_POS, (yyvsp[0].expr)); ;}
break;
case 180:
-#line 705 "parser.y"
+#line 707 "parser.y"
{ (yyval.expr) = make_expr1(EXPR_NEG, (yyvsp[0].expr)); ;}
break;
case 181:
-#line 706 "parser.y"
+#line 708 "parser.y"
{ (yyval.expr) = make_expr1(EXPR_ADDRESSOF, (yyvsp[0].expr)); ;}
break;
case 182:
-#line 707 "parser.y"
+#line 709 "parser.y"
{ (yyval.expr) = make_expr1(EXPR_PPTR, (yyvsp[0].expr)); ;}
break;
case 183:
-#line 708 "parser.y"
+#line 710 "parser.y"
{ (yyval.expr) = make_expr2(EXPR_MEMBER, make_expr1(EXPR_PPTR, (yyvsp[-2].expr)),
make_exprs(EXPR_IDENTIFIER, (yyvsp[0].str))); ;}
break;
case 184:
-#line 709 "parser.y"
+#line 711 "parser.y"
{ (yyval.expr) = make_expr2(EXPR_MEMBER, (yyvsp[-2].expr),
make_exprs(EXPR_IDENTIFIER, (yyvsp[0].str))); ;}
break;
case 185:
-#line 710 "parser.y"
+#line 712 "parser.y"
{ (yyval.expr) = make_exprt(EXPR_CAST, (yyvsp[-2].type), (yyvsp[0].expr)); ;}
break;
case 186:
-#line 711 "parser.y"
+#line 713 "parser.y"
{ (yyval.expr) = make_exprt(EXPR_SIZEOF, (yyvsp[-1].type), NULL); ;}
break;
case 187:
-#line 712 "parser.y"
+#line 714 "parser.y"
{ (yyval.expr) = make_expr2(EXPR_ARRAY, (yyvsp[-3].expr), (yyvsp[-1].expr)); ;}
break;
case 188:
-#line 713 "parser.y"
+#line 715 "parser.y"
{ (yyval.expr) = (yyvsp[-1].expr); ;}
break;
case 189:
-#line 716 "parser.y"
+#line 718 "parser.y"
{ (yyval.expr_list) = append_expr( NULL, (yyvsp[0].expr) ); ;}
break;
case 190:
-#line 717 "parser.y"
+#line 719 "parser.y"
{ (yyval.expr_list) = append_expr( (yyvsp[-2].expr_list), (yyvsp[0].expr) ); ;}
break;
case 191:
-#line 720 "parser.y"
+#line 722 "parser.y"
{ (yyval.expr) = (yyvsp[0].expr);
if (!(yyval.expr)->is_const)
error_loc("expression is not an integer constant\n");
@@ -3461,7 +3463,7 @@
break;
case 192:
-#line 726 "parser.y"
+#line 728 "parser.y"
{ (yyval.expr) = (yyvsp[0].expr);
if (!(yyval.expr)->is_const && (yyval.expr)->type != EXPR_STRLIT
&& (yyval.expr)->type != EXPR_WSTRLIT)
error_loc("expression is not constant\n");
@@ -3469,17 +3471,17 @@
break;
case 193:
-#line 732 "parser.y"
+#line 734 "parser.y"
{ (yyval.var_list) = NULL; ;}
break;
case 194:
-#line 733 "parser.y"
+#line 735 "parser.y"
{ (yyval.var_list) = append_var_list((yyvsp[-1].var_list), (yyvsp[0].var_list)); ;}
break;
case 195:
-#line 737 "parser.y"
+#line 739 "parser.y"
{ const char *first = LIST_ENTRY(list_head((yyvsp[-1].declarator_list)),
declarator_t, entry)->var->name;
check_field_attrs(first, (yyvsp[-3].attr_list));
(yyval.var_list) = set_var_types((yyvsp[-3].attr_list), (yyvsp[-2].declspec),
(yyvsp[-1].declarator_list));
@@ -3487,7 +3489,7 @@
break;
case 196:
-#line 741 "parser.y"
+#line 743 "parser.y"
{ var_t *v = make_var(NULL);
v->type = (yyvsp[-1].type); v->attrs = (yyvsp[-2].attr_list);
(yyval.var_list) = append_var(NULL, v);
@@ -3495,37 +3497,37 @@
break;
case 197:
-#line 748 "parser.y"
+#line 750 "parser.y"
{ (yyval.var) = (yyvsp[-1].var); ;}
break;
case 198:
-#line 749 "parser.y"
+#line 751 "parser.y"
{ (yyval.var) = make_var(NULL); (yyval.var)->attrs = (yyvsp[-1].attr_list); ;}
break;
case 199:
-#line 752 "parser.y"
+#line 754 "parser.y"
{ (yyval.var_list) = NULL; ;}
break;
case 200:
-#line 753 "parser.y"
+#line 755 "parser.y"
{ (yyval.var_list) = append_var( (yyvsp[-1].var_list), (yyvsp[0].var) ); ;}
break;
case 201:
-#line 757 "parser.y"
+#line 759 "parser.y"
{ (yyval.var) = (yyvsp[-1].var); ;}
break;
case 202:
-#line 758 "parser.y"
+#line 760 "parser.y"
{ (yyval.var) = NULL; ;}
break;
case 203:
-#line 761 "parser.y"
+#line 763 "parser.y"
{ (yyval.var) = (yyvsp[0].declarator)->var;
(yyval.var)->attrs = check_field_attrs((yyval.var)->name,
(yyvsp[-2].attr_list));
set_type((yyval.var), (yyvsp[-1].declspec), (yyvsp[0].declarator), FALSE);
@@ -3534,7 +3536,7 @@
break;
case 204:
-#line 769 "parser.y"
+#line 771 "parser.y"
{ var_t *v = (yyvsp[0].declarator)->var;
v->attrs = check_function_attrs(v->name, (yyvsp[-2].attr_list));
set_type(v, (yyvsp[-1].declspec), (yyvsp[0].declarator), FALSE);
@@ -3544,7 +3546,7 @@
break;
case 205:
-#line 779 "parser.y"
+#line 781 "parser.y"
{ (yyval.var) = (yyvsp[0].declarator)->var;
(yyval.var)->attrs = (yyvsp[-2].attr_list);
set_type((yyval.var), (yyvsp[-1].declspec), (yyvsp[0].declarator), FALSE);
@@ -3553,7 +3555,7 @@
break;
case 206:
-#line 784 "parser.y"
+#line 786 "parser.y"
{ (yyval.var) = (yyvsp[0].declarator)->var;
set_type((yyval.var), (yyvsp[-1].declspec), (yyvsp[0].declarator), FALSE);
free((yyvsp[0].declarator));
@@ -3561,52 +3563,52 @@
break;
case 207:
-#line 790 "parser.y"
+#line 792 "parser.y"
{ (yyval.var) = NULL; ;}
break;
case 209:
-#line 794 "parser.y"
+#line 796 "parser.y"
{ (yyval.var) = NULL; ;}
break;
case 210:
-#line 795 "parser.y"
+#line 797 "parser.y"
{ (yyval.var) = make_var((yyvsp[0].str)); ;}
break;
case 211:
-#line 796 "parser.y"
+#line 798 "parser.y"
{ (yyval.var) = make_var((yyvsp[0].str)); ;}
break;
case 212:
-#line 799 "parser.y"
- { (yyval.var) = make_var((yyvsp[0].str)); ;}
- break;
-
- case 213:
#line 801 "parser.y"
{ (yyval.var) = make_var((yyvsp[0].str)); ;}
break;
+ case 213:
+#line 803 "parser.y"
+ { (yyval.var) = make_var((yyvsp[0].str)); ;}
+ break;
+
case 214:
-#line 804 "parser.y"
+#line 806 "parser.y"
{ (yyval.type) = make_builtin((yyvsp[0].str)); ;}
break;
case 215:
-#line 805 "parser.y"
+#line 807 "parser.y"
{ (yyval.type) = make_builtin((yyvsp[0].str)); ;}
break;
case 217:
-#line 807 "parser.y"
+#line 809 "parser.y"
{ (yyval.type) = (yyvsp[0].type); (yyval.type)->sign = 1; ;}
break;
case 218:
-#line 808 "parser.y"
+#line 810 "parser.y"
{ (yyval.type) = (yyvsp[0].type); (yyval.type)->sign = -1;
switch ((yyval.type)->type) {
case RPC_FC_CHAR: break;
@@ -3626,91 +3628,94 @@
break;
case 219:
-#line 824 "parser.y"
+#line 826 "parser.y"
{ (yyval.type) = make_int(-1); ;}
break;
case 220:
-#line 825 "parser.y"
- { (yyval.type) = make_builtin((yyvsp[0].str)); ;}
- break;
-
- case 221:
-#line 826 "parser.y"
- { (yyval.type) = duptype(find_type("float", 0), 1); ;}
- break;
-
- case 222:
#line 827 "parser.y"
{ (yyval.type) = make_builtin((yyvsp[0].str)); ;}
break;
- case 223:
+ case 221:
#line 828 "parser.y"
- { (yyval.type) = make_builtin((yyvsp[0].str)); ;}
- break;
-
- case 224:
+ { (yyval.type) = duptype(find_type("float", 0), 1); ;}
+ break;
+
+ case 222:
#line 829 "parser.y"
{ (yyval.type) = make_builtin((yyvsp[0].str)); ;}
break;
- case 225:
+ case 223:
#line 830 "parser.y"
{ (yyval.type) = make_builtin((yyvsp[0].str)); ;}
break;
+ case 224:
+#line 831 "parser.y"
+ { (yyval.type) = make_builtin((yyvsp[0].str)); ;}
+ break;
+
+ case 225:
+#line 832 "parser.y"
+ { (yyval.type) = make_builtin((yyvsp[0].str)); ;}
+ break;
+
case 228:
-#line 837 "parser.y"
- { (yyval.type) = make_builtin((yyvsp[0].str)); ;}
- break;
-
- case 229:
-#line 838 "parser.y"
- { (yyval.type) = make_builtin((yyvsp[-1].str)); ;}
- break;
-
- case 230:
#line 839 "parser.y"
{ (yyval.type) = make_builtin((yyvsp[0].str)); ;}
break;
- case 231:
+ case 229:
#line 840 "parser.y"
{ (yyval.type) = make_builtin((yyvsp[-1].str)); ;}
break;
+ case 230:
+#line 841 "parser.y"
+ { (yyval.type) = make_builtin((yyvsp[0].str)); ;}
+ break;
+
+ case 231:
+#line 842 "parser.y"
+ { (yyval.type) = make_builtin((yyvsp[-1].str)); ;}
+ break;
+
case 232:
-#line 841 "parser.y"
+#line 843 "parser.y"
{ (yyval.type) = make_builtin((yyvsp[-1].str)); ;}
break;
case 233:
-#line 842 "parser.y"
+#line 844 "parser.y"
{ (yyval.type) = make_builtin((yyvsp[0].str)); ;}
break;
case 234:
-#line 843 "parser.y"
+#line 845 "parser.y"
{ (yyval.type) = make_builtin((yyvsp[0].str)); ;}
break;
case 235:
-#line 846 "parser.y"
+#line 848 "parser.y"
{ (yyval.type) = make_class((yyvsp[0].str)); ;}
break;
case 236:
-#line 847 "parser.y"
+#line 849 "parser.y"
{ (yyval.type) = find_type((yyvsp[0].str), 0);
- if ((yyval.type)->defined) error_loc("multiple definition
error\n");
- if ((yyval.type)->kind != TKIND_COCLASS) error_loc("%s was not declared a
coclass\n", (yyvsp[0].str));
+ if ((yyval.type)->kind != TKIND_COCLASS)
+ error_loc("%s was not declared a coclass at %s:%d\n",
+ (yyvsp[0].str), (yyval.type)->loc_info.input_name,
+ (yyval.type)->loc_info.line_number);
;}
break;
case 237:
-#line 853 "parser.y"
+#line 857 "parser.y"
{ (yyval.type) = (yyvsp[0].type);
+ check_def((yyval.type));
(yyval.type)->attrs = check_coclass_attrs((yyvsp[0].type)->name,
(yyvsp[-1].attr_list));
if (!parse_only && do_header)
write_coclass((yyval.type));
@@ -3720,7 +3725,7 @@
break;
case 238:
-#line 863 "parser.y"
+#line 868 "parser.y"
{ (yyval.type) = (yyvsp[-4].type);
(yyval.type)->ifaces = (yyvsp[-2].ifref_list);
(yyval.type)->defined = TRUE;
@@ -3728,37 +3733,37 @@
break;
case 239:
-#line 869 "parser.y"
+#line 874 "parser.y"
{ (yyval.ifref_list) = NULL; ;}
break;
case 240:
-#line 870 "parser.y"
+#line 875 "parser.y"
{ (yyval.ifref_list) = append_ifref( (yyvsp[-1].ifref_list), (yyvsp[0].ifref) ); ;}
break;
case 241:
-#line 874 "parser.y"
+#line 879 "parser.y"
{ (yyval.ifref) = make_ifref((yyvsp[0].type)); (yyval.ifref)->attrs =
(yyvsp[-1].attr_list); ;}
break;
case 242:
-#line 877 "parser.y"
+#line 882 "parser.y"
{ (yyval.type) = get_type(RPC_FC_IP, (yyvsp[0].str), 0); (yyval.type)->kind =
TKIND_DISPATCH; ;}
break;
case 243:
-#line 878 "parser.y"
+#line 883 "parser.y"
{ (yyval.type) = get_type(RPC_FC_IP, (yyvsp[0].str), 0); (yyval.type)->kind =
TKIND_DISPATCH; ;}
break;
case 244:
-#line 881 "parser.y"
+#line 886 "parser.y"
{ attr_t *attrs;
is_in_interface = TRUE;
is_object_interface = TRUE;
(yyval.type) = (yyvsp[0].type);
- if ((yyval.type)->defined) error_loc("multiple definition
error\n");
+ check_def((yyval.type));
attrs = make_attr(ATTR_DISPINTERFACE);
(yyval.type)->attrs = append_attr(
check_dispiface_attrs((yyvsp[0].type)->name, (yyvsp[-1].attr_list)), attrs );
(yyval.type)->ref = find_type("IDispatch", 0);
@@ -3769,27 +3774,27 @@
break;
case 245:
-#line 895 "parser.y"
+#line 900 "parser.y"
{ (yyval.var_list) = NULL; ;}
break;
case 246:
-#line 896 "parser.y"
+#line 901 "parser.y"
{ (yyval.var_list) = append_var( (yyvsp[-2].var_list), (yyvsp[-1].var) ); ;}
break;
case 247:
-#line 899 "parser.y"
+#line 904 "parser.y"
{ (yyval.func_list) = NULL; ;}
break;
case 248:
-#line 900 "parser.y"
+#line 905 "parser.y"
{ (yyval.func_list) = append_func( (yyvsp[-2].func_list), (yyvsp[-1].func) ); ;}
break;
case 249:
-#line 906 "parser.y"
+#line 911 "parser.y"
{ (yyval.type) = (yyvsp[-4].type);
(yyval.type)->fields_or_args = (yyvsp[-2].var_list);
(yyval.type)->funcs = (yyvsp[-1].func_list);
@@ -3800,7 +3805,7 @@
break;
case 250:
-#line 914 "parser.y"
+#line 919 "parser.y"
{ (yyval.type) = (yyvsp[-4].type);
(yyval.type)->fields_or_args = (yyvsp[-2].type)->fields_or_args;
(yyval.type)->funcs = (yyvsp[-2].type)->funcs;
@@ -3811,34 +3816,34 @@
break;
case 251:
-#line 923 "parser.y"
+#line 928 "parser.y"
{ (yyval.type) = NULL; ;}
break;
case 252:
-#line 924 "parser.y"
+#line 929 "parser.y"
{ (yyval.type) = find_type2((yyvsp[0].str), 0); ;}
break;
case 253:
-#line 927 "parser.y"
+#line 932 "parser.y"
{ (yyval.type) = get_type(RPC_FC_IP, (yyvsp[0].str), 0); (yyval.type)->kind =
TKIND_INTERFACE; ;}
break;
case 254:
-#line 928 "parser.y"
+#line 933 "parser.y"
{ (yyval.type) = get_type(RPC_FC_IP, (yyvsp[0].str), 0); (yyval.type)->kind =
TKIND_INTERFACE; ;}
break;
case 255:
-#line 931 "parser.y"
+#line 936 "parser.y"
{ (yyval.ifinfo).interface = (yyvsp[0].type);
(yyval.ifinfo).old_pointer_default = pointer_default;
if (is_attr((yyvsp[-1].attr_list), ATTR_POINTERDEFAULT))
pointer_default = get_attrv((yyvsp[-1].attr_list), ATTR_POINTERDEFAULT);
is_object_interface = is_object((yyvsp[-1].attr_list));
is_in_interface = TRUE;
- if ((yyvsp[0].type)->defined) error_loc("multiple definition
error\n");
+ check_def((yyvsp[0].type));
(yyvsp[0].type)->attrs = check_iface_attrs((yyvsp[0].type)->name,
(yyvsp[-1].attr_list));
(yyvsp[0].type)->defined = TRUE;
if (!parse_only && do_header) write_forward((yyvsp[0].type));
@@ -3846,7 +3851,7 @@
break;
case 256:
-#line 945 "parser.y"
+#line 950 "parser.y"
{ (yyval.type) = (yyvsp[-5].ifinfo).interface;
(yyval.type)->ref = (yyvsp[-4].type);
(yyval.type)->funcs = (yyvsp[-2].func_list);
@@ -3861,7 +3866,7 @@
break;
case 257:
-#line 960 "parser.y"
+#line 965 "parser.y"
{ (yyval.type) = (yyvsp[-7].ifinfo).interface;
(yyval.type)->ref = find_type2((yyvsp[-5].str), 0);
if (!(yyval.type)->ref) error_loc("base class '%s' not found in
import\n", (yyvsp[-5].str));
@@ -3876,39 +3881,39 @@
break;
case 258:
-#line 971 "parser.y"
+#line 976 "parser.y"
{ (yyval.type) = (yyvsp[-1].type); ;}
break;
case 259:
-#line 975 "parser.y"
+#line 980 "parser.y"
{ (yyval.type) = (yyvsp[-1].type); if (!parse_only && do_header)
write_forward((yyval.type)); ;}
break;
case 260:
-#line 976 "parser.y"
+#line 981 "parser.y"
{ (yyval.type) = (yyvsp[-1].type); if (!parse_only && do_header)
write_forward((yyval.type)); ;}
break;
case 261:
-#line 979 "parser.y"
+#line 984 "parser.y"
{ (yyval.type) = make_type(0, NULL); (yyval.type)->name = (yyvsp[0].str);
(yyval.type)->kind = TKIND_MODULE; ;}
break;
case 262:
-#line 980 "parser.y"
+#line 985 "parser.y"
{ (yyval.type) = make_type(0, NULL); (yyval.type)->name = (yyvsp[0].str);
(yyval.type)->kind = TKIND_MODULE; ;}
break;
case 263:
-#line 983 "parser.y"
+#line 988 "parser.y"
{ (yyval.type) = (yyvsp[0].type);
(yyval.type)->attrs = check_module_attrs((yyvsp[0].type)->name,
(yyvsp[-1].attr_list));
;}
break;
case 264:
-#line 989 "parser.y"
+#line 994 "parser.y"
{ (yyval.type) = (yyvsp[-4].type);
(yyval.type)->funcs = (yyvsp[-2].func_list);
/* FIXME: if (!parse_only && do_header) write_module($$); */
@@ -3916,97 +3921,97 @@
break;
case 265:
-#line 996 "parser.y"
+#line 1001 "parser.y"
{ (yyval.stgclass) = STG_EXTERN; ;}
break;
case 266:
-#line 997 "parser.y"
+#line 1002 "parser.y"
{ (yyval.stgclass) = STG_STATIC; ;}
break;
case 267:
-#line 998 "parser.y"
+#line 1003 "parser.y"
{ (yyval.stgclass) = STG_REGISTER; ;}
break;
case 268:
-#line 1002 "parser.y"
+#line 1007 "parser.y"
{ (yyval.attr) = make_attr(ATTR_INLINE); ;}
break;
case 269:
-#line 1006 "parser.y"
+#line 1011 "parser.y"
{ (yyval.attr) = make_attr(ATTR_CONST); ;}
break;
case 270:
-#line 1009 "parser.y"
+#line 1014 "parser.y"
{ (yyval.attr_list) = NULL; ;}
break;
case 271:
-#line 1010 "parser.y"
+#line 1015 "parser.y"
{ (yyval.attr_list) = append_attr((yyvsp[-1].attr_list), (yyvsp[0].attr)); ;}
break;
case 272:
-#line 1013 "parser.y"
+#line 1018 "parser.y"
{ (yyval.declspec) = make_decl_spec((yyvsp[-1].type), (yyvsp[0].declspec), NULL,
NULL, STG_NONE); ;}
break;
case 273:
-#line 1015 "parser.y"
+#line 1020 "parser.y"
{ (yyval.declspec) = make_decl_spec((yyvsp[-1].type), (yyvsp[-2].declspec),
(yyvsp[0].declspec), NULL, STG_NONE); ;}
break;
case 274:
-#line 1018 "parser.y"
+#line 1023 "parser.y"
{ (yyval.declspec) = NULL; ;}
break;
case 276:
-#line 1023 "parser.y"
+#line 1028 "parser.y"
{ (yyval.declspec) = make_decl_spec(NULL, (yyvsp[0].declspec), NULL,
(yyvsp[-1].attr), STG_NONE); ;}
break;
case 277:
-#line 1024 "parser.y"
+#line 1029 "parser.y"
{ (yyval.declspec) = make_decl_spec(NULL, (yyvsp[0].declspec), NULL,
(yyvsp[-1].attr), STG_NONE); ;}
break;
case 278:
-#line 1025 "parser.y"
+#line 1030 "parser.y"
{ (yyval.declspec) = make_decl_spec(NULL, (yyvsp[0].declspec), NULL, NULL,
(yyvsp[-1].stgclass)); ;}
break;
case 279:
-#line 1030 "parser.y"
+#line 1035 "parser.y"
{ (yyval.declarator) = (yyvsp[0].declarator); (yyval.declarator)->type =
append_ptrchain_type((yyval.declarator)->type, make_pointer_type(NULL,
(yyvsp[-1].attr_list))); ;}
break;
case 280:
-#line 1031 "parser.y"
+#line 1036 "parser.y"
{ (yyval.declarator) = (yyvsp[0].declarator); (yyval.declarator)->type->attrs =
append_attr((yyval.declarator)->type->attrs, make_attrp(ATTR_CALLCONV,
(yyvsp[-1].str))); ;}
break;
case 282:
-#line 1036 "parser.y"
+#line 1041 "parser.y"
{ (yyval.declarator) = make_declarator((yyvsp[0].var)); ;}
break;
case 283:
-#line 1037 "parser.y"
+#line 1042 "parser.y"
{ (yyval.declarator) = (yyvsp[-1].declarator); ;}
break;
case 284:
-#line 1038 "parser.y"
+#line 1043 "parser.y"
{ (yyval.declarator) = (yyvsp[-1].declarator); (yyval.declarator)->array =
append_array((yyval.declarator)->array, (yyvsp[0].expr)); ;}
break;
case 285:
-#line 1039 "parser.y"
+#line 1044 "parser.y"
{ (yyval.declarator) = (yyvsp[-3].declarator);
(yyval.declarator)->func_type =
append_ptrchain_type((yyval.declarator)->type, make_func_type((yyvsp[-1].var_list)));
(yyval.declarator)->type = NULL;
@@ -4014,44 +4019,45 @@
break;
case 286:
-#line 1046 "parser.y"
+#line 1051 "parser.y"
{ (yyval.declarator_list) = append_declarator( NULL, (yyvsp[0].declarator) ); ;}
break;
case 287:
-#line 1047 "parser.y"
+#line 1052 "parser.y"
{ (yyval.declarator_list) = append_declarator( (yyvsp[-2].declarator_list),
(yyvsp[0].declarator) ); ;}
break;
case 288:
-#line 1051 "parser.y"
+#line 1056 "parser.y"
{ (yyval.declarator) = (yyvsp[0].declarator); ;}
break;
case 289:
-#line 1052 "parser.y"
+#line 1057 "parser.y"
{ (yyval.declarator) = (yyvsp[-2].declarator);
(yyvsp[-2].declarator)->var->eval = (yyvsp[0].expr); ;}
break;
case 290:
-#line 1056 "parser.y"
+#line 1061 "parser.y"
{ (yyval.num) = RPC_FC_RP; ;}
break;
case 291:
-#line 1057 "parser.y"
+#line 1062 "parser.y"
{ (yyval.num) = RPC_FC_UP; ;}
break;
case 292:
-#line 1058 "parser.y"
+#line 1063 "parser.y"
{ (yyval.num) = RPC_FC_FP; ;}
break;
case 293:
-#line 1061 "parser.y"
+#line 1066 "parser.y"
{ (yyval.type) = get_typev(RPC_FC_STRUCT, (yyvsp[-3].var), tsSTRUCT);
/* overwrite RPC_FC_STRUCT with a more
exact type */
+ check_def((yyval.type));
(yyval.type)->type = get_struct_type( (yyvsp[-1].var_list) );
(yyval.type)->kind = TKIND_RECORD;
(yyval.type)->fields_or_args = (yyvsp[-1].var_list);
@@ -4062,65 +4068,66 @@
break;
case 294:
-#line 1072 "parser.y"
+#line 1078 "parser.y"
{ (yyval.type) = duptype(find_type("void", 0), 1); ;}
break;
case 295:
-#line 1073 "parser.y"
+#line 1079 "parser.y"
{ (yyval.type) = find_type((yyvsp[0].str), 0); ;}
break;
case 296:
-#line 1074 "parser.y"
+#line 1080 "parser.y"
{ (yyval.type) = (yyvsp[0].type); ;}
break;
case 297:
-#line 1075 "parser.y"
+#line 1081 "parser.y"
{ (yyval.type) = (yyvsp[0].type); ;}
break;
case 298:
-#line 1076 "parser.y"
+#line 1082 "parser.y"
{ (yyval.type) = find_type2((yyvsp[0].str), tsENUM); ;}
break;
case 299:
-#line 1077 "parser.y"
+#line 1083 "parser.y"
{ (yyval.type) = (yyvsp[0].type); ;}
break;
case 300:
-#line 1078 "parser.y"
+#line 1084 "parser.y"
{ (yyval.type) = get_type(RPC_FC_STRUCT, (yyvsp[0].str), tsSTRUCT); ;}
break;
case 301:
-#line 1079 "parser.y"
+#line 1085 "parser.y"
{ (yyval.type) = (yyvsp[0].type); ;}
break;
case 302:
-#line 1080 "parser.y"
+#line 1086 "parser.y"
{ (yyval.type) = find_type2((yyvsp[0].str), tsUNION); ;}
break;
case 303:
-#line 1081 "parser.y"
+#line 1087 "parser.y"
{ (yyval.type) = make_safearray((yyvsp[-1].type)); ;}
break;
case 304:
-#line 1085 "parser.y"
+#line 1091 "parser.y"
{ reg_typedefs((yyvsp[-1].declspec), (yyvsp[0].declarator_list),
check_typedef_attrs((yyvsp[-2].attr_list)));
(yyval.statement) = process_typedefs((yyvsp[0].declarator_list));
;}
break;
case 305:
-#line 1091 "parser.y"
+#line 1097 "parser.y"
{ (yyval.type) = get_typev(RPC_FC_NON_ENCAPSULATED_UNION, (yyvsp[-3].var), tsUNION);
+ check_def((yyval.type));
(yyval.type)->kind = TKIND_UNION;
(yyval.type)->fields_or_args = (yyvsp[-1].var_list);
(yyval.type)->defined = TRUE;
@@ -4128,9 +4135,10 @@
break;
case 306:
-#line 1098 "parser.y"
+#line 1105 "parser.y"
{ var_t *u = (yyvsp[-3].var);
(yyval.type) = get_typev(RPC_FC_ENCAPSULATED_UNION, (yyvsp[-8].var), tsUNION);
+ check_def((yyval.type));
(yyval.type)->kind = TKIND_UNION;
if (!u) u = make_var( xstrdup("tagged_union") );
u->type = make_type(RPC_FC_NON_ENCAPSULATED_UNION, NULL);
@@ -4144,12 +4152,12 @@
break;
case 307:
-#line 1113 "parser.y"
+#line 1121 "parser.y"
{ (yyval.num) = MAKEVERSION((yyvsp[0].num), 0); ;}
break;
case 308:
-#line 1114 "parser.y"
+#line 1122 "parser.y"
{ (yyval.num) = MAKEVERSION((yyvsp[-2].num), (yyvsp[0].num)); ;}
break;
@@ -4158,7 +4166,7 @@
}
/* Line 1126 of yacc.c. */
-#line 4162 "parser.tab.c"
+#line 4170 "parser.tab.c"
yyvsp -= yylen;
yyssp -= yylen;
@@ -4426,7 +4434,7 @@
}
-#line 1117 "parser.y"
+#line 1125 "parser.y"
static void decl_builtin(const char *name, unsigned char type)
@@ -4703,6 +4711,7 @@
t->tfswrite = FALSE;
t->checked = FALSE;
t->typelib_idx = -1;
+ init_loc_info(&t->loc_info);
return t;
}
@@ -5014,9 +5023,7 @@
v->attrs = NULL;
v->eval = NULL;
v->stgclass = STG_NONE;
- v->loc_info.input_name = input_name ? input_name : "stdin";
- v->loc_info.line_number = line_number;
- v->loc_info.near_text = parser_text;
+ init_loc_info(&v->loc_info);
return v;
}
@@ -5206,6 +5213,12 @@
if (name->name) {
type_t *cur;
+
+ cur = find_type_helper(name->name, 0);
+ if (cur)
+ error_loc("%s: redefinition error; original definition was at
%s:%d\n",
+ cur->name, cur->loc_info.input_name,
+ cur->loc_info.line_number);
/* set the attributes to allow set_type to do some checks on them */
name->attrs = attrs;
@@ -6210,3 +6223,17 @@
return list;
}
+void init_loc_info(loc_info_t *i)
+{
+ i->input_name = input_name ? input_name : "stdin";
+ i->line_number = line_number;
+ i->near_text = parser_text;
+}
+
+static void check_def(const type_t *t)
+{
+ if (t->defined)
+ error_loc("%s: redefinition error; original definition was at
%s:%d\n",
+ t->name, t->loc_info.input_name, t->loc_info.line_number);
+}
+
Modified: trunk/reactos/tools/widl/parser.tab.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/widl/parser.tab.h?re…
==============================================================================
--- trunk/reactos/tools/widl/parser.tab.h [iso-8859-1] (original)
+++ trunk/reactos/tools/widl/parser.tab.h [iso-8859-1] Wed Nov 19 17:13:05 2008
@@ -335,7 +335,7 @@
#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
-#line 177 "parser.y"
+#line 179 "parser.y"
typedef union YYSTYPE {
attr_t *attr;
attr_list_t *attr_list;
Modified: trunk/reactos/tools/widl/parser.y
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/widl/parser.y?rev=37…
==============================================================================
--- trunk/reactos/tools/widl/parser.y [iso-8859-1] (original)
+++ trunk/reactos/tools/widl/parser.y [iso-8859-1] Wed Nov 19 17:13:05 2008
@@ -156,6 +156,8 @@
static attr_list_t *check_coclass_attrs(const char *name, attr_list_t *attrs);
const char *get_attr_display_name(enum attr_type type);
static void add_explicit_handle_if_necessary(func_t *func);
+static type_t *find_type_helper(const char *name, int t);
+static void check_def(const type_t *t);
static statement_t *make_statement(enum statement_type type);
static statement_t *make_statement_type_decl(type_t *type);
@@ -845,12 +847,15 @@
coclass: tCOCLASS aIDENTIFIER { $$ = make_class($2); }
| tCOCLASS aKNOWNTYPE { $$ = find_type($2, 0);
- if ($$->defined) error_loc("multiple definition error\n");
- if ($$->kind != TKIND_COCLASS) error_loc("%s was not declared a
coclass\n", $2);
+ if ($$->kind != TKIND_COCLASS)
+ error_loc("%s was not declared a coclass at %s:%d\n",
+ $2, $$->loc_info.input_name,
+ $$->loc_info.line_number);
}
;
coclasshdr: attributes coclass { $$ = $2;
+ check_def($$);
$$->attrs = check_coclass_attrs($2->name, $1);
if (!parse_only && do_header)
write_coclass($$);
@@ -882,7 +887,7 @@
is_in_interface = TRUE;
is_object_interface = TRUE;
$$ = $2;
- if ($$->defined) error_loc("multiple definition error\n");
+ check_def($$);
attrs = make_attr(ATTR_DISPINTERFACE);
$$->attrs = append_attr( check_dispiface_attrs($2->name, $1), attrs );
$$->ref = find_type("IDispatch", 0);
@@ -934,7 +939,7 @@
pointer_default = get_attrv($1, ATTR_POINTERDEFAULT);
is_object_interface = is_object($1);
is_in_interface = TRUE;
- if ($2->defined) error_loc("multiple definition error\n");
+ check_def($2);
$2->attrs = check_iface_attrs($2->name, $1);
$2->defined = TRUE;
if (!parse_only && do_header) write_forward($2);
@@ -1060,6 +1065,7 @@
structdef: tSTRUCT t_ident '{' fields '}' { $$ = get_typev(RPC_FC_STRUCT,
$2, tsSTRUCT);
/* overwrite RPC_FC_STRUCT with a more
exact type */
+ check_def($$);
$$->type = get_struct_type( $4 );
$$->kind = TKIND_RECORD;
$$->fields_or_args = $4;
@@ -1089,6 +1095,7 @@
uniondef: tUNION t_ident '{' ne_union_fields '}'
{ $$ = get_typev(RPC_FC_NON_ENCAPSULATED_UNION, $2, tsUNION);
+ check_def($$);
$$->kind = TKIND_UNION;
$$->fields_or_args = $4;
$$->defined = TRUE;
@@ -1097,6 +1104,7 @@
tSWITCH '(' s_field ')'
m_ident '{' cases '}' { var_t *u = $7;
$$ = get_typev(RPC_FC_ENCAPSULATED_UNION, $2, tsUNION);
+ check_def($$);
$$->kind = TKIND_UNION;
if (!u) u = make_var( xstrdup("tagged_union") );
u->type = make_type(RPC_FC_NON_ENCAPSULATED_UNION, NULL);
@@ -1390,6 +1398,7 @@
t->tfswrite = FALSE;
t->checked = FALSE;
t->typelib_idx = -1;
+ init_loc_info(&t->loc_info);
return t;
}
@@ -1701,9 +1710,7 @@
v->attrs = NULL;
v->eval = NULL;
v->stgclass = STG_NONE;
- v->loc_info.input_name = input_name ? input_name : "stdin";
- v->loc_info.line_number = line_number;
- v->loc_info.near_text = parser_text;
+ init_loc_info(&v->loc_info);
return v;
}
@@ -1893,6 +1900,12 @@
if (name->name) {
type_t *cur;
+
+ cur = find_type_helper(name->name, 0);
+ if (cur)
+ error_loc("%s: redefinition error; original definition was at
%s:%d\n",
+ cur->name, cur->loc_info.input_name,
+ cur->loc_info.line_number);
/* set the attributes to allow set_type to do some checks on them */
name->attrs = attrs;
@@ -2896,3 +2909,17 @@
}
return list;
}
+
+void init_loc_info(loc_info_t *i)
+{
+ i->input_name = input_name ? input_name : "stdin";
+ i->line_number = line_number;
+ i->near_text = parser_text;
+}
+
+static void check_def(const type_t *t)
+{
+ if (t->defined)
+ error_loc("%s: redefinition error; original definition was at
%s:%d\n",
+ t->name, t->loc_info.input_name, t->loc_info.line_number);
+}
Modified: trunk/reactos/tools/widl/typelib.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/widl/typelib.c?rev=3…
==============================================================================
--- trunk/reactos/tools/widl/typelib.c [iso-8859-1] (original)
+++ trunk/reactos/tools/widl/typelib.c [iso-8859-1] Wed Nov 19 17:13:05 2008
@@ -69,6 +69,7 @@
a->kind = TKIND_ALIAS;
a->attrs = NULL;
a->declarray = FALSE;
+ init_loc_info(&a->loc_info);
return a;
}
Modified: trunk/reactos/tools/widl/widltypes.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/widl/widltypes.h?rev…
==============================================================================
--- trunk/reactos/tools/widl/widltypes.h [iso-8859-1] (original)
+++ trunk/reactos/tools/widl/widltypes.h [iso-8859-1] Wed Nov 19 17:13:05 2008
@@ -283,6 +283,7 @@
unsigned int typestring_offset;
unsigned int ptrdesc; /* used for complex structs */
int typelib_idx;
+ loc_info_t loc_info;
unsigned int declarray : 1; /* if declared as an array */
unsigned int ignore : 1;
unsigned int defined : 1;
@@ -419,6 +420,8 @@
type_t *find_type(const char *name, int t);
type_t *make_type(unsigned char type, type_t *ref);
+void init_loc_info(loc_info_t *);
+
static inline type_t *get_func_return_type(const func_t *func)
{
return func->def->type->ref;