1 /* A Bison parser, made by GNU Bison 2.1. */
3 /* Skeleton parser for Yacc-like parsing with Bison,
4 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
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
8 the Free Software Foundation; either version 2, or (at your option)
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA. */
21 /* As a special exception, when this file is copied by Bison into a
22 Bison output file, you may use that output file without restriction.
23 This special exception was added by the Free Software Foundation
24 in version 1.24 of Bison. */
26 /* Written by Richard Stallman by simplifying the original so called
27 ``semantic'' parser. */
29 /* All symbols defined below should begin with yy or YY, to avoid
30 infringing on user name space. This should be done even for local
31 variables, as they might otherwise be expanded by user macros.
32 There are some unavoidable exceptions within include files to
33 define necessary library symbols; they are noted "INFRINGES ON
34 USER NAME SPACE" below. */
36 /* Identify Bison output. */
40 #define YYBISON_VERSION "2.1"
43 #define YYSKELETON_NAME "yacc.c"
48 /* Using locations. */
49 #define YYLSP_NEEDED 0
51 /* Substitute the variable and function names. */
52 #define yyparse parser_parse
53 #define yylex parser_lex
54 #define yyerror parser_error
55 #define yylval parser_lval
56 #define yychar parser_char
57 #define yydebug parser_debug
58 #define yynerrs parser_nerrs
64 /* Put the tokens into the symbol table, so that GDB and other debuggers
98 tCONTEXTHANDLENOSERIALIZE
= 289,
99 tCONTEXTHANDLESERIALIZE
= 290,
103 tDEFAULTCOLLELEM
= 294,
105 tDEFAULTVTABLE
= 296,
107 tDISPINTERFACE
= 298,
115 tEXPLICITHANDLE
= 306,
125 tHELPSTRINGCONTEXT
= 316,
126 tHELPSTRINGDLL
= 317,
132 tIMMEDIATEBIND
= 323,
133 tIMPLICITHANDLE
= 324,
151 tNONEXTENSIBLE
= 342,
154 tOLEAUTOMATION
= 345,
158 tPOINTERDEFAULT
= 349,
180 tSTRICTCONTEXTHANDLE
= 371,
206 #define aIDENTIFIER 258
207 #define aKNOWNTYPE 259
216 #define tAGGREGATABLE 268
217 #define tALLOCATE 269
218 #define tAPPOBJECT 270
220 #define tASYNCUUID 272
221 #define tAUTOHANDLE 273
222 #define tBINDABLE 274
224 #define tBROADCAST 276
226 #define tBYTECOUNT 278
228 #define tCALLBACK 280
234 #define tCOMMSTATUS 286
236 #define tCONTEXTHANDLE 288
237 #define tCONTEXTHANDLENOSERIALIZE 289
238 #define tCONTEXTHANDLESERIALIZE 290
240 #define tCPPQUOTE 292
242 #define tDEFAULTCOLLELEM 294
243 #define tDEFAULTVALUE 295
244 #define tDEFAULTVTABLE 296
245 #define tDISPLAYBIND 297
246 #define tDISPINTERFACE 298
250 #define tENDPOINT 302
253 #define tERRORSTATUST 305
254 #define tEXPLICITHANDLE 306
257 #define tFASTCALL 309
261 #define tHELPCONTEXT 313
262 #define tHELPFILE 314
263 #define tHELPSTRING 315
264 #define tHELPSTRINGCONTEXT 316
265 #define tHELPSTRINGDLL 317
269 #define tIDEMPOTENT 321
271 #define tIMMEDIATEBIND 323
272 #define tIMPLICITHANDLE 324
274 #define tIMPORTLIB 326
277 #define tINPUTSYNC 329
280 #define tINTERFACE 332
282 #define tLENGTHIS 334
288 #define tNONBROWSABLE 340
289 #define tNONCREATABLE 341
290 #define tNONEXTENSIBLE 342
293 #define tOLEAUTOMATION 345
294 #define tOPTIONAL 346
297 #define tPOINTERDEFAULT 349
298 #define tPROPERTIES 350
301 #define tPROPPUTREF 353
305 #define tREADONLY 357
307 #define tREQUESTEDIT 359
308 #define tRESTRICTED 360
310 #define tSAFEARRAY 362
319 #define tSTRICTCONTEXTHANDLE 371
323 #define tSWITCHIS 375
324 #define tSWITCHTYPE 376
325 #define tTRANSMITAS 377
330 #define tUNSIGNED 382
337 #define tWIREMARSHAL 389
341 #define ADDRESSOF 393
346 /* Copy the first part of user declarations. */
352 * Copyright 2002 Ove Kaaven
354 * This library is free software; you can redistribute it and/or
355 * modify it under the terms of the GNU Lesser General Public
356 * License as published by the Free Software Foundation; either
357 * version 2.1 of the License, or (at your option) any later version.
359 * This library is distributed in the hope that it will be useful,
360 * but WITHOUT ANY WARRANTY; without even the implied warranty of
361 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
362 * Lesser General Public License for more details.
364 * You should have received a copy of the GNU Lesser General Public
365 * License along with this library; if not, write to the Free Software
366 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
389 /* Berkeley yacc (byacc) doesn't seem to know about these */
390 /* Some *BSD supplied versions do define these though */
392 # define YYEMPTY (-1) /* Empty lookahead value of yychar */
395 # define YYLEX yylex()
398 #elif defined(YYBISON)
399 /* Bison was used for original development */
400 /* #define YYEMPTY -2 */
401 /* #define YYLEX yylex() */
404 /* No yacc we know yet */
405 # if !defined(YYEMPTY) || !defined(YYLEX)
406 # error Yacc version/type unknown. This version needs to be verified for settings of YYEMPTY and YYLEX.
407 # elif defined(__GNUC__) /* gcc defines the #warning directive */
408 # warning Yacc version/type unknown. It defines YYEMPTY and YYLEX, but is not tested
409 /* #else we just take a chance that it works... */
413 #define YYERROR_VERBOSE
415 unsigned char pointer_default
= RPC_FC_UP
;
416 static int is_object_interface
= FALSE
;
417 /* are we inside a library block? */
418 static int is_inside_library
= FALSE
;
420 typedef struct list typelist_t
;
426 typelist_t incomplete_types
= LIST_INIT(incomplete_types
);
428 static void add_incomplete(type_t
*t
);
429 static void fix_incomplete(void);
431 static str_list_t
*append_str(str_list_t
*list
, char *str
);
432 static attr_list_t
*append_attr(attr_list_t
*list
, attr_t
*attr
);
433 static attr_t
*make_attr(enum attr_type type
);
434 static attr_t
*make_attrv(enum attr_type type
, unsigned long val
);
435 static attr_t
*make_attrp(enum attr_type type
, void *val
);
436 static expr_t
*make_expr(enum expr_type type
);
437 static expr_t
*make_exprl(enum expr_type type
, long val
);
438 static expr_t
*make_exprd(enum expr_type type
, double val
);
439 static expr_t
*make_exprs(enum expr_type type
, char *val
);
440 static expr_t
*make_exprt(enum expr_type type
, type_t
*tref
, expr_t
*expr
);
441 static expr_t
*make_expr1(enum expr_type type
, expr_t
*expr
);
442 static expr_t
*make_expr2(enum expr_type type
, expr_t
*exp1
, expr_t
*exp2
);
443 static expr_t
*make_expr3(enum expr_type type
, expr_t
*expr1
, expr_t
*expr2
, expr_t
*expr3
);
444 static type_t
*make_type(unsigned char type
, type_t
*ref
);
445 static expr_list_t
*append_expr(expr_list_t
*list
, expr_t
*expr
);
446 static array_dims_t
*append_array(array_dims_t
*list
, expr_t
*expr
);
447 static void set_type(var_t
*v
, type_t
*type
, const pident_t
*pident
, array_dims_t
*arr
, int top
);
448 static ifref_list_t
*append_ifref(ifref_list_t
*list
, ifref_t
*iface
);
449 static ifref_t
*make_ifref(type_t
*iface
);
450 static var_list_t
*append_var(var_list_t
*list
, var_t
*var
);
451 static var_t
*make_var(char *name
);
452 static pident_list_t
*append_pident(pident_list_t
*list
, pident_t
*p
);
453 static pident_t
*make_pident(var_t
*var
);
454 static func_list_t
*append_func(func_list_t
*list
, func_t
*func
);
455 static func_t
*make_func(var_t
*def
, var_list_t
*args
);
456 static type_t
*make_class(char *name
);
457 static type_t
*make_safearray(type_t
*type
);
458 static type_t
*make_builtin(char *name
);
459 static type_t
*make_int(int sign
);
461 static type_t
*reg_type(type_t
*type
, const char *name
, int t
);
462 static type_t
*reg_typedefs(type_t
*type
, var_list_t
*names
, attr_list_t
*attrs
);
463 static type_t
*find_type(const char *name
, int t
);
464 static type_t
*find_type2(char *name
, int t
);
465 static type_t
*get_type(unsigned char type
, char *name
, int t
);
466 static type_t
*get_typev(unsigned char type
, var_t
*name
, int t
);
467 static int get_struct_type(var_list_t
*fields
);
469 static var_t
*reg_const(var_t
*var
);
470 static var_t
*find_const(char *name
, int f
);
472 static void write_libid(const char *name
, const attr_list_t
*attr
);
473 static void write_clsid(type_t
*cls
);
474 static void write_diid(type_t
*iface
);
475 static void write_iid(type_t
*iface
);
477 static int compute_method_indexes(type_t
*iface
);
478 static char *gen_name(void);
479 static void process_typedefs(var_list_t
*names
);
480 static void check_arg(var_t
*arg
);
481 static void check_functions(const type_t
*iface
);
482 static void check_all_user_types(ifref_list_t
*ifaces
);
483 static const attr_list_t
*check_iface_attrs(const char *name
, const attr_list_t
*attrs
);
484 static attr_list_t
*check_function_attrs(const char *name
, attr_list_t
*attrs
);
485 static attr_list_t
*check_typedef_attrs(attr_list_t
*attrs
);
486 static attr_list_t
*check_field_attrs(const char *name
, attr_list_t
*attrs
);
487 static const attr_list_t
*check_library_attrs(const char *name
, const attr_list_t
*attrs
);
488 static attr_list_t
*check_dispiface_attrs(const char *name
, attr_list_t
*attrs
);
489 static const attr_list_t
*check_module_attrs(const char *name
, const attr_list_t
*attrs
);
490 static const attr_list_t
*check_coclass_attrs(const char *name
, const attr_list_t
*attrs
);
491 const char *get_attr_display_name(enum attr_type type
);
499 /* Enabling traces. */
504 /* Enabling verbose error messages. */
505 #ifdef YYERROR_VERBOSE
506 # undef YYERROR_VERBOSE
507 # define YYERROR_VERBOSE 1
509 # define YYERROR_VERBOSE 0
512 /* Enabling the token table. */
513 #ifndef YYTOKEN_TABLE
514 # define YYTOKEN_TABLE 0
517 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
519 typedef union YYSTYPE
{
521 attr_list_t
*attr_list
;
522 str_list_t
*str_list
;
524 expr_list_t
*expr_list
;
525 array_dims_t
*array_dims
;
528 var_list_t
*var_list
;
530 pident_list_t
*pident_list
;
532 func_list_t
*func_list
;
534 ifref_list_t
*ifref_list
;
539 interface_info_t ifinfo
;
541 /* Line 196 of yacc.c. */
542 #line 543 "parser.tab.c"
543 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
544 # define YYSTYPE_IS_DECLARED 1
545 # define YYSTYPE_IS_TRIVIAL 1
550 /* Copy the second part of user declarations. */
553 /* Line 219 of yacc.c. */
554 #line 555 "parser.tab.c"
556 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
557 # define YYSIZE_T __SIZE_TYPE__
559 #if ! defined (YYSIZE_T) && defined (size_t)
560 # define YYSIZE_T size_t
562 #if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus))
563 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
564 # define YYSIZE_T size_t
566 #if ! defined (YYSIZE_T)
567 # define YYSIZE_T unsigned int
573 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
574 # define YY_(msgid) dgettext ("bison-runtime", msgid)
578 # define YY_(msgid) msgid
582 #if ! defined (yyoverflow) || YYERROR_VERBOSE
584 /* The parser invokes alloca or malloc; define the necessary symbols. */
586 # ifdef YYSTACK_USE_ALLOCA
587 # if YYSTACK_USE_ALLOCA
589 # define YYSTACK_ALLOC __builtin_alloca
591 # define YYSTACK_ALLOC alloca
592 # if defined (__STDC__) || defined (__cplusplus)
593 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
594 # define YYINCLUDED_STDLIB_H
600 # ifdef YYSTACK_ALLOC
601 /* Pacify GCC's `empty if-body' warning. */
602 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
603 # ifndef YYSTACK_ALLOC_MAXIMUM
604 /* The OS might guarantee only one guard page at the bottom of the stack,
605 and a page size can be as small as 4096 bytes. So we cannot safely
606 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
607 to allow for a few compiler-allocated temporary stack slots. */
608 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */
611 # define YYSTACK_ALLOC YYMALLOC
612 # define YYSTACK_FREE YYFREE
613 # ifndef YYSTACK_ALLOC_MAXIMUM
614 # define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1)
620 # define YYMALLOC malloc
621 # if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \
622 && (defined (__STDC__) || defined (__cplusplus)))
623 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
628 # if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \
629 && (defined (__STDC__) || defined (__cplusplus)))
630 void free (void *); /* INFRINGES ON USER NAME SPACE */
637 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
640 #if (! defined (yyoverflow) \
641 && (! defined (__cplusplus) \
642 || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
644 /* A type that is properly aligned for any stack member. */
651 /* The size of the maximum gap between one aligned stack and the next. */
652 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
654 /* The size of an array large to enough to hold all stacks, each with
656 # define YYSTACK_BYTES(N) \
657 ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \
658 + YYSTACK_GAP_MAXIMUM)
660 /* Copy COUNT objects from FROM to TO. The source and destination do
663 # if defined (__GNUC__) && 1 < __GNUC__
664 # define YYCOPY(To, From, Count) \
665 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
667 # define YYCOPY(To, From, Count) \
671 for (yyi = 0; yyi < (Count); yyi++) \
672 (To)[yyi] = (From)[yyi]; \
678 /* Relocate STACK from its old location to the new one. The
679 local variables YYSIZE and YYSTACKSIZE give the old and new number of
680 elements in the stack, and YYPTR gives the new location of the
681 stack. Advance YYPTR to a properly aligned location for the next
683 # define YYSTACK_RELOCATE(Stack) \
686 YYSIZE_T yynewbytes; \
687 YYCOPY (&yyptr->Stack, Stack, yysize); \
688 Stack = &yyptr->Stack; \
689 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
690 yyptr += yynewbytes / sizeof (*yyptr); \
696 #if defined (__STDC__) || defined (__cplusplus)
697 typedef signed char yysigned_char
;
699 typedef short int yysigned_char
;
702 /* YYFINAL -- State number of the termination state. */
704 /* YYLAST -- Last index in YYTABLE. */
707 /* YYNTOKENS -- Number of terminals. */
708 #define YYNTOKENS 158
709 /* YYNNTS -- Number of nonterminals. */
711 /* YYNRULES -- Number of rules. */
713 /* YYNRULES -- Number of states. */
714 #define YYNSTATES 507
716 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
718 #define YYMAXUTOK 393
720 #define YYTRANSLATE(YYX) \
721 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
723 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
724 static const unsigned char yytranslate
[] =
726 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
727 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
728 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
729 2, 2, 2, 2, 2, 2, 2, 2, 139, 2,
730 150, 151, 142, 141, 135, 140, 157, 143, 2, 2,
731 2, 2, 2, 2, 2, 2, 2, 2, 137, 149,
732 2, 156, 2, 136, 2, 2, 2, 2, 2, 2,
733 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
734 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
735 2, 154, 2, 155, 2, 2, 2, 2, 2, 2,
736 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
737 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
738 2, 2, 2, 152, 138, 153, 144, 2, 2, 2,
739 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
740 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
741 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
742 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
743 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
744 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
745 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
746 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
747 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
748 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
749 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
750 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
751 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
752 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
753 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
754 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
755 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
756 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
757 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
758 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
759 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
760 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
761 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
762 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
763 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
764 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
769 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
771 static const unsigned short int yyprhs
[] =
773 0, 0, 3, 5, 6, 9, 12, 16, 19, 22,
774 25, 28, 29, 32, 35, 39, 42, 45, 48, 51,
775 54, 55, 59, 62, 63, 65, 68, 70, 73, 76,
776 78, 81, 84, 87, 92, 96, 100, 106, 109, 113,
777 118, 119, 121, 123, 125, 129, 131, 136, 140, 141,
778 145, 149, 151, 155, 160, 161, 163, 167, 169, 173,
779 178, 180, 184, 185, 187, 189, 191, 193, 195, 197,
780 202, 207, 209, 211, 213, 215, 217, 219, 224, 229,
781 231, 233, 238, 240, 245, 250, 255, 257, 259, 264,
782 269, 274, 279, 284, 286, 291, 293, 298, 300, 306,
783 308, 310, 315, 317, 319, 321, 323, 325, 327, 329,
784 331, 333, 338, 340, 342, 344, 346, 353, 355, 357,
785 359, 361, 366, 368, 370, 372, 377, 382, 387, 392,
786 394, 396, 401, 406, 408, 410, 412, 414, 416, 418,
787 420, 421, 424, 429, 433, 439, 440, 443, 445, 447,
788 451, 455, 457, 463, 465, 469, 470, 472, 474, 476,
789 478, 480, 482, 484, 490, 494, 498, 502, 506, 510,
790 514, 518, 522, 525, 528, 531, 534, 539, 544, 548,
791 550, 554, 556, 561, 562, 565, 568, 572, 575, 577,
792 582, 586, 587, 589, 590, 592, 594, 596, 598, 600,
793 602, 604, 607, 610, 612, 614, 616, 618, 620, 622,
794 624, 625, 627, 629, 632, 634, 637, 640, 642, 644,
795 647, 650, 653, 659, 660, 663, 666, 669, 672, 675,
796 678, 682, 685, 689, 695, 701, 702, 705, 708, 711,
797 714, 721, 730, 733, 736, 739, 742, 745, 748, 754,
798 757, 760, 763, 765, 770, 772, 776, 778, 780, 784,
799 786, 788, 790, 796, 798, 800, 802, 805, 807, 810,
800 812, 815, 817, 820, 825, 830, 836, 847, 849
803 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
804 static const short int yyrhs
[] =
806 159, 0, -1, 160, -1, -1, 160, 222, -1, 160,
807 221, -1, 160, 208, 149, -1, 160, 210, -1, 160,
808 225, -1, 160, 171, -1, 160, 164, -1, -1, 161,
809 222, -1, 161, 221, -1, 161, 208, 149, -1, 161,
810 210, -1, 161, 225, -1, 161, 164, -1, 161, 168,
811 -1, 161, 171, -1, -1, 162, 201, 149, -1, 162,
812 164, -1, -1, 149, -1, 187, 149, -1, 165, -1,
813 191, 149, -1, 197, 149, -1, 167, -1, 231, 149,
814 -1, 233, 149, -1, 234, 149, -1, 37, 150, 8,
815 151, -1, 70, 8, 149, -1, 166, 161, 10, -1,
816 71, 150, 8, 151, 163, -1, 80, 3, -1, 179,
817 169, 152, -1, 170, 161, 153, 163, -1, -1, 174,
818 -1, 132, -1, 175, -1, 174, 135, 175, -1, 173,
819 -1, 179, 232, 226, 176, -1, 232, 226, 176, -1,
820 -1, 154, 177, 155, -1, 154, 142, 155, -1, 193,
821 -1, 177, 135, 194, -1, 177, 155, 154, 194, -1,
822 -1, 179, -1, 154, 180, 155, -1, 182, -1, 180,
823 135, 182, -1, 180, 155, 154, 182, -1, 8, -1,
824 181, 135, 8, -1, -1, 13, -1, 15, -1, 16,
825 -1, 18, -1, 19, -1, 21, -1, 24, 150, 204,
826 151, -1, 26, 150, 195, 151, -1, 33, -1, 34,
827 -1, 35, -1, 36, -1, 38, -1, 39, -1, 40,
828 150, 196, 151, -1, 40, 150, 8, 151, -1, 41,
829 -1, 42, -1, 44, 150, 8, 151, -1, 46, -1,
830 47, 150, 181, 151, -1, 48, 150, 8, 151, -1,
831 48, 150, 196, 151, -1, 51, -1, 56, -1, 58,
832 150, 196, 151, -1, 59, 150, 8, 151, -1, 60,
833 150, 8, 151, -1, 61, 150, 196, 151, -1, 62,
834 150, 8, 151, -1, 63, -1, 65, 150, 196, 151,
835 -1, 66, -1, 67, 150, 194, 151, -1, 68, -1,
836 69, 150, 57, 3, 151, -1, 72, -1, 74, -1,
837 79, 150, 192, 151, -1, 81, -1, 85, -1, 86,
838 -1, 87, -1, 88, -1, 89, -1, 90, -1, 91,
839 -1, 92, -1, 94, 150, 230, 151, -1, 96, -1,
840 97, -1, 98, -1, 100, -1, 101, 150, 196, 135,
841 196, 151, -1, 102, -1, 104, -1, 105, -1, 106,
842 -1, 111, 150, 192, 151, -1, 114, -1, 116, -1,
843 117, -1, 120, 150, 194, 151, -1, 121, 150, 232,
844 151, -1, 122, 150, 232, 151, -1, 128, 150, 183,
845 151, -1, 129, -1, 130, -1, 131, 150, 235, 151,
846 -1, 134, 150, 232, 151, -1, 230, -1, 9, -1,
847 8, -1, 27, -1, 54, -1, 93, -1, 115, -1,
848 -1, 185, 186, -1, 26, 194, 137, 199, -1, 38,
849 137, 199, -1, 32, 232, 204, 156, 196, -1, -1,
850 189, 135, -1, 189, -1, 190, -1, 189, 135, 190,
851 -1, 204, 156, 196, -1, 204, -1, 49, 203, 152,
852 188, 153, -1, 193, -1, 192, 135, 193, -1, -1,
853 194, -1, 5, -1, 6, -1, 7, -1, 53, -1,
854 123, -1, 3, -1, 194, 136, 194, 137, 194, -1,
855 194, 138, 194, -1, 194, 139, 194, -1, 194, 141,
856 194, -1, 194, 140, 194, -1, 194, 142, 194, -1,
857 194, 143, 194, -1, 194, 11, 194, -1, 194, 12,
858 194, -1, 144, 194, -1, 140, 194, -1, 139, 194,
859 -1, 142, 194, -1, 150, 232, 151, 194, -1, 112,
860 150, 232, 151, -1, 150, 194, 151, -1, 196, -1,
861 195, 135, 196, -1, 194, -1, 52, 32, 232, 204,
862 -1, -1, 198, 199, -1, 200, 149, -1, 178, 234,
863 149, -1, 179, 149, -1, 149, -1, 178, 232, 226,
864 176, -1, 178, 232, 226, -1, -1, 204, -1, -1,
865 3, -1, 4, -1, 3, -1, 4, -1, 22, -1,
866 133, -1, 207, -1, 109, 207, -1, 127, 207, -1,
867 127, -1, 55, -1, 110, -1, 45, -1, 20, -1,
868 50, -1, 57, -1, -1, 75, -1, 75, -1, 108,
869 206, -1, 113, -1, 82, 206, -1, 64, 206, -1,
870 76, -1, 28, -1, 29, 3, -1, 29, 4, -1,
871 179, 208, -1, 209, 152, 211, 153, 163, -1, -1,
872 211, 212, -1, 178, 222, -1, 43, 3, -1, 43,
873 4, -1, 179, 213, -1, 95, 137, -1, 215, 200,
874 149, -1, 83, 137, -1, 216, 201, 149, -1, 214,
875 152, 215, 216, 153, -1, 214, 152, 219, 149, 153,
876 -1, -1, 137, 4, -1, 77, 3, -1, 77, 4,
877 -1, 179, 219, -1, 220, 218, 152, 162, 153, 163,
878 -1, 220, 137, 3, 152, 167, 162, 153, 163, -1,
879 217, 163, -1, 219, 149, -1, 213, 149, -1, 84,
880 3, -1, 84, 4, -1, 179, 223, -1, 224, 152,
881 162, 153, 163, -1, 142, 226, -1, 32, 226, -1,
882 184, 226, -1, 228, -1, 228, 150, 172, 151, -1,
883 204, -1, 150, 226, 151, -1, 227, -1, 226, -1,
884 229, 135, 226, -1, 103, -1, 126, -1, 99, -1,
885 118, 203, 152, 198, 153, -1, 132, -1, 4, -1,
886 205, -1, 32, 232, -1, 191, -1, 49, 3, -1,
887 231, -1, 118, 3, -1, 234, -1, 125, 3, -1,
888 107, 150, 232, 151, -1, 124, 178, 232, 229, -1,
889 125, 203, 152, 198, 153, -1, 125, 203, 119, 150,
890 200, 151, 202, 152, 185, 153, -1, 5, -1, 5,
894 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
895 static const unsigned short int yyrline
[] =
897 0, 304, 304, 313, 314, 315, 316, 320, 325, 326,
898 327, 330, 331, 332, 333, 334, 338, 339, 340, 341,
899 344, 345, 346, 349, 350, 353, 354, 355, 360, 361,
900 362, 367, 368, 375, 377, 383, 387, 391, 393, 400,
901 404, 405, 408, 411, 412, 413, 417, 422, 428, 429,
902 430, 433, 434, 435, 438, 439, 443, 449, 450, 451,
903 454, 455, 458, 459, 460, 461, 462, 463, 464, 465,
904 466, 467, 468, 469, 470, 471, 472, 473, 474, 475,
905 476, 477, 478, 479, 480, 481, 482, 483, 484, 485,
906 486, 487, 488, 489, 490, 491, 492, 493, 494, 495,
907 496, 497, 498, 499, 500, 501, 502, 503, 504, 505,
908 506, 507, 508, 509, 510, 511, 512, 515, 516, 517,
909 518, 519, 520, 521, 522, 523, 524, 525, 526, 527,
910 528, 529, 530, 531, 535, 536, 541, 542, 543, 544,
911 547, 548, 551, 555, 561, 567, 568, 569, 572, 576,
912 585, 589, 594, 603, 604, 617, 618, 621, 622, 623,
913 624, 625, 626, 627, 628, 629, 630, 631, 632, 633,
914 634, 635, 636, 637, 638, 639, 640, 641, 642, 645,
915 646, 649, 655, 660, 661, 664, 665, 666, 667, 670,
916 678, 687, 688, 691, 692, 693, 696, 698, 701, 702,
917 703, 704, 705, 721, 722, 723, 724, 725, 726, 727,
918 730, 731, 734, 735, 736, 737, 738, 739, 740, 743,
919 744, 750, 759, 766, 767, 771, 774, 775, 778, 791,
920 792, 795, 796, 799, 808, 817, 818, 821, 822, 825,
921 837, 850, 862, 866, 867, 870, 871, 874, 879, 886,
922 887, 888, 892, 895, 902, 903, 904, 911, 912, 916,
923 917, 918, 921, 932, 933, 934, 935, 936, 937, 938,
924 939, 940, 941, 942, 945, 950, 955, 972, 973
928 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
929 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
930 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
931 static const char *const yytname
[] =
933 "$end", "error", "$undefined", "aIDENTIFIER", "aKNOWNTYPE", "aNUM",
934 "aHEXNUM", "aDOUBLE", "aSTRING", "aUUID", "aEOF", "SHL", "SHR",
935 "tAGGREGATABLE", "tALLOCATE", "tAPPOBJECT", "tASYNC", "tASYNCUUID",
936 "tAUTOHANDLE", "tBINDABLE", "tBOOLEAN", "tBROADCAST", "tBYTE",
937 "tBYTECOUNT", "tCALLAS", "tCALLBACK", "tCASE", "tCDECL", "tCHAR",
938 "tCOCLASS", "tCODE", "tCOMMSTATUS", "tCONST", "tCONTEXTHANDLE",
939 "tCONTEXTHANDLENOSERIALIZE", "tCONTEXTHANDLESERIALIZE", "tCONTROL",
940 "tCPPQUOTE", "tDEFAULT", "tDEFAULTCOLLELEM", "tDEFAULTVALUE",
941 "tDEFAULTVTABLE", "tDISPLAYBIND", "tDISPINTERFACE", "tDLLNAME",
942 "tDOUBLE", "tDUAL", "tENDPOINT", "tENTRY", "tENUM", "tERRORSTATUST",
943 "tEXPLICITHANDLE", "tEXTERN", "tFALSE", "tFASTCALL", "tFLOAT", "tHANDLE",
944 "tHANDLET", "tHELPCONTEXT", "tHELPFILE", "tHELPSTRING",
945 "tHELPSTRINGCONTEXT", "tHELPSTRINGDLL", "tHIDDEN", "tHYPER", "tID",
946 "tIDEMPOTENT", "tIIDIS", "tIMMEDIATEBIND", "tIMPLICITHANDLE", "tIMPORT",
947 "tIMPORTLIB", "tIN", "tINLINE", "tINPUTSYNC", "tINT", "tINT64",
948 "tINTERFACE", "tLCID", "tLENGTHIS", "tLIBRARY", "tLOCAL", "tLONG",
949 "tMETHODS", "tMODULE", "tNONBROWSABLE", "tNONCREATABLE",
950 "tNONEXTENSIBLE", "tOBJECT", "tODL", "tOLEAUTOMATION", "tOPTIONAL",
951 "tOUT", "tPASCAL", "tPOINTERDEFAULT", "tPROPERTIES", "tPROPGET",
952 "tPROPPUT", "tPROPPUTREF", "tPTR", "tPUBLIC", "tRANGE", "tREADONLY",
953 "tREF", "tREQUESTEDIT", "tRESTRICTED", "tRETVAL", "tSAFEARRAY", "tSHORT",
954 "tSIGNED", "tSINGLE", "tSIZEIS", "tSIZEOF", "tSMALL", "tSOURCE",
955 "tSTDCALL", "tSTRICTCONTEXTHANDLE", "tSTRING", "tSTRUCT", "tSWITCH",
956 "tSWITCHIS", "tSWITCHTYPE", "tTRANSMITAS", "tTRUE", "tTYPEDEF", "tUNION",
957 "tUNIQUE", "tUNSIGNED", "tUUID", "tV1ENUM", "tVARARG", "tVERSION",
958 "tVOID", "tWCHAR", "tWIREMARSHAL", "','", "'?'", "':'", "'|'", "'&'",
959 "'-'", "'+'", "'*'", "'/'", "'~'", "CAST", "PPTR", "NEG", "ADDRESSOF",
960 "';'", "'('", "')'", "'{'", "'}'", "'['", "']'", "'='", "'.'", "$accept",
961 "input", "gbl_statements", "imp_statements", "int_statements",
962 "semicolon_opt", "statement", "cppquote", "import_start", "import",
963 "importlib", "libraryhdr", "library_start", "librarydef", "m_args",
964 "no_args", "args", "arg", "array", "array_list", "m_attributes",
965 "attributes", "attrib_list", "str_list", "attribute", "uuid_string",
966 "callconv", "cases", "case", "constdef", "enums", "enum_list", "enum",
967 "enumdef", "m_exprs", "m_expr", "expr", "expr_list_const", "expr_const",
968 "externdef", "fields", "field", "s_field", "funcdef", "m_ident",
969 "t_ident", "ident", "base_type", "m_int", "int_std", "coclass",
970 "coclasshdr", "coclassdef", "coclass_ints", "coclass_int",
971 "dispinterface", "dispinterfacehdr", "dispint_props", "dispint_meths",
972 "dispinterfacedef", "inherit", "interface", "interfacehdr",
973 "interfacedef", "interfacedec", "module", "modulehdr", "moduledef",
974 "pident", "func_ident", "direct_ident", "pident_list", "pointer_type",
975 "structdef", "type", "typedef", "uniondef", "version", 0
980 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
982 static const unsigned short int yytoknum
[] =
984 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
985 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
986 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
987 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
988 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
989 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
990 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
991 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
992 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
993 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
994 355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
995 365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
996 375, 376, 377, 378, 379, 380, 381, 382, 383, 384,
997 385, 386, 387, 388, 389, 44, 63, 58, 124, 38,
998 45, 43, 42, 47, 126, 390, 391, 392, 393, 59,
999 40, 41, 123, 125, 91, 93, 61, 46
1003 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
1004 static const unsigned char yyr1
[] =
1006 0, 158, 159, 160, 160, 160, 160, 160, 160, 160,
1007 160, 161, 161, 161, 161, 161, 161, 161, 161, 161,
1008 162, 162, 162, 163, 163, 164, 164, 164, 164, 164,
1009 164, 164, 164, 165, 166, 167, 168, 169, 170, 171,
1010 172, 172, 173, 174, 174, 174, 175, 175, 176, 176,
1011 176, 177, 177, 177, 178, 178, 179, 180, 180, 180,
1012 181, 181, 182, 182, 182, 182, 182, 182, 182, 182,
1013 182, 182, 182, 182, 182, 182, 182, 182, 182, 182,
1014 182, 182, 182, 182, 182, 182, 182, 182, 182, 182,
1015 182, 182, 182, 182, 182, 182, 182, 182, 182, 182,
1016 182, 182, 182, 182, 182, 182, 182, 182, 182, 182,
1017 182, 182, 182, 182, 182, 182, 182, 182, 182, 182,
1018 182, 182, 182, 182, 182, 182, 182, 182, 182, 182,
1019 182, 182, 182, 182, 183, 183, 184, 184, 184, 184,
1020 185, 185, 186, 186, 187, 188, 188, 188, 189, 189,
1021 190, 190, 191, 192, 192, 193, 193, 194, 194, 194,
1022 194, 194, 194, 194, 194, 194, 194, 194, 194, 194,
1023 194, 194, 194, 194, 194, 194, 194, 194, 194, 195,
1024 195, 196, 197, 198, 198, 199, 199, 199, 199, 200,
1025 201, 202, 202, 203, 203, 203, 204, 204, 205, 205,
1026 205, 205, 205, 205, 205, 205, 205, 205, 205, 205,
1027 206, 206, 207, 207, 207, 207, 207, 207, 207, 208,
1028 208, 209, 210, 211, 211, 212, 213, 213, 214, 215,
1029 215, 216, 216, 217, 217, 218, 218, 219, 219, 220,
1030 221, 221, 221, 222, 222, 223, 223, 224, 225, 226,
1031 226, 226, 226, 227, 228, 228, 228, 229, 229, 230,
1032 230, 230, 231, 232, 232, 232, 232, 232, 232, 232,
1033 232, 232, 232, 232, 233, 234, 234, 235, 235
1036 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
1037 static const unsigned char yyr2
[] =
1039 0, 2, 1, 0, 2, 2, 3, 2, 2, 2,
1040 2, 0, 2, 2, 3, 2, 2, 2, 2, 2,
1041 0, 3, 2, 0, 1, 2, 1, 2, 2, 1,
1042 2, 2, 2, 4, 3, 3, 5, 2, 3, 4,
1043 0, 1, 1, 1, 3, 1, 4, 3, 0, 3,
1044 3, 1, 3, 4, 0, 1, 3, 1, 3, 4,
1045 1, 3, 0, 1, 1, 1, 1, 1, 1, 4,
1046 4, 1, 1, 1, 1, 1, 1, 4, 4, 1,
1047 1, 4, 1, 4, 4, 4, 1, 1, 4, 4,
1048 4, 4, 4, 1, 4, 1, 4, 1, 5, 1,
1049 1, 4, 1, 1, 1, 1, 1, 1, 1, 1,
1050 1, 4, 1, 1, 1, 1, 6, 1, 1, 1,
1051 1, 4, 1, 1, 1, 4, 4, 4, 4, 1,
1052 1, 4, 4, 1, 1, 1, 1, 1, 1, 1,
1053 0, 2, 4, 3, 5, 0, 2, 1, 1, 3,
1054 3, 1, 5, 1, 3, 0, 1, 1, 1, 1,
1055 1, 1, 1, 5, 3, 3, 3, 3, 3, 3,
1056 3, 3, 2, 2, 2, 2, 4, 4, 3, 1,
1057 3, 1, 4, 0, 2, 2, 3, 2, 1, 4,
1058 3, 0, 1, 0, 1, 1, 1, 1, 1, 1,
1059 1, 2, 2, 1, 1, 1, 1, 1, 1, 1,
1060 0, 1, 1, 2, 1, 2, 2, 1, 1, 2,
1061 2, 2, 5, 0, 2, 2, 2, 2, 2, 2,
1062 3, 2, 3, 5, 5, 0, 2, 2, 2, 2,
1063 6, 8, 2, 2, 2, 2, 2, 2, 5, 2,
1064 2, 2, 1, 4, 1, 3, 1, 1, 3, 1,
1065 1, 1, 5, 1, 1, 1, 2, 1, 2, 1,
1066 2, 1, 2, 4, 4, 5, 10, 1, 3
1069 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
1070 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
1071 means the default is an error. */
1072 static const unsigned short int yydefact
[] =
1074 3, 0, 2, 1, 0, 0, 0, 0, 193, 0,
1075 0, 0, 193, 54, 193, 62, 10, 26, 11, 29,
1076 11, 9, 0, 0, 0, 0, 0, 0, 7, 0,
1077 0, 23, 0, 235, 5, 4, 0, 8, 0, 0,
1078 0, 219, 220, 264, 207, 198, 218, 0, 206, 193,
1079 208, 204, 209, 210, 212, 217, 210, 0, 210, 0,
1080 205, 214, 193, 193, 203, 263, 199, 267, 265, 200,
1081 269, 0, 271, 0, 226, 227, 194, 195, 0, 0,
1082 0, 237, 238, 0, 0, 55, 0, 63, 64, 65,
1083 66, 67, 68, 0, 0, 71, 72, 73, 74, 75,
1084 76, 0, 79, 80, 0, 82, 0, 0, 86, 87,
1085 0, 0, 0, 0, 0, 93, 0, 95, 0, 97,
1086 0, 99, 100, 0, 102, 103, 104, 105, 106, 107,
1087 108, 109, 110, 0, 112, 113, 114, 261, 115, 0,
1088 117, 259, 118, 119, 120, 0, 122, 123, 124, 0,
1089 0, 0, 260, 0, 129, 130, 0, 0, 0, 57,
1090 133, 0, 0, 0, 0, 0, 221, 228, 239, 247,
1091 25, 27, 28, 6, 223, 244, 0, 24, 242, 243,
1092 0, 0, 20, 30, 31, 32, 266, 268, 211, 216,
1093 215, 0, 213, 201, 270, 272, 202, 196, 197, 0,
1094 0, 145, 0, 34, 183, 0, 0, 183, 0, 0,
1095 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1096 0, 0, 155, 0, 0, 155, 0, 0, 0, 0,
1097 0, 0, 62, 56, 35, 0, 17, 18, 19, 0,
1098 15, 13, 12, 16, 23, 37, 245, 246, 38, 54,
1099 0, 54, 0, 0, 236, 20, 54, 0, 0, 33,
1100 0, 147, 148, 151, 182, 54, 136, 0, 137, 138,
1101 139, 0, 0, 0, 254, 257, 256, 252, 274, 54,
1102 54, 0, 162, 157, 158, 159, 160, 0, 161, 0,
1103 0, 0, 0, 0, 181, 0, 179, 0, 0, 0,
1104 60, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1105 0, 0, 0, 153, 156, 0, 0, 0, 0, 0,
1106 0, 135, 134, 0, 277, 0, 0, 58, 62, 0,
1107 14, 39, 23, 0, 224, 229, 0, 0, 0, 54,
1108 0, 0, 54, 23, 22, 0, 0, 273, 144, 152,
1109 146, 0, 188, 262, 0, 55, 184, 0, 250, 249,
1110 0, 251, 40, 0, 0, 275, 69, 0, 174, 173,
1111 175, 172, 0, 0, 0, 0, 0, 0, 0, 0,
1112 0, 0, 0, 0, 70, 78, 77, 81, 0, 83,
1113 84, 85, 88, 89, 90, 91, 92, 94, 96, 0,
1114 155, 101, 111, 0, 121, 125, 126, 127, 128, 0,
1115 131, 132, 59, 0, 222, 225, 231, 0, 230, 233,
1116 0, 234, 20, 23, 248, 0, 21, 149, 150, 271,
1117 187, 185, 255, 263, 0, 45, 41, 43, 0, 0,
1118 258, 191, 0, 178, 0, 170, 171, 0, 164, 165,
1119 167, 166, 168, 169, 180, 61, 98, 154, 0, 278,
1120 23, 48, 232, 54, 240, 190, 186, 253, 0, 0,
1121 48, 0, 192, 177, 176, 0, 116, 36, 155, 189,
1122 23, 44, 48, 47, 140, 163, 0, 0, 51, 241,
1123 46, 0, 50, 0, 49, 0, 0, 276, 141, 52,
1124 0, 0, 54, 53, 54, 143, 142
1127 /* YYDEFGOTO[NTERM-NUM]. */
1128 static const short int yydefgoto
[] =
1130 -1, 1, 2, 161, 256, 178, 344, 17, 18, 19,
1131 237, 165, 20, 238, 434, 435, 436, 437, 479, 487,
1132 345, 85, 158, 301, 159, 323, 273, 491, 498, 23,
1133 260, 261, 262, 67, 312, 313, 294, 295, 296, 25,
1134 265, 356, 357, 346, 471, 78, 274, 68, 189, 69,
1135 239, 27, 240, 249, 334, 29, 30, 251, 339, 31,
1136 181, 32, 33, 241, 242, 169, 36, 243, 275, 276,
1137 277, 278, 160, 70, 417, 39, 72, 325
1140 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1142 #define YYPACT_NINF -455
1143 static const short int yypact
[] =
1145 -455, 47, 733, -455, 135, 699, -87, 145, 151, 35,
1146 101, 153, 151, -53, 151, 908, -455, -455, -455, -455,
1147 -455, -455, 16, -42, -31, -27, -16, -25, -455, 9,
1148 12, 20, 41, 13, -455, -455, 43, -455, 50, 53,
1149 57, -455, -455, -455, -455, -455, -455, 699, -455, 190,
1150 -455, -455, -455, 71, -455, -455, 71, 2, 71, 15,
1151 -455, -455, 194, 201, 15, -455, -455, -455, -455, -455,
1152 -455, 226, -455, 203, -455, -455, -455, -455, 61, 699,
1153 60, -455, -455, 63, 699, -455, -110, -455, -455, -455,
1154 -455, -455, -455, 11, 70, -455, -455, -455, -455, -455,
1155 -455, 72, -455, -455, 76, -455, 88, 92, -455, -455,
1156 102, 106, 108, 109, 125, -455, 126, -455, 127, -455,
1157 130, -455, -455, 131, -455, -455, -455, -455, -455, -455,
1158 -455, -455, -455, 134, -455, -455, -455, -455, -455, 136,
1159 -455, -455, -455, -455, -455, 137, -455, -455, -455, 138,
1160 142, 143, -455, 144, -455, -455, 148, 149, -98, -455,
1161 -455, 362, 709, 258, 247, 114, -455, -455, -455, -455,
1162 -455, -455, -455, -455, -455, -455, -39, -455, -455, -455,
1163 251, 133, -455, -455, -455, -455, -455, 150, -455, -455,
1164 -455, 699, -455, -455, 150, -88, -455, -455, -455, 156,
1165 154, 226, 226, -455, -455, 99, 163, -455, 226, 68,
1166 303, 292, 293, 452, 68, 296, 306, 68, 307, 68,
1167 68, 259, 68, -48, 68, 68, 68, 699, 699, 31,
1168 312, 699, 908, 164, -455, 169, -455, -455, -455, 172,
1169 -455, -455, -455, -455, 20, -455, -455, -455, -455, 111,
1170 185, -55, 174, 175, -455, -455, 735, 177, 68, -455,
1171 173, 196, -455, 178, -455, -17, -455, 99, -455, -455,
1172 -455, 99, 99, 99, -455, -455, -455, 179, 198, -53,
1173 -9, 184, -455, -455, -455, -455, -455, 187, -455, 68,
1174 68, 68, 68, 491, 594, -86, -455, 189, 193, 202,
1175 -455, -83, 207, 210, 211, 212, 214, 215, 216, 217,
1176 531, 335, -82, -455, 594, 218, 206, -37, 545, 219,
1177 220, -455, -455, 222, 188, 224, 225, -455, 908, 339,
1178 -455, -455, 20, -7, -455, -455, 240, 699, 200, 116,
1179 199, 284, 746, 20, -455, 699, 229, -455, -455, -455,
1180 226, 68, -455, -455, 699, 230, -455, 231, -455, -455,
1181 235, -455, 275, 99, 236, -455, -455, 699, -455, -455,
1182 -455, -455, 559, 238, 68, 68, 68, 68, 68, 68,
1183 68, 68, 68, 68, -455, -455, -455, -455, 373, -455,
1184 -455, -455, -455, -455, -455, -455, -455, -455, -455, 239,
1185 68, -455, -455, 68, -455, -455, -455, -455, -455, 387,
1186 -455, -455, -455, 244, -455, -455, -455, 99, -455, -455,
1187 248, -455, -455, 20, -455, 99, -455, -455, -455, 249,
1188 -455, -455, -455, -22, 245, -455, 266, -455, 699, 99,
1189 -455, 226, 253, -455, 68, -455, -455, 440, 105, 93,
1190 0, 0, 261, 261, -455, -455, -455, -455, 255, -455,
1191 20, 256, -455, 786, -455, -455, -455, -455, 399, 99,
1192 256, 257, -455, -455, -455, 68, -455, -455, 515, -455,
1193 20, -455, 256, -455, -455, 594, 77, -94, -455, -455,
1194 -455, -6, -455, 68, 262, 68, 276, -455, -455, 594,
1195 68, 575, -77, 594, -77, -455, -455
1198 /* YYPGOTO[NTERM-NUM]. */
1199 static const short int yypgoto
[] =
1201 -455, -455, -455, 392, -240, -237, 23, -455, -455, 79,
1202 -455, -455, -455, 415, -455, -455, -455, -50, -358, -455,
1203 -12, -2, -455, -455, -209, -455, -455, -455, -455, -455,
1204 -455, -455, 73, 4, 197, -370, -204, -455, -200, -455,
1205 221, -454, -225, 85, -455, 48, -67, -455, 36, 56,
1206 44, -455, 423, -455, -455, 408, -455, -455, -455, -455,
1207 -455, 5, -455, 432, 3, -455, -455, 434, -238, -455,
1208 -455, -455, 223, 6, -3, -455, 1, -455
1211 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
1212 positive, shift that token. If negative, reduce the rule which
1213 number is the opposite. If zero, do what YYDEFACT says.
1214 If YYTABLE_NINF, syntax error. */
1215 #define YYTABLE_NINF -195
1216 static const short int yytable
[] =
1218 22, 84, 71, 40, 199, 35, 24, 331, 38, 206,
1219 298, 374, 375, 303, 304, 342, 310, 307, 314, 309,
1220 495, 314, 318, 327, 316, 16, 338, 168, 336, 358,
1221 457, -194, 496, 359, 360, 361, 7, 232, 11, 321,
1222 322, 493, 207, 46, 186, 4, 26, 3, 505, 383,
1223 506, 137, 388, 400, 364, 141, 250, 233, 348, 7,
1224 83, 494, 86, 73, -194, 384, 166, 79, 389, 401,
1225 11, 282, 352, 283, 284, 285, 202, 15, 152, 53,
1226 282, 205, 283, 284, 285, 368, 369, 370, 371, 372,
1227 54, 55, 190, 11, 192, 414, 163, 56, 400, 15,
1228 164, 15, 197, 198, 374, 375, 424, 170, 488, 80,
1229 83, 86, 483, -42, 404, 193, 374, 375, 171, 412,
1230 196, 286, 172, 58, 490, 440, 266, 174, 61, -42,
1231 286, 267, 352, 173, 263, 264, 353, 15, 41, 42,
1232 352, 281, 381, 382, 365, 15, 188, 497, 74, 75,
1233 180, 428, 191, 268, 76, 77, 81, 82, 175, 22,
1234 22, 208, 40, 40, 176, 24, 24, 38, 38, 177,
1235 445, 446, 447, 448, 449, 450, 451, 452, 453, 461,
1236 287, 252, 463, 454, 236, 236, 464, 465, 257, 287,
1237 179, 288, 269, 187, 77, 182, 314, 194, 77, 183,
1238 288, 470, 184, 458, 195, 77, 185, 289, 290, 203,
1239 291, 200, 292, 201, 270, 204, 289, 290, 293, 291,
1240 209, 292, 210, 477, 319, 320, 211, 293, 326, 197,
1241 198, 482, 492, 379, 380, 381, 382, 333, 212, 337,
1242 474, 271, 213, 489, 378, 379, 380, 381, 382, 272,
1243 246, 247, 214, 354, 253, 254, 215, 40, 216, 217,
1244 24, 245, 38, 355, 332, 15, 248, 337, 354, 419,
1245 15, 485, 374, 375, 314, 218, 219, 220, 355, 43,
1246 221, 222, 370, 263, 223, 255, 224, 225, 226, 499,
1247 373, 501, 227, 228, 229, 44, 503, 45, 230, 231,
1248 299, 300, -194, 46, 305, 259, 282, 47, 283, 284,
1249 285, 297, 258, 279, 306, 308, 311, 324, 328, 329,
1250 48, 330, 335, 340, 49, 50, 349, 341, 347, 362,
1251 51, 350, 52, 363, 351, 366, 415, 367, 399, 53,
1252 385, 403, 425, 40, 386, 409, 24, 413, 38, 418,
1253 54, 55, 421, 387, 10, 429, 286, 56, 390, 439,
1254 438, 391, 392, 393, 442, 394, 395, 396, 397, 402,
1255 406, 407, 234, 408, 472, 410, 411, 416, 426, 430,
1256 431, 455, 57, 58, 59, 60, 432, 441, 61, 444,
1257 456, 4, 459, 62, 5, 460, 467, 462, 466, 6,
1258 63, 468, 64, 43, 473, 7, 476, 433, 66, 484,
1259 478, 8, 162, 502, 9, 287, 500, 21, 481, 44,
1260 422, 45, 317, 427, 420, 28, 288, 46, 280, 15,
1261 167, 47, 10, 235, 34, 469, 37, 0, 0, 11,
1262 0, 0, 289, 290, 48, 291, 315, 292, 49, 50,
1263 0, 374, 375, 293, 51, 282, 52, 283, 284, 285,
1264 302, 0, 0, 53, 40, 439, 438, 24, 0, 38,
1265 0, 0, 0, 0, 54, 55, 0, 0, 0, 0,
1266 12, 56, 0, 0, 0, 0, 13, 14, 0, 0,
1267 354, 0, 354, 0, 282, 43, 283, 284, 285, 0,
1268 355, 0, 355, 0, 0, 286, 57, 58, 59, 60,
1269 0, 44, 61, 45, 0, 0, 15, 62, 282, 46,
1270 283, 284, 285, 47, 63, 0, 64, 0, 0, 0,
1271 0, 65, 66, 0, 0, 0, 48, 0, 0, 0,
1272 49, 50, 374, 375, 286, 0, 51, 0, 52, 0,
1273 0, 0, 0, 15, 0, 53, 374, 375, 0, 0,
1274 0, 0, 0, 0, 287, 0, 54, 55, 286, 0,
1275 374, 375, 0, 56, 0, 288, 376, 475, 377, 378,
1276 379, 380, 381, 382, 0, 0, 374, 375, 0, 0,
1277 0, 289, 290, 0, 291, 0, 292, 0, 57, 58,
1278 59, 60, 293, 287, 61, 374, 375, 0, 0, 62,
1279 0, 0, 0, 0, 288, 0, 63, 0, 64, 0,
1280 0, 0, 0, 65, 66, 0, 0, 287, 0, 0,
1281 289, 290, 0, 291, 0, 292, 0, 0, 288, 0,
1282 0, 293, 0, 0, 0, 0, 0, 0, 0, 0,
1283 0, 0, 0, 0, 289, 290, 0, 486, 0, 292,
1284 0, 0, 0, 0, 0, 293, 0, 376, 0, 377,
1285 378, 379, 380, 381, 382, 0, 0, 0, 0, 0,
1286 0, 376, 398, 377, 378, 379, 380, 381, 382, 0,
1287 0, 0, 0, 0, 0, 376, 405, 377, 378, 379,
1288 380, 381, 382, 43, 0, 0, 0, 0, 0, 0,
1289 443, 376, 504, 377, 378, 379, 380, 381, 382, 44,
1290 0, 45, 0, 0, 0, 0, 0, 46, 0, 0,
1291 376, 47, 377, 378, 379, 380, 381, 382, 4, 0,
1292 0, 5, 0, 0, 48, 0, 6, 0, 49, 50,
1293 0, 0, 7, 0, 51, 0, 52, 0, 8, 0,
1294 0, 9, 4, 53, 0, 5, 0, 5, 0, 0,
1295 6, 0, 6, 0, 54, 55, 7, 0, 5, 10,
1296 235, 56, 8, 6, 8, 9, 11, 9, 0, 0,
1297 0, 0, 0, 0, 0, 8, 0, 0, 9, 0,
1298 0, 0, 0, 10, 0, 10, 57, 58, 59, 60,
1299 11, 0, 61, 0, 0, 0, 10, 62, 5, 0,
1300 0, 0, 0, 6, 63, 0, 64, 12, 0, 0,
1301 0, 65, 66, 13, 14, 8, 0, 0, 9, 0,
1302 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1303 0, 12, 0, 12, 0, 0, 10, 13, 14, 13,
1304 14, 0, 244, 15, 12, 0, 0, 0, 0, 0,
1305 13, 14, 0, 0, 0, 0, 0, 0, 0, 0,
1306 0, 0, 0, 0, 0, 0, 0, 15, 343, 15,
1307 0, 0, 0, 0, 0, 0, 0, 0, 0, 423,
1308 15, 0, 0, 0, 12, 0, 0, 0, 0, 0,
1309 13, 14, 0, 0, 0, 0, 0, 0, 0, 0,
1310 0, 87, 0, 88, 89, 0, 90, 91, 0, 92,
1311 0, 0, 93, 0, 94, 0, 0, 0, 0, 480,
1312 15, 95, 96, 97, 98, 0, 99, 100, 101, 102,
1313 103, 0, 104, 0, 105, 106, 107, 0, 0, 108,
1314 0, 0, 0, 0, 109, 0, 110, 111, 112, 113,
1315 114, 115, 0, 116, 117, 118, 119, 120, 0, 0,
1316 121, 0, 122, 0, 0, 0, 0, 123, 0, 124,
1317 0, 0, 0, 125, 126, 127, 128, 129, 130, 131,
1318 132, 0, 133, 0, 134, 135, 136, 137, 138, 139,
1319 140, 141, 142, 143, 144, 0, 0, 0, 0, 145,
1320 0, 0, 146, 0, 147, 148, 0, 0, 149, 150,
1321 151, 0, 0, 0, 152, 0, 153, 154, 155, 156,
1325 static const short int yycheck
[] =
1327 2, 13, 5, 2, 71, 2, 2, 244, 2, 119,
1328 210, 11, 12, 213, 214, 255, 220, 217, 222, 219,
1329 26, 225, 226, 232, 224, 2, 251, 22, 83, 267,
1330 400, 119, 38, 271, 272, 273, 43, 135, 77, 8,
1331 9, 135, 152, 28, 47, 29, 2, 0, 502, 135,
1332 504, 99, 135, 135, 279, 103, 95, 155, 258, 43,
1333 12, 155, 14, 150, 152, 151, 22, 32, 151, 151,
1334 77, 3, 149, 5, 6, 7, 79, 154, 126, 64,
1335 3, 84, 5, 6, 7, 289, 290, 291, 292, 293,
1336 75, 76, 56, 77, 58, 332, 80, 82, 135, 154,
1337 84, 154, 3, 4, 11, 12, 343, 149, 478, 8,
1338 62, 63, 470, 135, 151, 59, 11, 12, 149, 328,
1339 64, 53, 149, 108, 482, 363, 27, 152, 113, 151,
1340 53, 32, 149, 149, 201, 202, 153, 154, 3, 4,
1341 149, 208, 142, 143, 153, 154, 75, 153, 3, 4,
1342 137, 351, 150, 54, 3, 4, 3, 4, 149, 161,
1343 162, 150, 161, 162, 152, 161, 162, 161, 162, 149,
1344 374, 375, 376, 377, 378, 379, 380, 381, 382, 417,
1345 112, 176, 422, 383, 161, 162, 423, 425, 191, 112,
1346 149, 123, 93, 3, 4, 152, 400, 3, 4, 149,
1347 123, 439, 149, 403, 3, 4, 149, 139, 140, 149,
1348 142, 8, 144, 152, 115, 152, 139, 140, 150, 142,
1349 150, 144, 150, 460, 227, 228, 150, 150, 231, 3,
1350 4, 469, 155, 140, 141, 142, 143, 249, 150, 251,
1351 444, 142, 150, 480, 139, 140, 141, 142, 143, 150,
1352 3, 4, 150, 265, 3, 4, 150, 256, 150, 150,
1353 256, 3, 256, 265, 153, 154, 152, 279, 280, 153,
1354 154, 475, 11, 12, 478, 150, 150, 150, 280, 4,
1355 150, 150, 486, 350, 150, 152, 150, 150, 150, 493,
1356 293, 495, 150, 150, 150, 20, 500, 22, 150, 150,
1357 8, 8, 152, 28, 8, 151, 3, 32, 5, 6,
1358 7, 8, 156, 150, 8, 8, 57, 5, 154, 150,
1359 45, 149, 137, 149, 49, 50, 153, 152, 151, 150,
1360 55, 135, 57, 135, 156, 151, 333, 150, 3, 64,
1361 151, 135, 345, 342, 151, 157, 342, 8, 342, 149,
1362 75, 76, 153, 151, 70, 354, 53, 82, 151, 362,
1363 362, 151, 151, 151, 367, 151, 151, 151, 151, 151,
1364 151, 151, 10, 151, 441, 151, 151, 137, 149, 149,
1365 149, 8, 107, 108, 109, 110, 151, 151, 113, 151,
1366 151, 29, 5, 118, 32, 151, 151, 149, 149, 37,
1367 125, 135, 127, 4, 151, 43, 151, 132, 133, 152,
1368 154, 49, 20, 137, 52, 112, 154, 2, 468, 20,
1369 341, 22, 225, 350, 339, 2, 123, 28, 207, 154,
1370 22, 32, 70, 71, 2, 438, 2, -1, -1, 77,
1371 -1, -1, 139, 140, 45, 142, 223, 144, 49, 50,
1372 -1, 11, 12, 150, 55, 3, 57, 5, 6, 7,
1373 8, -1, -1, 64, 463, 468, 468, 463, -1, 463,
1374 -1, -1, -1, -1, 75, 76, -1, -1, -1, -1,
1375 118, 82, -1, -1, -1, -1, 124, 125, -1, -1,
1376 502, -1, 504, -1, 3, 4, 5, 6, 7, -1,
1377 502, -1, 504, -1, -1, 53, 107, 108, 109, 110,
1378 -1, 20, 113, 22, -1, -1, 154, 118, 3, 28,
1379 5, 6, 7, 32, 125, -1, 127, -1, -1, -1,
1380 -1, 132, 133, -1, -1, -1, 45, -1, -1, -1,
1381 49, 50, 11, 12, 53, -1, 55, -1, 57, -1,
1382 -1, -1, -1, 154, -1, 64, 11, 12, -1, -1,
1383 -1, -1, -1, -1, 112, -1, 75, 76, 53, -1,
1384 11, 12, -1, 82, -1, 123, 136, 137, 138, 139,
1385 140, 141, 142, 143, -1, -1, 11, 12, -1, -1,
1386 -1, 139, 140, -1, 142, -1, 144, -1, 107, 108,
1387 109, 110, 150, 112, 113, 11, 12, -1, -1, 118,
1388 -1, -1, -1, -1, 123, -1, 125, -1, 127, -1,
1389 -1, -1, -1, 132, 133, -1, -1, 112, -1, -1,
1390 139, 140, -1, 142, -1, 144, -1, -1, 123, -1,
1391 -1, 150, -1, -1, -1, -1, -1, -1, -1, -1,
1392 -1, -1, -1, -1, 139, 140, -1, 142, -1, 144,
1393 -1, -1, -1, -1, -1, 150, -1, 136, -1, 138,
1394 139, 140, 141, 142, 143, -1, -1, -1, -1, -1,
1395 -1, 136, 151, 138, 139, 140, 141, 142, 143, -1,
1396 -1, -1, -1, -1, -1, 136, 151, 138, 139, 140,
1397 141, 142, 143, 4, -1, -1, -1, -1, -1, -1,
1398 151, 136, 137, 138, 139, 140, 141, 142, 143, 20,
1399 -1, 22, -1, -1, -1, -1, -1, 28, -1, -1,
1400 136, 32, 138, 139, 140, 141, 142, 143, 29, -1,
1401 -1, 32, -1, -1, 45, -1, 37, -1, 49, 50,
1402 -1, -1, 43, -1, 55, -1, 57, -1, 49, -1,
1403 -1, 52, 29, 64, -1, 32, -1, 32, -1, -1,
1404 37, -1, 37, -1, 75, 76, 43, -1, 32, 70,
1405 71, 82, 49, 37, 49, 52, 77, 52, -1, -1,
1406 -1, -1, -1, -1, -1, 49, -1, -1, 52, -1,
1407 -1, -1, -1, 70, -1, 70, 107, 108, 109, 110,
1408 77, -1, 113, -1, -1, -1, 70, 118, 32, -1,
1409 -1, -1, -1, 37, 125, -1, 127, 118, -1, -1,
1410 -1, 132, 133, 124, 125, 49, -1, -1, 52, -1,
1411 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1412 -1, 118, -1, 118, -1, -1, 70, 124, 125, 124,
1413 125, -1, 153, 154, 118, -1, -1, -1, -1, -1,
1414 124, 125, -1, -1, -1, -1, -1, -1, -1, -1,
1415 -1, -1, -1, -1, -1, -1, -1, 154, 153, 154,
1416 -1, -1, -1, -1, -1, -1, -1, -1, -1, 153,
1417 154, -1, -1, -1, 118, -1, -1, -1, -1, -1,
1418 124, 125, -1, -1, -1, -1, -1, -1, -1, -1,
1419 -1, 13, -1, 15, 16, -1, 18, 19, -1, 21,
1420 -1, -1, 24, -1, 26, -1, -1, -1, -1, 153,
1421 154, 33, 34, 35, 36, -1, 38, 39, 40, 41,
1422 42, -1, 44, -1, 46, 47, 48, -1, -1, 51,
1423 -1, -1, -1, -1, 56, -1, 58, 59, 60, 61,
1424 62, 63, -1, 65, 66, 67, 68, 69, -1, -1,
1425 72, -1, 74, -1, -1, -1, -1, 79, -1, 81,
1426 -1, -1, -1, 85, 86, 87, 88, 89, 90, 91,
1427 92, -1, 94, -1, 96, 97, 98, 99, 100, 101,
1428 102, 103, 104, 105, 106, -1, -1, -1, -1, 111,
1429 -1, -1, 114, -1, 116, 117, -1, -1, 120, 121,
1430 122, -1, -1, -1, 126, -1, 128, 129, 130, 131,
1434 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1435 symbol of state STATE-NUM. */
1436 static const unsigned char yystos
[] =
1438 0, 159, 160, 0, 29, 32, 37, 43, 49, 52,
1439 70, 77, 118, 124, 125, 154, 164, 165, 166, 167,
1440 170, 171, 179, 187, 191, 197, 208, 209, 210, 213,
1441 214, 217, 219, 220, 221, 222, 224, 225, 231, 233,
1442 234, 3, 4, 4, 20, 22, 28, 32, 45, 49,
1443 50, 55, 57, 64, 75, 76, 82, 107, 108, 109,
1444 110, 113, 118, 125, 127, 132, 133, 191, 205, 207,
1445 231, 232, 234, 150, 3, 4, 3, 4, 203, 32,
1446 8, 3, 4, 203, 178, 179, 203, 13, 15, 16,
1447 18, 19, 21, 24, 26, 33, 34, 35, 36, 38,
1448 39, 40, 41, 42, 44, 46, 47, 48, 51, 56,
1449 58, 59, 60, 61, 62, 63, 65, 66, 67, 68,
1450 69, 72, 74, 79, 81, 85, 86, 87, 88, 89,
1451 90, 91, 92, 94, 96, 97, 98, 99, 100, 101,
1452 102, 103, 104, 105, 106, 111, 114, 116, 117, 120,
1453 121, 122, 126, 128, 129, 130, 131, 134, 180, 182,
1454 230, 161, 161, 80, 84, 169, 208, 213, 219, 223,
1455 149, 149, 149, 149, 152, 149, 152, 149, 163, 149,
1456 137, 218, 152, 149, 149, 149, 232, 3, 75, 206,
1457 206, 150, 206, 207, 3, 3, 207, 3, 4, 204,
1458 8, 152, 232, 149, 152, 232, 119, 152, 150, 150,
1459 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
1460 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
1461 150, 150, 135, 155, 10, 71, 164, 168, 171, 208,
1462 210, 221, 222, 225, 153, 3, 3, 4, 152, 211,
1463 95, 215, 219, 3, 4, 152, 162, 232, 156, 151,
1464 188, 189, 190, 204, 204, 198, 27, 32, 54, 93,
1465 115, 142, 150, 184, 204, 226, 227, 228, 229, 150,
1466 198, 204, 3, 5, 6, 7, 53, 112, 123, 139,
1467 140, 142, 144, 150, 194, 195, 196, 8, 196, 8,
1468 8, 181, 8, 196, 196, 8, 8, 196, 8, 196,
1469 194, 57, 192, 193, 194, 230, 196, 192, 194, 232,
1470 232, 8, 9, 183, 5, 235, 232, 182, 154, 150,
1471 149, 163, 153, 178, 212, 137, 83, 178, 200, 216,
1472 149, 152, 162, 153, 164, 178, 201, 151, 196, 153,
1473 135, 156, 149, 153, 178, 179, 199, 200, 226, 226,
1474 226, 226, 150, 135, 200, 153, 151, 150, 194, 194,
1475 194, 194, 194, 232, 11, 12, 136, 138, 139, 140,
1476 141, 142, 143, 135, 151, 151, 151, 151, 135, 151,
1477 151, 151, 151, 151, 151, 151, 151, 151, 151, 3,
1478 135, 151, 151, 135, 151, 151, 151, 151, 151, 157,
1479 151, 151, 182, 8, 163, 222, 137, 232, 149, 153,
1480 201, 153, 167, 153, 163, 232, 149, 190, 196, 234,
1481 149, 149, 151, 132, 172, 173, 174, 175, 179, 232,
1482 226, 151, 232, 151, 151, 194, 194, 194, 194, 194,
1483 194, 194, 194, 194, 196, 8, 151, 193, 196, 5,
1484 151, 226, 149, 162, 163, 226, 149, 151, 135, 232,
1485 226, 202, 204, 151, 194, 137, 151, 163, 154, 176,
1486 153, 175, 226, 176, 152, 194, 142, 177, 193, 163,
1487 176, 185, 155, 135, 155, 26, 38, 153, 186, 194,
1488 154, 194, 137, 194, 137, 199, 199
1491 #define yyerrok (yyerrstatus = 0)
1492 #define yyclearin (yychar = YYEMPTY)
1493 #define YYEMPTY (-2)
1496 #define YYACCEPT goto yyacceptlab
1497 #define YYABORT goto yyabortlab
1498 #define YYERROR goto yyerrorlab
1501 /* Like YYERROR except do call yyerror. This remains here temporarily
1502 to ease the transition to the new meaning of YYERROR, for GCC.
1503 Once GCC version 2 has supplanted version 1, this can go. */
1505 #define YYFAIL goto yyerrlab
1507 #define YYRECOVERING() (!!yyerrstatus)
1509 #define YYBACKUP(Token, Value) \
1511 if (yychar == YYEMPTY && yylen == 1) \
1515 yytoken = YYTRANSLATE (yychar); \
1521 yyerror (YY_("syntax error: cannot back up")); \
1528 #define YYERRCODE 256
1531 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1532 If N is 0, then set CURRENT to the empty location which ends
1533 the previous symbol: RHS[0] (always defined). */
1535 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
1536 #ifndef YYLLOC_DEFAULT
1537 # define YYLLOC_DEFAULT(Current, Rhs, N) \
1541 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1542 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1543 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1544 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1548 (Current).first_line = (Current).last_line = \
1549 YYRHSLOC (Rhs, 0).last_line; \
1550 (Current).first_column = (Current).last_column = \
1551 YYRHSLOC (Rhs, 0).last_column; \
1557 /* YY_LOCATION_PRINT -- Print the location on the stream.
1558 This macro was not mandated originally: define only if we know
1559 we won't break user code: when these are the locations we know. */
1561 #ifndef YY_LOCATION_PRINT
1562 # if YYLTYPE_IS_TRIVIAL
1563 # define YY_LOCATION_PRINT(File, Loc) \
1564 fprintf (File, "%d.%d-%d.%d", \
1565 (Loc).first_line, (Loc).first_column, \
1566 (Loc).last_line, (Loc).last_column)
1568 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1573 /* YYLEX -- calling `yylex' with the right arguments. */
1576 # define YYLEX yylex (YYLEX_PARAM)
1578 # define YYLEX yylex ()
1581 /* Enable debugging if requested. */
1585 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1586 # define YYFPRINTF fprintf
1589 # define YYDPRINTF(Args) \
1595 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1599 YYFPRINTF (stderr, "%s ", Title); \
1600 yysymprint (stderr, \
1602 YYFPRINTF (stderr, "\n"); \
1606 /*------------------------------------------------------------------.
1607 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1609 `------------------------------------------------------------------*/
1611 #if defined (__STDC__) || defined (__cplusplus)
1613 yy_stack_print (short int *bottom
, short int *top
)
1616 yy_stack_print (bottom
, top
)
1621 YYFPRINTF (stderr
, "Stack now");
1622 for (/* Nothing. */; bottom
<= top
; ++bottom
)
1623 YYFPRINTF (stderr
, " %d", *bottom
);
1624 YYFPRINTF (stderr
, "\n");
1627 # define YY_STACK_PRINT(Bottom, Top) \
1630 yy_stack_print ((Bottom), (Top)); \
1634 /*------------------------------------------------.
1635 | Report that the YYRULE is going to be reduced. |
1636 `------------------------------------------------*/
1638 #if defined (__STDC__) || defined (__cplusplus)
1640 yy_reduce_print (int yyrule
)
1643 yy_reduce_print (yyrule
)
1648 unsigned long int yylno
= yyrline
[yyrule
];
1649 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu), ",
1651 /* Print the symbols being reduced, and their result. */
1652 for (yyi
= yyprhs
[yyrule
]; 0 <= yyrhs
[yyi
]; yyi
++)
1653 YYFPRINTF (stderr
, "%s ", yytname
[yyrhs
[yyi
]]);
1654 YYFPRINTF (stderr
, "-> %s\n", yytname
[yyr1
[yyrule
]]);
1657 # define YY_REDUCE_PRINT(Rule) \
1660 yy_reduce_print (Rule); \
1663 /* Nonzero means print parse trace. It is left uninitialized so that
1664 multiple parsers can coexist. */
1666 #else /* !YYDEBUG */
1667 # define YYDPRINTF(Args)
1668 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1669 # define YY_STACK_PRINT(Bottom, Top)
1670 # define YY_REDUCE_PRINT(Rule)
1671 #endif /* !YYDEBUG */
1674 /* YYINITDEPTH -- initial size of the parser's stacks. */
1676 # define YYINITDEPTH 200
1679 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1680 if the built-in stack extension method is used).
1682 Do not make this value too large; the results are undefined if
1683 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1684 evaluated with infinite-precision integer arithmetic. */
1687 # define YYMAXDEPTH 10000
1695 # if defined (__GLIBC__) && defined (_STRING_H)
1696 # define yystrlen strlen
1698 /* Return the length of YYSTR. */
1700 # if defined (__STDC__) || defined (__cplusplus)
1701 yystrlen (const char *yystr
)
1707 const char *yys
= yystr
;
1709 while (*yys
++ != '\0')
1712 return yys
- yystr
- 1;
1718 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
1719 # define yystpcpy stpcpy
1721 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1724 # if defined (__STDC__) || defined (__cplusplus)
1725 yystpcpy (char *yydest
, const char *yysrc
)
1727 yystpcpy (yydest
, yysrc
)
1733 const char *yys
= yysrc
;
1735 while ((*yyd
++ = *yys
++) != '\0')
1744 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1745 quotes and backslashes, so that it's suitable for yyerror. The
1746 heuristic is that double-quoting is unnecessary unless the string
1747 contains an apostrophe, a comma, or backslash (other than
1748 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1749 null, do not copy; instead, return the length of what the result
1752 yytnamerr (char *yyres
, const char *yystr
)
1757 char const *yyp
= yystr
;
1764 goto do_not_strip_quotes
;
1768 goto do_not_strip_quotes
;
1781 do_not_strip_quotes
: ;
1785 return yystrlen (yystr
);
1787 return yystpcpy (yyres
, yystr
) - yyres
;
1791 #endif /* YYERROR_VERBOSE */
1796 /*--------------------------------.
1797 | Print this symbol on YYOUTPUT. |
1798 `--------------------------------*/
1800 #if defined (__STDC__) || defined (__cplusplus)
1802 yysymprint (FILE *yyoutput
, int yytype
, YYSTYPE
*yyvaluep
)
1805 yysymprint (yyoutput
, yytype
, yyvaluep
)
1811 /* Pacify ``unused variable'' warnings. */
1814 if (yytype
< YYNTOKENS
)
1815 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1817 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1821 if (yytype
< YYNTOKENS
)
1822 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1829 YYFPRINTF (yyoutput
, ")");
1832 #endif /* ! YYDEBUG */
1833 /*-----------------------------------------------.
1834 | Release the memory associated to this symbol. |
1835 `-----------------------------------------------*/
1837 #if defined (__STDC__) || defined (__cplusplus)
1839 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
)
1842 yydestruct (yymsg
, yytype
, yyvaluep
)
1848 /* Pacify ``unused variable'' warnings. */
1853 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1864 /* Prevent warnings from -Wmissing-prototypes. */
1866 #ifdef YYPARSE_PARAM
1867 # if defined (__STDC__) || defined (__cplusplus)
1868 int yyparse (void *YYPARSE_PARAM
);
1872 #else /* ! YYPARSE_PARAM */
1873 #if defined (__STDC__) || defined (__cplusplus)
1878 #endif /* ! YYPARSE_PARAM */
1882 /* The look-ahead symbol. */
1885 /* The semantic value of the look-ahead symbol. */
1888 /* Number of syntax errors so far. */
1897 #ifdef YYPARSE_PARAM
1898 # if defined (__STDC__) || defined (__cplusplus)
1899 int yyparse (void *YYPARSE_PARAM
)
1901 int yyparse (YYPARSE_PARAM
)
1902 void *YYPARSE_PARAM
;
1904 #else /* ! YYPARSE_PARAM */
1905 #if defined (__STDC__) || defined (__cplusplus)
1919 /* Number of tokens to shift before error messages enabled. */
1921 /* Look-ahead token as an internal (translated) token number. */
1924 /* Three stacks and their tools:
1925 `yyss': related to states,
1926 `yyvs': related to semantic values,
1927 `yyls': related to locations.
1929 Refer to the stacks thru separate pointers, to allow yyoverflow
1930 to reallocate them elsewhere. */
1932 /* The state stack. */
1933 short int yyssa
[YYINITDEPTH
];
1934 short int *yyss
= yyssa
;
1937 /* The semantic value stack. */
1938 YYSTYPE yyvsa
[YYINITDEPTH
];
1939 YYSTYPE
*yyvs
= yyvsa
;
1944 #define YYPOPSTACK (yyvsp--, yyssp--)
1946 YYSIZE_T yystacksize
= YYINITDEPTH
;
1948 /* The variables used to return semantic value and location from the
1953 /* When reducing, the number of symbols on the RHS of the reduced
1957 YYDPRINTF ((stderr
, "Starting parse\n"));
1962 yychar
= YYEMPTY
; /* Cause a token to be read. */
1964 /* Initialize stack pointers.
1965 Waste one element of value and location stack
1966 so that they stay on the same level as the state stack.
1967 The wasted elements are never initialized. */
1974 /*------------------------------------------------------------.
1975 | yynewstate -- Push a new state, which is found in yystate. |
1976 `------------------------------------------------------------*/
1978 /* In all cases, when you get here, the value and location stacks
1979 have just been pushed. so pushing a state here evens the stacks.
1986 if (yyss
+ yystacksize
- 1 <= yyssp
)
1988 /* Get the current used size of the three stacks, in elements. */
1989 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1993 /* Give user a chance to reallocate the stack. Use copies of
1994 these so that the &'s don't force the real ones into
1996 YYSTYPE
*yyvs1
= yyvs
;
1997 short int *yyss1
= yyss
;
2000 /* Each stack pointer address is followed by the size of the
2001 data in use in that stack, in bytes. This used to be a
2002 conditional around just the two extra args, but that might
2003 be undefined if yyoverflow is a macro. */
2004 yyoverflow (YY_("memory exhausted"),
2005 &yyss1
, yysize
* sizeof (*yyssp
),
2006 &yyvs1
, yysize
* sizeof (*yyvsp
),
2013 #else /* no yyoverflow */
2014 # ifndef YYSTACK_RELOCATE
2015 goto yyexhaustedlab
;
2017 /* Extend the stack our own way. */
2018 if (YYMAXDEPTH
<= yystacksize
)
2019 goto yyexhaustedlab
;
2021 if (YYMAXDEPTH
< yystacksize
)
2022 yystacksize
= YYMAXDEPTH
;
2025 short int *yyss1
= yyss
;
2026 union yyalloc
*yyptr
=
2027 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
2029 goto yyexhaustedlab
;
2030 YYSTACK_RELOCATE (yyss
);
2031 YYSTACK_RELOCATE (yyvs
);
2033 # undef YYSTACK_RELOCATE
2035 YYSTACK_FREE (yyss1
);
2038 #endif /* no yyoverflow */
2040 yyssp
= yyss
+ yysize
- 1;
2041 yyvsp
= yyvs
+ yysize
- 1;
2044 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
2045 (unsigned long int) yystacksize
));
2047 if (yyss
+ yystacksize
- 1 <= yyssp
)
2051 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
2060 /* Do appropriate processing given the current state. */
2061 /* Read a look-ahead token if we need one and don't already have one. */
2064 /* First try to decide what to do without reference to look-ahead token. */
2066 yyn
= yypact
[yystate
];
2067 if (yyn
== YYPACT_NINF
)
2070 /* Not known => get a look-ahead token if don't already have one. */
2072 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
2073 if (yychar
== YYEMPTY
)
2075 YYDPRINTF ((stderr
, "Reading a token: "));
2079 if (yychar
<= YYEOF
)
2081 yychar
= yytoken
= YYEOF
;
2082 YYDPRINTF ((stderr
, "Now at end of input.\n"));
2086 yytoken
= YYTRANSLATE (yychar
);
2087 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
2090 /* If the proper action on seeing token YYTOKEN is to reduce or to
2091 detect an error, take that action. */
2093 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
2098 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
2107 /* Shift the look-ahead token. */
2108 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
2110 /* Discard the token being shifted unless it is eof. */
2111 if (yychar
!= YYEOF
)
2117 /* Count tokens shifted since error; after three, turn off error
2126 /*-----------------------------------------------------------.
2127 | yydefault -- do the default action for the current state. |
2128 `-----------------------------------------------------------*/
2130 yyn
= yydefact
[yystate
];
2136 /*-----------------------------.
2137 | yyreduce -- Do a reduction. |
2138 `-----------------------------*/
2140 /* yyn is the number of a rule to reduce with. */
2143 /* If YYLEN is nonzero, implement the default value of the action:
2146 Otherwise, the following line sets YYVAL to garbage.
2147 This behavior is undocumented and Bison
2148 users should not rely upon it. Assigning to YYVAL
2149 unconditionally makes the parser a bit smaller, and it avoids a
2150 GCC warning that YYVAL may be used uninitialized. */
2151 yyval
= yyvsp
[1-yylen
];
2154 YY_REDUCE_PRINT (yyn
);
2158 #line 304 "parser.y"
2160 check_all_user_types((yyvsp
[0].ifref_list
));
2161 write_proxies((yyvsp
[0].ifref_list
));
2162 write_client((yyvsp
[0].ifref_list
));
2163 write_server((yyvsp
[0].ifref_list
));
2164 write_dlldata((yyvsp
[0].ifref_list
));
2169 #line 313 "parser.y"
2170 { (yyval
.ifref_list
) = NULL
; ;}
2174 #line 314 "parser.y"
2175 { (yyval
.ifref_list
) = (yyvsp
[-1].ifref_list
); ;}
2179 #line 315 "parser.y"
2180 { (yyval
.ifref_list
) = append_ifref( (yyvsp
[-1].ifref_list
), make_ifref((yyvsp
[0].type
)) ); ;}
2184 #line 316 "parser.y"
2185 { (yyval
.ifref_list
) = (yyvsp
[-2].ifref_list
);
2186 reg_type((yyvsp
[-1].type
), (yyvsp
[-1].type
)->name
, 0);
2187 if (!parse_only
&& do_header
) write_coclass_forward((yyvsp
[-1].type
));
2192 #line 320 "parser.y"
2193 { (yyval
.ifref_list
) = (yyvsp
[-1].ifref_list
);
2194 add_typelib_entry((yyvsp
[0].type
));
2195 reg_type((yyvsp
[0].type
), (yyvsp
[0].type
)->name
, 0);
2196 if (!parse_only
&& do_header
) write_coclass_forward((yyvsp
[0].type
));
2201 #line 325 "parser.y"
2202 { (yyval
.ifref_list
) = (yyvsp
[-1].ifref_list
); add_typelib_entry((yyvsp
[0].type
)); ;}
2206 #line 326 "parser.y"
2207 { (yyval
.ifref_list
) = (yyvsp
[-1].ifref_list
); ;}
2211 #line 327 "parser.y"
2212 { (yyval
.ifref_list
) = (yyvsp
[-1].ifref_list
); ;}
2216 #line 330 "parser.y"
2221 #line 331 "parser.y"
2222 { if (!parse_only
) add_typelib_entry((yyvsp
[0].type
)); ;}
2226 #line 332 "parser.y"
2227 { if (!parse_only
) add_typelib_entry((yyvsp
[0].type
)); ;}
2231 #line 333 "parser.y"
2232 { reg_type((yyvsp
[-1].type
), (yyvsp
[-1].type
)->name
, 0); if (!parse_only
&& do_header
) write_coclass_forward((yyvsp
[-1].type
)); ;}
2236 #line 334 "parser.y"
2237 { if (!parse_only
) add_typelib_entry((yyvsp
[0].type
));
2238 reg_type((yyvsp
[0].type
), (yyvsp
[0].type
)->name
, 0);
2239 if (!parse_only
&& do_header
) write_coclass_forward((yyvsp
[0].type
));
2244 #line 338 "parser.y"
2245 { if (!parse_only
) add_typelib_entry((yyvsp
[0].type
)); ;}
2249 #line 339 "parser.y"
2254 #line 340 "parser.y"
2259 #line 341 "parser.y"
2264 #line 344 "parser.y"
2265 { (yyval
.func_list
) = NULL
; ;}
2269 #line 345 "parser.y"
2270 { (yyval
.func_list
) = append_func( (yyvsp
[-2].func_list
), (yyvsp
[-1].func
) ); ;}
2274 #line 346 "parser.y"
2275 { (yyval
.func_list
) = (yyvsp
[-1].func_list
); ;}
2279 #line 353 "parser.y"
2280 { if (!parse_only
&& do_header
) { write_constdef((yyvsp
[-1].var
)); } ;}
2284 #line 354 "parser.y"
2289 #line 355 "parser.y"
2290 { if (!parse_only
&& do_header
) {
2291 write_type_def_or_decl(header
, (yyvsp
[-1].type
), FALSE
, NULL
);
2292 fprintf(header
, ";\n\n");
2298 #line 360 "parser.y"
2299 { if (!parse_only
&& do_header
) { write_externdef((yyvsp
[-1].var
)); } ;}
2303 #line 361 "parser.y"
2308 #line 362 "parser.y"
2309 { if (!parse_only
&& do_header
) {
2310 write_type_def_or_decl(header
, (yyvsp
[-1].type
), FALSE
, NULL
);
2311 fprintf(header
, ";\n\n");
2317 #line 367 "parser.y"
2322 #line 368 "parser.y"
2323 { if (!parse_only
&& do_header
) {
2324 write_type_def_or_decl(header
, (yyvsp
[-1].type
), FALSE
, NULL
);
2325 fprintf(header
, ";\n\n");
2331 #line 375 "parser.y"
2332 { if (!parse_only
&& do_header
) fprintf(header
, "%s\n", (yyvsp
[-1].str
)); ;}
2336 #line 377 "parser.y"
2337 { assert(yychar
== YYEMPTY
);
2338 (yyval
.num
) = do_import((yyvsp
[-1].str
));
2339 if (!(yyval
.num
)) yychar
= aEOF
;
2344 #line 384 "parser.y"
2345 { if ((yyvsp
[-2].num
)) pop_import(); ;}
2349 #line 388 "parser.y"
2350 { if(!parse_only
) add_importlib((yyvsp
[-2].str
)); ;}
2354 #line 391 "parser.y"
2355 { (yyval
.str
) = (yyvsp
[0].str
); ;}
2359 #line 393 "parser.y"
2360 { check_library_attrs((yyvsp
[-1].str
), (yyvsp
[-2].attr_list
));
2361 if (!parse_only
) start_typelib((yyvsp
[-1].str
), (yyvsp
[-2].attr_list
));
2362 if (!parse_only
&& do_header
) write_library((yyvsp
[-1].str
), (yyvsp
[-2].attr_list
));
2363 if (!parse_only
&& do_idfile
) write_libid((yyvsp
[-1].str
), (yyvsp
[-2].attr_list
));
2364 is_inside_library
= TRUE
;
2369 #line 401 "parser.y"
2370 { if (!parse_only
) end_typelib(); is_inside_library
= FALSE
; ;}
2374 #line 404 "parser.y"
2375 { (yyval
.var_list
) = NULL
; ;}
2379 #line 408 "parser.y"
2380 { (yyval
.var_list
) = NULL
; ;}
2384 #line 411 "parser.y"
2385 { check_arg((yyvsp
[0].var
)); (yyval
.var_list
) = append_var( NULL
, (yyvsp
[0].var
) ); ;}
2389 #line 412 "parser.y"
2390 { check_arg((yyvsp
[0].var
)); (yyval
.var_list
) = append_var( (yyvsp
[-2].var_list
), (yyvsp
[0].var
)); ;}
2394 #line 417 "parser.y"
2395 { (yyval
.var
) = (yyvsp
[-1].pident
)->var
;
2396 (yyval
.var
)->attrs
= (yyvsp
[-3].attr_list
);
2397 set_type((yyval
.var
), (yyvsp
[-2].type
), (yyvsp
[-1].pident
), (yyvsp
[0].array_dims
), TRUE
);
2398 free((yyvsp
[-1].pident
));
2403 #line 422 "parser.y"
2404 { (yyval
.var
) = (yyvsp
[-1].pident
)->var
;
2405 set_type((yyval
.var
), (yyvsp
[-2].type
), (yyvsp
[-1].pident
), (yyvsp
[0].array_dims
), TRUE
);
2406 free((yyvsp
[-1].pident
));
2411 #line 428 "parser.y"
2412 { (yyval
.array_dims
) = NULL
; ;}
2416 #line 429 "parser.y"
2417 { (yyval
.array_dims
) = (yyvsp
[-1].array_dims
); ;}
2421 #line 430 "parser.y"
2422 { (yyval
.array_dims
) = append_array( NULL
, make_expr(EXPR_VOID
) ); ;}
2426 #line 433 "parser.y"
2427 { (yyval
.array_dims
) = append_array( NULL
, (yyvsp
[0].expr
) ); ;}
2431 #line 434 "parser.y"
2432 { (yyval
.array_dims
) = append_array( (yyvsp
[-2].array_dims
), (yyvsp
[0].expr
) ); ;}
2436 #line 435 "parser.y"
2437 { (yyval
.array_dims
) = append_array( (yyvsp
[-3].array_dims
), (yyvsp
[0].expr
) ); ;}
2441 #line 438 "parser.y"
2442 { (yyval
.attr_list
) = NULL
; ;}
2446 #line 443 "parser.y"
2447 { (yyval
.attr_list
) = (yyvsp
[-1].attr_list
);
2448 if (!(yyval
.attr_list
))
2449 error_loc("empty attribute lists unsupported\n");
2454 #line 449 "parser.y"
2455 { (yyval
.attr_list
) = append_attr( NULL
, (yyvsp
[0].attr
) ); ;}
2459 #line 450 "parser.y"
2460 { (yyval
.attr_list
) = append_attr( (yyvsp
[-2].attr_list
), (yyvsp
[0].attr
) ); ;}
2464 #line 451 "parser.y"
2465 { (yyval
.attr_list
) = append_attr( (yyvsp
[-3].attr_list
), (yyvsp
[0].attr
) ); ;}
2469 #line 454 "parser.y"
2470 { (yyval
.str_list
) = append_str( NULL
, (yyvsp
[0].str
) ); ;}
2474 #line 455 "parser.y"
2475 { (yyval
.str_list
) = append_str( (yyvsp
[-2].str_list
), (yyvsp
[0].str
) ); ;}
2479 #line 458 "parser.y"
2480 { (yyval
.attr
) = NULL
; ;}
2484 #line 459 "parser.y"
2485 { (yyval
.attr
) = make_attr(ATTR_AGGREGATABLE
); ;}
2489 #line 460 "parser.y"
2490 { (yyval
.attr
) = make_attr(ATTR_APPOBJECT
); ;}
2494 #line 461 "parser.y"
2495 { (yyval
.attr
) = make_attr(ATTR_ASYNC
); ;}
2499 #line 462 "parser.y"
2500 { (yyval
.attr
) = make_attr(ATTR_AUTO_HANDLE
); ;}
2504 #line 463 "parser.y"
2505 { (yyval
.attr
) = make_attr(ATTR_BINDABLE
); ;}
2509 #line 464 "parser.y"
2510 { (yyval
.attr
) = make_attr(ATTR_BROADCAST
); ;}
2514 #line 465 "parser.y"
2515 { (yyval
.attr
) = make_attrp(ATTR_CALLAS
, (yyvsp
[-1].var
)); ;}
2519 #line 466 "parser.y"
2520 { (yyval
.attr
) = make_attrp(ATTR_CASE
, (yyvsp
[-1].expr_list
)); ;}
2524 #line 467 "parser.y"
2525 { (yyval
.attr
) = make_attrv(ATTR_CONTEXTHANDLE
, 0); ;}
2529 #line 468 "parser.y"
2530 { (yyval
.attr
) = make_attrv(ATTR_CONTEXTHANDLE
, 0); /* RPC_CONTEXT_HANDLE_DONT_SERIALIZE */ ;}
2534 #line 469 "parser.y"
2535 { (yyval
.attr
) = make_attrv(ATTR_CONTEXTHANDLE
, 0); /* RPC_CONTEXT_HANDLE_SERIALIZE */ ;}
2539 #line 470 "parser.y"
2540 { (yyval
.attr
) = make_attr(ATTR_CONTROL
); ;}
2544 #line 471 "parser.y"
2545 { (yyval
.attr
) = make_attr(ATTR_DEFAULT
); ;}
2549 #line 472 "parser.y"
2550 { (yyval
.attr
) = make_attr(ATTR_DEFAULTCOLLELEM
); ;}
2554 #line 473 "parser.y"
2555 { (yyval
.attr
) = make_attrp(ATTR_DEFAULTVALUE_EXPR
, (yyvsp
[-1].expr
)); ;}
2559 #line 474 "parser.y"
2560 { (yyval
.attr
) = make_attrp(ATTR_DEFAULTVALUE_STRING
, (yyvsp
[-1].str
)); ;}
2564 #line 475 "parser.y"
2565 { (yyval
.attr
) = make_attr(ATTR_DEFAULTVTABLE
); ;}
2569 #line 476 "parser.y"
2570 { (yyval
.attr
) = make_attr(ATTR_DISPLAYBIND
); ;}
2574 #line 477 "parser.y"
2575 { (yyval
.attr
) = make_attrp(ATTR_DLLNAME
, (yyvsp
[-1].str
)); ;}
2579 #line 478 "parser.y"
2580 { (yyval
.attr
) = make_attr(ATTR_DUAL
); ;}
2584 #line 479 "parser.y"
2585 { (yyval
.attr
) = make_attrp(ATTR_ENDPOINT
, (yyvsp
[-1].str_list
)); ;}
2589 #line 480 "parser.y"
2590 { (yyval
.attr
) = make_attrp(ATTR_ENTRY_STRING
, (yyvsp
[-1].str
)); ;}
2594 #line 481 "parser.y"
2595 { (yyval
.attr
) = make_attrp(ATTR_ENTRY_ORDINAL
, (yyvsp
[-1].expr
)); ;}
2599 #line 482 "parser.y"
2600 { (yyval
.attr
) = make_attr(ATTR_EXPLICIT_HANDLE
); ;}
2604 #line 483 "parser.y"
2605 { (yyval
.attr
) = make_attr(ATTR_HANDLE
); ;}
2609 #line 484 "parser.y"
2610 { (yyval
.attr
) = make_attrp(ATTR_HELPCONTEXT
, (yyvsp
[-1].expr
)); ;}
2614 #line 485 "parser.y"
2615 { (yyval
.attr
) = make_attrp(ATTR_HELPFILE
, (yyvsp
[-1].str
)); ;}
2619 #line 486 "parser.y"
2620 { (yyval
.attr
) = make_attrp(ATTR_HELPSTRING
, (yyvsp
[-1].str
)); ;}
2624 #line 487 "parser.y"
2625 { (yyval
.attr
) = make_attrp(ATTR_HELPSTRINGCONTEXT
, (yyvsp
[-1].expr
)); ;}
2629 #line 488 "parser.y"
2630 { (yyval
.attr
) = make_attrp(ATTR_HELPSTRINGDLL
, (yyvsp
[-1].str
)); ;}
2634 #line 489 "parser.y"
2635 { (yyval
.attr
) = make_attr(ATTR_HIDDEN
); ;}
2639 #line 490 "parser.y"
2640 { (yyval
.attr
) = make_attrp(ATTR_ID
, (yyvsp
[-1].expr
)); ;}
2644 #line 491 "parser.y"
2645 { (yyval
.attr
) = make_attr(ATTR_IDEMPOTENT
); ;}
2649 #line 492 "parser.y"
2650 { (yyval
.attr
) = make_attrp(ATTR_IIDIS
, (yyvsp
[-1].expr
)); ;}
2654 #line 493 "parser.y"
2655 { (yyval
.attr
) = make_attr(ATTR_IMMEDIATEBIND
); ;}
2659 #line 494 "parser.y"
2660 { (yyval
.attr
) = make_attrp(ATTR_IMPLICIT_HANDLE
, (yyvsp
[-1].str
)); ;}
2664 #line 495 "parser.y"
2665 { (yyval
.attr
) = make_attr(ATTR_IN
); ;}
2669 #line 496 "parser.y"
2670 { (yyval
.attr
) = make_attr(ATTR_INPUTSYNC
); ;}
2674 #line 497 "parser.y"
2675 { (yyval
.attr
) = make_attrp(ATTR_LENGTHIS
, (yyvsp
[-1].expr_list
)); ;}
2679 #line 498 "parser.y"
2680 { (yyval
.attr
) = make_attr(ATTR_LOCAL
); ;}
2684 #line 499 "parser.y"
2685 { (yyval
.attr
) = make_attr(ATTR_NONBROWSABLE
); ;}
2689 #line 500 "parser.y"
2690 { (yyval
.attr
) = make_attr(ATTR_NONCREATABLE
); ;}
2694 #line 501 "parser.y"
2695 { (yyval
.attr
) = make_attr(ATTR_NONEXTENSIBLE
); ;}
2699 #line 502 "parser.y"
2700 { (yyval
.attr
) = make_attr(ATTR_OBJECT
); ;}
2704 #line 503 "parser.y"
2705 { (yyval
.attr
) = make_attr(ATTR_ODL
); ;}
2709 #line 504 "parser.y"
2710 { (yyval
.attr
) = make_attr(ATTR_OLEAUTOMATION
); ;}
2714 #line 505 "parser.y"
2715 { (yyval
.attr
) = make_attr(ATTR_OPTIONAL
); ;}
2719 #line 506 "parser.y"
2720 { (yyval
.attr
) = make_attr(ATTR_OUT
); ;}
2724 #line 507 "parser.y"
2725 { (yyval
.attr
) = make_attrv(ATTR_POINTERDEFAULT
, (yyvsp
[-1].num
)); ;}
2729 #line 508 "parser.y"
2730 { (yyval
.attr
) = make_attr(ATTR_PROPGET
); ;}
2734 #line 509 "parser.y"
2735 { (yyval
.attr
) = make_attr(ATTR_PROPPUT
); ;}
2739 #line 510 "parser.y"
2740 { (yyval
.attr
) = make_attr(ATTR_PROPPUTREF
); ;}
2744 #line 511 "parser.y"
2745 { (yyval
.attr
) = make_attr(ATTR_PUBLIC
); ;}
2749 #line 512 "parser.y"
2750 { expr_list_t
*list
= append_expr( NULL
, (yyvsp
[-3].expr
) );
2751 list
= append_expr( list
, (yyvsp
[-1].expr
) );
2752 (yyval
.attr
) = make_attrp(ATTR_RANGE
, list
); ;}
2756 #line 515 "parser.y"
2757 { (yyval
.attr
) = make_attr(ATTR_READONLY
); ;}
2761 #line 516 "parser.y"
2762 { (yyval
.attr
) = make_attr(ATTR_REQUESTEDIT
); ;}
2766 #line 517 "parser.y"
2767 { (yyval
.attr
) = make_attr(ATTR_RESTRICTED
); ;}
2771 #line 518 "parser.y"
2772 { (yyval
.attr
) = make_attr(ATTR_RETVAL
); ;}
2776 #line 519 "parser.y"
2777 { (yyval
.attr
) = make_attrp(ATTR_SIZEIS
, (yyvsp
[-1].expr_list
)); ;}
2781 #line 520 "parser.y"
2782 { (yyval
.attr
) = make_attr(ATTR_SOURCE
); ;}
2786 #line 521 "parser.y"
2787 { (yyval
.attr
) = make_attr(ATTR_STRICTCONTEXTHANDLE
); ;}
2791 #line 522 "parser.y"
2792 { (yyval
.attr
) = make_attr(ATTR_STRING
); ;}
2796 #line 523 "parser.y"
2797 { (yyval
.attr
) = make_attrp(ATTR_SWITCHIS
, (yyvsp
[-1].expr
)); ;}
2801 #line 524 "parser.y"
2802 { (yyval
.attr
) = make_attrp(ATTR_SWITCHTYPE
, (yyvsp
[-1].type
)); ;}
2806 #line 525 "parser.y"
2807 { (yyval
.attr
) = make_attrp(ATTR_TRANSMITAS
, (yyvsp
[-1].type
)); ;}
2811 #line 526 "parser.y"
2812 { (yyval
.attr
) = make_attrp(ATTR_UUID
, (yyvsp
[-1].uuid
)); ;}
2816 #line 527 "parser.y"
2817 { (yyval
.attr
) = make_attr(ATTR_V1ENUM
); ;}
2821 #line 528 "parser.y"
2822 { (yyval
.attr
) = make_attr(ATTR_VARARG
); ;}
2826 #line 529 "parser.y"
2827 { (yyval
.attr
) = make_attrv(ATTR_VERSION
, (yyvsp
[-1].num
)); ;}
2831 #line 530 "parser.y"
2832 { (yyval
.attr
) = make_attrp(ATTR_WIREMARSHAL
, (yyvsp
[-1].type
)); ;}
2836 #line 531 "parser.y"
2837 { (yyval
.attr
) = make_attrv(ATTR_POINTERTYPE
, (yyvsp
[0].num
)); ;}
2841 #line 536 "parser.y"
2842 { if (!is_valid_uuid((yyvsp
[0].str
)))
2843 error_loc("invalid UUID: %s\n", (yyvsp
[0].str
));
2844 (yyval
.uuid
) = parse_uuid((yyvsp
[0].str
)); ;}
2848 #line 541 "parser.y"
2849 { (yyval
.str
) = (yyvsp
[0].str
); ;}
2853 #line 542 "parser.y"
2854 { (yyval
.str
) = (yyvsp
[0].str
); ;}
2858 #line 543 "parser.y"
2859 { (yyval
.str
) = (yyvsp
[0].str
); ;}
2863 #line 544 "parser.y"
2864 { (yyval
.str
) = (yyvsp
[0].str
); ;}
2868 #line 547 "parser.y"
2869 { (yyval
.var_list
) = NULL
; ;}
2873 #line 548 "parser.y"
2874 { (yyval
.var_list
) = append_var( (yyvsp
[-1].var_list
), (yyvsp
[0].var
) ); ;}
2878 #line 551 "parser.y"
2879 { attr_t
*a
= make_attrp(ATTR_CASE
, append_expr( NULL
, (yyvsp
[-2].expr
) ));
2880 (yyval
.var
) = (yyvsp
[0].var
); if (!(yyval
.var
)) (yyval
.var
) = make_var(NULL
);
2881 (yyval
.var
)->attrs
= append_attr( (yyval
.var
)->attrs
, a
);
2886 #line 555 "parser.y"
2887 { attr_t
*a
= make_attr(ATTR_DEFAULT
);
2888 (yyval
.var
) = (yyvsp
[0].var
); if (!(yyval
.var
)) (yyval
.var
) = make_var(NULL
);
2889 (yyval
.var
)->attrs
= append_attr( (yyval
.var
)->attrs
, a
);
2894 #line 561 "parser.y"
2895 { (yyval
.var
) = reg_const((yyvsp
[-2].var
));
2896 set_type((yyval
.var
), (yyvsp
[-3].type
), NULL
, NULL
, FALSE
);
2897 (yyval
.var
)->eval
= (yyvsp
[0].expr
);
2902 #line 567 "parser.y"
2903 { (yyval
.var_list
) = NULL
; ;}
2907 #line 568 "parser.y"
2908 { (yyval
.var_list
) = (yyvsp
[-1].var_list
); ;}
2912 #line 572 "parser.y"
2913 { if (!(yyvsp
[0].var
)->eval
)
2914 (yyvsp
[0].var
)->eval
= make_exprl(EXPR_NUM
, 0 /* default for first enum entry */);
2915 (yyval
.var_list
) = append_var( NULL
, (yyvsp
[0].var
) );
2920 #line 576 "parser.y"
2921 { if (!(yyvsp
[0].var
)->eval
)
2923 var_t
*last
= LIST_ENTRY( list_tail((yyval
.var_list
)), var_t
, entry
);
2924 (yyvsp
[0].var
)->eval
= make_exprl(EXPR_NUM
, last
->eval
->cval
+ 1);
2926 (yyval
.var_list
) = append_var( (yyvsp
[-2].var_list
), (yyvsp
[0].var
) );
2931 #line 585 "parser.y"
2932 { (yyval
.var
) = reg_const((yyvsp
[-2].var
));
2933 (yyval
.var
)->eval
= (yyvsp
[0].expr
);
2934 (yyval
.var
)->type
= make_int(0);
2939 #line 589 "parser.y"
2940 { (yyval
.var
) = reg_const((yyvsp
[0].var
));
2941 (yyval
.var
)->type
= make_int(0);
2946 #line 594 "parser.y"
2947 { (yyval
.type
) = get_typev(RPC_FC_ENUM16
, (yyvsp
[-3].var
), tsENUM
);
2948 (yyval
.type
)->kind
= TKIND_ENUM
;
2949 (yyval
.type
)->fields_or_args
= (yyvsp
[-1].var_list
);
2950 (yyval
.type
)->defined
= TRUE
;
2952 add_typelib_entry((yyval
.type
));
2957 #line 603 "parser.y"
2958 { (yyval
.expr_list
) = append_expr( NULL
, (yyvsp
[0].expr
) ); ;}
2962 #line 604 "parser.y"
2963 { (yyval
.expr_list
) = append_expr( (yyvsp
[-2].expr_list
), (yyvsp
[0].expr
) ); ;}
2967 #line 617 "parser.y"
2968 { (yyval
.expr
) = make_expr(EXPR_VOID
); ;}
2972 #line 621 "parser.y"
2973 { (yyval
.expr
) = make_exprl(EXPR_NUM
, (yyvsp
[0].num
)); ;}
2977 #line 622 "parser.y"
2978 { (yyval
.expr
) = make_exprl(EXPR_HEXNUM
, (yyvsp
[0].num
)); ;}
2982 #line 623 "parser.y"
2983 { (yyval
.expr
) = make_exprd(EXPR_DOUBLE
, (yyvsp
[0].dbl
)); ;}
2987 #line 624 "parser.y"
2988 { (yyval
.expr
) = make_exprl(EXPR_TRUEFALSE
, 0); ;}
2992 #line 625 "parser.y"
2993 { (yyval
.expr
) = make_exprl(EXPR_TRUEFALSE
, 1); ;}
2997 #line 626 "parser.y"
2998 { (yyval
.expr
) = make_exprs(EXPR_IDENTIFIER
, (yyvsp
[0].str
)); ;}
3002 #line 627 "parser.y"
3003 { (yyval
.expr
) = make_expr3(EXPR_COND
, (yyvsp
[-4].expr
), (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3007 #line 628 "parser.y"
3008 { (yyval
.expr
) = make_expr2(EXPR_OR
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3012 #line 629 "parser.y"
3013 { (yyval
.expr
) = make_expr2(EXPR_AND
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3017 #line 630 "parser.y"
3018 { (yyval
.expr
) = make_expr2(EXPR_ADD
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3022 #line 631 "parser.y"
3023 { (yyval
.expr
) = make_expr2(EXPR_SUB
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3027 #line 632 "parser.y"
3028 { (yyval
.expr
) = make_expr2(EXPR_MUL
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3032 #line 633 "parser.y"
3033 { (yyval
.expr
) = make_expr2(EXPR_DIV
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3037 #line 634 "parser.y"
3038 { (yyval
.expr
) = make_expr2(EXPR_SHL
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3042 #line 635 "parser.y"
3043 { (yyval
.expr
) = make_expr2(EXPR_SHR
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3047 #line 636 "parser.y"
3048 { (yyval
.expr
) = make_expr1(EXPR_NOT
, (yyvsp
[0].expr
)); ;}
3052 #line 637 "parser.y"
3053 { (yyval
.expr
) = make_expr1(EXPR_NEG
, (yyvsp
[0].expr
)); ;}
3057 #line 638 "parser.y"
3058 { (yyval
.expr
) = make_expr1(EXPR_ADDRESSOF
, (yyvsp
[0].expr
)); ;}
3062 #line 639 "parser.y"
3063 { (yyval
.expr
) = make_expr1(EXPR_PPTR
, (yyvsp
[0].expr
)); ;}
3067 #line 640 "parser.y"
3068 { (yyval
.expr
) = make_exprt(EXPR_CAST
, (yyvsp
[-2].type
), (yyvsp
[0].expr
)); ;}
3072 #line 641 "parser.y"
3073 { (yyval
.expr
) = make_exprt(EXPR_SIZEOF
, (yyvsp
[-1].type
), NULL
); ;}
3077 #line 642 "parser.y"
3078 { (yyval
.expr
) = (yyvsp
[-1].expr
); ;}
3082 #line 645 "parser.y"
3083 { (yyval
.expr_list
) = append_expr( NULL
, (yyvsp
[0].expr
) ); ;}
3087 #line 646 "parser.y"
3088 { (yyval
.expr_list
) = append_expr( (yyvsp
[-2].expr_list
), (yyvsp
[0].expr
) ); ;}
3092 #line 649 "parser.y"
3093 { (yyval
.expr
) = (yyvsp
[0].expr
);
3094 if (!(yyval
.expr
)->is_const
)
3095 error_loc("expression is not constant\n");
3100 #line 655 "parser.y"
3101 { (yyval
.var
) = (yyvsp
[0].var
);
3102 set_type((yyval
.var
), (yyvsp
[-1].type
), NULL
, NULL
, FALSE
);
3107 #line 660 "parser.y"
3108 { (yyval
.var_list
) = NULL
; ;}
3112 #line 661 "parser.y"
3113 { (yyval
.var_list
) = append_var( (yyvsp
[-1].var_list
), (yyvsp
[0].var
) ); ;}
3117 #line 664 "parser.y"
3118 { (yyval
.var
) = (yyvsp
[-1].var
); ;}
3122 #line 665 "parser.y"
3123 { (yyval
.var
) = make_var(NULL
); (yyval
.var
)->type
= (yyvsp
[-1].type
); (yyval
.var
)->attrs
= (yyvsp
[-2].attr_list
); ;}
3127 #line 666 "parser.y"
3128 { (yyval
.var
) = make_var(NULL
); (yyval
.var
)->attrs
= (yyvsp
[-1].attr_list
); ;}
3132 #line 667 "parser.y"
3133 { (yyval
.var
) = NULL
; ;}
3137 #line 670 "parser.y"
3138 { (yyval
.var
) = (yyvsp
[-1].pident
)->var
;
3139 (yyval
.var
)->attrs
= check_field_attrs((yyval
.var
)->name
, (yyvsp
[-3].attr_list
));
3140 set_type((yyval
.var
), (yyvsp
[-2].type
), (yyvsp
[-1].pident
), (yyvsp
[0].array_dims
), FALSE
);
3141 free((yyvsp
[-1].pident
));
3146 #line 678 "parser.y"
3147 { var_t
*v
= (yyvsp
[0].pident
)->var
;
3148 var_list_t
*args
= (yyvsp
[0].pident
)->args
;
3149 v
->attrs
= check_function_attrs(v
->name
, (yyvsp
[-2].attr_list
));
3150 set_type(v
, (yyvsp
[-1].type
), (yyvsp
[0].pident
), NULL
, FALSE
);
3151 free((yyvsp
[0].pident
));
3152 (yyval
.func
) = make_func(v
, args
);
3157 #line 687 "parser.y"
3158 { (yyval
.var
) = NULL
; ;}
3162 #line 691 "parser.y"
3163 { (yyval
.var
) = NULL
; ;}
3167 #line 692 "parser.y"
3168 { (yyval
.var
) = make_var((yyvsp
[0].str
)); ;}
3172 #line 693 "parser.y"
3173 { (yyval
.var
) = make_var((yyvsp
[0].str
)); ;}
3177 #line 696 "parser.y"
3178 { (yyval
.var
) = make_var((yyvsp
[0].str
)); ;}
3182 #line 698 "parser.y"
3183 { (yyval
.var
) = make_var((yyvsp
[0].str
)); ;}
3187 #line 701 "parser.y"
3188 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3192 #line 702 "parser.y"
3193 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3197 #line 704 "parser.y"
3198 { (yyval
.type
) = (yyvsp
[0].type
); (yyval
.type
)->sign
= 1; ;}
3202 #line 705 "parser.y"
3203 { (yyval
.type
) = (yyvsp
[0].type
); (yyval
.type
)->sign
= -1;
3204 switch ((yyval
.type
)->type
) {
3205 case RPC_FC_CHAR
: break;
3206 case RPC_FC_SMALL
: (yyval
.type
)->type
= RPC_FC_USMALL
; break;
3207 case RPC_FC_SHORT
: (yyval
.type
)->type
= RPC_FC_USHORT
; break;
3208 case RPC_FC_LONG
: (yyval
.type
)->type
= RPC_FC_ULONG
; break;
3210 if ((yyval
.type
)->name
[0] == 'h') /* hyper, as opposed to __int64 */
3212 (yyval
.type
) = alias((yyval
.type
), "MIDL_uhyper");
3213 (yyval
.type
)->sign
= 0;
3222 #line 721 "parser.y"
3223 { (yyval
.type
) = make_int(-1); ;}
3227 #line 722 "parser.y"
3228 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3232 #line 723 "parser.y"
3233 { (yyval
.type
) = duptype(find_type("float", 0), 1); ;}
3237 #line 724 "parser.y"
3238 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3242 #line 725 "parser.y"
3243 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3247 #line 726 "parser.y"
3248 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3252 #line 727 "parser.y"
3253 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3257 #line 734 "parser.y"
3258 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3262 #line 735 "parser.y"
3263 { (yyval
.type
) = make_builtin((yyvsp
[-1].str
)); ;}
3267 #line 736 "parser.y"
3268 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3272 #line 737 "parser.y"
3273 { (yyval
.type
) = make_builtin((yyvsp
[-1].str
)); ;}
3277 #line 738 "parser.y"
3278 { (yyval
.type
) = make_builtin((yyvsp
[-1].str
)); ;}
3282 #line 739 "parser.y"
3283 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3287 #line 740 "parser.y"
3288 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3292 #line 743 "parser.y"
3293 { (yyval
.type
) = make_class((yyvsp
[0].str
)); ;}
3297 #line 744 "parser.y"
3298 { (yyval
.type
) = find_type((yyvsp
[0].str
), 0);
3299 if ((yyval
.type
)->defined
) error_loc("multiple definition error\n");
3300 if ((yyval
.type
)->kind
!= TKIND_COCLASS
) error_loc("%s was not declared a coclass\n", (yyvsp
[0].str
));
3305 #line 750 "parser.y"
3306 { (yyval
.type
) = (yyvsp
[0].type
);
3307 (yyval
.type
)->attrs
= check_coclass_attrs((yyvsp
[0].type
)->name
, (yyvsp
[-1].attr_list
));
3308 if (!parse_only
&& do_header
)
3309 write_coclass((yyval
.type
));
3310 if (!parse_only
&& do_idfile
)
3311 write_clsid((yyval
.type
));
3316 #line 760 "parser.y"
3317 { (yyval
.type
) = (yyvsp
[-4].type
);
3318 (yyval
.type
)->ifaces
= (yyvsp
[-2].ifref_list
);
3319 (yyval
.type
)->defined
= TRUE
;
3324 #line 766 "parser.y"
3325 { (yyval
.ifref_list
) = NULL
; ;}
3329 #line 767 "parser.y"
3330 { (yyval
.ifref_list
) = append_ifref( (yyvsp
[-1].ifref_list
), (yyvsp
[0].ifref
) ); ;}
3334 #line 771 "parser.y"
3335 { (yyval
.ifref
) = make_ifref((yyvsp
[0].type
)); (yyval
.ifref
)->attrs
= (yyvsp
[-1].attr_list
); ;}
3339 #line 774 "parser.y"
3340 { (yyval
.type
) = get_type(0, (yyvsp
[0].str
), 0); (yyval
.type
)->kind
= TKIND_DISPATCH
; ;}
3344 #line 775 "parser.y"
3345 { (yyval
.type
) = get_type(0, (yyvsp
[0].str
), 0); (yyval
.type
)->kind
= TKIND_DISPATCH
; ;}
3349 #line 778 "parser.y"
3351 is_object_interface
= TRUE
;
3352 (yyval
.type
) = (yyvsp
[0].type
);
3353 if ((yyval
.type
)->defined
) error_loc("multiple definition error\n");
3354 attrs
= make_attr(ATTR_DISPINTERFACE
);
3355 (yyval
.type
)->attrs
= append_attr( check_dispiface_attrs((yyvsp
[0].type
)->name
, (yyvsp
[-1].attr_list
)), attrs
);
3356 (yyval
.type
)->ref
= find_type("IDispatch", 0);
3357 if (!(yyval
.type
)->ref
) error_loc("IDispatch is undefined\n");
3358 (yyval
.type
)->defined
= TRUE
;
3359 if (!parse_only
&& do_header
) write_forward((yyval
.type
));
3364 #line 791 "parser.y"
3365 { (yyval
.var_list
) = NULL
; ;}
3369 #line 792 "parser.y"
3370 { (yyval
.var_list
) = append_var( (yyvsp
[-2].var_list
), (yyvsp
[-1].var
) ); ;}
3374 #line 795 "parser.y"
3375 { (yyval
.func_list
) = NULL
; ;}
3379 #line 796 "parser.y"
3380 { (yyval
.func_list
) = append_func( (yyvsp
[-2].func_list
), (yyvsp
[-1].func
) ); ;}
3384 #line 802 "parser.y"
3385 { (yyval
.type
) = (yyvsp
[-4].type
);
3386 (yyval
.type
)->fields_or_args
= (yyvsp
[-2].var_list
);
3387 (yyval
.type
)->funcs
= (yyvsp
[-1].func_list
);
3388 if (!parse_only
&& do_header
) write_dispinterface((yyval
.type
));
3389 if (!parse_only
&& do_idfile
) write_diid((yyval
.type
));
3394 #line 809 "parser.y"
3395 { (yyval
.type
) = (yyvsp
[-4].type
);
3396 (yyval
.type
)->fields_or_args
= (yyvsp
[-2].type
)->fields_or_args
;
3397 (yyval
.type
)->funcs
= (yyvsp
[-2].type
)->funcs
;
3398 if (!parse_only
&& do_header
) write_dispinterface((yyval
.type
));
3399 if (!parse_only
&& do_idfile
) write_diid((yyval
.type
));
3404 #line 817 "parser.y"
3405 { (yyval
.type
) = NULL
; ;}
3409 #line 818 "parser.y"
3410 { (yyval
.type
) = find_type2((yyvsp
[0].str
), 0); ;}
3414 #line 821 "parser.y"
3415 { (yyval
.type
) = get_type(RPC_FC_IP
, (yyvsp
[0].str
), 0); (yyval
.type
)->kind
= TKIND_INTERFACE
; ;}
3419 #line 822 "parser.y"
3420 { (yyval
.type
) = get_type(RPC_FC_IP
, (yyvsp
[0].str
), 0); (yyval
.type
)->kind
= TKIND_INTERFACE
; ;}
3424 #line 825 "parser.y"
3425 { (yyval
.ifinfo
).interface
= (yyvsp
[0].type
);
3426 (yyval
.ifinfo
).old_pointer_default
= pointer_default
;
3427 if (is_attr((yyvsp
[-1].attr_list
), ATTR_POINTERDEFAULT
))
3428 pointer_default
= get_attrv((yyvsp
[-1].attr_list
), ATTR_POINTERDEFAULT
);
3429 is_object_interface
= is_object((yyvsp
[-1].attr_list
));
3430 if ((yyvsp
[0].type
)->defined
) error_loc("multiple definition error\n");
3431 (yyvsp
[0].type
)->attrs
= check_iface_attrs((yyvsp
[0].type
)->name
, (yyvsp
[-1].attr_list
));
3432 (yyvsp
[0].type
)->defined
= TRUE
;
3433 if (!parse_only
&& do_header
) write_forward((yyvsp
[0].type
));
3438 #line 838 "parser.y"
3439 { (yyval
.type
) = (yyvsp
[-5].ifinfo
).interface
;
3440 (yyval
.type
)->ref
= (yyvsp
[-4].type
);
3441 (yyval
.type
)->funcs
= (yyvsp
[-2].func_list
);
3442 check_functions((yyval
.type
));
3443 compute_method_indexes((yyval
.type
));
3444 if (!parse_only
&& do_header
) write_interface((yyval
.type
));
3445 if (!parse_only
&& local_stubs
) write_locals(local_stubs
, (yyval
.type
), TRUE
);
3446 if (!parse_only
&& do_idfile
) write_iid((yyval
.type
));
3447 pointer_default
= (yyvsp
[-5].ifinfo
).old_pointer_default
;
3452 #line 852 "parser.y"
3453 { (yyval
.type
) = (yyvsp
[-7].ifinfo
).interface
;
3454 (yyval
.type
)->ref
= find_type2((yyvsp
[-5].str
), 0);
3455 if (!(yyval
.type
)->ref
) error_loc("base class '%s' not found in import\n", (yyvsp
[-5].str
));
3456 (yyval
.type
)->funcs
= (yyvsp
[-2].func_list
);
3457 compute_method_indexes((yyval
.type
));
3458 if (!parse_only
&& do_header
) write_interface((yyval
.type
));
3459 if (!parse_only
&& local_stubs
) write_locals(local_stubs
, (yyval
.type
), TRUE
);
3460 if (!parse_only
&& do_idfile
) write_iid((yyval
.type
));
3461 pointer_default
= (yyvsp
[-7].ifinfo
).old_pointer_default
;
3466 #line 862 "parser.y"
3467 { (yyval
.type
) = (yyvsp
[-1].type
); ;}
3471 #line 866 "parser.y"
3472 { (yyval
.type
) = (yyvsp
[-1].type
); if (!parse_only
&& do_header
) write_forward((yyval
.type
)); ;}
3476 #line 867 "parser.y"
3477 { (yyval
.type
) = (yyvsp
[-1].type
); if (!parse_only
&& do_header
) write_forward((yyval
.type
)); ;}
3481 #line 870 "parser.y"
3482 { (yyval
.type
) = make_type(0, NULL
); (yyval
.type
)->name
= (yyvsp
[0].str
); (yyval
.type
)->kind
= TKIND_MODULE
; ;}
3486 #line 871 "parser.y"
3487 { (yyval
.type
) = make_type(0, NULL
); (yyval
.type
)->name
= (yyvsp
[0].str
); (yyval
.type
)->kind
= TKIND_MODULE
; ;}
3491 #line 874 "parser.y"
3492 { (yyval
.type
) = (yyvsp
[0].type
);
3493 (yyval
.type
)->attrs
= check_module_attrs((yyvsp
[0].type
)->name
, (yyvsp
[-1].attr_list
));
3498 #line 880 "parser.y"
3499 { (yyval
.type
) = (yyvsp
[-4].type
);
3500 (yyval
.type
)->funcs
= (yyvsp
[-2].func_list
);
3501 /* FIXME: if (!parse_only && do_header) write_module($$); */
3506 #line 886 "parser.y"
3507 { (yyval
.pident
) = (yyvsp
[0].pident
); (yyval
.pident
)->ptr_level
++; ;}
3511 #line 887 "parser.y"
3512 { (yyval
.pident
) = (yyvsp
[0].pident
); /* FIXME */ ;}
3516 #line 888 "parser.y"
3517 { (yyval
.pident
) = (yyvsp
[0].pident
);
3518 if ((yyval
.pident
)->callconv
) parser_warning("multiple calling conventions %s, %s for function %s\n", (yyval
.pident
)->callconv
, (yyvsp
[-1].str
), (yyval
.pident
)->var
->name
);
3519 (yyval
.pident
)->callconv
= (yyvsp
[-1].str
);
3524 #line 896 "parser.y"
3525 { (yyval
.pident
) = (yyvsp
[-3].pident
);
3526 (yyvsp
[-3].pident
)->args
= (yyvsp
[-1].var_list
);
3527 (yyvsp
[-3].pident
)->is_func
= TRUE
;
3532 #line 902 "parser.y"
3533 { (yyval
.pident
) = make_pident((yyvsp
[0].var
)); ;}
3537 #line 903 "parser.y"
3538 { (yyval
.pident
) = (yyvsp
[-1].pident
); ;}
3542 #line 904 "parser.y"
3543 { (yyval
.pident
) = (yyvsp
[0].pident
);
3544 (yyval
.pident
)->func_ptr_level
= (yyval
.pident
)->ptr_level
;
3545 (yyval
.pident
)->ptr_level
= 0;
3550 #line 911 "parser.y"
3551 { (yyval
.pident_list
) = append_pident( NULL
, (yyvsp
[0].pident
) ); ;}
3555 #line 912 "parser.y"
3556 { (yyval
.pident_list
) = append_pident( (yyvsp
[-2].pident_list
), (yyvsp
[0].pident
) ); ;}
3560 #line 916 "parser.y"
3561 { (yyval
.num
) = RPC_FC_RP
; ;}
3565 #line 917 "parser.y"
3566 { (yyval
.num
) = RPC_FC_UP
; ;}
3570 #line 918 "parser.y"
3571 { (yyval
.num
) = RPC_FC_FP
; ;}
3575 #line 921 "parser.y"
3576 { (yyval
.type
) = get_typev(RPC_FC_STRUCT
, (yyvsp
[-3].var
), tsSTRUCT
);
3577 /* overwrite RPC_FC_STRUCT with a more exact type */
3578 (yyval
.type
)->type
= get_struct_type( (yyvsp
[-1].var_list
) );
3579 (yyval
.type
)->kind
= TKIND_RECORD
;
3580 (yyval
.type
)->fields_or_args
= (yyvsp
[-1].var_list
);
3581 (yyval
.type
)->defined
= TRUE
;
3583 add_typelib_entry((yyval
.type
));
3588 #line 932 "parser.y"
3589 { (yyval
.type
) = duptype(find_type("void", 0), 1); ;}
3593 #line 933 "parser.y"
3594 { (yyval
.type
) = find_type((yyvsp
[0].str
), 0); ;}
3598 #line 934 "parser.y"
3599 { (yyval
.type
) = (yyvsp
[0].type
); ;}
3603 #line 935 "parser.y"
3604 { (yyval
.type
) = duptype((yyvsp
[0].type
), 1); (yyval
.type
)->is_const
= TRUE
; ;}
3608 #line 936 "parser.y"
3609 { (yyval
.type
) = (yyvsp
[0].type
); ;}
3613 #line 937 "parser.y"
3614 { (yyval
.type
) = find_type2((yyvsp
[0].str
), tsENUM
); ;}
3618 #line 938 "parser.y"
3619 { (yyval
.type
) = (yyvsp
[0].type
); ;}
3623 #line 939 "parser.y"
3624 { (yyval
.type
) = get_type(RPC_FC_STRUCT
, (yyvsp
[0].str
), tsSTRUCT
); ;}
3628 #line 940 "parser.y"
3629 { (yyval
.type
) = (yyvsp
[0].type
); ;}
3633 #line 941 "parser.y"
3634 { (yyval
.type
) = find_type2((yyvsp
[0].str
), tsUNION
); ;}
3638 #line 942 "parser.y"
3639 { (yyval
.type
) = make_safearray((yyvsp
[-1].type
)); ;}
3643 #line 945 "parser.y"
3644 { reg_typedefs((yyvsp
[-1].type
), (yyvsp
[0].pident_list
), check_typedef_attrs((yyvsp
[-2].attr_list
)));
3645 process_typedefs((yyvsp
[0].pident_list
));
3650 #line 950 "parser.y"
3651 { (yyval
.type
) = get_typev(RPC_FC_NON_ENCAPSULATED_UNION
, (yyvsp
[-3].var
), tsUNION
);
3652 (yyval
.type
)->kind
= TKIND_UNION
;
3653 (yyval
.type
)->fields_or_args
= (yyvsp
[-1].var_list
);
3654 (yyval
.type
)->defined
= TRUE
;
3659 #line 957 "parser.y"
3660 { var_t
*u
= (yyvsp
[-3].var
);
3661 (yyval
.type
) = get_typev(RPC_FC_ENCAPSULATED_UNION
, (yyvsp
[-8].var
), tsUNION
);
3662 (yyval
.type
)->kind
= TKIND_UNION
;
3663 if (!u
) u
= make_var( xstrdup("tagged_union") );
3664 u
->type
= make_type(RPC_FC_NON_ENCAPSULATED_UNION
, NULL
);
3665 u
->type
->kind
= TKIND_UNION
;
3666 u
->type
->fields_or_args
= (yyvsp
[-1].var_list
);
3667 u
->type
->defined
= TRUE
;
3668 (yyval
.type
)->fields_or_args
= append_var( (yyval
.type
)->fields_or_args
, (yyvsp
[-5].var
) );
3669 (yyval
.type
)->fields_or_args
= append_var( (yyval
.type
)->fields_or_args
, u
);
3670 (yyval
.type
)->defined
= TRUE
;
3675 #line 972 "parser.y"
3676 { (yyval
.num
) = MAKEVERSION((yyvsp
[0].num
), 0); ;}
3680 #line 973 "parser.y"
3681 { (yyval
.num
) = MAKEVERSION((yyvsp
[-2].num
), (yyvsp
[0].num
)); ;}
3688 /* Line 1126 of yacc.c. */
3689 #line 3690 "parser.tab.c"
3695 YY_STACK_PRINT (yyss
, yyssp
);
3700 /* Now `shift' the result of the reduction. Determine what state
3701 that goes to, based on the state we popped back to and the rule
3702 number reduced by. */
3706 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
3707 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
3708 yystate
= yytable
[yystate
];
3710 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
3715 /*------------------------------------.
3716 | yyerrlab -- here on detecting error |
3717 `------------------------------------*/
3719 /* If not already recovering from an error, report this error. */
3724 yyn
= yypact
[yystate
];
3726 if (YYPACT_NINF
< yyn
&& yyn
< YYLAST
)
3728 int yytype
= YYTRANSLATE (yychar
);
3729 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytype
]);
3730 YYSIZE_T yysize
= yysize0
;
3732 int yysize_overflow
= 0;
3734 # define YYERROR_VERBOSE_ARGS_MAXIMUM 5
3735 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
3739 /* This is so xgettext sees the translatable formats that are
3740 constructed on the fly. */
3741 YY_("syntax error, unexpected %s");
3742 YY_("syntax error, unexpected %s, expecting %s");
3743 YY_("syntax error, unexpected %s, expecting %s or %s");
3744 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
3745 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
3749 static char const yyunexpected
[] = "syntax error, unexpected %s";
3750 static char const yyexpecting
[] = ", expecting %s";
3751 static char const yyor
[] = " or %s";
3752 char yyformat
[sizeof yyunexpected
3753 + sizeof yyexpecting
- 1
3754 + ((YYERROR_VERBOSE_ARGS_MAXIMUM
- 2)
3755 * (sizeof yyor
- 1))];
3756 char const *yyprefix
= yyexpecting
;
3758 /* Start YYX at -YYN if negative to avoid negative indexes in
3760 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
3762 /* Stay within bounds of both yycheck and yytname. */
3763 int yychecklim
= YYLAST
- yyn
;
3764 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
3767 yyarg
[0] = yytname
[yytype
];
3768 yyfmt
= yystpcpy (yyformat
, yyunexpected
);
3770 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
3771 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
3773 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
3777 yyformat
[sizeof yyunexpected
- 1] = '\0';
3780 yyarg
[yycount
++] = yytname
[yyx
];
3781 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
3782 yysize_overflow
|= yysize1
< yysize
;
3784 yyfmt
= yystpcpy (yyfmt
, yyprefix
);
3788 yyf
= YY_(yyformat
);
3789 yysize1
= yysize
+ yystrlen (yyf
);
3790 yysize_overflow
|= yysize1
< yysize
;
3793 if (!yysize_overflow
&& yysize
<= YYSTACK_ALLOC_MAXIMUM
)
3794 yymsg
= (char *) YYSTACK_ALLOC (yysize
);
3797 /* Avoid sprintf, as that infringes on the user's name space.
3798 Don't have undefined behavior even if the translation
3799 produced a string with the wrong number of "%s"s. */
3802 while ((*yyp
= *yyf
))
3804 if (*yyp
== '%' && yyf
[1] == 's' && yyi
< yycount
)
3806 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
3816 YYSTACK_FREE (yymsg
);
3820 yyerror (YY_("syntax error"));
3821 goto yyexhaustedlab
;
3825 #endif /* YYERROR_VERBOSE */
3826 yyerror (YY_("syntax error"));
3831 if (yyerrstatus
== 3)
3833 /* If just tried and failed to reuse look-ahead token after an
3834 error, discard it. */
3836 if (yychar
<= YYEOF
)
3838 /* Return failure if at end of input. */
3839 if (yychar
== YYEOF
)
3844 yydestruct ("Error: discarding", yytoken
, &yylval
);
3849 /* Else will try to reuse look-ahead token after shifting the error
3854 /*---------------------------------------------------.
3855 | yyerrorlab -- error raised explicitly by YYERROR. |
3856 `---------------------------------------------------*/
3859 /* Pacify compilers like GCC when the user code never invokes
3860 YYERROR and the label yyerrorlab therefore never appears in user
3871 /*-------------------------------------------------------------.
3872 | yyerrlab1 -- common code for both syntax error and YYERROR. |
3873 `-------------------------------------------------------------*/
3875 yyerrstatus
= 3; /* Each real token shifted decrements this. */
3879 yyn
= yypact
[yystate
];
3880 if (yyn
!= YYPACT_NINF
)
3883 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
3891 /* Pop the current state because it cannot handle the error token. */
3896 yydestruct ("Error: popping", yystos
[yystate
], yyvsp
);
3899 YY_STACK_PRINT (yyss
, yyssp
);
3908 /* Shift the error token. */
3909 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
3915 /*-------------------------------------.
3916 | yyacceptlab -- YYACCEPT comes here. |
3917 `-------------------------------------*/
3922 /*-----------------------------------.
3923 | yyabortlab -- YYABORT comes here. |
3924 `-----------------------------------*/
3930 /*-------------------------------------------------.
3931 | yyexhaustedlab -- memory exhaustion comes here. |
3932 `-------------------------------------------------*/
3934 yyerror (YY_("memory exhausted"));
3940 if (yychar
!= YYEOF
&& yychar
!= YYEMPTY
)
3941 yydestruct ("Cleanup: discarding lookahead",
3943 while (yyssp
!= yyss
)
3945 yydestruct ("Cleanup: popping",
3946 yystos
[*yyssp
], yyvsp
);
3951 YYSTACK_FREE (yyss
);
3957 #line 976 "parser.y"
3960 static void decl_builtin(const char *name
, unsigned char type
)
3962 type_t
*t
= make_type(type
, NULL
);
3963 t
->name
= xstrdup(name
);
3964 reg_type(t
, name
, 0);
3967 static type_t
*make_builtin(char *name
)
3969 /* NAME is strdup'd in the lexer */
3970 type_t
*t
= duptype(find_type(name
, 0), 0);
3975 static type_t
*make_int(int sign
)
3977 type_t
*t
= duptype(find_type("int", 0), 1);
3981 t
->type
= t
->type
== RPC_FC_LONG
? RPC_FC_ULONG
: RPC_FC_USHORT
;
3986 void init_types(void)
3988 decl_builtin("void", 0);
3989 decl_builtin("byte", RPC_FC_BYTE
);
3990 decl_builtin("wchar_t", RPC_FC_WCHAR
);
3991 decl_builtin("int", RPC_FC_LONG
); /* win32 */
3992 decl_builtin("short", RPC_FC_SHORT
);
3993 decl_builtin("small", RPC_FC_SMALL
);
3994 decl_builtin("long", RPC_FC_LONG
);
3995 decl_builtin("hyper", RPC_FC_HYPER
);
3996 decl_builtin("__int64", RPC_FC_HYPER
);
3997 decl_builtin("char", RPC_FC_CHAR
);
3998 decl_builtin("float", RPC_FC_FLOAT
);
3999 decl_builtin("double", RPC_FC_DOUBLE
);
4000 decl_builtin("boolean", RPC_FC_BYTE
);
4001 decl_builtin("error_status_t", RPC_FC_ERROR_STATUS_T
);
4002 decl_builtin("handle_t", RPC_FC_BIND_PRIMITIVE
);
4005 static str_list_t
*append_str(str_list_t
*list
, char *str
)
4007 struct str_list_entry_t
*entry
;
4009 if (!str
) return list
;
4012 list
= xmalloc( sizeof(*list
) );
4015 entry
= xmalloc( sizeof(*entry
) );
4017 list_add_tail( list
, &entry
->entry
);
4021 static attr_list_t
*append_attr(attr_list_t
*list
, attr_t
*attr
)
4023 attr_t
*attr_existing
;
4024 if (!attr
) return list
;
4027 list
= xmalloc( sizeof(*list
) );
4030 LIST_FOR_EACH_ENTRY(attr_existing
, list
, attr_t
, entry
)
4031 if (attr_existing
->type
== attr
->type
)
4033 parser_warning("duplicate attribute %s\n", get_attr_display_name(attr
->type
));
4034 /* use the last attribute, like MIDL does */
4035 list_remove(&attr_existing
->entry
);
4038 list_add_tail( list
, &attr
->entry
);
4042 static attr_t
*make_attr(enum attr_type type
)
4044 attr_t
*a
= xmalloc(sizeof(attr_t
));
4050 static attr_t
*make_attrv(enum attr_type type
, unsigned long val
)
4052 attr_t
*a
= xmalloc(sizeof(attr_t
));
4058 static attr_t
*make_attrp(enum attr_type type
, void *val
)
4060 attr_t
*a
= xmalloc(sizeof(attr_t
));
4066 static expr_t
*make_expr(enum expr_type type
)
4068 expr_t
*e
= xmalloc(sizeof(expr_t
));
4072 e
->is_const
= FALSE
;
4077 static expr_t
*make_exprl(enum expr_type type
, long val
)
4079 expr_t
*e
= xmalloc(sizeof(expr_t
));
4083 e
->is_const
= FALSE
;
4084 /* check for numeric constant */
4085 if (type
== EXPR_NUM
|| type
== EXPR_HEXNUM
|| type
== EXPR_TRUEFALSE
) {
4086 /* make sure true/false value is valid */
4087 assert(type
!= EXPR_TRUEFALSE
|| val
== 0 || val
== 1);
4094 static expr_t
*make_exprd(enum expr_type type
, double val
)
4096 expr_t
*e
= xmalloc(sizeof(expr_t
));
4105 static expr_t
*make_exprs(enum expr_type type
, char *val
)
4108 e
= xmalloc(sizeof(expr_t
));
4112 e
->is_const
= FALSE
;
4113 /* check for predefined constants */
4114 if (type
== EXPR_IDENTIFIER
) {
4115 var_t
*c
= find_const(val
, 0);
4117 e
->u
.sval
= c
->name
;
4120 e
->cval
= c
->eval
->cval
;
4126 static expr_t
*make_exprt(enum expr_type type
, type_t
*tref
, expr_t
*expr
)
4129 e
= xmalloc(sizeof(expr_t
));
4133 e
->is_const
= FALSE
;
4134 /* check for cast of constant expression */
4135 if (type
== EXPR_SIZEOF
) {
4136 switch (tref
->type
) {
4153 case RPC_FC_ERROR_STATUS_T
:
4164 if (type
== EXPR_CAST
&& expr
->is_const
) {
4166 e
->cval
= expr
->cval
;
4171 static expr_t
*make_expr1(enum expr_type type
, expr_t
*expr
)
4174 if (type
== EXPR_ADDRESSOF
&& expr
->type
!= EXPR_IDENTIFIER
)
4175 error_loc("address-of operator applied to invalid expression\n");
4176 e
= xmalloc(sizeof(expr_t
));
4180 e
->is_const
= FALSE
;
4181 /* check for compile-time optimization */
4182 if (expr
->is_const
) {
4186 e
->cval
= -expr
->cval
;
4189 e
->cval
= ~expr
->cval
;
4192 e
->is_const
= FALSE
;
4199 static expr_t
*make_expr2(enum expr_type type
, expr_t
*expr1
, expr_t
*expr2
)
4202 e
= xmalloc(sizeof(expr_t
));
4206 e
->is_const
= FALSE
;
4207 /* check for compile-time optimization */
4208 if (expr1
->is_const
&& expr2
->is_const
) {
4212 e
->cval
= expr1
->cval
+ expr2
->cval
;
4215 e
->cval
= expr1
->cval
- expr2
->cval
;
4218 e
->cval
= expr1
->cval
* expr2
->cval
;
4221 e
->cval
= expr1
->cval
/ expr2
->cval
;
4224 e
->cval
= expr1
->cval
| expr2
->cval
;
4227 e
->cval
= expr1
->cval
& expr2
->cval
;
4230 e
->cval
= expr1
->cval
<< expr2
->cval
;
4233 e
->cval
= expr1
->cval
>> expr2
->cval
;
4236 e
->is_const
= FALSE
;
4243 static expr_t
*make_expr3(enum expr_type type
, expr_t
*expr1
, expr_t
*expr2
, expr_t
*expr3
)
4246 e
= xmalloc(sizeof(expr_t
));
4251 e
->is_const
= FALSE
;
4252 /* check for compile-time optimization */
4253 if (expr1
->is_const
&& expr2
->is_const
&& expr3
->is_const
) {
4257 e
->cval
= expr1
->cval
? expr2
->cval
: expr3
->cval
;
4260 e
->is_const
= FALSE
;
4267 static expr_list_t
*append_expr(expr_list_t
*list
, expr_t
*expr
)
4269 if (!expr
) return list
;
4272 list
= xmalloc( sizeof(*list
) );
4275 list_add_tail( list
, &expr
->entry
);
4279 static array_dims_t
*append_array(array_dims_t
*list
, expr_t
*expr
)
4281 if (!expr
) return list
;
4284 list
= xmalloc( sizeof(*list
) );
4287 list_add_tail( list
, &expr
->entry
);
4291 static struct list type_pool
= LIST_INIT(type_pool
);
4298 type_t
*alloc_type(void)
4300 type_pool_node_t
*node
= xmalloc(sizeof *node
);
4301 list_add_tail(&type_pool
, &node
->link
);
4305 void set_all_tfswrite(int val
)
4307 type_pool_node_t
*node
;
4308 LIST_FOR_EACH_ENTRY(node
, &type_pool
, type_pool_node_t
, link
)
4309 node
->data
.tfswrite
= val
;
4312 static type_t
*make_type(unsigned char type
, type_t
*ref
)
4314 type_t
*t
= alloc_type();
4316 t
->kind
= TKIND_PRIMITIVE
;
4322 t
->fields_or_args
= NULL
;
4326 t
->length_is
= NULL
;
4327 t
->typestring_offset
= 0;
4329 t
->declarray
= FALSE
;
4330 t
->ignore
= (parse_only
!= 0);
4331 t
->is_const
= FALSE
;
4335 t
->user_types_registered
= FALSE
;
4336 t
->tfswrite
= FALSE
;
4337 t
->typelib_idx
= -1;
4341 static void set_type(var_t
*v
, type_t
*type
, const pident_t
*pident
, array_dims_t
*arr
,
4344 expr_list_t
*sizes
= get_attrp(v
->attrs
, ATTR_SIZEIS
);
4345 expr_list_t
*lengs
= get_attrp(v
->attrs
, ATTR_LENGTHIS
);
4346 int ptr_attr
= get_attrv(v
->attrs
, ATTR_POINTERTYPE
);
4347 int ptr_type
= ptr_attr
;
4348 int sizeless
, has_varconf
;
4350 type_t
*atype
, **ptype
;
4351 int ptr_level
= (pident
? pident
->ptr_level
: 0);
4355 if (!ptr_type
&& top
)
4356 ptr_type
= RPC_FC_RP
;
4358 for ( ; 0 < ptr_level
; --ptr_level
)
4360 v
->type
= make_type(pointer_default
, v
->type
);
4361 if (ptr_level
== 1 && ptr_type
&& !arr
)
4363 v
->type
->type
= ptr_type
;
4368 if (ptr_type
&& !arr
)
4370 if (is_ptr(v
->type
))
4372 if (v
->type
->type
!= ptr_type
)
4374 v
->type
= duptype(v
->type
, 1);
4375 v
->type
->type
= ptr_type
;
4378 else if (!arr
&& ptr_attr
)
4379 error_loc("%s: pointer attribute applied to non-pointer type\n", v
->name
);
4382 if (pident
&& pident
->is_func
) {
4383 int func_ptr_level
= pident
->func_ptr_level
;
4384 v
->type
= make_type(RPC_FC_FUNCTION
, v
->type
);
4385 v
->type
->fields_or_args
= pident
->args
;
4386 if (pident
->callconv
)
4387 v
->type
->attrs
= append_attr(NULL
, make_attrp(ATTR_CALLCONV
, pident
->callconv
));
4388 else if (is_object_interface
) {
4389 static char *stdmethodcalltype
;
4390 if (!stdmethodcalltype
) stdmethodcalltype
= strdup("STDMETHODCALLTYPE");
4391 v
->type
->attrs
= append_attr(NULL
, make_attrp(ATTR_CALLCONV
, stdmethodcalltype
));
4393 for (; func_ptr_level
> 0; func_ptr_level
--)
4394 v
->type
= make_type(ptr_type
, v
->type
);
4398 if (arr
) LIST_FOR_EACH_ENTRY_REV(dim
, arr
, expr_t
, entry
)
4401 error_loc("%s: only the first array dimension can be unspecified\n", v
->name
);
4405 unsigned int align
= 0;
4406 size_t size
= type_memsize(v
->type
, &align
);
4409 error_loc("%s: array dimension must be positive\n", v
->name
);
4411 if (0xffffffffuL
/ size
< (unsigned long) dim
->cval
)
4412 error_loc("%s: total array size is too large\n", v
->name
);
4413 else if (0xffffuL
< size
* dim
->cval
)
4414 v
->type
= make_type(RPC_FC_LGFARRAY
, v
->type
);
4416 v
->type
= make_type(RPC_FC_SMFARRAY
, v
->type
);
4421 v
->type
= make_type(RPC_FC_CARRAY
, v
->type
);
4424 v
->type
->declarray
= TRUE
;
4425 v
->type
->dim
= dim
->cval
;
4429 has_varconf
= FALSE
;
4430 if (sizes
) LIST_FOR_EACH_ENTRY(dim
, sizes
, expr_t
, entry
)
4432 if (dim
->type
!= EXPR_VOID
)
4435 atype
= *ptype
= duptype(*ptype
, 0);
4437 if (atype
->type
== RPC_FC_SMFARRAY
|| atype
->type
== RPC_FC_LGFARRAY
)
4438 error_loc("%s: cannot specify size_is for a fixed sized array\n", v
->name
);
4440 if (atype
->type
!= RPC_FC_CARRAY
&& !is_ptr(atype
))
4441 error_loc("%s: size_is attribute applied to illegal type\n", v
->name
);
4443 atype
->type
= RPC_FC_CARRAY
;
4444 atype
->size_is
= dim
;
4447 ptype
= &(*ptype
)->ref
;
4449 error_loc("%s: too many expressions in size_is attribute\n", v
->name
);
4453 if (lengs
) LIST_FOR_EACH_ENTRY(dim
, lengs
, expr_t
, entry
)
4455 if (dim
->type
!= EXPR_VOID
)
4458 atype
= *ptype
= duptype(*ptype
, 0);
4460 if (atype
->type
== RPC_FC_SMFARRAY
)
4461 atype
->type
= RPC_FC_SMVARRAY
;
4462 else if (atype
->type
== RPC_FC_LGFARRAY
)
4463 atype
->type
= RPC_FC_LGVARRAY
;
4464 else if (atype
->type
== RPC_FC_CARRAY
)
4465 atype
->type
= RPC_FC_CVARRAY
;
4467 error_loc("%s: length_is attribute applied to illegal type\n", v
->name
);
4469 atype
->length_is
= dim
;
4472 ptype
= &(*ptype
)->ref
;
4474 error_loc("%s: too many expressions in length_is attribute\n", v
->name
);
4477 if (has_varconf
&& !last_array(v
->type
))
4480 for (ptype
= &v
->type
; is_array(*ptype
); ptype
= &(*ptype
)->ref
)
4482 *ptype
= duptype(*ptype
, 0);
4483 (*ptype
)->type
= RPC_FC_BOGUS_ARRAY
;
4487 if (is_array(v
->type
))
4489 const type_t
*rt
= v
->type
->ref
;
4490 if (is_user_type(rt
))
4491 v
->type
->type
= RPC_FC_BOGUS_ARRAY
;
4495 case RPC_FC_BOGUS_STRUCT
:
4496 case RPC_FC_NON_ENCAPSULATED_UNION
:
4497 case RPC_FC_ENCAPSULATED_UNION
:
4499 v
->type
->type
= RPC_FC_BOGUS_ARRAY
;
4501 /* FC_RP should be above, but widl overuses these, and will break things. */
4504 if (rt
->ref
->type
== RPC_FC_IP
)
4505 v
->type
->type
= RPC_FC_BOGUS_ARRAY
;
4511 static ifref_list_t
*append_ifref(ifref_list_t
*list
, ifref_t
*iface
)
4513 if (!iface
) return list
;
4516 list
= xmalloc( sizeof(*list
) );
4519 list_add_tail( list
, &iface
->entry
);
4523 static ifref_t
*make_ifref(type_t
*iface
)
4525 ifref_t
*l
= xmalloc(sizeof(ifref_t
));
4531 static var_list_t
*append_var(var_list_t
*list
, var_t
*var
)
4533 if (!var
) return list
;
4536 list
= xmalloc( sizeof(*list
) );
4539 list_add_tail( list
, &var
->entry
);
4543 static var_t
*make_var(char *name
)
4545 var_t
*v
= xmalloc(sizeof(var_t
));
4550 v
->loc_info
.input_name
= input_name
? input_name
: "stdin";
4551 v
->loc_info
.line_number
= line_number
;
4552 v
->loc_info
.near_text
= parser_text
;
4556 static pident_list_t
*append_pident(pident_list_t
*list
, pident_t
*p
)
4558 if (!p
) return list
;
4560 list
= xmalloc(sizeof(*list
));
4563 list_add_tail(list
, &p
->entry
);
4567 static pident_t
*make_pident(var_t
*var
)
4569 pident_t
*p
= xmalloc(sizeof(*p
));
4573 p
->func_ptr_level
= 0;
4579 static func_list_t
*append_func(func_list_t
*list
, func_t
*func
)
4581 if (!func
) return list
;
4584 list
= xmalloc( sizeof(*list
) );
4587 list_add_tail( list
, &func
->entry
);
4591 static func_t
*make_func(var_t
*def
, var_list_t
*args
)
4593 func_t
*f
= xmalloc(sizeof(func_t
));
4596 f
->ignore
= parse_only
;
4601 static type_t
*make_class(char *name
)
4603 type_t
*c
= make_type(0, NULL
);
4605 c
->kind
= TKIND_COCLASS
;
4609 static type_t
*make_safearray(type_t
*type
)
4611 type_t
*sa
= duptype(find_type("SAFEARRAY", 0), 1);
4613 return make_type(pointer_default
, sa
);
4618 static int hash_ident(const char *name
)
4620 const char *p
= name
;
4622 /* a simple sum hash is probably good enough */
4627 return sum
& (HASHMAX
-1);
4630 /***** type repository *****/
4639 struct rtype
*type_hash
[HASHMAX
];
4641 static type_t
*reg_type(type_t
*type
, const char *name
, int t
)
4646 error_loc("registering named type without name\n");
4649 hash
= hash_ident(name
);
4650 nt
= xmalloc(sizeof(struct rtype
));
4654 nt
->next
= type_hash
[hash
];
4655 type_hash
[hash
] = nt
;
4659 static int is_incomplete(const type_t
*t
)
4661 return !t
->defined
&& (is_struct(t
->type
) || is_union(t
->type
));
4664 static void add_incomplete(type_t
*t
)
4666 struct typenode
*tn
= xmalloc(sizeof *tn
);
4668 list_add_tail(&incomplete_types
, &tn
->entry
);
4671 static void fix_type(type_t
*t
)
4673 if (t
->kind
== TKIND_ALIAS
&& is_incomplete(t
)) {
4674 type_t
*ot
= t
->orig
;
4676 t
->fields_or_args
= ot
->fields_or_args
;
4677 t
->defined
= ot
->defined
;
4681 static void fix_incomplete(void)
4683 struct typenode
*tn
, *next
;
4685 LIST_FOR_EACH_ENTRY_SAFE(tn
, next
, &incomplete_types
, struct typenode
, entry
) {
4691 static type_t
*reg_typedefs(type_t
*type
, pident_list_t
*pidents
, attr_list_t
*attrs
)
4694 const pident_t
*pident
;
4696 int is_str
= is_attr(attrs
, ATTR_STRING
);
4697 unsigned char ptr_type
= get_attrv(attrs
, ATTR_POINTERTYPE
);
4708 if (c
!= RPC_FC_CHAR
&& c
!= RPC_FC_BYTE
&& c
!= RPC_FC_WCHAR
)
4710 pident
= LIST_ENTRY( list_head( pidents
), const pident_t
, entry
);
4711 error_loc("'%s': [string] attribute is only valid on 'char', 'byte', or 'wchar_t' pointers and arrays\n",
4716 /* We must generate names for tagless enum, struct or union.
4717 Typedef-ing a tagless enum, struct or union means we want the typedef
4718 to be included in a library whether it has other attributes or not,
4719 hence the public attribute. */
4720 if ((type
->kind
== TKIND_ENUM
|| type
->kind
== TKIND_RECORD
4721 || type
->kind
== TKIND_UNION
) && ! type
->name
&& ! parse_only
)
4723 if (! is_attr(attrs
, ATTR_PUBLIC
))
4724 attrs
= append_attr( attrs
, make_attr(ATTR_PUBLIC
) );
4725 type
->name
= gen_name();
4728 LIST_FOR_EACH_ENTRY( pident
, pidents
, const pident_t
, entry
)
4730 var_t
*name
= pident
->var
;
4734 int cptr
= pident
->ptr_level
;
4736 while (cptr
> ptrc
) {
4737 cur
= ptr
= make_type(pointer_default
, cur
);
4741 while (cptr
< ptrc
) {
4746 if (pident
->is_func
) {
4747 int func_ptr_level
= pident
->func_ptr_level
;
4748 cur
= make_type(RPC_FC_FUNCTION
, cur
);
4749 cur
->fields_or_args
= pident
->args
;
4750 if (pident
->callconv
)
4751 cur
->attrs
= append_attr(NULL
, make_attrp(ATTR_CALLCONV
, pident
->callconv
));
4752 else if (is_object_interface
) {
4753 static char *stdmethodcalltype
;
4754 if (!stdmethodcalltype
) stdmethodcalltype
= strdup("STDMETHODCALLTYPE");
4755 cur
->attrs
= append_attr(NULL
, make_attrp(ATTR_CALLCONV
, stdmethodcalltype
));
4757 for (; func_ptr_level
> 0; func_ptr_level
--)
4758 cur
= make_type(pointer_default
, cur
);
4760 cur
= alias(cur
, name
->name
);
4765 cur
->type
= ptr_type
;
4767 error_loc("'%s': pointer attribute applied to non-pointer type\n",
4770 else if (is_str
&& ! is_ptr(cur
))
4771 error_loc("'%s': [string] attribute applied to non-pointer type\n",
4774 if (is_incomplete(cur
))
4775 add_incomplete(cur
);
4776 reg_type(cur
, cur
->name
, 0);
4782 static type_t
*find_type(const char *name
, int t
)
4784 struct rtype
*cur
= type_hash
[hash_ident(name
)];
4785 while (cur
&& (cur
->t
!= t
|| strcmp(cur
->name
, name
)))
4788 error_loc("type '%s' not found\n", name
);
4794 static type_t
*find_type2(char *name
, int t
)
4796 type_t
*tp
= find_type(name
, t
);
4801 int is_type(const char *name
)
4803 struct rtype
*cur
= type_hash
[hash_ident(name
)];
4804 while (cur
&& (cur
->t
|| strcmp(cur
->name
, name
)))
4806 if (cur
) return TRUE
;
4810 static type_t
*get_type(unsigned char type
, char *name
, int t
)
4812 struct rtype
*cur
= NULL
;
4815 cur
= type_hash
[hash_ident(name
)];
4816 while (cur
&& (cur
->t
!= t
|| strcmp(cur
->name
, name
)))
4823 tp
= make_type(type
, NULL
);
4825 if (!name
) return tp
;
4826 return reg_type(tp
, name
, t
);
4829 static type_t
*get_typev(unsigned char type
, var_t
*name
, int t
)
4836 return get_type(type
, sname
, t
);
4839 static int get_struct_type(var_list_t
*fields
)
4841 int has_pointer
= 0;
4842 int has_conformance
= 0;
4843 int has_variance
= 0;
4846 if (get_padding(fields
))
4847 return RPC_FC_BOGUS_STRUCT
;
4849 if (fields
) LIST_FOR_EACH_ENTRY( field
, fields
, var_t
, entry
)
4851 type_t
*t
= field
->type
;
4853 if (is_user_type(t
))
4854 return RPC_FC_BOGUS_STRUCT
;
4865 case RPC_FC_ENCAPSULATED_UNION
:
4866 case RPC_FC_NON_ENCAPSULATED_UNION
:
4867 case RPC_FC_BOGUS_STRUCT
:
4868 return RPC_FC_BOGUS_STRUCT
;
4875 if (field
->type
->declarray
)
4877 if (is_string_type(field
->attrs
, field
->type
))
4879 if (is_conformant_array(field
->type
))
4880 has_conformance
= 1;
4885 if (is_array(field
->type
->ref
))
4886 return RPC_FC_BOGUS_STRUCT
;
4888 if (is_conformant_array(field
->type
))
4890 has_conformance
= 1;
4891 if (field
->type
->declarray
&& list_next(fields
, &field
->entry
))
4892 error_loc("field '%s' deriving from a conformant array must be the last field in the structure\n",
4895 if (field
->type
->length_is
)
4898 t
= field
->type
->ref
;
4904 * RPC_FC_BYTE, RPC_FC_STRUCT, etc
4905 * Simple types don't effect the type of struct.
4906 * A struct containing a simple struct is still a simple struct.
4907 * So long as we can block copy the data, we return RPC_FC_STRUCT.
4909 case 0: /* void pointer */
4919 case RPC_FC_INT3264
:
4920 case RPC_FC_UINT3264
:
4933 case RPC_FC_CVARRAY
:
4934 case RPC_FC_BOGUS_ARRAY
:
4939 * Propagate member attributes
4940 * a struct should be at least as complex as its member
4942 case RPC_FC_CVSTRUCT
:
4943 has_conformance
= 1;
4948 case RPC_FC_CPSTRUCT
:
4949 has_conformance
= 1;
4950 if (list_next( fields
, &field
->entry
))
4951 error_loc("field '%s' deriving from a conformant array must be the last field in the structure\n",
4956 case RPC_FC_CSTRUCT
:
4957 has_conformance
= 1;
4958 if (list_next( fields
, &field
->entry
))
4959 error_loc("field '%s' deriving from a conformant array must be the last field in the structure\n",
4963 case RPC_FC_PSTRUCT
:
4968 error_loc("Unknown struct member %s with type (0x%02x)\n", field
->name
, t
->type
);
4969 /* fallthru - treat it as complex */
4971 /* as soon as we see one of these these members, it's bogus... */
4972 case RPC_FC_ENCAPSULATED_UNION
:
4973 case RPC_FC_NON_ENCAPSULATED_UNION
:
4974 case RPC_FC_BOGUS_STRUCT
:
4976 return RPC_FC_BOGUS_STRUCT
;
4982 if ( has_conformance
)
4983 return RPC_FC_CVSTRUCT
;
4985 return RPC_FC_BOGUS_STRUCT
;
4987 if( has_conformance
&& has_pointer
)
4988 return RPC_FC_CPSTRUCT
;
4989 if( has_conformance
)
4990 return RPC_FC_CSTRUCT
;
4992 return RPC_FC_PSTRUCT
;
4993 return RPC_FC_STRUCT
;
4996 /***** constant repository *****/
5001 struct rconst
*next
;
5004 struct rconst
*const_hash
[HASHMAX
];
5006 static var_t
*reg_const(var_t
*var
)
5011 error_loc("registering constant without name\n");
5014 hash
= hash_ident(var
->name
);
5015 nc
= xmalloc(sizeof(struct rconst
));
5016 nc
->name
= var
->name
;
5018 nc
->next
= const_hash
[hash
];
5019 const_hash
[hash
] = nc
;
5023 static var_t
*find_const(char *name
, int f
)
5025 struct rconst
*cur
= const_hash
[hash_ident(name
)];
5026 while (cur
&& strcmp(cur
->name
, name
))
5029 if (f
) error_loc("constant '%s' not found\n", name
);
5035 static void write_libid(const char *name
, const attr_list_t
*attr
)
5037 const UUID
*uuid
= get_attrp(attr
, ATTR_UUID
);
5038 write_guid(idfile
, "LIBID", name
, uuid
);
5041 static void write_clsid(type_t
*cls
)
5043 const UUID
*uuid
= get_attrp(cls
->attrs
, ATTR_UUID
);
5044 write_guid(idfile
, "CLSID", cls
->name
, uuid
);
5047 static void write_diid(type_t
*iface
)
5049 const UUID
*uuid
= get_attrp(iface
->attrs
, ATTR_UUID
);
5050 write_guid(idfile
, "DIID", iface
->name
, uuid
);
5053 static void write_iid(type_t
*iface
)
5055 const UUID
*uuid
= get_attrp(iface
->attrs
, ATTR_UUID
);
5056 write_guid(idfile
, "IID", iface
->name
, uuid
);
5059 static int compute_method_indexes(type_t
*iface
)
5065 idx
= compute_method_indexes(iface
->ref
);
5072 LIST_FOR_EACH_ENTRY( f
, iface
->funcs
, func_t
, entry
)
5073 if (! is_callas(f
->def
->attrs
))
5079 static char *gen_name(void)
5081 static const char format
[] = "__WIDL_%s_generated_name_%08lX";
5082 static unsigned long n
= 0;
5083 static const char *file_id
;
5089 char *dst
= dup_basename(input_name
, ".idl");
5093 if (! isalnum((unsigned char) *dst
))
5096 size
= sizeof format
- 7 + strlen(file_id
) + 8;
5099 name
= xmalloc(size
);
5100 sprintf(name
, format
, file_id
, n
++);
5104 static void process_typedefs(pident_list_t
*pidents
)
5106 pident_t
*pident
, *next
;
5108 if (!pidents
) return;
5109 LIST_FOR_EACH_ENTRY_SAFE( pident
, next
, pidents
, pident_t
, entry
)
5111 var_t
*var
= pident
->var
;
5112 type_t
*type
= find_type(var
->name
, 0);
5114 if (! parse_only
&& do_header
)
5115 write_typedef(type
);
5116 if (in_typelib
&& type
->attrs
)
5117 add_typelib_entry(type
);
5126 unsigned int dce_compatible
: 1;
5127 unsigned int acf
: 1;
5128 unsigned int on_interface
: 1;
5129 unsigned int on_function
: 1;
5130 unsigned int on_arg
: 1;
5131 unsigned int on_type
: 1;
5132 unsigned int on_field
: 1;
5133 unsigned int on_library
: 1;
5134 unsigned int on_dispinterface
: 1;
5135 unsigned int on_module
: 1;
5136 unsigned int on_coclass
: 1;
5137 const char *display_name
;
5140 struct allowed_attr allowed_attr
[] =
5142 /* attr { D ACF I Fn ARG T Fi L DI M C <display name> } */
5143 /* ATTR_AGGREGATABLE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "aggregatable" },
5144 /* ATTR_APPOBJECT */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "appobject" },
5145 /* ATTR_ASYNC */ { 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, "async" },
5146 /* ATTR_AUTO_HANDLE */ { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, "auto_handle" },
5147 /* ATTR_BINDABLE */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "bindable" },
5148 /* ATTR_BROADCAST */ { 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "broadcast" },
5149 /* ATTR_CALLAS */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "call_as" },
5150 /* ATTR_CALLCONV */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL
},
5151 /* ATTR_CASE */ { 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, "case" },
5152 /* ATTR_CONTEXTHANDLE */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, "context_handle" },
5153 /* ATTR_CONTROL */ { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, "control" },
5154 /* ATTR_DEFAULT */ { 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, "default" },
5155 /* ATTR_DEFAULTCOLLELEM */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "defaultcollelem" },
5156 /* ATTR_DEFAULTVALUE_EXPR */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, "defaultvalue" },
5157 /* ATTR_DEFAULTVALUE_STRING */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, "defaultvalue" },
5158 /* ATTR_DEFAULTVTABLE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "defaultvtable" },
5159 /* ATTR_DISPINTERFACE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL
},
5160 /* ATTR_DISPLAYBIND */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "displaybind" },
5161 /* ATTR_DLLNAME */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, "dllname" },
5162 /* ATTR_DUAL */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "dual" },
5163 /* ATTR_ENDPOINT */ { 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "endpoint" },
5164 /* ATTR_ENTRY_ORDINAL */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "entry" },
5165 /* ATTR_ENTRY_STRING */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "entry" },
5166 /* ATTR_EXPLICIT_HANDLE */ { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, "explicit_handle" },
5167 /* ATTR_HANDLE */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, "handle" },
5168 /* ATTR_HELPCONTEXT */ { 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, "helpcontext" },
5169 /* ATTR_HELPFILE */ { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, "helpfile" },
5170 /* ATTR_HELPSTRING */ { 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, "helpstring" },
5171 /* ATTR_HELPSTRINGCONTEXT */ { 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, "helpstringcontext" },
5172 /* ATTR_HELPSTRINGDLL */ { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, "helpstringdll" },
5173 /* ATTR_HIDDEN */ { 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, "hidden" },
5174 /* ATTR_ID */ { 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, "id" },
5175 /* ATTR_IDEMPOTENT */ { 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "idempotent" },
5176 /* ATTR_IIDIS */ { 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, "iid_is" },
5177 /* ATTR_IMMEDIATEBIND */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "immediatebind" },
5178 /* ATTR_IMPLICIT_HANDLE */ { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, "implicit_handle" },
5179 /* ATTR_IN */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, "in" },
5180 /* ATTR_INPUTSYNC */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "inputsync" },
5181 /* ATTR_LENGTHIS */ { 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, "length_is" },
5182 /* ATTR_LOCAL */ { 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, "local" },
5183 /* ATTR_NONBROWSABLE */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "nonbrowsable" },
5184 /* ATTR_NONCREATABLE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "noncreatable" },
5185 /* ATTR_NONEXTENSIBLE */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "nonextensible" },
5186 /* ATTR_OBJECT */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "object" },
5187 /* ATTR_ODL */ { 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, "odl" },
5188 /* ATTR_OLEAUTOMATION */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "oleautomation" },
5189 /* ATTR_OPTIONAL */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, "optional" },
5190 /* ATTR_OUT */ { 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, "out" },
5191 /* ATTR_POINTERDEFAULT */ { 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "pointer_default" },
5192 /* ATTR_POINTERTYPE */ { 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, "ref, unique or ptr" },
5193 /* ATTR_PROPGET */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "propget" },
5194 /* ATTR_PROPPUT */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "propput" },
5195 /* ATTR_PROPPUTREF */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "propputref" },
5196 /* ATTR_PUBLIC */ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, "public" },
5197 /* ATTR_RANGE */ { 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, "range" },
5198 /* ATTR_READONLY */ { 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, "readonly" },
5199 /* ATTR_REQUESTEDIT */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "requestedit" },
5200 /* ATTR_RESTRICTED */ { 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, "restricted" },
5201 /* ATTR_RETVAL */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, "retval" },
5202 /* ATTR_SIZEIS */ { 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, "size_is" },
5203 /* ATTR_SOURCE */ { 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, "source" },
5204 /* ATTR_STRICTCONTEXTHANDLE */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "strict_context_handle" },
5205 /* ATTR_STRING */ { 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, "string" },
5206 /* ATTR_SWITCHIS */ { 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, "switch_is" },
5207 /* ATTR_SWITCHTYPE */ { 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, "switch_type" },
5208 /* ATTR_TRANSMITAS */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, "transmit_as" },
5209 /* ATTR_UUID */ { 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, "uuid" },
5210 /* ATTR_V1ENUM */ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, "v1_enum" },
5211 /* ATTR_VARARG */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "vararg" },
5212 /* ATTR_VERSION */ { 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, "version" },
5213 /* ATTR_WIREMARSHAL */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, "wire_marshal" },
5216 const char *get_attr_display_name(enum attr_type type
)
5218 return allowed_attr
[type
].display_name
;
5221 static const attr_list_t
*check_iface_attrs(const char *name
, const attr_list_t
*attrs
)
5224 if (!attrs
) return attrs
;
5225 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
5227 if (!allowed_attr
[attr
->type
].on_interface
)
5228 error_loc("inapplicable attribute %s for interface %s\n",
5229 allowed_attr
[attr
->type
].display_name
, name
);
5234 static attr_list_t
*check_function_attrs(const char *name
, attr_list_t
*attrs
)
5237 if (!attrs
) return attrs
;
5238 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
5240 if (!allowed_attr
[attr
->type
].on_function
)
5241 error_loc("inapplicable attribute %s for function %s\n",
5242 allowed_attr
[attr
->type
].display_name
, name
);
5247 static void check_arg(var_t
*arg
)
5249 const type_t
*t
= arg
->type
;
5252 if (t
->type
== 0 && ! is_var_ptr(arg
))
5253 error_loc("argument '%s' has void type\n", arg
->name
);
5257 LIST_FOR_EACH_ENTRY(attr
, arg
->attrs
, const attr_t
, entry
)
5259 if (!allowed_attr
[attr
->type
].on_arg
)
5260 error_loc("inapplicable attribute %s for argument %s\n",
5261 allowed_attr
[attr
->type
].display_name
, arg
->name
);
5266 static attr_list_t
*check_typedef_attrs(attr_list_t
*attrs
)
5269 if (!attrs
) return attrs
;
5270 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
5272 if (!allowed_attr
[attr
->type
].on_type
)
5273 error_loc("inapplicable attribute %s for typedef\n",
5274 allowed_attr
[attr
->type
].display_name
);
5279 static attr_list_t
*check_field_attrs(const char *name
, attr_list_t
*attrs
)
5282 if (!attrs
) return attrs
;
5283 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
5285 if (!allowed_attr
[attr
->type
].on_field
)
5286 error_loc("inapplicable attribute %s for field %s\n",
5287 allowed_attr
[attr
->type
].display_name
, name
);
5292 static const attr_list_t
*check_library_attrs(const char *name
, const attr_list_t
*attrs
)
5295 if (!attrs
) return attrs
;
5296 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
5298 if (!allowed_attr
[attr
->type
].on_library
)
5299 error_loc("inapplicable attribute %s for library %s\n",
5300 allowed_attr
[attr
->type
].display_name
, name
);
5305 static attr_list_t
*check_dispiface_attrs(const char *name
, attr_list_t
*attrs
)
5308 if (!attrs
) return attrs
;
5309 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
5311 if (!allowed_attr
[attr
->type
].on_dispinterface
)
5312 error_loc("inapplicable attribute %s for dispinterface %s\n",
5313 allowed_attr
[attr
->type
].display_name
, name
);
5318 static const attr_list_t
*check_module_attrs(const char *name
, const attr_list_t
*attrs
)
5321 if (!attrs
) return attrs
;
5322 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
5324 if (!allowed_attr
[attr
->type
].on_module
)
5325 error_loc("inapplicable attribute %s for module %s\n",
5326 allowed_attr
[attr
->type
].display_name
, name
);
5331 static const attr_list_t
*check_coclass_attrs(const char *name
, const attr_list_t
*attrs
)
5334 if (!attrs
) return attrs
;
5335 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
5337 if (!allowed_attr
[attr
->type
].on_coclass
)
5338 error_loc("inapplicable attribute %s for coclass %s\n",
5339 allowed_attr
[attr
->type
].display_name
, name
);
5344 /* checks that arguments for a function make sense for marshalling and unmarshalling */
5345 static void check_remoting_args(const func_t
*func
)
5347 const char *funcname
= func
->def
->name
;
5350 if (func
->args
) LIST_FOR_EACH_ENTRY( arg
, func
->args
, const var_t
, entry
)
5353 const type_t
*type
= arg
->type
;
5354 int is_wire_marshal
= 0;
5355 int is_context_handle
= 0;
5357 /* get pointer level and fundamental type for the argument */
5360 if (!is_wire_marshal
&& is_attr(type
->attrs
, ATTR_WIREMARSHAL
))
5361 is_wire_marshal
= 1;
5362 if (!is_context_handle
&& is_attr(type
->attrs
, ATTR_CONTEXTHANDLE
))
5363 is_context_handle
= 1;
5364 if (type
->kind
== TKIND_ALIAS
)
5366 else if (is_ptr(type
))
5375 /* check that [out] parameters have enough pointer levels */
5376 if (is_attr(arg
->attrs
, ATTR_OUT
))
5378 if (!is_array(type
))
5381 error_loc_info(&arg
->loc_info
, "out parameter \'%s\' of function \'%s\' is not a pointer\n", arg
->name
, funcname
);
5382 if (type
->type
== RPC_FC_IP
&& ptr_level
== 1)
5383 error_loc_info(&arg
->loc_info
, "out interface pointer \'%s\' of function \'%s\' is not a double pointer\n", arg
->name
, funcname
);
5387 if (type
->type
== 0 && !is_attr(arg
->attrs
, ATTR_IIDIS
) && !is_wire_marshal
&& !is_context_handle
)
5388 error_loc_info(&arg
->loc_info
, "parameter \'%s\' of function \'%s\' cannot derive from void *\n", arg
->name
, funcname
);
5389 else if (type
->type
== RPC_FC_FUNCTION
)
5390 error_loc_info(&arg
->loc_info
, "parameter \'%s\' of function \'%s\' cannot be a function pointer\n", arg
->name
, funcname
);
5394 static void check_functions(const type_t
*iface
)
5396 if (!is_inside_library
&& !is_attr(iface
->attrs
, ATTR_LOCAL
))
5399 if (iface
->funcs
) LIST_FOR_EACH_ENTRY( func
, iface
->funcs
, const func_t
, entry
)
5401 if (!is_attr(func
->def
->attrs
, ATTR_LOCAL
))
5402 check_remoting_args(func
);
5407 static void check_all_user_types(ifref_list_t
*ifrefs
)
5409 const ifref_t
*ifref
;
5412 if (ifrefs
) LIST_FOR_EACH_ENTRY(ifref
, ifrefs
, const ifref_t
, entry
)
5414 const func_list_t
*fs
= ifref
->iface
->funcs
;
5415 if (fs
) LIST_FOR_EACH_ENTRY(f
, fs
, const func_t
, entry
)
5416 check_for_additional_prototype_types(f
->args
);
5420 int is_valid_uuid(const char *s
)
5424 for (i
= 0; i
< 36; ++i
)
5425 if (i
== 8 || i
== 13 || i
== 18 || i
== 23)
5431 if (!isxdigit(s
[i
]))
5434 return s
[i
] == '\0';