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,
124 tHELPSTRINGCONTEXT
= 315,
125 tHELPSTRINGDLL
= 316,
131 tIMMEDIATEBIND
= 322,
132 tIMPLICITHANDLE
= 323,
150 tNONEXTENSIBLE
= 341,
153 tOLEAUTOMATION
= 344,
156 tPOINTERDEFAULT
= 347,
178 tSTRICTCONTEXTHANDLE
= 369,
204 #define aIDENTIFIER 258
205 #define aKNOWNTYPE 259
214 #define tAGGREGATABLE 268
215 #define tALLOCATE 269
216 #define tAPPOBJECT 270
218 #define tASYNCUUID 272
219 #define tAUTOHANDLE 273
220 #define tBINDABLE 274
222 #define tBROADCAST 276
224 #define tBYTECOUNT 278
226 #define tCALLBACK 280
232 #define tCOMMSTATUS 286
234 #define tCONTEXTHANDLE 288
235 #define tCONTEXTHANDLENOSERIALIZE 289
236 #define tCONTEXTHANDLESERIALIZE 290
238 #define tCPPQUOTE 292
240 #define tDEFAULTCOLLELEM 294
241 #define tDEFAULTVALUE 295
242 #define tDEFAULTVTABLE 296
243 #define tDISPLAYBIND 297
244 #define tDISPINTERFACE 298
248 #define tENDPOINT 302
251 #define tERRORSTATUST 305
252 #define tEXPLICITHANDLE 306
258 #define tHELPCONTEXT 312
259 #define tHELPFILE 313
260 #define tHELPSTRING 314
261 #define tHELPSTRINGCONTEXT 315
262 #define tHELPSTRINGDLL 316
266 #define tIDEMPOTENT 320
268 #define tIMMEDIATEBIND 322
269 #define tIMPLICITHANDLE 323
271 #define tIMPORTLIB 325
274 #define tINPUTSYNC 328
277 #define tINTERFACE 331
279 #define tLENGTHIS 333
285 #define tNONBROWSABLE 339
286 #define tNONCREATABLE 340
287 #define tNONEXTENSIBLE 341
290 #define tOLEAUTOMATION 344
291 #define tOPTIONAL 345
293 #define tPOINTERDEFAULT 347
294 #define tPROPERTIES 348
297 #define tPROPPUTREF 351
301 #define tREADONLY 355
303 #define tREQUESTEDIT 357
304 #define tRESTRICTED 358
306 #define tSAFEARRAY 360
315 #define tSTRICTCONTEXTHANDLE 369
319 #define tSWITCHIS 373
320 #define tSWITCHTYPE 374
321 #define tTRANSMITAS 375
326 #define tUNSIGNED 380
333 #define tWIREMARSHAL 387
337 #define ADDRESSOF 391
342 /* Copy the first part of user declarations. */
348 * Copyright 2002 Ove Kaaven
350 * This library is free software; you can redistribute it and/or
351 * modify it under the terms of the GNU Lesser General Public
352 * License as published by the Free Software Foundation; either
353 * version 2.1 of the License, or (at your option) any later version.
355 * This library is distributed in the hope that it will be useful,
356 * but WITHOUT ANY WARRANTY; without even the implied warranty of
357 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
358 * Lesser General Public License for more details.
360 * You should have received a copy of the GNU Lesser General Public
361 * License along with this library; if not, write to the Free Software
362 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
385 /* Berkeley yacc (byacc) doesn't seem to know about these */
386 /* Some *BSD supplied versions do define these though */
388 # define YYEMPTY (-1) /* Empty lookahead value of yychar */
391 # define YYLEX yylex()
394 #elif defined(YYBISON)
395 /* Bison was used for original development */
396 /* #define YYEMPTY -2 */
397 /* #define YYLEX yylex() */
400 /* No yacc we know yet */
401 # if !defined(YYEMPTY) || !defined(YYLEX)
402 # error Yacc version/type unknown. This version needs to be verified for settings of YYEMPTY and YYLEX.
403 # elif defined(__GNUC__) /* gcc defines the #warning directive */
404 # warning Yacc version/type unknown. It defines YYEMPTY and YYLEX, but is not tested
405 /* #else we just take a chance that it works... */
409 unsigned char pointer_default
= RPC_FC_UP
;
411 typedef struct list typelist_t
;
417 typelist_t incomplete_types
= LIST_INIT(incomplete_types
);
419 static void add_incomplete(type_t
*t
);
420 static void fix_incomplete(void);
422 static str_list_t
*append_str(str_list_t
*list
, char *str
);
423 static attr_list_t
*append_attr(attr_list_t
*list
, attr_t
*attr
);
424 static attr_t
*make_attr(enum attr_type type
);
425 static attr_t
*make_attrv(enum attr_type type
, unsigned long val
);
426 static attr_t
*make_attrp(enum attr_type type
, void *val
);
427 static expr_t
*make_expr(enum expr_type type
);
428 static expr_t
*make_exprl(enum expr_type type
, long val
);
429 static expr_t
*make_exprd(enum expr_type type
, double val
);
430 static expr_t
*make_exprs(enum expr_type type
, char *val
);
431 static expr_t
*make_exprt(enum expr_type type
, type_t
*tref
, expr_t
*expr
);
432 static expr_t
*make_expr1(enum expr_type type
, expr_t
*expr
);
433 static expr_t
*make_expr2(enum expr_type type
, expr_t
*exp1
, expr_t
*exp2
);
434 static expr_t
*make_expr3(enum expr_type type
, expr_t
*expr1
, expr_t
*expr2
, expr_t
*expr3
);
435 static type_t
*make_type(unsigned char type
, type_t
*ref
);
436 static expr_list_t
*append_expr(expr_list_t
*list
, expr_t
*expr
);
437 static array_dims_t
*append_array(array_dims_t
*list
, expr_t
*expr
);
438 static void set_type(var_t
*v
, type_t
*type
, int ptr_level
, array_dims_t
*arr
, int top
);
439 static ifref_list_t
*append_ifref(ifref_list_t
*list
, ifref_t
*iface
);
440 static ifref_t
*make_ifref(type_t
*iface
);
441 static var_list_t
*append_var(var_list_t
*list
, var_t
*var
);
442 static var_t
*make_var(char *name
);
443 static pident_list_t
*append_pident(pident_list_t
*list
, pident_t
*p
);
444 static pident_t
*make_pident(var_t
*var
);
445 static func_list_t
*append_func(func_list_t
*list
, func_t
*func
);
446 static func_t
*make_func(var_t
*def
, var_list_t
*args
);
447 static type_t
*make_class(char *name
);
448 static type_t
*make_safearray(type_t
*type
);
449 static type_t
*make_builtin(char *name
);
450 static type_t
*make_int(int sign
);
452 static type_t
*reg_type(type_t
*type
, const char *name
, int t
);
453 static type_t
*reg_typedefs(type_t
*type
, var_list_t
*names
, attr_list_t
*attrs
);
454 static type_t
*find_type(const char *name
, int t
);
455 static type_t
*find_type2(char *name
, int t
);
456 static type_t
*get_type(unsigned char type
, char *name
, int t
);
457 static type_t
*get_typev(unsigned char type
, var_t
*name
, int t
);
458 static int get_struct_type(var_list_t
*fields
);
460 static var_t
*reg_const(var_t
*var
);
461 static var_t
*find_const(char *name
, int f
);
463 static void write_libid(const char *name
, const attr_list_t
*attr
);
464 static void write_clsid(type_t
*cls
);
465 static void write_diid(type_t
*iface
);
466 static void write_iid(type_t
*iface
);
468 static int compute_method_indexes(type_t
*iface
);
469 static char *gen_name(void);
470 static void process_typedefs(var_list_t
*names
);
471 static void check_arg(var_t
*arg
);
472 static void check_all_user_types(ifref_list_t
*ifaces
);
480 /* Enabling traces. */
485 /* Enabling verbose error messages. */
486 #ifdef YYERROR_VERBOSE
487 # undef YYERROR_VERBOSE
488 # define YYERROR_VERBOSE 1
490 # define YYERROR_VERBOSE 0
493 /* Enabling the token table. */
494 #ifndef YYTOKEN_TABLE
495 # define YYTOKEN_TABLE 0
498 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
500 typedef union YYSTYPE
{
502 attr_list_t
*attr_list
;
503 str_list_t
*str_list
;
505 expr_list_t
*expr_list
;
506 array_dims_t
*array_dims
;
509 var_list_t
*var_list
;
511 pident_list_t
*pident_list
;
513 func_list_t
*func_list
;
515 ifref_list_t
*ifref_list
;
520 interface_info_t ifinfo
;
522 /* Line 196 of yacc.c. */
523 #line 524 "parser.tab.c"
524 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
525 # define YYSTYPE_IS_DECLARED 1
526 # define YYSTYPE_IS_TRIVIAL 1
531 /* Copy the second part of user declarations. */
534 /* Line 219 of yacc.c. */
535 #line 536 "parser.tab.c"
537 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
538 # define YYSIZE_T __SIZE_TYPE__
540 #if ! defined (YYSIZE_T) && defined (size_t)
541 # define YYSIZE_T size_t
543 #if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus))
544 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
545 # define YYSIZE_T size_t
547 #if ! defined (YYSIZE_T)
548 # define YYSIZE_T unsigned int
554 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
555 # define YY_(msgid) dgettext ("bison-runtime", msgid)
559 # define YY_(msgid) msgid
563 #if ! defined (yyoverflow) || YYERROR_VERBOSE
565 /* The parser invokes alloca or malloc; define the necessary symbols. */
567 # ifdef YYSTACK_USE_ALLOCA
568 # if YYSTACK_USE_ALLOCA
570 # define YYSTACK_ALLOC __builtin_alloca
572 # define YYSTACK_ALLOC alloca
573 # if defined (__STDC__) || defined (__cplusplus)
574 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
575 # define YYINCLUDED_STDLIB_H
581 # ifdef YYSTACK_ALLOC
582 /* Pacify GCC's `empty if-body' warning. */
583 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
584 # ifndef YYSTACK_ALLOC_MAXIMUM
585 /* The OS might guarantee only one guard page at the bottom of the stack,
586 and a page size can be as small as 4096 bytes. So we cannot safely
587 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
588 to allow for a few compiler-allocated temporary stack slots. */
589 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */
592 # define YYSTACK_ALLOC YYMALLOC
593 # define YYSTACK_FREE YYFREE
594 # ifndef YYSTACK_ALLOC_MAXIMUM
595 # define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1)
601 # define YYMALLOC malloc
602 # if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \
603 && (defined (__STDC__) || defined (__cplusplus)))
604 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
609 # if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \
610 && (defined (__STDC__) || defined (__cplusplus)))
611 void free (void *); /* INFRINGES ON USER NAME SPACE */
618 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
621 #if (! defined (yyoverflow) \
622 && (! defined (__cplusplus) \
623 || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
625 /* A type that is properly aligned for any stack member. */
632 /* The size of the maximum gap between one aligned stack and the next. */
633 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
635 /* The size of an array large to enough to hold all stacks, each with
637 # define YYSTACK_BYTES(N) \
638 ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \
639 + YYSTACK_GAP_MAXIMUM)
641 /* Copy COUNT objects from FROM to TO. The source and destination do
644 # if defined (__GNUC__) && 1 < __GNUC__
645 # define YYCOPY(To, From, Count) \
646 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
648 # define YYCOPY(To, From, Count) \
652 for (yyi = 0; yyi < (Count); yyi++) \
653 (To)[yyi] = (From)[yyi]; \
659 /* Relocate STACK from its old location to the new one. The
660 local variables YYSIZE and YYSTACKSIZE give the old and new number of
661 elements in the stack, and YYPTR gives the new location of the
662 stack. Advance YYPTR to a properly aligned location for the next
664 # define YYSTACK_RELOCATE(Stack) \
667 YYSIZE_T yynewbytes; \
668 YYCOPY (&yyptr->Stack, Stack, yysize); \
669 Stack = &yyptr->Stack; \
670 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
671 yyptr += yynewbytes / sizeof (*yyptr); \
677 #if defined (__STDC__) || defined (__cplusplus)
678 typedef signed char yysigned_char
;
680 typedef short int yysigned_char
;
683 /* YYFINAL -- State number of the termination state. */
685 /* YYLAST -- Last index in YYTABLE. */
688 /* YYNTOKENS -- Number of terminals. */
689 #define YYNTOKENS 156
690 /* YYNNTS -- Number of nonterminals. */
692 /* YYNRULES -- Number of rules. */
694 /* YYNRULES -- Number of states. */
695 #define YYNSTATES 500
697 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
699 #define YYMAXUTOK 391
701 #define YYTRANSLATE(YYX) \
702 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
704 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
705 static const unsigned char yytranslate
[] =
707 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
708 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
709 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
710 2, 2, 2, 2, 2, 2, 2, 2, 137, 2,
711 148, 149, 140, 139, 133, 138, 155, 141, 2, 2,
712 2, 2, 2, 2, 2, 2, 2, 2, 135, 147,
713 2, 154, 2, 134, 2, 2, 2, 2, 2, 2,
714 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
715 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
716 2, 152, 2, 153, 2, 2, 2, 2, 2, 2,
717 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
718 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
719 2, 2, 2, 150, 136, 151, 142, 2, 2, 2,
720 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
721 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
722 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
723 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
724 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
725 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
726 2, 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, 2, 2,
730 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
731 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
732 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
733 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
734 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
735 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
736 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
737 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
738 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
739 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
740 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
741 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
742 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
743 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
744 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
745 125, 126, 127, 128, 129, 130, 131, 132, 143, 144,
750 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
752 static const unsigned short int yyprhs
[] =
754 0, 0, 3, 5, 6, 9, 12, 16, 19, 22,
755 25, 28, 29, 32, 35, 39, 42, 45, 48, 51,
756 52, 56, 59, 61, 64, 66, 69, 72, 74, 77,
757 80, 83, 88, 92, 96, 101, 104, 108, 112, 113,
758 115, 117, 119, 123, 125, 130, 134, 141, 147, 148,
759 152, 156, 158, 162, 167, 168, 170, 174, 176, 180,
760 185, 187, 191, 192, 194, 196, 198, 200, 202, 207,
761 212, 214, 216, 218, 220, 222, 224, 229, 234, 236,
762 238, 243, 245, 250, 255, 260, 262, 264, 269, 274,
763 279, 284, 289, 291, 296, 298, 303, 305, 311, 313,
764 315, 320, 322, 324, 326, 328, 330, 332, 334, 336,
765 338, 343, 345, 347, 349, 351, 358, 360, 362, 364,
766 366, 371, 373, 375, 377, 382, 387, 392, 397, 399,
767 401, 406, 411, 413, 415, 417, 418, 420, 421, 424,
768 429, 433, 439, 440, 443, 445, 447, 451, 455, 457,
769 463, 465, 469, 470, 472, 474, 476, 478, 480, 482,
770 484, 490, 494, 498, 502, 506, 510, 514, 518, 522,
771 525, 528, 531, 534, 539, 544, 548, 550, 554, 556,
772 561, 562, 565, 568, 572, 575, 577, 582, 590, 591,
773 593, 594, 596, 598, 600, 602, 604, 606, 608, 611,
774 614, 616, 618, 620, 622, 624, 626, 628, 629, 631,
775 633, 636, 638, 641, 644, 646, 648, 651, 654, 657,
776 662, 663, 666, 669, 672, 675, 678, 681, 685, 688,
777 692, 698, 704, 705, 708, 711, 714, 717, 723, 731,
778 733, 736, 739, 742, 745, 748, 753, 756, 759, 761,
779 763, 767, 769, 773, 775, 777, 779, 785, 787, 789,
780 791, 794, 796, 799, 801, 804, 806, 809, 814, 819,
784 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
785 static const short int yyrhs
[] =
787 157, 0, -1, 158, -1, -1, 158, 219, -1, 158,
788 218, -1, 158, 205, 147, -1, 158, 207, -1, 158,
789 222, -1, 158, 168, -1, 158, 161, -1, -1, 159,
790 219, -1, 159, 218, -1, 159, 205, 147, -1, 159,
791 207, -1, 159, 222, -1, 159, 161, -1, 159, 165,
792 -1, -1, 160, 198, 147, -1, 160, 161, -1, 147,
793 -1, 184, 147, -1, 162, -1, 188, 147, -1, 194,
794 147, -1, 164, -1, 227, 147, -1, 229, 147, -1,
795 230, 147, -1, 37, 148, 8, 149, -1, 69, 8,
796 147, -1, 163, 159, 10, -1, 70, 148, 8, 149,
797 -1, 79, 3, -1, 176, 166, 150, -1, 167, 159,
798 151, -1, -1, 171, -1, 130, -1, 172, -1, 171,
799 133, 172, -1, 170, -1, 176, 228, 224, 173, -1,
800 228, 224, 173, -1, 176, 228, 224, 148, 169, 149,
801 -1, 228, 224, 148, 169, 149, -1, -1, 152, 174,
802 153, -1, 152, 140, 153, -1, 190, -1, 174, 133,
803 191, -1, 174, 153, 152, 191, -1, -1, 176, -1,
804 152, 177, 153, -1, 179, -1, 177, 133, 179, -1,
805 177, 153, 152, 179, -1, 8, -1, 178, 133, 8,
806 -1, -1, 13, -1, 15, -1, 16, -1, 18, -1,
807 19, -1, 24, 148, 201, 149, -1, 26, 148, 192,
808 149, -1, 33, -1, 34, -1, 35, -1, 36, -1,
809 38, -1, 39, -1, 40, 148, 193, 149, -1, 40,
810 148, 8, 149, -1, 41, -1, 42, -1, 44, 148,
811 8, 149, -1, 46, -1, 47, 148, 178, 149, -1,
812 48, 148, 8, 149, -1, 48, 148, 193, 149, -1,
813 51, -1, 55, -1, 57, 148, 193, 149, -1, 58,
814 148, 8, 149, -1, 59, 148, 8, 149, -1, 60,
815 148, 193, 149, -1, 61, 148, 8, 149, -1, 62,
816 -1, 64, 148, 193, 149, -1, 65, -1, 66, 148,
817 191, 149, -1, 67, -1, 68, 148, 56, 3, 149,
818 -1, 71, -1, 73, -1, 78, 148, 189, 149, -1,
819 80, -1, 84, -1, 85, -1, 86, -1, 87, -1,
820 88, -1, 89, -1, 90, -1, 91, -1, 92, 148,
821 226, 149, -1, 94, -1, 95, -1, 96, -1, 98,
822 -1, 99, 148, 193, 133, 193, 149, -1, 100, -1,
823 102, -1, 103, -1, 104, -1, 109, 148, 189, 149,
824 -1, 112, -1, 114, -1, 115, -1, 118, 148, 191,
825 149, -1, 119, 148, 228, 149, -1, 120, 148, 228,
826 149, -1, 126, 148, 180, 149, -1, 127, -1, 128,
827 -1, 129, 148, 231, 149, -1, 132, 148, 228, 149,
828 -1, 226, -1, 9, -1, 8, -1, -1, 113, -1,
829 -1, 182, 183, -1, 26, 191, 135, 196, -1, 38,
830 135, 196, -1, 32, 228, 201, 154, 193, -1, -1,
831 186, 133, -1, 186, -1, 187, -1, 186, 133, 187,
832 -1, 201, 154, 193, -1, 201, -1, 49, 200, 150,
833 185, 151, -1, 190, -1, 189, 133, 190, -1, -1,
834 191, -1, 5, -1, 6, -1, 7, -1, 53, -1,
835 121, -1, 3, -1, 191, 134, 191, 135, 191, -1,
836 191, 136, 191, -1, 191, 137, 191, -1, 191, 139,
837 191, -1, 191, 138, 191, -1, 191, 140, 191, -1,
838 191, 141, 191, -1, 191, 11, 191, -1, 191, 12,
839 191, -1, 142, 191, -1, 138, 191, -1, 137, 191,
840 -1, 140, 191, -1, 148, 228, 149, 191, -1, 110,
841 148, 228, 149, -1, 148, 191, 149, -1, 193, -1,
842 192, 133, 193, -1, 191, -1, 52, 32, 228, 201,
843 -1, -1, 195, 196, -1, 197, 147, -1, 175, 230,
844 147, -1, 176, 147, -1, 147, -1, 175, 228, 224,
845 173, -1, 175, 228, 181, 224, 148, 169, 149, -1,
846 -1, 201, -1, -1, 3, -1, 4, -1, 3, -1,
847 4, -1, 22, -1, 131, -1, 204, -1, 107, 204,
848 -1, 125, 204, -1, 125, -1, 54, -1, 108, -1,
849 45, -1, 20, -1, 50, -1, 56, -1, -1, 74,
850 -1, 74, -1, 106, 203, -1, 111, -1, 81, 203,
851 -1, 63, 203, -1, 75, -1, 28, -1, 29, 3,
852 -1, 29, 4, -1, 176, 205, -1, 206, 150, 208,
853 151, -1, -1, 208, 209, -1, 175, 219, -1, 43,
854 3, -1, 43, 4, -1, 176, 210, -1, 93, 135,
855 -1, 212, 197, 147, -1, 82, 135, -1, 213, 198,
856 147, -1, 211, 150, 212, 213, 151, -1, 211, 150,
857 216, 147, 151, -1, -1, 135, 4, -1, 76, 3,
858 -1, 76, 4, -1, 176, 216, -1, 217, 215, 150,
859 160, 151, -1, 217, 135, 3, 150, 164, 160, 151,
860 -1, 214, -1, 216, 147, -1, 210, 147, -1, 83,
861 3, -1, 83, 4, -1, 176, 220, -1, 221, 150,
862 160, 151, -1, 140, 224, -1, 32, 223, -1, 201,
863 -1, 223, -1, 148, 224, 149, -1, 224, -1, 225,
864 133, 224, -1, 101, -1, 124, -1, 97, -1, 116,
865 200, 150, 195, 151, -1, 130, -1, 4, -1, 202,
866 -1, 32, 228, -1, 188, -1, 49, 3, -1, 227,
867 -1, 116, 3, -1, 230, -1, 123, 3, -1, 105,
868 148, 228, 149, -1, 122, 175, 228, 225, -1, 123,
869 200, 150, 195, 151, -1, 123, 200, 117, 148, 197,
870 149, 199, 150, 182, 151, -1, 5, -1, 5, 155,
874 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
875 static const unsigned short int yyrline
[] =
877 0, 286, 286, 295, 296, 297, 298, 302, 307, 308,
878 309, 312, 313, 314, 315, 316, 320, 321, 322, 325,
879 326, 327, 330, 331, 332, 333, 338, 339, 340, 345,
880 346, 353, 355, 358, 361, 364, 366, 371, 374, 375,
881 378, 381, 382, 383, 387, 392, 396, 402, 409, 410,
882 411, 414, 415, 416, 419, 420, 424, 430, 431, 432,
883 435, 436, 439, 440, 441, 442, 443, 444, 445, 446,
884 447, 448, 449, 450, 451, 452, 453, 454, 455, 456,
885 457, 458, 459, 460, 461, 462, 463, 464, 465, 466,
886 467, 468, 469, 470, 471, 472, 473, 474, 475, 476,
887 477, 478, 479, 480, 481, 482, 483, 484, 485, 486,
888 487, 488, 489, 490, 491, 492, 495, 496, 497, 498,
889 499, 500, 501, 502, 503, 504, 505, 506, 507, 508,
890 509, 510, 511, 515, 516, 521, 522, 525, 526, 529,
891 533, 539, 545, 546, 547, 550, 554, 563, 567, 572,
892 581, 582, 595, 596, 599, 600, 601, 602, 603, 604,
893 605, 606, 607, 608, 609, 610, 611, 612, 613, 614,
894 615, 616, 617, 618, 619, 620, 623, 624, 627, 633,
895 638, 639, 642, 643, 644, 645, 648, 656, 668, 669,
896 672, 673, 674, 677, 679, 682, 683, 684, 685, 686,
897 702, 703, 704, 705, 706, 707, 708, 711, 712, 715,
898 716, 717, 718, 719, 720, 721, 724, 725, 731, 740,
899 746, 747, 751, 754, 755, 758, 770, 771, 774, 775,
900 778, 787, 796, 797, 800, 801, 804, 815, 827, 838,
901 842, 843, 846, 847, 850, 855, 861, 862, 865, 866,
902 867, 871, 872, 876, 877, 878, 881, 892, 893, 894,
903 895, 896, 897, 898, 899, 900, 901, 902, 905, 910,
908 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
909 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
910 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
911 static const char *const yytname
[] =
913 "$end", "error", "$undefined", "aIDENTIFIER", "aKNOWNTYPE", "aNUM",
914 "aHEXNUM", "aDOUBLE", "aSTRING", "aUUID", "aEOF", "SHL", "SHR",
915 "tAGGREGATABLE", "tALLOCATE", "tAPPOBJECT", "tASYNC", "tASYNCUUID",
916 "tAUTOHANDLE", "tBINDABLE", "tBOOLEAN", "tBROADCAST", "tBYTE",
917 "tBYTECOUNT", "tCALLAS", "tCALLBACK", "tCASE", "tCDECL", "tCHAR",
918 "tCOCLASS", "tCODE", "tCOMMSTATUS", "tCONST", "tCONTEXTHANDLE",
919 "tCONTEXTHANDLENOSERIALIZE", "tCONTEXTHANDLESERIALIZE", "tCONTROL",
920 "tCPPQUOTE", "tDEFAULT", "tDEFAULTCOLLELEM", "tDEFAULTVALUE",
921 "tDEFAULTVTABLE", "tDISPLAYBIND", "tDISPINTERFACE", "tDLLNAME",
922 "tDOUBLE", "tDUAL", "tENDPOINT", "tENTRY", "tENUM", "tERRORSTATUST",
923 "tEXPLICITHANDLE", "tEXTERN", "tFALSE", "tFLOAT", "tHANDLE", "tHANDLET",
924 "tHELPCONTEXT", "tHELPFILE", "tHELPSTRING", "tHELPSTRINGCONTEXT",
925 "tHELPSTRINGDLL", "tHIDDEN", "tHYPER", "tID", "tIDEMPOTENT", "tIIDIS",
926 "tIMMEDIATEBIND", "tIMPLICITHANDLE", "tIMPORT", "tIMPORTLIB", "tIN",
927 "tINLINE", "tINPUTSYNC", "tINT", "tINT64", "tINTERFACE", "tLCID",
928 "tLENGTHIS", "tLIBRARY", "tLOCAL", "tLONG", "tMETHODS", "tMODULE",
929 "tNONBROWSABLE", "tNONCREATABLE", "tNONEXTENSIBLE", "tOBJECT", "tODL",
930 "tOLEAUTOMATION", "tOPTIONAL", "tOUT", "tPOINTERDEFAULT", "tPROPERTIES",
931 "tPROPGET", "tPROPPUT", "tPROPPUTREF", "tPTR", "tPUBLIC", "tRANGE",
932 "tREADONLY", "tREF", "tREQUESTEDIT", "tRESTRICTED", "tRETVAL",
933 "tSAFEARRAY", "tSHORT", "tSIGNED", "tSINGLE", "tSIZEIS", "tSIZEOF",
934 "tSMALL", "tSOURCE", "tSTDCALL", "tSTRICTCONTEXTHANDLE", "tSTRING",
935 "tSTRUCT", "tSWITCH", "tSWITCHIS", "tSWITCHTYPE", "tTRANSMITAS", "tTRUE",
936 "tTYPEDEF", "tUNION", "tUNIQUE", "tUNSIGNED", "tUUID", "tV1ENUM",
937 "tVARARG", "tVERSION", "tVOID", "tWCHAR", "tWIREMARSHAL", "','", "'?'",
938 "':'", "'|'", "'&'", "'-'", "'+'", "'*'", "'/'", "'~'", "CAST", "PPTR",
939 "NEG", "ADDRESSOF", "';'", "'('", "')'", "'{'", "'}'", "'['", "']'",
940 "'='", "'.'", "$accept", "input", "gbl_statements", "imp_statements",
941 "int_statements", "statement", "cppquote", "import_start", "import",
942 "importlib", "libraryhdr", "library_start", "librarydef", "m_args",
943 "no_args", "args", "arg", "array", "array_list", "m_attributes",
944 "attributes", "attrib_list", "str_list", "attribute", "uuid_string",
945 "callconv", "cases", "case", "constdef", "enums", "enum_list", "enum",
946 "enumdef", "m_exprs", "m_expr", "expr", "expr_list_const", "expr_const",
947 "externdef", "fields", "field", "s_field", "funcdef", "m_ident",
948 "t_ident", "ident", "base_type", "m_int", "int_std", "coclass",
949 "coclasshdr", "coclassdef", "coclass_ints", "coclass_int",
950 "dispinterface", "dispinterfacehdr", "dispint_props", "dispint_meths",
951 "dispinterfacedef", "inherit", "interface", "interfacehdr",
952 "interfacedef", "interfacedec", "module", "modulehdr", "moduledef",
953 "p_ident", "pident", "pident_list", "pointer_type", "structdef", "type",
954 "typedef", "uniondef", "version", 0
959 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
961 static const unsigned short int yytoknum
[] =
963 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
964 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
965 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
966 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
967 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
968 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
969 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
970 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
971 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
972 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
973 355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
974 365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
975 375, 376, 377, 378, 379, 380, 381, 382, 383, 384,
976 385, 386, 387, 44, 63, 58, 124, 38, 45, 43,
977 42, 47, 126, 388, 389, 390, 391, 59, 40, 41,
978 123, 125, 91, 93, 61, 46
982 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
983 static const unsigned char yyr1
[] =
985 0, 156, 157, 158, 158, 158, 158, 158, 158, 158,
986 158, 159, 159, 159, 159, 159, 159, 159, 159, 160,
987 160, 160, 161, 161, 161, 161, 161, 161, 161, 161,
988 161, 162, 163, 164, 165, 166, 167, 168, 169, 169,
989 170, 171, 171, 171, 172, 172, 172, 172, 173, 173,
990 173, 174, 174, 174, 175, 175, 176, 177, 177, 177,
991 178, 178, 179, 179, 179, 179, 179, 179, 179, 179,
992 179, 179, 179, 179, 179, 179, 179, 179, 179, 179,
993 179, 179, 179, 179, 179, 179, 179, 179, 179, 179,
994 179, 179, 179, 179, 179, 179, 179, 179, 179, 179,
995 179, 179, 179, 179, 179, 179, 179, 179, 179, 179,
996 179, 179, 179, 179, 179, 179, 179, 179, 179, 179,
997 179, 179, 179, 179, 179, 179, 179, 179, 179, 179,
998 179, 179, 179, 180, 180, 181, 181, 182, 182, 183,
999 183, 184, 185, 185, 185, 186, 186, 187, 187, 188,
1000 189, 189, 190, 190, 191, 191, 191, 191, 191, 191,
1001 191, 191, 191, 191, 191, 191, 191, 191, 191, 191,
1002 191, 191, 191, 191, 191, 191, 192, 192, 193, 194,
1003 195, 195, 196, 196, 196, 196, 197, 198, 199, 199,
1004 200, 200, 200, 201, 201, 202, 202, 202, 202, 202,
1005 202, 202, 202, 202, 202, 202, 202, 203, 203, 204,
1006 204, 204, 204, 204, 204, 204, 205, 205, 206, 207,
1007 208, 208, 209, 210, 210, 211, 212, 212, 213, 213,
1008 214, 214, 215, 215, 216, 216, 217, 218, 218, 218,
1009 219, 219, 220, 220, 221, 222, 223, 223, 224, 224,
1010 224, 225, 225, 226, 226, 226, 227, 228, 228, 228,
1011 228, 228, 228, 228, 228, 228, 228, 228, 229, 230,
1015 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
1016 static const unsigned char yyr2
[] =
1018 0, 2, 1, 0, 2, 2, 3, 2, 2, 2,
1019 2, 0, 2, 2, 3, 2, 2, 2, 2, 0,
1020 3, 2, 1, 2, 1, 2, 2, 1, 2, 2,
1021 2, 4, 3, 3, 4, 2, 3, 3, 0, 1,
1022 1, 1, 3, 1, 4, 3, 6, 5, 0, 3,
1023 3, 1, 3, 4, 0, 1, 3, 1, 3, 4,
1024 1, 3, 0, 1, 1, 1, 1, 1, 4, 4,
1025 1, 1, 1, 1, 1, 1, 4, 4, 1, 1,
1026 4, 1, 4, 4, 4, 1, 1, 4, 4, 4,
1027 4, 4, 1, 4, 1, 4, 1, 5, 1, 1,
1028 4, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1029 4, 1, 1, 1, 1, 6, 1, 1, 1, 1,
1030 4, 1, 1, 1, 4, 4, 4, 4, 1, 1,
1031 4, 4, 1, 1, 1, 0, 1, 0, 2, 4,
1032 3, 5, 0, 2, 1, 1, 3, 3, 1, 5,
1033 1, 3, 0, 1, 1, 1, 1, 1, 1, 1,
1034 5, 3, 3, 3, 3, 3, 3, 3, 3, 2,
1035 2, 2, 2, 4, 4, 3, 1, 3, 1, 4,
1036 0, 2, 2, 3, 2, 1, 4, 7, 0, 1,
1037 0, 1, 1, 1, 1, 1, 1, 1, 2, 2,
1038 1, 1, 1, 1, 1, 1, 1, 0, 1, 1,
1039 2, 1, 2, 2, 1, 1, 2, 2, 2, 4,
1040 0, 2, 2, 2, 2, 2, 2, 3, 2, 3,
1041 5, 5, 0, 2, 2, 2, 2, 5, 7, 1,
1042 2, 2, 2, 2, 2, 4, 2, 2, 1, 1,
1043 3, 1, 3, 1, 1, 1, 5, 1, 1, 1,
1044 2, 1, 2, 1, 2, 1, 2, 4, 4, 5,
1048 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
1049 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
1050 means the default is an error. */
1051 static const unsigned short int yydefact
[] =
1053 3, 0, 2, 1, 0, 0, 0, 0, 190, 0,
1054 0, 0, 190, 54, 190, 22, 62, 10, 24, 11,
1055 27, 11, 9, 0, 0, 0, 0, 0, 0, 7,
1056 0, 0, 239, 0, 232, 5, 4, 0, 8, 0,
1057 0, 0, 216, 217, 258, 204, 195, 215, 0, 203,
1058 190, 205, 201, 206, 207, 209, 214, 207, 0, 207,
1059 0, 202, 211, 190, 190, 200, 257, 196, 261, 259,
1060 197, 263, 0, 265, 0, 223, 224, 191, 192, 0,
1061 0, 0, 234, 235, 0, 0, 55, 0, 63, 64,
1062 65, 66, 67, 0, 0, 70, 71, 72, 73, 74,
1063 75, 0, 78, 79, 0, 81, 0, 0, 85, 86,
1064 0, 0, 0, 0, 0, 92, 0, 94, 0, 96,
1065 0, 98, 99, 0, 101, 102, 103, 104, 105, 106,
1066 107, 108, 109, 0, 111, 112, 113, 255, 114, 0,
1067 116, 253, 117, 118, 119, 0, 121, 122, 123, 0,
1068 0, 0, 254, 0, 128, 129, 0, 0, 0, 57,
1069 132, 0, 0, 0, 0, 0, 218, 225, 236, 244,
1070 23, 25, 26, 6, 220, 241, 0, 240, 0, 0,
1071 19, 28, 29, 30, 260, 262, 208, 213, 212, 0,
1072 210, 198, 264, 266, 199, 193, 194, 0, 0, 142,
1073 0, 32, 180, 0, 0, 180, 0, 0, 0, 0,
1074 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1075 152, 0, 0, 152, 0, 0, 0, 0, 0, 0,
1076 62, 56, 33, 0, 17, 18, 0, 0, 15, 13,
1077 12, 16, 37, 35, 242, 243, 36, 54, 0, 54,
1078 0, 0, 233, 19, 54, 0, 0, 31, 0, 144,
1079 145, 148, 179, 54, 0, 0, 0, 248, 249, 251,
1080 268, 54, 54, 0, 159, 154, 155, 156, 157, 0,
1081 158, 0, 0, 0, 0, 0, 178, 0, 176, 0,
1082 0, 0, 60, 0, 0, 0, 0, 0, 0, 0,
1083 0, 0, 0, 0, 0, 150, 153, 0, 0, 0,
1084 0, 0, 0, 134, 133, 0, 271, 0, 0, 58,
1085 62, 0, 14, 219, 0, 221, 226, 0, 0, 0,
1086 54, 0, 0, 54, 245, 21, 0, 0, 267, 141,
1087 149, 143, 0, 185, 256, 0, 55, 181, 0, 247,
1088 246, 0, 0, 0, 269, 68, 0, 171, 170, 172,
1089 169, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1090 0, 0, 0, 69, 77, 76, 80, 0, 82, 83,
1091 84, 87, 88, 89, 90, 91, 93, 95, 0, 152,
1092 100, 110, 0, 120, 124, 125, 126, 127, 0, 130,
1093 131, 59, 0, 222, 228, 0, 227, 230, 0, 231,
1094 19, 237, 135, 20, 146, 147, 265, 184, 182, 250,
1095 252, 188, 0, 175, 0, 167, 168, 0, 161, 162,
1096 164, 163, 165, 166, 177, 61, 97, 151, 0, 272,
1097 34, 48, 229, 54, 136, 0, 183, 0, 189, 174,
1098 173, 0, 115, 152, 186, 238, 0, 137, 160, 0,
1099 0, 51, 38, 0, 50, 0, 49, 257, 0, 43,
1100 39, 41, 0, 0, 0, 0, 270, 138, 52, 0,
1101 187, 0, 0, 48, 0, 54, 53, 42, 48, 38,
1102 45, 54, 140, 38, 44, 0, 139, 0, 47, 46
1105 /* YYDEFGOTO[NTERM-NUM]. */
1106 static const short int yydefgoto
[] =
1108 -1, 1, 2, 161, 254, 335, 18, 19, 20, 235,
1109 165, 21, 22, 468, 469, 470, 471, 454, 460, 336,
1110 86, 158, 293, 159, 315, 445, 463, 477, 24, 258,
1111 259, 260, 68, 304, 305, 286, 287, 288, 26, 263,
1112 347, 348, 337, 447, 79, 267, 69, 187, 70, 166,
1113 28, 238, 247, 325, 30, 31, 249, 330, 32, 179,
1114 33, 34, 239, 240, 169, 37, 241, 268, 269, 270,
1115 160, 71, 473, 40, 73, 317
1118 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1120 #define YYPACT_NINF -446
1121 static const short int yypact
[] =
1123 -446, 35, 724, -446, 46, 664, -106, 102, 146, 85,
1124 84, 186, 146, -18, 146, -446, 887, -446, -446, -446,
1125 -446, -446, -446, 40, 0, 22, 25, 44, -10, -446,
1126 54, 37, -446, 80, 58, -446, -446, 82, -446, 92,
1127 94, 97, -446, -446, -446, -446, -446, -446, 664, -446,
1128 200, -446, -446, -446, 77, -446, -446, 77, 104, 77,
1129 205, -446, -446, 202, 214, 205, -446, -446, -446, -446,
1130 -446, -446, 227, -446, 248, -446, -446, -446, -446, 110,
1131 664, 118, -446, -446, 117, 664, -446, -96, -446, -446,
1132 -446, -446, -446, 121, 129, -446, -446, -446, -446, -446,
1133 -446, 136, -446, -446, 154, -446, 156, 157, -446, -446,
1134 158, 159, 160, 162, 164, -446, 166, -446, 167, -446,
1135 170, -446, -446, 174, -446, -446, -446, -446, -446, -446,
1136 -446, -446, -446, 175, -446, -446, -446, -446, -446, 177,
1137 -446, -446, -446, -446, -446, 179, -446, -446, -446, 181,
1138 185, 191, -446, 192, -446, -446, 194, 195, -95, -446,
1139 -446, 72, 674, 344, 231, 198, -446, -446, -446, -446,
1140 -446, -446, -446, -446, -446, -446, -42, -446, 270, 199,
1141 -446, -446, -446, -446, -446, 204, -446, -446, -446, 664,
1142 -446, -446, 204, -93, -446, -446, -446, 196, 208, 227,
1143 227, -446, -446, 13, 210, -446, 227, 314, 243, 351,
1144 352, 292, 314, 353, 355, 314, 357, 314, 314, 310,
1145 314, -71, 314, 314, 314, 664, 664, 267, 363, 664,
1146 887, 217, -446, 222, -446, -446, 31, 224, -446, -446,
1147 -446, -446, -446, -446, -446, -446, -446, 131, 237, -63,
1148 226, 225, -446, -446, 663, 228, 314, -446, 223, 249,
1149 -446, 230, -446, -72, -7, 13, 13, -446, -446, -446,
1150 257, -18, -25, 244, -446, -446, -446, -446, -446, 246,
1151 -446, 314, 314, 314, 314, 511, 367, -85, -446, 247,
1152 250, 251, -446, -61, 252, 254, 256, 258, 259, 260,
1153 261, 265, 282, 373, -56, -446, 367, 266, 262, -46,
1154 474, 268, 277, -446, -446, 278, 273, 287, 288, -446,
1155 887, 390, -446, -446, -14, -446, -446, 303, 664, 295,
1156 137, 294, 370, 697, -446, -446, 664, 300, -446, -446,
1157 -446, 227, 314, -446, -446, 664, 308, -446, 311, -446,
1158 -446, 301, 13, 318, -446, -446, 664, -446, -446, -446,
1159 -446, 524, 320, 314, 314, 314, 314, 314, 314, 314,
1160 314, 314, 314, -446, -446, -446, -446, 449, -446, -446,
1161 -446, -446, -446, -446, -446, -446, -446, -446, 323, 314,
1162 -446, -446, 314, -446, -446, -446, -446, -446, 454, -446,
1163 -446, -446, 324, -446, -446, 13, -446, -446, 327, -446,
1164 -446, -446, 365, -446, -446, -446, 333, -446, -446, -446,
1165 -446, 227, 332, -446, 314, -446, -446, 73, 59, 16,
1166 -3, -3, 279, 279, -446, -446, -446, -446, 339, -446,
1167 -446, 338, -446, 785, -446, 13, -446, 342, -446, -446,
1168 -446, 314, -446, 458, -446, -446, 345, -446, 367, 105,
1169 -86, -446, 281, -6, -446, 314, 346, -31, 348, -446,
1170 361, -446, 664, 13, 314, 364, -446, -446, 367, 314,
1171 -446, 421, 13, -20, 542, -84, 367, -446, -17, 281,
1172 -446, -84, -446, 281, -446, 360, -446, 371, -446, -446
1175 /* YYPGOTO[NTERM-NUM]. */
1176 static const short int yypgoto
[] =
1178 -446, -446, -446, 479, -235, 9, -446, -446, 178, -446,
1179 -446, -446, -446, -350, -446, -446, 32, -410, -446, -9,
1180 -2, -446, -446, -207, -446, -446, -446, -446, -446, -446,
1181 -446, 171, 3, 296, -367, -187, -446, -156, -446, 316,
1182 -445, -206, 193, -446, 27, -70, -446, 87, 60, 12,
1183 -446, 520, -446, -446, -13, -446, -446, -446, -446, -446,
1184 -8, -446, 522, 4, -446, -446, 523, 274, -253, -446,
1185 309, 5, -4, -446, 1, -446
1188 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
1189 positive, shift that token. If negative, reduce the rule which
1190 number is the opposite. If zero, do what YYDEFACT says.
1191 If YYTABLE_NINF, syntax error. */
1192 #define YYTABLE_NINF -192
1193 static const short int yytable
[] =
1195 23, 72, 197, 41, 85, 25, 36, 39, 363, 364,
1196 167, 17, 350, 351, 27, 168, 195, 196, 333, 327,
1197 474, 204, 437, 319, -191, 264, 137, 363, 364, 7,
1198 141, 302, 475, 306, 11, 3, 306, 310, 230, 84,
1199 492, 87, 74, 329, 184, 264, 496, 465, 372, 42,
1200 43, 248, 290, 152, 205, 295, 296, -191, 231, 299,
1201 4, 301, 11, 343, 373, 353, 308, 466, 16, 4,
1202 363, 364, 377, 490, 7, 343, 200, 389, 494, 344,
1203 16, 203, 232, 7, 363, 364, 461, 389, 378, 16,
1204 84, 87, 81, 390, 357, 358, 359, 360, 361, 420,
1205 339, 4, -40, 393, 5, 75, 76, 11, 274, 6,
1206 275, 276, 277, 401, 164, 7, 11, 80, -40, 163,
1207 191, 8, 343, 164, 9, 194, 354, 16, 489, 261,
1208 262, 493, 453, 265, 16, 453, 273, 370, 371, 495,
1209 174, 10, 233, 497, 188, 476, 190, 170, 11, 77,
1210 78, 186, 441, 265, 368, 369, 370, 371, 278, 236,
1211 236, 266, 41, 41, 25, 25, 39, 39, 250, 171,
1212 234, 234, 172, 237, 237, 443, 425, 426, 427, 428,
1213 429, 430, 431, 432, 433, 255, 415, 176, 12, 82,
1214 83, 173, 456, 178, 13, 14, 367, 368, 369, 370,
1215 371, 175, 306, 185, 78, 192, 78, 365, 451, 366,
1216 367, 368, 369, 370, 371, 279, 434, 193, 78, 15,
1217 483, 311, 312, 167, 16, 318, 280, 177, 168, 488,
1218 195, 196, 180, 47, 244, 245, 438, 450, 324, 181,
1219 328, 182, 281, 282, 183, 283, 274, 284, 275, 276,
1220 277, 289, 189, 285, 345, 41, 198, 25, 464, 39,
1221 199, 346, 328, 345, 458, 201, 306, 202, 54, 206,
1222 346, 261, 359, 251, 252, 313, 314, 207, 478, 55,
1223 56, 362, 323, 16, 208, 44, 57, 484, 407, 16,
1224 363, 364, 486, 363, 364, 274, 278, 275, 276, 277,
1225 294, 45, 209, 46, 210, 211, 212, 213, 214, 47,
1226 215, 59, 216, 48, 217, 218, 62, 274, 219, 275,
1227 276, 277, 220, 221, 405, 222, 49, 223, 403, 224,
1228 50, 51, 412, 225, 41, 52, 25, 53, 39, 226,
1229 227, 405, 228, 229, 54, 278, 416, 243, 246, 253,
1230 256, 448, 422, 279, -191, 55, 56, 257, 271, 291,
1231 292, 297, 57, 298, 280, 300, 303, 278, 316, 320,
1232 321, 322, 326, 331, 340, 332, 388, 338, 363, 364,
1233 281, 282, 341, 283, 342, 284, 58, 59, 60, 61,
1234 352, 285, 62, 355, 356, 392, 374, 63, 402, 375,
1235 376, 379, 279, 380, 64, 381, 65, 382, 383, 384,
1236 385, 467, 67, 280, 386, 391, 365, 395, 366, 367,
1237 368, 369, 370, 371, 279, 44, 396, 397, 398, 281,
1238 282, 387, 283, 16, 284, 280, 399, 400, 404, 10,
1239 285, 45, 406, 46, 41, 409, 25, 413, 39, 47,
1240 419, 281, 282, 48, 283, 417, 284, 435, 418, 439,
1241 472, 274, 285, 275, 276, 277, 49, 421, 482, 424,
1242 50, 51, 436, 440, 442, 52, 345, 53, 444, 472,
1243 446, 449, 345, 346, 54, 363, 364, 472, 452, 346,
1244 453, 472, 457, 462, 481, 55, 56, 480, 479, 485,
1245 162, 365, 57, 366, 367, 368, 369, 370, 371, 498,
1246 410, 278, 414, 487, 274, 44, 275, 276, 277, 309,
1247 499, 272, 29, 408, 35, 38, 58, 59, 60, 61,
1248 307, 45, 62, 46, 0, 363, 364, 63, 349, 47,
1249 0, 0, 0, 48, 64, 0, 65, 0, 0, 0,
1250 0, 66, 67, 363, 364, 0, 49, 0, 0, 0,
1251 50, 51, 0, 0, 278, 52, 0, 53, 279, 0,
1252 0, 0, 0, 16, 54, 0, 0, 0, 0, 280,
1253 0, 0, 0, 0, 0, 55, 56, 0, 0, 0,
1254 0, 0, 57, 0, 0, 281, 282, 0, 459, 0,
1255 284, 0, 0, 0, 0, 0, 285, 0, 365, 0,
1256 366, 367, 368, 369, 370, 371, 58, 59, 60, 61,
1257 0, 279, 62, 394, 0, 0, 0, 63, 0, 0,
1258 0, 0, 280, 0, 64, 0, 65, 0, 0, 0,
1259 0, 66, 67, 0, 0, 0, 0, 0, 281, 282,
1260 0, 283, 0, 284, 0, 0, 0, 0, 365, 285,
1261 366, 367, 368, 369, 370, 371, 0, 0, 44, 0,
1262 0, 0, 0, 423, 0, 0, 365, 491, 366, 367,
1263 368, 369, 370, 371, 45, 0, 46, 0, 0, 0,
1264 0, 0, 47, 0, 0, 5, 48, 0, 0, 0,
1265 6, 0, 0, 4, 0, 0, 5, 0, 0, 49,
1266 0, 6, 8, 50, 51, 9, 0, 7, 52, 0,
1267 53, 0, 0, 8, 0, 0, 9, 54, 0, 5,
1268 0, 0, 10, 0, 6, 0, 0, 0, 55, 56,
1269 0, 0, 0, 10, 233, 57, 8, 0, 0, 9,
1270 11, 0, 0, 4, 0, 0, 5, 0, 0, 0,
1271 0, 6, 0, 0, 0, 0, 10, 7, 0, 58,
1272 59, 60, 61, 8, 0, 62, 9, 0, 0, 12,
1273 63, 0, 0, 0, 0, 13, 14, 64, 0, 65,
1274 12, 0, 0, 10, 66, 67, 13, 14, 0, 0,
1275 11, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1276 15, 0, 0, 12, 334, 16, 0, 5, 0, 13,
1277 14, 15, 6, 0, 0, 242, 16, 0, 0, 0,
1278 0, 0, 0, 0, 8, 0, 0, 9, 0, 0,
1279 12, 0, 0, 0, 15, 0, 13, 14, 411, 16,
1280 0, 0, 0, 0, 10, 0, 0, 0, 0, 0,
1281 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1282 0, 15, 0, 0, 0, 0, 16, 0, 0, 0,
1283 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1284 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1285 88, 12, 89, 90, 0, 91, 92, 13, 14, 0,
1286 0, 93, 0, 94, 0, 0, 0, 0, 0, 0,
1287 95, 96, 97, 98, 0, 99, 100, 101, 102, 103,
1288 0, 104, 15, 105, 106, 107, 455, 16, 108, 0,
1289 0, 0, 109, 0, 110, 111, 112, 113, 114, 115,
1290 0, 116, 117, 118, 119, 120, 0, 0, 121, 0,
1291 122, 0, 0, 0, 0, 123, 0, 124, 0, 0,
1292 0, 125, 126, 127, 128, 129, 130, 131, 132, 133,
1293 0, 134, 135, 136, 137, 138, 139, 140, 141, 142,
1294 143, 144, 0, 0, 0, 0, 145, 0, 0, 146,
1295 0, 147, 148, 0, 0, 149, 150, 151, 0, 0,
1296 0, 152, 0, 153, 154, 155, 156, 0, 0, 157
1299 static const short int yycheck
[] =
1301 2, 5, 72, 2, 13, 2, 2, 2, 11, 12,
1302 23, 2, 265, 266, 2, 23, 3, 4, 253, 82,
1303 26, 117, 389, 230, 117, 32, 97, 11, 12, 43,
1304 101, 218, 38, 220, 76, 0, 223, 224, 133, 12,
1305 485, 14, 148, 249, 48, 32, 491, 133, 133, 3,
1306 4, 93, 208, 124, 150, 211, 212, 150, 153, 215,
1307 29, 217, 76, 147, 149, 271, 222, 153, 152, 29,
1308 11, 12, 133, 483, 43, 147, 80, 133, 488, 151,
1309 152, 85, 10, 43, 11, 12, 453, 133, 149, 152,
1310 63, 64, 8, 149, 281, 282, 283, 284, 285, 352,
1311 256, 29, 133, 149, 32, 3, 4, 76, 3, 37,
1312 5, 6, 7, 320, 83, 43, 76, 32, 149, 79,
1313 60, 49, 147, 83, 52, 65, 151, 152, 148, 199,
1314 200, 148, 152, 140, 152, 152, 206, 140, 141, 489,
1315 150, 69, 70, 493, 57, 151, 59, 147, 76, 3,
1316 4, 74, 405, 140, 138, 139, 140, 141, 53, 161,
1317 162, 148, 161, 162, 161, 162, 161, 162, 176, 147,
1318 161, 162, 147, 161, 162, 410, 363, 364, 365, 366,
1319 367, 368, 369, 370, 371, 189, 342, 150, 116, 3,
1320 4, 147, 445, 135, 122, 123, 137, 138, 139, 140,
1321 141, 147, 389, 3, 4, 3, 4, 134, 135, 136,
1322 137, 138, 139, 140, 141, 110, 372, 3, 4, 147,
1323 473, 225, 226, 236, 152, 229, 121, 147, 236, 482,
1324 3, 4, 150, 28, 3, 4, 392, 424, 247, 147,
1325 249, 147, 137, 138, 147, 140, 3, 142, 5, 6,
1326 7, 8, 148, 148, 263, 254, 8, 254, 153, 254,
1327 150, 263, 271, 272, 451, 147, 453, 150, 63, 148,
1328 272, 341, 459, 3, 4, 8, 9, 148, 465, 74,
1329 75, 285, 151, 152, 148, 4, 81, 474, 151, 152,
1330 11, 12, 479, 11, 12, 3, 53, 5, 6, 7,
1331 8, 20, 148, 22, 148, 148, 148, 148, 148, 28,
1332 148, 106, 148, 32, 148, 148, 111, 3, 148, 5,
1333 6, 7, 148, 148, 328, 148, 45, 148, 324, 148,
1334 49, 50, 336, 148, 333, 54, 333, 56, 333, 148,
1335 148, 345, 148, 148, 63, 53, 345, 3, 150, 150,
1336 154, 421, 356, 110, 150, 74, 75, 149, 148, 8,
1337 8, 8, 81, 8, 121, 8, 56, 53, 5, 152,
1338 148, 147, 135, 147, 151, 150, 3, 149, 11, 12,
1339 137, 138, 133, 140, 154, 142, 105, 106, 107, 108,
1340 133, 148, 111, 149, 148, 133, 149, 116, 8, 149,
1341 149, 149, 110, 149, 123, 149, 125, 149, 149, 149,
1342 149, 130, 131, 121, 149, 149, 134, 149, 136, 137,
1343 138, 139, 140, 141, 110, 4, 149, 149, 155, 137,
1344 138, 149, 140, 152, 142, 121, 149, 149, 135, 69,
1345 148, 20, 147, 22, 443, 151, 443, 147, 443, 28,
1346 149, 137, 138, 32, 140, 147, 142, 8, 147, 5,
1347 462, 3, 148, 5, 6, 7, 45, 149, 472, 149,
1348 49, 50, 149, 149, 147, 54, 485, 56, 113, 481,
1349 147, 149, 491, 485, 63, 11, 12, 489, 149, 491,
1350 152, 493, 150, 148, 133, 74, 75, 149, 152, 135,
1351 21, 134, 81, 136, 137, 138, 139, 140, 141, 149,
1352 332, 53, 341, 481, 3, 4, 5, 6, 7, 223,
1353 149, 205, 2, 330, 2, 2, 105, 106, 107, 108,
1354 221, 20, 111, 22, -1, 11, 12, 116, 264, 28,
1355 -1, -1, -1, 32, 123, -1, 125, -1, -1, -1,
1356 -1, 130, 131, 11, 12, -1, 45, -1, -1, -1,
1357 49, 50, -1, -1, 53, 54, -1, 56, 110, -1,
1358 -1, -1, -1, 152, 63, -1, -1, -1, -1, 121,
1359 -1, -1, -1, -1, -1, 74, 75, -1, -1, -1,
1360 -1, -1, 81, -1, -1, 137, 138, -1, 140, -1,
1361 142, -1, -1, -1, -1, -1, 148, -1, 134, -1,
1362 136, 137, 138, 139, 140, 141, 105, 106, 107, 108,
1363 -1, 110, 111, 149, -1, -1, -1, 116, -1, -1,
1364 -1, -1, 121, -1, 123, -1, 125, -1, -1, -1,
1365 -1, 130, 131, -1, -1, -1, -1, -1, 137, 138,
1366 -1, 140, -1, 142, -1, -1, -1, -1, 134, 148,
1367 136, 137, 138, 139, 140, 141, -1, -1, 4, -1,
1368 -1, -1, -1, 149, -1, -1, 134, 135, 136, 137,
1369 138, 139, 140, 141, 20, -1, 22, -1, -1, -1,
1370 -1, -1, 28, -1, -1, 32, 32, -1, -1, -1,
1371 37, -1, -1, 29, -1, -1, 32, -1, -1, 45,
1372 -1, 37, 49, 49, 50, 52, -1, 43, 54, -1,
1373 56, -1, -1, 49, -1, -1, 52, 63, -1, 32,
1374 -1, -1, 69, -1, 37, -1, -1, -1, 74, 75,
1375 -1, -1, -1, 69, 70, 81, 49, -1, -1, 52,
1376 76, -1, -1, 29, -1, -1, 32, -1, -1, -1,
1377 -1, 37, -1, -1, -1, -1, 69, 43, -1, 105,
1378 106, 107, 108, 49, -1, 111, 52, -1, -1, 116,
1379 116, -1, -1, -1, -1, 122, 123, 123, -1, 125,
1380 116, -1, -1, 69, 130, 131, 122, 123, -1, -1,
1381 76, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1382 147, -1, -1, 116, 151, 152, -1, 32, -1, 122,
1383 123, 147, 37, -1, -1, 151, 152, -1, -1, -1,
1384 -1, -1, -1, -1, 49, -1, -1, 52, -1, -1,
1385 116, -1, -1, -1, 147, -1, 122, 123, 151, 152,
1386 -1, -1, -1, -1, 69, -1, -1, -1, -1, -1,
1387 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1388 -1, 147, -1, -1, -1, -1, 152, -1, -1, -1,
1389 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1390 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1391 13, 116, 15, 16, -1, 18, 19, 122, 123, -1,
1392 -1, 24, -1, 26, -1, -1, -1, -1, -1, -1,
1393 33, 34, 35, 36, -1, 38, 39, 40, 41, 42,
1394 -1, 44, 147, 46, 47, 48, 151, 152, 51, -1,
1395 -1, -1, 55, -1, 57, 58, 59, 60, 61, 62,
1396 -1, 64, 65, 66, 67, 68, -1, -1, 71, -1,
1397 73, -1, -1, -1, -1, 78, -1, 80, -1, -1,
1398 -1, 84, 85, 86, 87, 88, 89, 90, 91, 92,
1399 -1, 94, 95, 96, 97, 98, 99, 100, 101, 102,
1400 103, 104, -1, -1, -1, -1, 109, -1, -1, 112,
1401 -1, 114, 115, -1, -1, 118, 119, 120, -1, -1,
1402 -1, 124, -1, 126, 127, 128, 129, -1, -1, 132
1405 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1406 symbol of state STATE-NUM. */
1407 static const unsigned char yystos
[] =
1409 0, 157, 158, 0, 29, 32, 37, 43, 49, 52,
1410 69, 76, 116, 122, 123, 147, 152, 161, 162, 163,
1411 164, 167, 168, 176, 184, 188, 194, 205, 206, 207,
1412 210, 211, 214, 216, 217, 218, 219, 221, 222, 227,
1413 229, 230, 3, 4, 4, 20, 22, 28, 32, 45,
1414 49, 50, 54, 56, 63, 74, 75, 81, 105, 106,
1415 107, 108, 111, 116, 123, 125, 130, 131, 188, 202,
1416 204, 227, 228, 230, 148, 3, 4, 3, 4, 200,
1417 32, 8, 3, 4, 200, 175, 176, 200, 13, 15,
1418 16, 18, 19, 24, 26, 33, 34, 35, 36, 38,
1419 39, 40, 41, 42, 44, 46, 47, 48, 51, 55,
1420 57, 58, 59, 60, 61, 62, 64, 65, 66, 67,
1421 68, 71, 73, 78, 80, 84, 85, 86, 87, 88,
1422 89, 90, 91, 92, 94, 95, 96, 97, 98, 99,
1423 100, 101, 102, 103, 104, 109, 112, 114, 115, 118,
1424 119, 120, 124, 126, 127, 128, 129, 132, 177, 179,
1425 226, 159, 159, 79, 83, 166, 205, 210, 216, 220,
1426 147, 147, 147, 147, 150, 147, 150, 147, 135, 215,
1427 150, 147, 147, 147, 228, 3, 74, 203, 203, 148,
1428 203, 204, 3, 3, 204, 3, 4, 201, 8, 150,
1429 228, 147, 150, 228, 117, 150, 148, 148, 148, 148,
1430 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
1431 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
1432 133, 153, 10, 70, 161, 165, 176, 205, 207, 218,
1433 219, 222, 151, 3, 3, 4, 150, 208, 93, 212,
1434 216, 3, 4, 150, 160, 228, 154, 149, 185, 186,
1435 187, 201, 201, 195, 32, 140, 148, 201, 223, 224,
1436 225, 148, 195, 201, 3, 5, 6, 7, 53, 110,
1437 121, 137, 138, 140, 142, 148, 191, 192, 193, 8,
1438 193, 8, 8, 178, 8, 193, 193, 8, 8, 193,
1439 8, 193, 191, 56, 189, 190, 191, 226, 193, 189,
1440 191, 228, 228, 8, 9, 180, 5, 231, 228, 179,
1441 152, 148, 147, 151, 175, 209, 135, 82, 175, 197,
1442 213, 147, 150, 160, 151, 161, 175, 198, 149, 193,
1443 151, 133, 154, 147, 151, 175, 176, 196, 197, 223,
1444 224, 224, 133, 197, 151, 149, 148, 191, 191, 191,
1445 191, 191, 228, 11, 12, 134, 136, 137, 138, 139,
1446 140, 141, 133, 149, 149, 149, 149, 133, 149, 149,
1447 149, 149, 149, 149, 149, 149, 149, 149, 3, 133,
1448 149, 149, 133, 149, 149, 149, 149, 149, 155, 149,
1449 149, 179, 8, 219, 135, 228, 147, 151, 198, 151,
1450 164, 151, 228, 147, 187, 193, 230, 147, 147, 149,
1451 224, 149, 228, 149, 149, 191, 191, 191, 191, 191,
1452 191, 191, 191, 191, 193, 8, 149, 190, 193, 5,
1453 149, 224, 147, 160, 113, 181, 147, 199, 201, 149,
1454 191, 135, 149, 152, 173, 151, 224, 150, 191, 140,
1455 174, 190, 148, 182, 153, 133, 153, 130, 169, 170,
1456 171, 172, 176, 228, 26, 38, 151, 183, 191, 152,
1457 149, 133, 228, 224, 191, 135, 191, 172, 224, 148,
1458 173, 135, 196, 148, 173, 169, 196, 169, 149, 149
1461 #define yyerrok (yyerrstatus = 0)
1462 #define yyclearin (yychar = YYEMPTY)
1463 #define YYEMPTY (-2)
1466 #define YYACCEPT goto yyacceptlab
1467 #define YYABORT goto yyabortlab
1468 #define YYERROR goto yyerrorlab
1471 /* Like YYERROR except do call yyerror. This remains here temporarily
1472 to ease the transition to the new meaning of YYERROR, for GCC.
1473 Once GCC version 2 has supplanted version 1, this can go. */
1475 #define YYFAIL goto yyerrlab
1477 #define YYRECOVERING() (!!yyerrstatus)
1479 #define YYBACKUP(Token, Value) \
1481 if (yychar == YYEMPTY && yylen == 1) \
1485 yytoken = YYTRANSLATE (yychar); \
1491 yyerror (YY_("syntax error: cannot back up")); \
1498 #define YYERRCODE 256
1501 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1502 If N is 0, then set CURRENT to the empty location which ends
1503 the previous symbol: RHS[0] (always defined). */
1505 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
1506 #ifndef YYLLOC_DEFAULT
1507 # define YYLLOC_DEFAULT(Current, Rhs, N) \
1511 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1512 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1513 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1514 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1518 (Current).first_line = (Current).last_line = \
1519 YYRHSLOC (Rhs, 0).last_line; \
1520 (Current).first_column = (Current).last_column = \
1521 YYRHSLOC (Rhs, 0).last_column; \
1527 /* YY_LOCATION_PRINT -- Print the location on the stream.
1528 This macro was not mandated originally: define only if we know
1529 we won't break user code: when these are the locations we know. */
1531 #ifndef YY_LOCATION_PRINT
1532 # if YYLTYPE_IS_TRIVIAL
1533 # define YY_LOCATION_PRINT(File, Loc) \
1534 fprintf (File, "%d.%d-%d.%d", \
1535 (Loc).first_line, (Loc).first_column, \
1536 (Loc).last_line, (Loc).last_column)
1538 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1543 /* YYLEX -- calling `yylex' with the right arguments. */
1546 # define YYLEX yylex (YYLEX_PARAM)
1548 # define YYLEX yylex ()
1551 /* Enable debugging if requested. */
1555 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1556 # define YYFPRINTF fprintf
1559 # define YYDPRINTF(Args) \
1565 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1569 YYFPRINTF (stderr, "%s ", Title); \
1570 yysymprint (stderr, \
1572 YYFPRINTF (stderr, "\n"); \
1576 /*------------------------------------------------------------------.
1577 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1579 `------------------------------------------------------------------*/
1581 #if defined (__STDC__) || defined (__cplusplus)
1583 yy_stack_print (short int *bottom
, short int *top
)
1586 yy_stack_print (bottom
, top
)
1591 YYFPRINTF (stderr
, "Stack now");
1592 for (/* Nothing. */; bottom
<= top
; ++bottom
)
1593 YYFPRINTF (stderr
, " %d", *bottom
);
1594 YYFPRINTF (stderr
, "\n");
1597 # define YY_STACK_PRINT(Bottom, Top) \
1600 yy_stack_print ((Bottom), (Top)); \
1604 /*------------------------------------------------.
1605 | Report that the YYRULE is going to be reduced. |
1606 `------------------------------------------------*/
1608 #if defined (__STDC__) || defined (__cplusplus)
1610 yy_reduce_print (int yyrule
)
1613 yy_reduce_print (yyrule
)
1618 unsigned long int yylno
= yyrline
[yyrule
];
1619 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu), ",
1621 /* Print the symbols being reduced, and their result. */
1622 for (yyi
= yyprhs
[yyrule
]; 0 <= yyrhs
[yyi
]; yyi
++)
1623 YYFPRINTF (stderr
, "%s ", yytname
[yyrhs
[yyi
]]);
1624 YYFPRINTF (stderr
, "-> %s\n", yytname
[yyr1
[yyrule
]]);
1627 # define YY_REDUCE_PRINT(Rule) \
1630 yy_reduce_print (Rule); \
1633 /* Nonzero means print parse trace. It is left uninitialized so that
1634 multiple parsers can coexist. */
1636 #else /* !YYDEBUG */
1637 # define YYDPRINTF(Args)
1638 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1639 # define YY_STACK_PRINT(Bottom, Top)
1640 # define YY_REDUCE_PRINT(Rule)
1641 #endif /* !YYDEBUG */
1644 /* YYINITDEPTH -- initial size of the parser's stacks. */
1646 # define YYINITDEPTH 200
1649 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1650 if the built-in stack extension method is used).
1652 Do not make this value too large; the results are undefined if
1653 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1654 evaluated with infinite-precision integer arithmetic. */
1657 # define YYMAXDEPTH 10000
1665 # if defined (__GLIBC__) && defined (_STRING_H)
1666 # define yystrlen strlen
1668 /* Return the length of YYSTR. */
1670 # if defined (__STDC__) || defined (__cplusplus)
1671 yystrlen (const char *yystr
)
1677 const char *yys
= yystr
;
1679 while (*yys
++ != '\0')
1682 return yys
- yystr
- 1;
1688 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
1689 # define yystpcpy stpcpy
1691 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1694 # if defined (__STDC__) || defined (__cplusplus)
1695 yystpcpy (char *yydest
, const char *yysrc
)
1697 yystpcpy (yydest
, yysrc
)
1703 const char *yys
= yysrc
;
1705 while ((*yyd
++ = *yys
++) != '\0')
1714 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1715 quotes and backslashes, so that it's suitable for yyerror. The
1716 heuristic is that double-quoting is unnecessary unless the string
1717 contains an apostrophe, a comma, or backslash (other than
1718 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1719 null, do not copy; instead, return the length of what the result
1722 yytnamerr (char *yyres
, const char *yystr
)
1727 char const *yyp
= yystr
;
1734 goto do_not_strip_quotes
;
1738 goto do_not_strip_quotes
;
1751 do_not_strip_quotes
: ;
1755 return yystrlen (yystr
);
1757 return yystpcpy (yyres
, yystr
) - yyres
;
1761 #endif /* YYERROR_VERBOSE */
1766 /*--------------------------------.
1767 | Print this symbol on YYOUTPUT. |
1768 `--------------------------------*/
1770 #if defined (__STDC__) || defined (__cplusplus)
1772 yysymprint (FILE *yyoutput
, int yytype
, YYSTYPE
*yyvaluep
)
1775 yysymprint (yyoutput
, yytype
, yyvaluep
)
1781 /* Pacify ``unused variable'' warnings. */
1784 if (yytype
< YYNTOKENS
)
1785 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1787 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1791 if (yytype
< YYNTOKENS
)
1792 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1799 YYFPRINTF (yyoutput
, ")");
1802 #endif /* ! YYDEBUG */
1803 /*-----------------------------------------------.
1804 | Release the memory associated to this symbol. |
1805 `-----------------------------------------------*/
1807 #if defined (__STDC__) || defined (__cplusplus)
1809 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
)
1812 yydestruct (yymsg
, yytype
, yyvaluep
)
1818 /* Pacify ``unused variable'' warnings. */
1823 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1834 /* Prevent warnings from -Wmissing-prototypes. */
1836 #ifdef YYPARSE_PARAM
1837 # if defined (__STDC__) || defined (__cplusplus)
1838 int yyparse (void *YYPARSE_PARAM
);
1842 #else /* ! YYPARSE_PARAM */
1843 #if defined (__STDC__) || defined (__cplusplus)
1848 #endif /* ! YYPARSE_PARAM */
1852 /* The look-ahead symbol. */
1855 /* The semantic value of the look-ahead symbol. */
1858 /* Number of syntax errors so far. */
1867 #ifdef YYPARSE_PARAM
1868 # if defined (__STDC__) || defined (__cplusplus)
1869 int yyparse (void *YYPARSE_PARAM
)
1871 int yyparse (YYPARSE_PARAM
)
1872 void *YYPARSE_PARAM
;
1874 #else /* ! YYPARSE_PARAM */
1875 #if defined (__STDC__) || defined (__cplusplus)
1889 /* Number of tokens to shift before error messages enabled. */
1891 /* Look-ahead token as an internal (translated) token number. */
1894 /* Three stacks and their tools:
1895 `yyss': related to states,
1896 `yyvs': related to semantic values,
1897 `yyls': related to locations.
1899 Refer to the stacks thru separate pointers, to allow yyoverflow
1900 to reallocate them elsewhere. */
1902 /* The state stack. */
1903 short int yyssa
[YYINITDEPTH
];
1904 short int *yyss
= yyssa
;
1907 /* The semantic value stack. */
1908 YYSTYPE yyvsa
[YYINITDEPTH
];
1909 YYSTYPE
*yyvs
= yyvsa
;
1914 #define YYPOPSTACK (yyvsp--, yyssp--)
1916 YYSIZE_T yystacksize
= YYINITDEPTH
;
1918 /* The variables used to return semantic value and location from the
1923 /* When reducing, the number of symbols on the RHS of the reduced
1927 YYDPRINTF ((stderr
, "Starting parse\n"));
1932 yychar
= YYEMPTY
; /* Cause a token to be read. */
1934 /* Initialize stack pointers.
1935 Waste one element of value and location stack
1936 so that they stay on the same level as the state stack.
1937 The wasted elements are never initialized. */
1944 /*------------------------------------------------------------.
1945 | yynewstate -- Push a new state, which is found in yystate. |
1946 `------------------------------------------------------------*/
1948 /* In all cases, when you get here, the value and location stacks
1949 have just been pushed. so pushing a state here evens the stacks.
1956 if (yyss
+ yystacksize
- 1 <= yyssp
)
1958 /* Get the current used size of the three stacks, in elements. */
1959 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1963 /* Give user a chance to reallocate the stack. Use copies of
1964 these so that the &'s don't force the real ones into
1966 YYSTYPE
*yyvs1
= yyvs
;
1967 short int *yyss1
= yyss
;
1970 /* Each stack pointer address is followed by the size of the
1971 data in use in that stack, in bytes. This used to be a
1972 conditional around just the two extra args, but that might
1973 be undefined if yyoverflow is a macro. */
1974 yyoverflow (YY_("memory exhausted"),
1975 &yyss1
, yysize
* sizeof (*yyssp
),
1976 &yyvs1
, yysize
* sizeof (*yyvsp
),
1983 #else /* no yyoverflow */
1984 # ifndef YYSTACK_RELOCATE
1985 goto yyexhaustedlab
;
1987 /* Extend the stack our own way. */
1988 if (YYMAXDEPTH
<= yystacksize
)
1989 goto yyexhaustedlab
;
1991 if (YYMAXDEPTH
< yystacksize
)
1992 yystacksize
= YYMAXDEPTH
;
1995 short int *yyss1
= yyss
;
1996 union yyalloc
*yyptr
=
1997 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1999 goto yyexhaustedlab
;
2000 YYSTACK_RELOCATE (yyss
);
2001 YYSTACK_RELOCATE (yyvs
);
2003 # undef YYSTACK_RELOCATE
2005 YYSTACK_FREE (yyss1
);
2008 #endif /* no yyoverflow */
2010 yyssp
= yyss
+ yysize
- 1;
2011 yyvsp
= yyvs
+ yysize
- 1;
2014 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
2015 (unsigned long int) yystacksize
));
2017 if (yyss
+ yystacksize
- 1 <= yyssp
)
2021 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
2030 /* Do appropriate processing given the current state. */
2031 /* Read a look-ahead token if we need one and don't already have one. */
2034 /* First try to decide what to do without reference to look-ahead token. */
2036 yyn
= yypact
[yystate
];
2037 if (yyn
== YYPACT_NINF
)
2040 /* Not known => get a look-ahead token if don't already have one. */
2042 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
2043 if (yychar
== YYEMPTY
)
2045 YYDPRINTF ((stderr
, "Reading a token: "));
2049 if (yychar
<= YYEOF
)
2051 yychar
= yytoken
= YYEOF
;
2052 YYDPRINTF ((stderr
, "Now at end of input.\n"));
2056 yytoken
= YYTRANSLATE (yychar
);
2057 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
2060 /* If the proper action on seeing token YYTOKEN is to reduce or to
2061 detect an error, take that action. */
2063 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
2068 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
2077 /* Shift the look-ahead token. */
2078 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
2080 /* Discard the token being shifted unless it is eof. */
2081 if (yychar
!= YYEOF
)
2087 /* Count tokens shifted since error; after three, turn off error
2096 /*-----------------------------------------------------------.
2097 | yydefault -- do the default action for the current state. |
2098 `-----------------------------------------------------------*/
2100 yyn
= yydefact
[yystate
];
2106 /*-----------------------------.
2107 | yyreduce -- Do a reduction. |
2108 `-----------------------------*/
2110 /* yyn is the number of a rule to reduce with. */
2113 /* If YYLEN is nonzero, implement the default value of the action:
2116 Otherwise, the following line sets YYVAL to garbage.
2117 This behavior is undocumented and Bison
2118 users should not rely upon it. Assigning to YYVAL
2119 unconditionally makes the parser a bit smaller, and it avoids a
2120 GCC warning that YYVAL may be used uninitialized. */
2121 yyval
= yyvsp
[1-yylen
];
2124 YY_REDUCE_PRINT (yyn
);
2128 #line 286 "parser.y"
2130 check_all_user_types((yyvsp
[0].ifref_list
));
2131 write_proxies((yyvsp
[0].ifref_list
));
2132 write_client((yyvsp
[0].ifref_list
));
2133 write_server((yyvsp
[0].ifref_list
));
2134 write_dlldata((yyvsp
[0].ifref_list
));
2139 #line 295 "parser.y"
2140 { (yyval
.ifref_list
) = NULL
; ;}
2144 #line 296 "parser.y"
2145 { (yyval
.ifref_list
) = (yyvsp
[-1].ifref_list
); ;}
2149 #line 297 "parser.y"
2150 { (yyval
.ifref_list
) = append_ifref( (yyvsp
[-1].ifref_list
), make_ifref((yyvsp
[0].type
)) ); ;}
2154 #line 298 "parser.y"
2155 { (yyval
.ifref_list
) = (yyvsp
[-2].ifref_list
);
2156 reg_type((yyvsp
[-1].type
), (yyvsp
[-1].type
)->name
, 0);
2157 if (!parse_only
&& do_header
) write_coclass_forward((yyvsp
[-1].type
));
2162 #line 302 "parser.y"
2163 { (yyval
.ifref_list
) = (yyvsp
[-1].ifref_list
);
2164 add_typelib_entry((yyvsp
[0].type
));
2165 reg_type((yyvsp
[0].type
), (yyvsp
[0].type
)->name
, 0);
2166 if (!parse_only
&& do_header
) write_coclass_forward((yyvsp
[0].type
));
2171 #line 307 "parser.y"
2172 { (yyval
.ifref_list
) = (yyvsp
[-1].ifref_list
); add_typelib_entry((yyvsp
[0].type
)); ;}
2176 #line 308 "parser.y"
2177 { (yyval
.ifref_list
) = (yyvsp
[-1].ifref_list
); ;}
2181 #line 309 "parser.y"
2182 { (yyval
.ifref_list
) = (yyvsp
[-1].ifref_list
); ;}
2186 #line 312 "parser.y"
2191 #line 313 "parser.y"
2192 { if (!parse_only
) add_typelib_entry((yyvsp
[0].type
)); ;}
2196 #line 314 "parser.y"
2197 { if (!parse_only
) add_typelib_entry((yyvsp
[0].type
)); ;}
2201 #line 315 "parser.y"
2202 { reg_type((yyvsp
[-1].type
), (yyvsp
[-1].type
)->name
, 0); if (!parse_only
&& do_header
) write_coclass_forward((yyvsp
[-1].type
)); ;}
2206 #line 316 "parser.y"
2207 { if (!parse_only
) add_typelib_entry((yyvsp
[0].type
));
2208 reg_type((yyvsp
[0].type
), (yyvsp
[0].type
)->name
, 0);
2209 if (!parse_only
&& do_header
) write_coclass_forward((yyvsp
[0].type
));
2214 #line 320 "parser.y"
2215 { if (!parse_only
) add_typelib_entry((yyvsp
[0].type
)); ;}
2219 #line 321 "parser.y"
2224 #line 322 "parser.y"
2229 #line 325 "parser.y"
2230 { (yyval
.func_list
) = NULL
; ;}
2234 #line 326 "parser.y"
2235 { (yyval
.func_list
) = append_func( (yyvsp
[-2].func_list
), (yyvsp
[-1].func
) ); ;}
2239 #line 327 "parser.y"
2240 { (yyval
.func_list
) = (yyvsp
[-1].func_list
); ;}
2244 #line 330 "parser.y"
2249 #line 331 "parser.y"
2250 { if (!parse_only
&& do_header
) { write_constdef((yyvsp
[-1].var
)); } ;}
2254 #line 332 "parser.y"
2259 #line 333 "parser.y"
2260 { if (!parse_only
&& do_header
) {
2261 write_type_def_or_decl(header
, (yyvsp
[-1].type
), FALSE
, NULL
);
2262 fprintf(header
, ";\n\n");
2268 #line 338 "parser.y"
2269 { if (!parse_only
&& do_header
) { write_externdef((yyvsp
[-1].var
)); } ;}
2273 #line 339 "parser.y"
2278 #line 340 "parser.y"
2279 { if (!parse_only
&& do_header
) {
2280 write_type_def_or_decl(header
, (yyvsp
[-1].type
), FALSE
, NULL
);
2281 fprintf(header
, ";\n\n");
2287 #line 345 "parser.y"
2292 #line 346 "parser.y"
2293 { if (!parse_only
&& do_header
) {
2294 write_type_def_or_decl(header
, (yyvsp
[-1].type
), FALSE
, NULL
);
2295 fprintf(header
, ";\n\n");
2301 #line 353 "parser.y"
2302 { if (!parse_only
&& do_header
) fprintf(header
, "%s\n", (yyvsp
[-1].str
)); ;}
2306 #line 355 "parser.y"
2307 { assert(yychar
== YYEMPTY
);
2308 if (!do_import((yyvsp
[-1].str
))) yychar
= aEOF
; ;}
2312 #line 358 "parser.y"
2317 #line 361 "parser.y"
2318 { if(!parse_only
) add_importlib((yyvsp
[-1].str
)); ;}
2322 #line 364 "parser.y"
2323 { (yyval
.str
) = (yyvsp
[0].str
); ;}
2327 #line 366 "parser.y"
2328 { start_typelib((yyvsp
[-1].str
), (yyvsp
[-2].attr_list
));
2329 if (!parse_only
&& do_header
) write_library((yyvsp
[-1].str
), (yyvsp
[-2].attr_list
));
2330 if (!parse_only
&& do_idfile
) write_libid((yyvsp
[-1].str
), (yyvsp
[-2].attr_list
));
2335 #line 371 "parser.y"
2340 #line 374 "parser.y"
2341 { (yyval
.var_list
) = NULL
; ;}
2345 #line 378 "parser.y"
2346 { (yyval
.var_list
) = NULL
; ;}
2350 #line 381 "parser.y"
2351 { check_arg((yyvsp
[0].var
)); (yyval
.var_list
) = append_var( NULL
, (yyvsp
[0].var
) ); ;}
2355 #line 382 "parser.y"
2356 { check_arg((yyvsp
[0].var
)); (yyval
.var_list
) = append_var( (yyvsp
[-2].var_list
), (yyvsp
[0].var
)); ;}
2360 #line 387 "parser.y"
2361 { (yyval
.var
) = (yyvsp
[-1].pident
)->var
;
2362 (yyval
.var
)->attrs
= (yyvsp
[-3].attr_list
);
2363 set_type((yyval
.var
), (yyvsp
[-2].type
), (yyvsp
[-1].pident
)->ptr_level
, (yyvsp
[0].array_dims
), TRUE
);
2364 free((yyvsp
[-1].pident
));
2369 #line 392 "parser.y"
2370 { (yyval
.var
) = (yyvsp
[-1].pident
)->var
;
2371 set_type((yyval
.var
), (yyvsp
[-2].type
), (yyvsp
[-1].pident
)->ptr_level
, (yyvsp
[0].array_dims
), TRUE
);
2372 free((yyvsp
[-1].pident
));
2377 #line 396 "parser.y"
2378 { (yyval
.var
) = (yyvsp
[-3].pident
)->var
;
2379 (yyval
.var
)->attrs
= (yyvsp
[-5].attr_list
);
2380 set_type((yyval
.var
), (yyvsp
[-4].type
), (yyvsp
[-3].pident
)->ptr_level
- 1, NULL
, TRUE
);
2381 free((yyvsp
[-3].pident
));
2382 (yyval
.var
)->args
= (yyvsp
[-1].var_list
);
2387 #line 402 "parser.y"
2388 { (yyval
.var
) = (yyvsp
[-3].pident
)->var
;
2389 set_type((yyval
.var
), (yyvsp
[-4].type
), (yyvsp
[-3].pident
)->ptr_level
- 1, NULL
, TRUE
);
2390 free((yyvsp
[-3].pident
));
2391 (yyval
.var
)->args
= (yyvsp
[-1].var_list
);
2396 #line 409 "parser.y"
2397 { (yyval
.array_dims
) = NULL
; ;}
2401 #line 410 "parser.y"
2402 { (yyval
.array_dims
) = (yyvsp
[-1].array_dims
); ;}
2406 #line 411 "parser.y"
2407 { (yyval
.array_dims
) = append_array( NULL
, make_expr(EXPR_VOID
) ); ;}
2411 #line 414 "parser.y"
2412 { (yyval
.array_dims
) = append_array( NULL
, (yyvsp
[0].expr
) ); ;}
2416 #line 415 "parser.y"
2417 { (yyval
.array_dims
) = append_array( (yyvsp
[-2].array_dims
), (yyvsp
[0].expr
) ); ;}
2421 #line 416 "parser.y"
2422 { (yyval
.array_dims
) = append_array( (yyvsp
[-3].array_dims
), (yyvsp
[0].expr
) ); ;}
2426 #line 419 "parser.y"
2427 { (yyval
.attr_list
) = NULL
; ;}
2431 #line 424 "parser.y"
2432 { (yyval
.attr_list
) = (yyvsp
[-1].attr_list
);
2433 if (!(yyval
.attr_list
))
2434 error_loc("empty attribute lists unsupported\n");
2439 #line 430 "parser.y"
2440 { (yyval
.attr_list
) = append_attr( NULL
, (yyvsp
[0].attr
) ); ;}
2444 #line 431 "parser.y"
2445 { (yyval
.attr_list
) = append_attr( (yyvsp
[-2].attr_list
), (yyvsp
[0].attr
) ); ;}
2449 #line 432 "parser.y"
2450 { (yyval
.attr_list
) = append_attr( (yyvsp
[-3].attr_list
), (yyvsp
[0].attr
) ); ;}
2454 #line 435 "parser.y"
2455 { (yyval
.str_list
) = append_str( NULL
, (yyvsp
[0].str
) ); ;}
2459 #line 436 "parser.y"
2460 { (yyval
.str_list
) = append_str( (yyvsp
[-2].str_list
), (yyvsp
[0].str
) ); ;}
2464 #line 439 "parser.y"
2465 { (yyval
.attr
) = NULL
; ;}
2469 #line 440 "parser.y"
2470 { (yyval
.attr
) = make_attr(ATTR_AGGREGATABLE
); ;}
2474 #line 441 "parser.y"
2475 { (yyval
.attr
) = make_attr(ATTR_APPOBJECT
); ;}
2479 #line 442 "parser.y"
2480 { (yyval
.attr
) = make_attr(ATTR_ASYNC
); ;}
2484 #line 443 "parser.y"
2485 { (yyval
.attr
) = make_attr(ATTR_AUTO_HANDLE
); ;}
2489 #line 444 "parser.y"
2490 { (yyval
.attr
) = make_attr(ATTR_BINDABLE
); ;}
2494 #line 445 "parser.y"
2495 { (yyval
.attr
) = make_attrp(ATTR_CALLAS
, (yyvsp
[-1].var
)); ;}
2499 #line 446 "parser.y"
2500 { (yyval
.attr
) = make_attrp(ATTR_CASE
, (yyvsp
[-1].expr_list
)); ;}
2504 #line 447 "parser.y"
2505 { (yyval
.attr
) = make_attrv(ATTR_CONTEXTHANDLE
, 0); ;}
2509 #line 448 "parser.y"
2510 { (yyval
.attr
) = make_attrv(ATTR_CONTEXTHANDLE
, 0); /* RPC_CONTEXT_HANDLE_DONT_SERIALIZE */ ;}
2514 #line 449 "parser.y"
2515 { (yyval
.attr
) = make_attrv(ATTR_CONTEXTHANDLE
, 0); /* RPC_CONTEXT_HANDLE_SERIALIZE */ ;}
2519 #line 450 "parser.y"
2520 { (yyval
.attr
) = make_attr(ATTR_CONTROL
); ;}
2524 #line 451 "parser.y"
2525 { (yyval
.attr
) = make_attr(ATTR_DEFAULT
); ;}
2529 #line 452 "parser.y"
2530 { (yyval
.attr
) = make_attr(ATTR_DEFAULTCOLLELEM
); ;}
2534 #line 453 "parser.y"
2535 { (yyval
.attr
) = make_attrp(ATTR_DEFAULTVALUE_EXPR
, (yyvsp
[-1].expr
)); ;}
2539 #line 454 "parser.y"
2540 { (yyval
.attr
) = make_attrp(ATTR_DEFAULTVALUE_STRING
, (yyvsp
[-1].str
)); ;}
2544 #line 455 "parser.y"
2545 { (yyval
.attr
) = make_attr(ATTR_DEFAULTVTABLE
); ;}
2549 #line 456 "parser.y"
2550 { (yyval
.attr
) = make_attr(ATTR_DISPLAYBIND
); ;}
2554 #line 457 "parser.y"
2555 { (yyval
.attr
) = make_attrp(ATTR_DLLNAME
, (yyvsp
[-1].str
)); ;}
2559 #line 458 "parser.y"
2560 { (yyval
.attr
) = make_attr(ATTR_DUAL
); ;}
2564 #line 459 "parser.y"
2565 { (yyval
.attr
) = make_attrp(ATTR_ENDPOINT
, (yyvsp
[-1].str_list
)); ;}
2569 #line 460 "parser.y"
2570 { (yyval
.attr
) = make_attrp(ATTR_ENTRY_STRING
, (yyvsp
[-1].str
)); ;}
2574 #line 461 "parser.y"
2575 { (yyval
.attr
) = make_attrp(ATTR_ENTRY_ORDINAL
, (yyvsp
[-1].expr
)); ;}
2579 #line 462 "parser.y"
2580 { (yyval
.attr
) = make_attr(ATTR_EXPLICIT_HANDLE
); ;}
2584 #line 463 "parser.y"
2585 { (yyval
.attr
) = make_attr(ATTR_HANDLE
); ;}
2589 #line 464 "parser.y"
2590 { (yyval
.attr
) = make_attrp(ATTR_HELPCONTEXT
, (yyvsp
[-1].expr
)); ;}
2594 #line 465 "parser.y"
2595 { (yyval
.attr
) = make_attrp(ATTR_HELPFILE
, (yyvsp
[-1].str
)); ;}
2599 #line 466 "parser.y"
2600 { (yyval
.attr
) = make_attrp(ATTR_HELPSTRING
, (yyvsp
[-1].str
)); ;}
2604 #line 467 "parser.y"
2605 { (yyval
.attr
) = make_attrp(ATTR_HELPSTRINGCONTEXT
, (yyvsp
[-1].expr
)); ;}
2609 #line 468 "parser.y"
2610 { (yyval
.attr
) = make_attrp(ATTR_HELPSTRINGDLL
, (yyvsp
[-1].str
)); ;}
2614 #line 469 "parser.y"
2615 { (yyval
.attr
) = make_attr(ATTR_HIDDEN
); ;}
2619 #line 470 "parser.y"
2620 { (yyval
.attr
) = make_attrp(ATTR_ID
, (yyvsp
[-1].expr
)); ;}
2624 #line 471 "parser.y"
2625 { (yyval
.attr
) = make_attr(ATTR_IDEMPOTENT
); ;}
2629 #line 472 "parser.y"
2630 { (yyval
.attr
) = make_attrp(ATTR_IIDIS
, (yyvsp
[-1].expr
)); ;}
2634 #line 473 "parser.y"
2635 { (yyval
.attr
) = make_attr(ATTR_IMMEDIATEBIND
); ;}
2639 #line 474 "parser.y"
2640 { (yyval
.attr
) = make_attrp(ATTR_IMPLICIT_HANDLE
, (yyvsp
[-1].str
)); ;}
2644 #line 475 "parser.y"
2645 { (yyval
.attr
) = make_attr(ATTR_IN
); ;}
2649 #line 476 "parser.y"
2650 { (yyval
.attr
) = make_attr(ATTR_INPUTSYNC
); ;}
2654 #line 477 "parser.y"
2655 { (yyval
.attr
) = make_attrp(ATTR_LENGTHIS
, (yyvsp
[-1].expr_list
)); ;}
2659 #line 478 "parser.y"
2660 { (yyval
.attr
) = make_attr(ATTR_LOCAL
); ;}
2664 #line 479 "parser.y"
2665 { (yyval
.attr
) = make_attr(ATTR_NONBROWSABLE
); ;}
2669 #line 480 "parser.y"
2670 { (yyval
.attr
) = make_attr(ATTR_NONCREATABLE
); ;}
2674 #line 481 "parser.y"
2675 { (yyval
.attr
) = make_attr(ATTR_NONEXTENSIBLE
); ;}
2679 #line 482 "parser.y"
2680 { (yyval
.attr
) = make_attr(ATTR_OBJECT
); ;}
2684 #line 483 "parser.y"
2685 { (yyval
.attr
) = make_attr(ATTR_ODL
); ;}
2689 #line 484 "parser.y"
2690 { (yyval
.attr
) = make_attr(ATTR_OLEAUTOMATION
); ;}
2694 #line 485 "parser.y"
2695 { (yyval
.attr
) = make_attr(ATTR_OPTIONAL
); ;}
2699 #line 486 "parser.y"
2700 { (yyval
.attr
) = make_attr(ATTR_OUT
); ;}
2704 #line 487 "parser.y"
2705 { (yyval
.attr
) = make_attrv(ATTR_POINTERDEFAULT
, (yyvsp
[-1].num
)); ;}
2709 #line 488 "parser.y"
2710 { (yyval
.attr
) = make_attr(ATTR_PROPGET
); ;}
2714 #line 489 "parser.y"
2715 { (yyval
.attr
) = make_attr(ATTR_PROPPUT
); ;}
2719 #line 490 "parser.y"
2720 { (yyval
.attr
) = make_attr(ATTR_PROPPUTREF
); ;}
2724 #line 491 "parser.y"
2725 { (yyval
.attr
) = make_attr(ATTR_PUBLIC
); ;}
2729 #line 492 "parser.y"
2730 { expr_list_t
*list
= append_expr( NULL
, (yyvsp
[-3].expr
) );
2731 list
= append_expr( list
, (yyvsp
[-1].expr
) );
2732 (yyval
.attr
) = make_attrp(ATTR_RANGE
, list
); ;}
2736 #line 495 "parser.y"
2737 { (yyval
.attr
) = make_attr(ATTR_READONLY
); ;}
2741 #line 496 "parser.y"
2742 { (yyval
.attr
) = make_attr(ATTR_REQUESTEDIT
); ;}
2746 #line 497 "parser.y"
2747 { (yyval
.attr
) = make_attr(ATTR_RESTRICTED
); ;}
2751 #line 498 "parser.y"
2752 { (yyval
.attr
) = make_attr(ATTR_RETVAL
); ;}
2756 #line 499 "parser.y"
2757 { (yyval
.attr
) = make_attrp(ATTR_SIZEIS
, (yyvsp
[-1].expr_list
)); ;}
2761 #line 500 "parser.y"
2762 { (yyval
.attr
) = make_attr(ATTR_SOURCE
); ;}
2766 #line 501 "parser.y"
2767 { (yyval
.attr
) = make_attr(ATTR_STRICTCONTEXTHANDLE
); ;}
2771 #line 502 "parser.y"
2772 { (yyval
.attr
) = make_attr(ATTR_STRING
); ;}
2776 #line 503 "parser.y"
2777 { (yyval
.attr
) = make_attrp(ATTR_SWITCHIS
, (yyvsp
[-1].expr
)); ;}
2781 #line 504 "parser.y"
2782 { (yyval
.attr
) = make_attrp(ATTR_SWITCHTYPE
, (yyvsp
[-1].type
)); ;}
2786 #line 505 "parser.y"
2787 { (yyval
.attr
) = make_attrp(ATTR_TRANSMITAS
, (yyvsp
[-1].type
)); ;}
2791 #line 506 "parser.y"
2792 { (yyval
.attr
) = make_attrp(ATTR_UUID
, (yyvsp
[-1].uuid
)); ;}
2796 #line 507 "parser.y"
2797 { (yyval
.attr
) = make_attr(ATTR_V1ENUM
); ;}
2801 #line 508 "parser.y"
2802 { (yyval
.attr
) = make_attr(ATTR_VARARG
); ;}
2806 #line 509 "parser.y"
2807 { (yyval
.attr
) = make_attrv(ATTR_VERSION
, (yyvsp
[-1].num
)); ;}
2811 #line 510 "parser.y"
2812 { (yyval
.attr
) = make_attrp(ATTR_WIREMARSHAL
, (yyvsp
[-1].type
)); ;}
2816 #line 511 "parser.y"
2817 { (yyval
.attr
) = make_attrv(ATTR_POINTERTYPE
, (yyvsp
[0].num
)); ;}
2821 #line 516 "parser.y"
2822 { if (!is_valid_uuid((yyvsp
[0].str
)))
2823 error_loc("invalid UUID: %s\n", (yyvsp
[0].str
));
2824 (yyval
.uuid
) = parse_uuid((yyvsp
[0].str
)); ;}
2828 #line 525 "parser.y"
2829 { (yyval
.var_list
) = NULL
; ;}
2833 #line 526 "parser.y"
2834 { (yyval
.var_list
) = append_var( (yyvsp
[-1].var_list
), (yyvsp
[0].var
) ); ;}
2838 #line 529 "parser.y"
2839 { attr_t
*a
= make_attrp(ATTR_CASE
, append_expr( NULL
, (yyvsp
[-2].expr
) ));
2840 (yyval
.var
) = (yyvsp
[0].var
); if (!(yyval
.var
)) (yyval
.var
) = make_var(NULL
);
2841 (yyval
.var
)->attrs
= append_attr( (yyval
.var
)->attrs
, a
);
2846 #line 533 "parser.y"
2847 { attr_t
*a
= make_attr(ATTR_DEFAULT
);
2848 (yyval
.var
) = (yyvsp
[0].var
); if (!(yyval
.var
)) (yyval
.var
) = make_var(NULL
);
2849 (yyval
.var
)->attrs
= append_attr( (yyval
.var
)->attrs
, a
);
2854 #line 539 "parser.y"
2855 { (yyval
.var
) = reg_const((yyvsp
[-2].var
));
2856 set_type((yyval
.var
), (yyvsp
[-3].type
), 0, NULL
, FALSE
);
2857 (yyval
.var
)->eval
= (yyvsp
[0].expr
);
2862 #line 545 "parser.y"
2863 { (yyval
.var_list
) = NULL
; ;}
2867 #line 546 "parser.y"
2868 { (yyval
.var_list
) = (yyvsp
[-1].var_list
); ;}
2872 #line 550 "parser.y"
2873 { if (!(yyvsp
[0].var
)->eval
)
2874 (yyvsp
[0].var
)->eval
= make_exprl(EXPR_NUM
, 0 /* default for first enum entry */);
2875 (yyval
.var_list
) = append_var( NULL
, (yyvsp
[0].var
) );
2880 #line 554 "parser.y"
2881 { if (!(yyvsp
[0].var
)->eval
)
2883 var_t
*last
= LIST_ENTRY( list_tail((yyval
.var_list
)), var_t
, entry
);
2884 (yyvsp
[0].var
)->eval
= make_exprl(EXPR_NUM
, last
->eval
->cval
+ 1);
2886 (yyval
.var_list
) = append_var( (yyvsp
[-2].var_list
), (yyvsp
[0].var
) );
2891 #line 563 "parser.y"
2892 { (yyval
.var
) = reg_const((yyvsp
[-2].var
));
2893 (yyval
.var
)->eval
= (yyvsp
[0].expr
);
2894 (yyval
.var
)->type
= make_int(0);
2899 #line 567 "parser.y"
2900 { (yyval
.var
) = reg_const((yyvsp
[0].var
));
2901 (yyval
.var
)->type
= make_int(0);
2906 #line 572 "parser.y"
2907 { (yyval
.type
) = get_typev(RPC_FC_ENUM16
, (yyvsp
[-3].var
), tsENUM
);
2908 (yyval
.type
)->kind
= TKIND_ENUM
;
2909 (yyval
.type
)->fields
= (yyvsp
[-1].var_list
);
2910 (yyval
.type
)->defined
= TRUE
;
2912 add_typelib_entry((yyval
.type
));
2917 #line 581 "parser.y"
2918 { (yyval
.expr_list
) = append_expr( NULL
, (yyvsp
[0].expr
) ); ;}
2922 #line 582 "parser.y"
2923 { (yyval
.expr_list
) = append_expr( (yyvsp
[-2].expr_list
), (yyvsp
[0].expr
) ); ;}
2927 #line 595 "parser.y"
2928 { (yyval
.expr
) = make_expr(EXPR_VOID
); ;}
2932 #line 599 "parser.y"
2933 { (yyval
.expr
) = make_exprl(EXPR_NUM
, (yyvsp
[0].num
)); ;}
2937 #line 600 "parser.y"
2938 { (yyval
.expr
) = make_exprl(EXPR_HEXNUM
, (yyvsp
[0].num
)); ;}
2942 #line 601 "parser.y"
2943 { (yyval
.expr
) = make_exprd(EXPR_DOUBLE
, (yyvsp
[0].dbl
)); ;}
2947 #line 602 "parser.y"
2948 { (yyval
.expr
) = make_exprl(EXPR_TRUEFALSE
, 0); ;}
2952 #line 603 "parser.y"
2953 { (yyval
.expr
) = make_exprl(EXPR_TRUEFALSE
, 1); ;}
2957 #line 604 "parser.y"
2958 { (yyval
.expr
) = make_exprs(EXPR_IDENTIFIER
, (yyvsp
[0].str
)); ;}
2962 #line 605 "parser.y"
2963 { (yyval
.expr
) = make_expr3(EXPR_COND
, (yyvsp
[-4].expr
), (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
2967 #line 606 "parser.y"
2968 { (yyval
.expr
) = make_expr2(EXPR_OR
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
2972 #line 607 "parser.y"
2973 { (yyval
.expr
) = make_expr2(EXPR_AND
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
2977 #line 608 "parser.y"
2978 { (yyval
.expr
) = make_expr2(EXPR_ADD
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
2982 #line 609 "parser.y"
2983 { (yyval
.expr
) = make_expr2(EXPR_SUB
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
2987 #line 610 "parser.y"
2988 { (yyval
.expr
) = make_expr2(EXPR_MUL
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
2992 #line 611 "parser.y"
2993 { (yyval
.expr
) = make_expr2(EXPR_DIV
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
2997 #line 612 "parser.y"
2998 { (yyval
.expr
) = make_expr2(EXPR_SHL
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3002 #line 613 "parser.y"
3003 { (yyval
.expr
) = make_expr2(EXPR_SHR
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3007 #line 614 "parser.y"
3008 { (yyval
.expr
) = make_expr1(EXPR_NOT
, (yyvsp
[0].expr
)); ;}
3012 #line 615 "parser.y"
3013 { (yyval
.expr
) = make_expr1(EXPR_NEG
, (yyvsp
[0].expr
)); ;}
3017 #line 616 "parser.y"
3018 { (yyval
.expr
) = make_expr1(EXPR_ADDRESSOF
, (yyvsp
[0].expr
)); ;}
3022 #line 617 "parser.y"
3023 { (yyval
.expr
) = make_expr1(EXPR_PPTR
, (yyvsp
[0].expr
)); ;}
3027 #line 618 "parser.y"
3028 { (yyval
.expr
) = make_exprt(EXPR_CAST
, (yyvsp
[-2].type
), (yyvsp
[0].expr
)); ;}
3032 #line 619 "parser.y"
3033 { (yyval
.expr
) = make_exprt(EXPR_SIZEOF
, (yyvsp
[-1].type
), NULL
); ;}
3037 #line 620 "parser.y"
3038 { (yyval
.expr
) = (yyvsp
[-1].expr
); ;}
3042 #line 623 "parser.y"
3043 { (yyval
.expr_list
) = append_expr( NULL
, (yyvsp
[0].expr
) ); ;}
3047 #line 624 "parser.y"
3048 { (yyval
.expr_list
) = append_expr( (yyvsp
[-2].expr_list
), (yyvsp
[0].expr
) ); ;}
3052 #line 627 "parser.y"
3053 { (yyval
.expr
) = (yyvsp
[0].expr
);
3054 if (!(yyval
.expr
)->is_const
)
3055 error_loc("expression is not constant\n");
3060 #line 633 "parser.y"
3061 { (yyval
.var
) = (yyvsp
[0].var
);
3062 set_type((yyval
.var
), (yyvsp
[-1].type
), 0, NULL
, FALSE
);
3067 #line 638 "parser.y"
3068 { (yyval
.var_list
) = NULL
; ;}
3072 #line 639 "parser.y"
3073 { (yyval
.var_list
) = append_var( (yyvsp
[-1].var_list
), (yyvsp
[0].var
) ); ;}
3077 #line 642 "parser.y"
3078 { (yyval
.var
) = (yyvsp
[-1].var
); ;}
3082 #line 643 "parser.y"
3083 { (yyval
.var
) = make_var(NULL
); (yyval
.var
)->type
= (yyvsp
[-1].type
); (yyval
.var
)->attrs
= (yyvsp
[-2].attr_list
); ;}
3087 #line 644 "parser.y"
3088 { (yyval
.var
) = make_var(NULL
); (yyval
.var
)->attrs
= (yyvsp
[-1].attr_list
); ;}
3092 #line 645 "parser.y"
3093 { (yyval
.var
) = NULL
; ;}
3097 #line 648 "parser.y"
3098 { (yyval
.var
) = (yyvsp
[-1].pident
)->var
;
3099 (yyval
.var
)->attrs
= (yyvsp
[-3].attr_list
);
3100 set_type((yyval
.var
), (yyvsp
[-2].type
), (yyvsp
[-1].pident
)->ptr_level
, (yyvsp
[0].array_dims
), FALSE
);
3101 free((yyvsp
[-1].pident
));
3106 #line 657 "parser.y"
3107 { var_t
*v
= (yyvsp
[-3].pident
)->var
;
3108 v
->attrs
= (yyvsp
[-6].attr_list
);
3109 set_type(v
, (yyvsp
[-5].type
), (yyvsp
[-3].pident
)->ptr_level
, NULL
, FALSE
);
3110 free((yyvsp
[-3].pident
));
3111 (yyval
.func
) = make_func(v
, (yyvsp
[-1].var_list
));
3112 if (is_attr(v
->attrs
, ATTR_IN
)) {
3113 error_loc("inapplicable attribute [in] for function '%s'\n",(yyval
.func
)->def
->name
);
3119 #line 668 "parser.y"
3120 { (yyval
.var
) = NULL
; ;}
3124 #line 672 "parser.y"
3125 { (yyval
.var
) = NULL
; ;}
3129 #line 673 "parser.y"
3130 { (yyval
.var
) = make_var((yyvsp
[0].str
)); ;}
3134 #line 674 "parser.y"
3135 { (yyval
.var
) = make_var((yyvsp
[0].str
)); ;}
3139 #line 677 "parser.y"
3140 { (yyval
.var
) = make_var((yyvsp
[0].str
)); ;}
3144 #line 679 "parser.y"
3145 { (yyval
.var
) = make_var((yyvsp
[0].str
)); ;}
3149 #line 682 "parser.y"
3150 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3154 #line 683 "parser.y"
3155 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3159 #line 685 "parser.y"
3160 { (yyval
.type
) = (yyvsp
[0].type
); (yyval
.type
)->sign
= 1; ;}
3164 #line 686 "parser.y"
3165 { (yyval
.type
) = (yyvsp
[0].type
); (yyval
.type
)->sign
= -1;
3166 switch ((yyval
.type
)->type
) {
3167 case RPC_FC_CHAR
: break;
3168 case RPC_FC_SMALL
: (yyval
.type
)->type
= RPC_FC_USMALL
; break;
3169 case RPC_FC_SHORT
: (yyval
.type
)->type
= RPC_FC_USHORT
; break;
3170 case RPC_FC_LONG
: (yyval
.type
)->type
= RPC_FC_ULONG
; break;
3172 if ((yyval
.type
)->name
[0] == 'h') /* hyper, as opposed to __int64 */
3174 (yyval
.type
) = alias((yyval
.type
), "MIDL_uhyper");
3175 (yyval
.type
)->sign
= 0;
3184 #line 702 "parser.y"
3185 { (yyval
.type
) = make_int(-1); ;}
3189 #line 703 "parser.y"
3190 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3194 #line 704 "parser.y"
3195 { (yyval
.type
) = duptype(find_type("float", 0), 1); ;}
3199 #line 705 "parser.y"
3200 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3204 #line 706 "parser.y"
3205 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3209 #line 707 "parser.y"
3210 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3214 #line 708 "parser.y"
3215 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3219 #line 715 "parser.y"
3220 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3224 #line 716 "parser.y"
3225 { (yyval
.type
) = make_builtin((yyvsp
[-1].str
)); ;}
3229 #line 717 "parser.y"
3230 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3234 #line 718 "parser.y"
3235 { (yyval
.type
) = make_builtin((yyvsp
[-1].str
)); ;}
3239 #line 719 "parser.y"
3240 { (yyval
.type
) = make_builtin((yyvsp
[-1].str
)); ;}
3244 #line 720 "parser.y"
3245 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3249 #line 721 "parser.y"
3250 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3254 #line 724 "parser.y"
3255 { (yyval
.type
) = make_class((yyvsp
[0].str
)); ;}
3259 #line 725 "parser.y"
3260 { (yyval
.type
) = find_type((yyvsp
[0].str
), 0);
3261 if ((yyval
.type
)->defined
) error_loc("multiple definition error\n");
3262 if ((yyval
.type
)->kind
!= TKIND_COCLASS
) error_loc("%s was not declared a coclass\n", (yyvsp
[0].str
));
3267 #line 731 "parser.y"
3268 { (yyval
.type
) = (yyvsp
[0].type
);
3269 (yyval
.type
)->attrs
= (yyvsp
[-1].attr_list
);
3270 if (!parse_only
&& do_header
)
3271 write_coclass((yyval
.type
));
3272 if (!parse_only
&& do_idfile
)
3273 write_clsid((yyval
.type
));
3278 #line 740 "parser.y"
3279 { (yyval
.type
) = (yyvsp
[-3].type
);
3280 (yyval
.type
)->ifaces
= (yyvsp
[-1].ifref_list
);
3281 (yyval
.type
)->defined
= TRUE
;
3286 #line 746 "parser.y"
3287 { (yyval
.ifref_list
) = NULL
; ;}
3291 #line 747 "parser.y"
3292 { (yyval
.ifref_list
) = append_ifref( (yyvsp
[-1].ifref_list
), (yyvsp
[0].ifref
) ); ;}
3296 #line 751 "parser.y"
3297 { (yyval
.ifref
) = make_ifref((yyvsp
[0].type
)); (yyval
.ifref
)->attrs
= (yyvsp
[-1].attr_list
); ;}
3301 #line 754 "parser.y"
3302 { (yyval
.type
) = get_type(0, (yyvsp
[0].str
), 0); (yyval
.type
)->kind
= TKIND_DISPATCH
; ;}
3306 #line 755 "parser.y"
3307 { (yyval
.type
) = get_type(0, (yyvsp
[0].str
), 0); (yyval
.type
)->kind
= TKIND_DISPATCH
; ;}
3311 #line 758 "parser.y"
3313 (yyval
.type
) = (yyvsp
[0].type
);
3314 if ((yyval
.type
)->defined
) error_loc("multiple definition error\n");
3315 attrs
= make_attr(ATTR_DISPINTERFACE
);
3316 (yyval
.type
)->attrs
= append_attr( (yyvsp
[-1].attr_list
), attrs
);
3317 (yyval
.type
)->ref
= find_type("IDispatch", 0);
3318 if (!(yyval
.type
)->ref
) error_loc("IDispatch is undefined\n");
3319 (yyval
.type
)->defined
= TRUE
;
3320 if (!parse_only
&& do_header
) write_forward((yyval
.type
));
3325 #line 770 "parser.y"
3326 { (yyval
.var_list
) = NULL
; ;}
3330 #line 771 "parser.y"
3331 { (yyval
.var_list
) = append_var( (yyvsp
[-2].var_list
), (yyvsp
[-1].var
) ); ;}
3335 #line 774 "parser.y"
3336 { (yyval
.func_list
) = NULL
; ;}
3340 #line 775 "parser.y"
3341 { (yyval
.func_list
) = append_func( (yyvsp
[-2].func_list
), (yyvsp
[-1].func
) ); ;}
3345 #line 781 "parser.y"
3346 { (yyval
.type
) = (yyvsp
[-4].type
);
3347 (yyval
.type
)->fields
= (yyvsp
[-2].var_list
);
3348 (yyval
.type
)->funcs
= (yyvsp
[-1].func_list
);
3349 if (!parse_only
&& do_header
) write_dispinterface((yyval
.type
));
3350 if (!parse_only
&& do_idfile
) write_diid((yyval
.type
));
3355 #line 788 "parser.y"
3356 { (yyval
.type
) = (yyvsp
[-4].type
);
3357 (yyval
.type
)->fields
= (yyvsp
[-2].type
)->fields
;
3358 (yyval
.type
)->funcs
= (yyvsp
[-2].type
)->funcs
;
3359 if (!parse_only
&& do_header
) write_dispinterface((yyval
.type
));
3360 if (!parse_only
&& do_idfile
) write_diid((yyval
.type
));
3365 #line 796 "parser.y"
3366 { (yyval
.type
) = NULL
; ;}
3370 #line 797 "parser.y"
3371 { (yyval
.type
) = find_type2((yyvsp
[0].str
), 0); ;}
3375 #line 800 "parser.y"
3376 { (yyval
.type
) = get_type(RPC_FC_IP
, (yyvsp
[0].str
), 0); (yyval
.type
)->kind
= TKIND_INTERFACE
; ;}
3380 #line 801 "parser.y"
3381 { (yyval
.type
) = get_type(RPC_FC_IP
, (yyvsp
[0].str
), 0); (yyval
.type
)->kind
= TKIND_INTERFACE
; ;}
3385 #line 804 "parser.y"
3386 { (yyval
.ifinfo
).interface
= (yyvsp
[0].type
);
3387 (yyval
.ifinfo
).old_pointer_default
= pointer_default
;
3388 if (is_attr((yyvsp
[-1].attr_list
), ATTR_POINTERDEFAULT
))
3389 pointer_default
= get_attrv((yyvsp
[-1].attr_list
), ATTR_POINTERDEFAULT
);
3390 if ((yyvsp
[0].type
)->defined
) error_loc("multiple definition error\n");
3391 (yyvsp
[0].type
)->attrs
= (yyvsp
[-1].attr_list
);
3392 (yyvsp
[0].type
)->defined
= TRUE
;
3393 if (!parse_only
&& do_header
) write_forward((yyvsp
[0].type
));
3398 #line 816 "parser.y"
3399 { (yyval
.type
) = (yyvsp
[-4].ifinfo
).interface
;
3400 (yyval
.type
)->ref
= (yyvsp
[-3].type
);
3401 (yyval
.type
)->funcs
= (yyvsp
[-1].func_list
);
3402 compute_method_indexes((yyval
.type
));
3403 if (!parse_only
&& do_header
) write_interface((yyval
.type
));
3404 if (!parse_only
&& local_stubs
) write_locals(local_stubs
, (yyval
.type
), TRUE
);
3405 if (!parse_only
&& do_idfile
) write_iid((yyval
.type
));
3406 pointer_default
= (yyvsp
[-4].ifinfo
).old_pointer_default
;
3411 #line 828 "parser.y"
3412 { (yyval
.type
) = (yyvsp
[-6].ifinfo
).interface
;
3413 (yyval
.type
)->ref
= find_type2((yyvsp
[-4].str
), 0);
3414 if (!(yyval
.type
)->ref
) error_loc("base class '%s' not found in import\n", (yyvsp
[-4].str
));
3415 (yyval
.type
)->funcs
= (yyvsp
[-1].func_list
);
3416 compute_method_indexes((yyval
.type
));
3417 if (!parse_only
&& do_header
) write_interface((yyval
.type
));
3418 if (!parse_only
&& local_stubs
) write_locals(local_stubs
, (yyval
.type
), TRUE
);
3419 if (!parse_only
&& do_idfile
) write_iid((yyval
.type
));
3420 pointer_default
= (yyvsp
[-6].ifinfo
).old_pointer_default
;
3425 #line 838 "parser.y"
3426 { (yyval
.type
) = (yyvsp
[0].type
); ;}
3430 #line 842 "parser.y"
3431 { (yyval
.type
) = (yyvsp
[-1].type
); if (!parse_only
&& do_header
) write_forward((yyval
.type
)); ;}
3435 #line 843 "parser.y"
3436 { (yyval
.type
) = (yyvsp
[-1].type
); if (!parse_only
&& do_header
) write_forward((yyval
.type
)); ;}
3440 #line 846 "parser.y"
3441 { (yyval
.type
) = make_type(0, NULL
); (yyval
.type
)->name
= (yyvsp
[0].str
); (yyval
.type
)->kind
= TKIND_MODULE
; ;}
3445 #line 847 "parser.y"
3446 { (yyval
.type
) = make_type(0, NULL
); (yyval
.type
)->name
= (yyvsp
[0].str
); (yyval
.type
)->kind
= TKIND_MODULE
; ;}
3450 #line 850 "parser.y"
3451 { (yyval
.type
) = (yyvsp
[0].type
);
3452 (yyval
.type
)->attrs
= (yyvsp
[-1].attr_list
);
3457 #line 855 "parser.y"
3458 { (yyval
.type
) = (yyvsp
[-3].type
);
3459 (yyval
.type
)->funcs
= (yyvsp
[-1].func_list
);
3460 /* FIXME: if (!parse_only && do_header) write_module($$); */
3465 #line 861 "parser.y"
3466 { (yyval
.pident
) = (yyvsp
[0].pident
); (yyval
.pident
)->ptr_level
++; ;}
3470 #line 862 "parser.y"
3471 { (yyval
.pident
) = (yyvsp
[0].pident
); /* FIXME */ ;}
3475 #line 865 "parser.y"
3476 { (yyval
.pident
) = make_pident((yyvsp
[0].var
)); ;}
3480 #line 867 "parser.y"
3481 { (yyval
.pident
) = (yyvsp
[-1].pident
); ;}
3485 #line 871 "parser.y"
3486 { (yyval
.pident_list
) = append_pident( NULL
, (yyvsp
[0].pident
) ); ;}
3490 #line 872 "parser.y"
3491 { (yyval
.pident_list
) = append_pident( (yyvsp
[-2].pident_list
), (yyvsp
[0].pident
) ); ;}
3495 #line 876 "parser.y"
3496 { (yyval
.num
) = RPC_FC_RP
; ;}
3500 #line 877 "parser.y"
3501 { (yyval
.num
) = RPC_FC_UP
; ;}
3505 #line 878 "parser.y"
3506 { (yyval
.num
) = RPC_FC_FP
; ;}
3510 #line 881 "parser.y"
3511 { (yyval
.type
) = get_typev(RPC_FC_STRUCT
, (yyvsp
[-3].var
), tsSTRUCT
);
3512 /* overwrite RPC_FC_STRUCT with a more exact type */
3513 (yyval
.type
)->type
= get_struct_type( (yyvsp
[-1].var_list
) );
3514 (yyval
.type
)->kind
= TKIND_RECORD
;
3515 (yyval
.type
)->fields
= (yyvsp
[-1].var_list
);
3516 (yyval
.type
)->defined
= TRUE
;
3518 add_typelib_entry((yyval
.type
));
3523 #line 892 "parser.y"
3524 { (yyval
.type
) = duptype(find_type("void", 0), 1); ;}
3528 #line 893 "parser.y"
3529 { (yyval
.type
) = find_type((yyvsp
[0].str
), 0); ;}
3533 #line 894 "parser.y"
3534 { (yyval
.type
) = (yyvsp
[0].type
); ;}
3538 #line 895 "parser.y"
3539 { (yyval
.type
) = duptype((yyvsp
[0].type
), 1); (yyval
.type
)->is_const
= TRUE
; ;}
3543 #line 896 "parser.y"
3544 { (yyval
.type
) = (yyvsp
[0].type
); ;}
3548 #line 897 "parser.y"
3549 { (yyval
.type
) = find_type2((yyvsp
[0].str
), tsENUM
); ;}
3553 #line 898 "parser.y"
3554 { (yyval
.type
) = (yyvsp
[0].type
); ;}
3558 #line 899 "parser.y"
3559 { (yyval
.type
) = get_type(RPC_FC_STRUCT
, (yyvsp
[0].str
), tsSTRUCT
); ;}
3563 #line 900 "parser.y"
3564 { (yyval
.type
) = (yyvsp
[0].type
); ;}
3568 #line 901 "parser.y"
3569 { (yyval
.type
) = find_type2((yyvsp
[0].str
), tsUNION
); ;}
3573 #line 902 "parser.y"
3574 { (yyval
.type
) = make_safearray((yyvsp
[-1].type
)); ;}
3578 #line 905 "parser.y"
3579 { reg_typedefs((yyvsp
[-1].type
), (yyvsp
[0].pident_list
), (yyvsp
[-2].attr_list
));
3580 process_typedefs((yyvsp
[0].pident_list
));
3585 #line 910 "parser.y"
3586 { (yyval
.type
) = get_typev(RPC_FC_NON_ENCAPSULATED_UNION
, (yyvsp
[-3].var
), tsUNION
);
3587 (yyval
.type
)->kind
= TKIND_UNION
;
3588 (yyval
.type
)->fields
= (yyvsp
[-1].var_list
);
3589 (yyval
.type
)->defined
= TRUE
;
3594 #line 917 "parser.y"
3595 { var_t
*u
= (yyvsp
[-3].var
);
3596 (yyval
.type
) = get_typev(RPC_FC_ENCAPSULATED_UNION
, (yyvsp
[-8].var
), tsUNION
);
3597 (yyval
.type
)->kind
= TKIND_UNION
;
3598 if (!u
) u
= make_var( xstrdup("tagged_union") );
3599 u
->type
= make_type(RPC_FC_NON_ENCAPSULATED_UNION
, NULL
);
3600 u
->type
->kind
= TKIND_UNION
;
3601 u
->type
->fields
= (yyvsp
[-1].var_list
);
3602 u
->type
->defined
= TRUE
;
3603 (yyval
.type
)->fields
= append_var( (yyval
.type
)->fields
, (yyvsp
[-5].var
) );
3604 (yyval
.type
)->fields
= append_var( (yyval
.type
)->fields
, u
);
3605 (yyval
.type
)->defined
= TRUE
;
3610 #line 932 "parser.y"
3611 { (yyval
.num
) = MAKEVERSION((yyvsp
[0].num
), 0); ;}
3615 #line 933 "parser.y"
3616 { (yyval
.num
) = MAKEVERSION((yyvsp
[-2].num
), (yyvsp
[0].num
)); ;}
3623 /* Line 1126 of yacc.c. */
3624 #line 3625 "parser.tab.c"
3630 YY_STACK_PRINT (yyss
, yyssp
);
3635 /* Now `shift' the result of the reduction. Determine what state
3636 that goes to, based on the state we popped back to and the rule
3637 number reduced by. */
3641 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
3642 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
3643 yystate
= yytable
[yystate
];
3645 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
3650 /*------------------------------------.
3651 | yyerrlab -- here on detecting error |
3652 `------------------------------------*/
3654 /* If not already recovering from an error, report this error. */
3659 yyn
= yypact
[yystate
];
3661 if (YYPACT_NINF
< yyn
&& yyn
< YYLAST
)
3663 int yytype
= YYTRANSLATE (yychar
);
3664 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytype
]);
3665 YYSIZE_T yysize
= yysize0
;
3667 int yysize_overflow
= 0;
3669 # define YYERROR_VERBOSE_ARGS_MAXIMUM 5
3670 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
3674 /* This is so xgettext sees the translatable formats that are
3675 constructed on the fly. */
3676 YY_("syntax error, unexpected %s");
3677 YY_("syntax error, unexpected %s, expecting %s");
3678 YY_("syntax error, unexpected %s, expecting %s or %s");
3679 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
3680 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
3684 static char const yyunexpected
[] = "syntax error, unexpected %s";
3685 static char const yyexpecting
[] = ", expecting %s";
3686 static char const yyor
[] = " or %s";
3687 char yyformat
[sizeof yyunexpected
3688 + sizeof yyexpecting
- 1
3689 + ((YYERROR_VERBOSE_ARGS_MAXIMUM
- 2)
3690 * (sizeof yyor
- 1))];
3691 char const *yyprefix
= yyexpecting
;
3693 /* Start YYX at -YYN if negative to avoid negative indexes in
3695 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
3697 /* Stay within bounds of both yycheck and yytname. */
3698 int yychecklim
= YYLAST
- yyn
;
3699 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
3702 yyarg
[0] = yytname
[yytype
];
3703 yyfmt
= yystpcpy (yyformat
, yyunexpected
);
3705 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
3706 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
3708 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
3712 yyformat
[sizeof yyunexpected
- 1] = '\0';
3715 yyarg
[yycount
++] = yytname
[yyx
];
3716 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
3717 yysize_overflow
|= yysize1
< yysize
;
3719 yyfmt
= yystpcpy (yyfmt
, yyprefix
);
3723 yyf
= YY_(yyformat
);
3724 yysize1
= yysize
+ yystrlen (yyf
);
3725 yysize_overflow
|= yysize1
< yysize
;
3728 if (!yysize_overflow
&& yysize
<= YYSTACK_ALLOC_MAXIMUM
)
3729 yymsg
= (char *) YYSTACK_ALLOC (yysize
);
3732 /* Avoid sprintf, as that infringes on the user's name space.
3733 Don't have undefined behavior even if the translation
3734 produced a string with the wrong number of "%s"s. */
3737 while ((*yyp
= *yyf
))
3739 if (*yyp
== '%' && yyf
[1] == 's' && yyi
< yycount
)
3741 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
3751 YYSTACK_FREE (yymsg
);
3755 yyerror (YY_("syntax error"));
3756 goto yyexhaustedlab
;
3760 #endif /* YYERROR_VERBOSE */
3761 yyerror (YY_("syntax error"));
3766 if (yyerrstatus
== 3)
3768 /* If just tried and failed to reuse look-ahead token after an
3769 error, discard it. */
3771 if (yychar
<= YYEOF
)
3773 /* Return failure if at end of input. */
3774 if (yychar
== YYEOF
)
3779 yydestruct ("Error: discarding", yytoken
, &yylval
);
3784 /* Else will try to reuse look-ahead token after shifting the error
3789 /*---------------------------------------------------.
3790 | yyerrorlab -- error raised explicitly by YYERROR. |
3791 `---------------------------------------------------*/
3794 /* Pacify compilers like GCC when the user code never invokes
3795 YYERROR and the label yyerrorlab therefore never appears in user
3806 /*-------------------------------------------------------------.
3807 | yyerrlab1 -- common code for both syntax error and YYERROR. |
3808 `-------------------------------------------------------------*/
3810 yyerrstatus
= 3; /* Each real token shifted decrements this. */
3814 yyn
= yypact
[yystate
];
3815 if (yyn
!= YYPACT_NINF
)
3818 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
3826 /* Pop the current state because it cannot handle the error token. */
3831 yydestruct ("Error: popping", yystos
[yystate
], yyvsp
);
3834 YY_STACK_PRINT (yyss
, yyssp
);
3843 /* Shift the error token. */
3844 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
3850 /*-------------------------------------.
3851 | yyacceptlab -- YYACCEPT comes here. |
3852 `-------------------------------------*/
3857 /*-----------------------------------.
3858 | yyabortlab -- YYABORT comes here. |
3859 `-----------------------------------*/
3865 /*-------------------------------------------------.
3866 | yyexhaustedlab -- memory exhaustion comes here. |
3867 `-------------------------------------------------*/
3869 yyerror (YY_("memory exhausted"));
3875 if (yychar
!= YYEOF
&& yychar
!= YYEMPTY
)
3876 yydestruct ("Cleanup: discarding lookahead",
3878 while (yyssp
!= yyss
)
3880 yydestruct ("Cleanup: popping",
3881 yystos
[*yyssp
], yyvsp
);
3886 YYSTACK_FREE (yyss
);
3892 #line 936 "parser.y"
3895 static void decl_builtin(const char *name
, unsigned char type
)
3897 type_t
*t
= make_type(type
, NULL
);
3898 t
->name
= xstrdup(name
);
3899 reg_type(t
, name
, 0);
3902 static type_t
*make_builtin(char *name
)
3904 /* NAME is strdup'd in the lexer */
3905 type_t
*t
= duptype(find_type(name
, 0), 0);
3910 static type_t
*make_int(int sign
)
3912 type_t
*t
= duptype(find_type("int", 0), 1);
3916 t
->type
= t
->type
== RPC_FC_LONG
? RPC_FC_ULONG
: RPC_FC_USHORT
;
3921 void init_types(void)
3923 decl_builtin("void", 0);
3924 decl_builtin("byte", RPC_FC_BYTE
);
3925 decl_builtin("wchar_t", RPC_FC_WCHAR
);
3926 decl_builtin("int", RPC_FC_LONG
); /* win32 */
3927 decl_builtin("short", RPC_FC_SHORT
);
3928 decl_builtin("small", RPC_FC_SMALL
);
3929 decl_builtin("long", RPC_FC_LONG
);
3930 decl_builtin("hyper", RPC_FC_HYPER
);
3931 decl_builtin("__int64", RPC_FC_HYPER
);
3932 decl_builtin("char", RPC_FC_CHAR
);
3933 decl_builtin("float", RPC_FC_FLOAT
);
3934 decl_builtin("double", RPC_FC_DOUBLE
);
3935 decl_builtin("boolean", RPC_FC_BYTE
);
3936 decl_builtin("error_status_t", RPC_FC_ERROR_STATUS_T
);
3937 decl_builtin("handle_t", RPC_FC_BIND_PRIMITIVE
);
3940 static str_list_t
*append_str(str_list_t
*list
, char *str
)
3942 struct str_list_entry_t
*entry
;
3944 if (!str
) return list
;
3947 list
= xmalloc( sizeof(*list
) );
3950 entry
= xmalloc( sizeof(*entry
) );
3952 list_add_tail( list
, &entry
->entry
);
3956 static attr_list_t
*append_attr(attr_list_t
*list
, attr_t
*attr
)
3958 if (!attr
) return list
;
3961 list
= xmalloc( sizeof(*list
) );
3964 list_add_tail( list
, &attr
->entry
);
3968 static attr_t
*make_attr(enum attr_type type
)
3970 attr_t
*a
= xmalloc(sizeof(attr_t
));
3976 static attr_t
*make_attrv(enum attr_type type
, unsigned long val
)
3978 attr_t
*a
= xmalloc(sizeof(attr_t
));
3984 static attr_t
*make_attrp(enum attr_type type
, void *val
)
3986 attr_t
*a
= xmalloc(sizeof(attr_t
));
3992 static expr_t
*make_expr(enum expr_type type
)
3994 expr_t
*e
= xmalloc(sizeof(expr_t
));
3998 e
->is_const
= FALSE
;
4003 static expr_t
*make_exprl(enum expr_type type
, long val
)
4005 expr_t
*e
= xmalloc(sizeof(expr_t
));
4009 e
->is_const
= FALSE
;
4010 /* check for numeric constant */
4011 if (type
== EXPR_NUM
|| type
== EXPR_HEXNUM
|| type
== EXPR_TRUEFALSE
) {
4012 /* make sure true/false value is valid */
4013 assert(type
!= EXPR_TRUEFALSE
|| val
== 0 || val
== 1);
4020 static expr_t
*make_exprd(enum expr_type type
, double val
)
4022 expr_t
*e
= xmalloc(sizeof(expr_t
));
4031 static expr_t
*make_exprs(enum expr_type type
, char *val
)
4034 e
= xmalloc(sizeof(expr_t
));
4038 e
->is_const
= FALSE
;
4039 /* check for predefined constants */
4040 if (type
== EXPR_IDENTIFIER
) {
4041 var_t
*c
= find_const(val
, 0);
4043 e
->u
.sval
= c
->name
;
4046 e
->cval
= c
->eval
->cval
;
4052 static expr_t
*make_exprt(enum expr_type type
, type_t
*tref
, expr_t
*expr
)
4055 e
= xmalloc(sizeof(expr_t
));
4059 e
->is_const
= FALSE
;
4060 /* check for cast of constant expression */
4061 if (type
== EXPR_SIZEOF
) {
4062 switch (tref
->type
) {
4079 case RPC_FC_ERROR_STATUS_T
:
4090 if (type
== EXPR_CAST
&& expr
->is_const
) {
4092 e
->cval
= expr
->cval
;
4097 static expr_t
*make_expr1(enum expr_type type
, expr_t
*expr
)
4100 if (type
== EXPR_ADDRESSOF
&& expr
->type
!= EXPR_IDENTIFIER
)
4101 error("address-of operator applied to invalid expression\n");
4102 e
= xmalloc(sizeof(expr_t
));
4106 e
->is_const
= FALSE
;
4107 /* check for compile-time optimization */
4108 if (expr
->is_const
) {
4112 e
->cval
= -expr
->cval
;
4115 e
->cval
= ~expr
->cval
;
4118 e
->is_const
= FALSE
;
4125 static expr_t
*make_expr2(enum expr_type type
, expr_t
*expr1
, expr_t
*expr2
)
4128 e
= xmalloc(sizeof(expr_t
));
4132 e
->is_const
= FALSE
;
4133 /* check for compile-time optimization */
4134 if (expr1
->is_const
&& expr2
->is_const
) {
4138 e
->cval
= expr1
->cval
+ expr2
->cval
;
4141 e
->cval
= expr1
->cval
- expr2
->cval
;
4144 e
->cval
= expr1
->cval
* expr2
->cval
;
4147 e
->cval
= expr1
->cval
/ expr2
->cval
;
4150 e
->cval
= expr1
->cval
| expr2
->cval
;
4153 e
->cval
= expr1
->cval
& expr2
->cval
;
4156 e
->cval
= expr1
->cval
<< expr2
->cval
;
4159 e
->cval
= expr1
->cval
>> expr2
->cval
;
4162 e
->is_const
= FALSE
;
4169 static expr_t
*make_expr3(enum expr_type type
, expr_t
*expr1
, expr_t
*expr2
, expr_t
*expr3
)
4172 e
= xmalloc(sizeof(expr_t
));
4177 e
->is_const
= FALSE
;
4178 /* check for compile-time optimization */
4179 if (expr1
->is_const
&& expr2
->is_const
&& expr3
->is_const
) {
4183 e
->cval
= expr1
->cval
? expr2
->cval
: expr3
->cval
;
4186 e
->is_const
= FALSE
;
4193 static expr_list_t
*append_expr(expr_list_t
*list
, expr_t
*expr
)
4195 if (!expr
) return list
;
4198 list
= xmalloc( sizeof(*list
) );
4201 list_add_tail( list
, &expr
->entry
);
4205 static array_dims_t
*append_array(array_dims_t
*list
, expr_t
*expr
)
4207 if (!expr
) return list
;
4210 list
= xmalloc( sizeof(*list
) );
4213 list_add_tail( list
, &expr
->entry
);
4217 static struct list type_pool
= LIST_INIT(type_pool
);
4224 type_t
*alloc_type(void)
4226 type_pool_node_t
*node
= xmalloc(sizeof *node
);
4227 list_add_tail(&type_pool
, &node
->link
);
4231 void set_all_tfswrite(int val
)
4233 type_pool_node_t
*node
;
4234 LIST_FOR_EACH_ENTRY(node
, &type_pool
, type_pool_node_t
, link
)
4235 node
->data
.tfswrite
= val
;
4238 static type_t
*make_type(unsigned char type
, type_t
*ref
)
4240 type_t
*t
= alloc_type();
4242 t
->kind
= TKIND_PRIMITIVE
;
4252 t
->length_is
= NULL
;
4253 t
->typestring_offset
= 0;
4255 t
->declarray
= FALSE
;
4256 t
->ignore
= (parse_only
!= 0);
4257 t
->is_const
= FALSE
;
4261 t
->user_types_registered
= FALSE
;
4262 t
->tfswrite
= FALSE
;
4263 t
->typelib_idx
= -1;
4267 static void set_type(var_t
*v
, type_t
*type
, int ptr_level
, array_dims_t
*arr
,
4270 expr_list_t
*sizes
= get_attrp(v
->attrs
, ATTR_SIZEIS
);
4271 expr_list_t
*lengs
= get_attrp(v
->attrs
, ATTR_LENGTHIS
);
4272 int ptr_attr
= get_attrv(v
->attrs
, ATTR_POINTERTYPE
);
4273 int ptr_type
= ptr_attr
;
4274 int sizeless
, has_varconf
;
4276 type_t
*atype
, **ptype
;
4280 if (!ptr_type
&& top
)
4281 ptr_type
= RPC_FC_RP
;
4283 for ( ; 0 < ptr_level
; --ptr_level
)
4285 v
->type
= make_type(pointer_default
, v
->type
);
4286 if (ptr_level
== 1 && ptr_type
&& !arr
)
4288 v
->type
->type
= ptr_type
;
4293 if (ptr_type
&& !arr
)
4295 if (is_ptr(v
->type
))
4297 if (v
->type
->type
!= ptr_type
)
4299 v
->type
= duptype(v
->type
, 1);
4300 v
->type
->type
= ptr_type
;
4303 else if (!arr
&& ptr_attr
)
4304 error("%s: pointer attribute applied to non-pointer type\n", v
->name
);
4308 if (arr
) LIST_FOR_EACH_ENTRY_REV(dim
, arr
, expr_t
, entry
)
4311 error("%s: only the first array dimension can be unspecified\n", v
->name
);
4315 unsigned int align
= 0;
4316 size_t size
= type_memsize(v
->type
, &align
);
4319 error("%s: array dimension must be positive\n", v
->name
);
4321 if (0xffffffffuL
/ size
< (unsigned long) dim
->cval
)
4322 error("%s: total array size is too large\n", v
->name
);
4323 else if (0xffffuL
< size
* dim
->cval
)
4324 v
->type
= make_type(RPC_FC_LGFARRAY
, v
->type
);
4326 v
->type
= make_type(RPC_FC_SMFARRAY
, v
->type
);
4331 v
->type
= make_type(RPC_FC_CARRAY
, v
->type
);
4334 v
->type
->declarray
= TRUE
;
4335 v
->type
->dim
= dim
->cval
;
4339 has_varconf
= FALSE
;
4340 if (sizes
) LIST_FOR_EACH_ENTRY(dim
, sizes
, expr_t
, entry
)
4342 if (dim
->type
!= EXPR_VOID
)
4345 atype
= *ptype
= duptype(*ptype
, 0);
4347 if (atype
->type
== RPC_FC_SMFARRAY
|| atype
->type
== RPC_FC_LGFARRAY
)
4348 error("%s: cannot specify size_is for a fixed sized array\n", v
->name
);
4350 if (atype
->type
!= RPC_FC_CARRAY
&& !is_ptr(atype
))
4351 error("%s: size_is attribute applied to illegal type\n", v
->name
);
4353 atype
->type
= RPC_FC_CARRAY
;
4354 atype
->size_is
= dim
;
4357 ptype
= &(*ptype
)->ref
;
4359 error("%s: too many expressions in size_is attribute\n", v
->name
);
4363 if (lengs
) LIST_FOR_EACH_ENTRY(dim
, lengs
, expr_t
, entry
)
4365 if (dim
->type
!= EXPR_VOID
)
4368 atype
= *ptype
= duptype(*ptype
, 0);
4370 if (atype
->type
== RPC_FC_SMFARRAY
)
4371 atype
->type
= RPC_FC_SMVARRAY
;
4372 else if (atype
->type
== RPC_FC_LGFARRAY
)
4373 atype
->type
= RPC_FC_LGVARRAY
;
4374 else if (atype
->type
== RPC_FC_CARRAY
)
4375 atype
->type
= RPC_FC_CVARRAY
;
4377 error("%s: length_is attribute applied to illegal type\n", v
->name
);
4379 atype
->length_is
= dim
;
4382 ptype
= &(*ptype
)->ref
;
4384 error("%s: too many expressions in length_is attribute\n", v
->name
);
4387 if (has_varconf
&& !last_array(v
->type
))
4390 for (ptype
= &v
->type
; is_array(*ptype
); ptype
= &(*ptype
)->ref
)
4392 *ptype
= duptype(*ptype
, 0);
4393 (*ptype
)->type
= RPC_FC_BOGUS_ARRAY
;
4397 if (is_array(v
->type
))
4399 const type_t
*rt
= v
->type
->ref
;
4400 if (is_user_type(rt
))
4401 v
->type
->type
= RPC_FC_BOGUS_ARRAY
;
4405 case RPC_FC_BOGUS_STRUCT
:
4406 case RPC_FC_NON_ENCAPSULATED_UNION
:
4407 case RPC_FC_ENCAPSULATED_UNION
:
4409 v
->type
->type
= RPC_FC_BOGUS_ARRAY
;
4411 /* FC_RP should be above, but widl overuses these, and will break things. */
4414 if (rt
->ref
->type
== RPC_FC_IP
)
4415 v
->type
->type
= RPC_FC_BOGUS_ARRAY
;
4421 static ifref_list_t
*append_ifref(ifref_list_t
*list
, ifref_t
*iface
)
4423 if (!iface
) return list
;
4426 list
= xmalloc( sizeof(*list
) );
4429 list_add_tail( list
, &iface
->entry
);
4433 static ifref_t
*make_ifref(type_t
*iface
)
4435 ifref_t
*l
= xmalloc(sizeof(ifref_t
));
4441 static var_list_t
*append_var(var_list_t
*list
, var_t
*var
)
4443 if (!var
) return list
;
4446 list
= xmalloc( sizeof(*list
) );
4449 list_add_tail( list
, &var
->entry
);
4453 static var_t
*make_var(char *name
)
4455 var_t
*v
= xmalloc(sizeof(var_t
));
4464 static pident_list_t
*append_pident(pident_list_t
*list
, pident_t
*p
)
4466 if (!p
) return list
;
4468 list
= xmalloc(sizeof(*list
));
4471 list_add_tail(list
, &p
->entry
);
4475 static pident_t
*make_pident(var_t
*var
)
4477 pident_t
*p
= xmalloc(sizeof(*p
));
4483 static func_list_t
*append_func(func_list_t
*list
, func_t
*func
)
4485 if (!func
) return list
;
4488 list
= xmalloc( sizeof(*list
) );
4491 list_add_tail( list
, &func
->entry
);
4495 static func_t
*make_func(var_t
*def
, var_list_t
*args
)
4497 func_t
*f
= xmalloc(sizeof(func_t
));
4500 f
->ignore
= parse_only
;
4505 static type_t
*make_class(char *name
)
4507 type_t
*c
= make_type(0, NULL
);
4509 c
->kind
= TKIND_COCLASS
;
4513 static type_t
*make_safearray(type_t
*type
)
4515 type_t
*sa
= duptype(find_type("SAFEARRAY", 0), 1);
4517 return make_type(pointer_default
, sa
);
4522 static int hash_ident(const char *name
)
4524 const char *p
= name
;
4526 /* a simple sum hash is probably good enough */
4531 return sum
& (HASHMAX
-1);
4534 /***** type repository *****/
4543 struct rtype
*type_hash
[HASHMAX
];
4545 static type_t
*reg_type(type_t
*type
, const char *name
, int t
)
4550 error_loc("registering named type without name\n");
4553 hash
= hash_ident(name
);
4554 nt
= xmalloc(sizeof(struct rtype
));
4558 nt
->next
= type_hash
[hash
];
4559 type_hash
[hash
] = nt
;
4563 static int is_incomplete(const type_t
*t
)
4565 return !t
->defined
&& (is_struct(t
->type
) || is_union(t
->type
));
4568 static void add_incomplete(type_t
*t
)
4570 struct typenode
*tn
= xmalloc(sizeof *tn
);
4572 list_add_tail(&incomplete_types
, &tn
->entry
);
4575 static void fix_type(type_t
*t
)
4577 if (t
->kind
== TKIND_ALIAS
&& is_incomplete(t
)) {
4578 type_t
*ot
= t
->orig
;
4580 t
->fields
= ot
->fields
;
4581 t
->defined
= ot
->defined
;
4585 static void fix_incomplete(void)
4587 struct typenode
*tn
, *next
;
4589 LIST_FOR_EACH_ENTRY_SAFE(tn
, next
, &incomplete_types
, struct typenode
, entry
) {
4595 static type_t
*reg_typedefs(type_t
*type
, pident_list_t
*pidents
, attr_list_t
*attrs
)
4598 const pident_t
*pident
;
4600 int is_str
= is_attr(attrs
, ATTR_STRING
);
4601 unsigned char ptr_type
= get_attrv(attrs
, ATTR_POINTERTYPE
);
4612 if (c
!= RPC_FC_CHAR
&& c
!= RPC_FC_BYTE
&& c
!= RPC_FC_WCHAR
)
4614 pident
= LIST_ENTRY( list_head( pidents
), const pident_t
, entry
);
4615 error_loc("'%s': [string] attribute is only valid on 'char', 'byte', or 'wchar_t' pointers and arrays\n",
4620 /* We must generate names for tagless enum, struct or union.
4621 Typedef-ing a tagless enum, struct or union means we want the typedef
4622 to be included in a library whether it has other attributes or not,
4623 hence the public attribute. */
4624 if ((type
->kind
== TKIND_ENUM
|| type
->kind
== TKIND_RECORD
4625 || type
->kind
== TKIND_UNION
) && ! type
->name
&& ! parse_only
)
4627 if (! is_attr(attrs
, ATTR_PUBLIC
))
4628 attrs
= append_attr( attrs
, make_attr(ATTR_PUBLIC
) );
4629 type
->name
= gen_name();
4632 LIST_FOR_EACH_ENTRY( pident
, pidents
, const pident_t
, entry
)
4634 var_t
*name
= pident
->var
;
4638 int cptr
= pident
->ptr_level
;
4640 while (cptr
> ptrc
) {
4641 cur
= ptr
= make_type(pointer_default
, cur
);
4645 while (cptr
< ptrc
) {
4650 cur
= alias(cur
, name
->name
);
4655 cur
->type
= ptr_type
;
4657 error_loc("'%s': pointer attribute applied to non-pointer type\n",
4660 else if (is_str
&& ! is_ptr(cur
))
4661 error_loc("'%s': [string] attribute applied to non-pointer type\n",
4664 if (is_incomplete(cur
))
4665 add_incomplete(cur
);
4666 reg_type(cur
, cur
->name
, 0);
4672 static type_t
*find_type(const char *name
, int t
)
4674 struct rtype
*cur
= type_hash
[hash_ident(name
)];
4675 while (cur
&& (cur
->t
!= t
|| strcmp(cur
->name
, name
)))
4678 error_loc("type '%s' not found\n", name
);
4684 static type_t
*find_type2(char *name
, int t
)
4686 type_t
*tp
= find_type(name
, t
);
4691 int is_type(const char *name
)
4693 struct rtype
*cur
= type_hash
[hash_ident(name
)];
4694 while (cur
&& (cur
->t
|| strcmp(cur
->name
, name
)))
4696 if (cur
) return TRUE
;
4700 static type_t
*get_type(unsigned char type
, char *name
, int t
)
4702 struct rtype
*cur
= NULL
;
4705 cur
= type_hash
[hash_ident(name
)];
4706 while (cur
&& (cur
->t
!= t
|| strcmp(cur
->name
, name
)))
4713 tp
= make_type(type
, NULL
);
4715 if (!name
) return tp
;
4716 return reg_type(tp
, name
, t
);
4719 static type_t
*get_typev(unsigned char type
, var_t
*name
, int t
)
4726 return get_type(type
, sname
, t
);
4729 static int get_struct_type(var_list_t
*fields
)
4731 int has_pointer
= 0;
4732 int has_conformance
= 0;
4733 int has_variance
= 0;
4736 if (get_padding(fields
))
4737 return RPC_FC_BOGUS_STRUCT
;
4739 if (fields
) LIST_FOR_EACH_ENTRY( field
, fields
, var_t
, entry
)
4741 type_t
*t
= field
->type
;
4743 if (is_user_type(t
))
4744 return RPC_FC_BOGUS_STRUCT
;
4755 case RPC_FC_ENCAPSULATED_UNION
:
4756 case RPC_FC_NON_ENCAPSULATED_UNION
:
4757 case RPC_FC_BOGUS_STRUCT
:
4758 return RPC_FC_BOGUS_STRUCT
;
4765 if (field
->type
->declarray
)
4767 if (is_string_type(field
->attrs
, field
->type
))
4769 if (is_conformant_array(field
->type
))
4770 has_conformance
= 1;
4775 if (is_array(field
->type
->ref
))
4776 return RPC_FC_BOGUS_STRUCT
;
4778 if (is_conformant_array(field
->type
))
4780 has_conformance
= 1;
4781 if (field
->type
->declarray
&& list_next(fields
, &field
->entry
))
4782 error_loc("field '%s' deriving from a conformant array must be the last field in the structure\n",
4785 if (field
->type
->length_is
)
4788 t
= field
->type
->ref
;
4794 * RPC_FC_BYTE, RPC_FC_STRUCT, etc
4795 * Simple types don't effect the type of struct.
4796 * A struct containing a simple struct is still a simple struct.
4797 * So long as we can block copy the data, we return RPC_FC_STRUCT.
4799 case 0: /* void pointer */
4809 case RPC_FC_INT3264
:
4810 case RPC_FC_UINT3264
:
4824 case RPC_FC_CVARRAY
:
4825 case RPC_FC_BOGUS_ARRAY
:
4830 * Propagate member attributes
4831 * a struct should be at least as complex as its member
4833 case RPC_FC_CVSTRUCT
:
4834 has_conformance
= 1;
4839 case RPC_FC_CPSTRUCT
:
4840 has_conformance
= 1;
4841 if (list_next( fields
, &field
->entry
))
4842 error_loc("field '%s' deriving from a conformant array must be the last field in the structure\n",
4847 case RPC_FC_CSTRUCT
:
4848 has_conformance
= 1;
4849 if (list_next( fields
, &field
->entry
))
4850 error_loc("field '%s' deriving from a conformant array must be the last field in the structure\n",
4854 case RPC_FC_PSTRUCT
:
4859 error_loc("Unknown struct member %s with type (0x%02x)\n", field
->name
, t
->type
);
4860 /* fallthru - treat it as complex */
4862 /* as soon as we see one of these these members, it's bogus... */
4863 case RPC_FC_ENCAPSULATED_UNION
:
4864 case RPC_FC_NON_ENCAPSULATED_UNION
:
4865 case RPC_FC_BOGUS_STRUCT
:
4866 return RPC_FC_BOGUS_STRUCT
;
4872 if ( has_conformance
)
4873 return RPC_FC_CVSTRUCT
;
4875 return RPC_FC_BOGUS_STRUCT
;
4877 if( has_conformance
&& has_pointer
)
4878 return RPC_FC_CPSTRUCT
;
4879 if( has_conformance
)
4880 return RPC_FC_CSTRUCT
;
4882 return RPC_FC_PSTRUCT
;
4883 return RPC_FC_STRUCT
;
4886 /***** constant repository *****/
4891 struct rconst
*next
;
4894 struct rconst
*const_hash
[HASHMAX
];
4896 static var_t
*reg_const(var_t
*var
)
4901 error_loc("registering constant without name\n");
4904 hash
= hash_ident(var
->name
);
4905 nc
= xmalloc(sizeof(struct rconst
));
4906 nc
->name
= var
->name
;
4908 nc
->next
= const_hash
[hash
];
4909 const_hash
[hash
] = nc
;
4913 static var_t
*find_const(char *name
, int f
)
4915 struct rconst
*cur
= const_hash
[hash_ident(name
)];
4916 while (cur
&& strcmp(cur
->name
, name
))
4919 if (f
) error_loc("constant '%s' not found\n", name
);
4925 static void write_libid(const char *name
, const attr_list_t
*attr
)
4927 const UUID
*uuid
= get_attrp(attr
, ATTR_UUID
);
4928 write_guid(idfile
, "LIBID", name
, uuid
);
4931 static void write_clsid(type_t
*cls
)
4933 const UUID
*uuid
= get_attrp(cls
->attrs
, ATTR_UUID
);
4934 write_guid(idfile
, "CLSID", cls
->name
, uuid
);
4937 static void write_diid(type_t
*iface
)
4939 const UUID
*uuid
= get_attrp(iface
->attrs
, ATTR_UUID
);
4940 write_guid(idfile
, "DIID", iface
->name
, uuid
);
4943 static void write_iid(type_t
*iface
)
4945 const UUID
*uuid
= get_attrp(iface
->attrs
, ATTR_UUID
);
4946 write_guid(idfile
, "IID", iface
->name
, uuid
);
4949 static int compute_method_indexes(type_t
*iface
)
4955 idx
= compute_method_indexes(iface
->ref
);
4962 LIST_FOR_EACH_ENTRY( f
, iface
->funcs
, func_t
, entry
)
4963 if (! is_callas(f
->def
->attrs
))
4969 static char *gen_name(void)
4971 static const char format
[] = "__WIDL_%s_generated_name_%08lX";
4972 static unsigned long n
= 0;
4973 static const char *file_id
;
4979 char *dst
= dup_basename(input_name
, ".idl");
4983 if (! isalnum((unsigned char) *dst
))
4986 size
= sizeof format
- 7 + strlen(file_id
) + 8;
4989 name
= xmalloc(size
);
4990 sprintf(name
, format
, file_id
, n
++);
4994 static void process_typedefs(pident_list_t
*pidents
)
4996 pident_t
*pident
, *next
;
4998 if (!pidents
) return;
4999 LIST_FOR_EACH_ENTRY_SAFE( pident
, next
, pidents
, pident_t
, entry
)
5001 var_t
*var
= pident
->var
;
5002 type_t
*type
= find_type(var
->name
, 0);
5004 if (! parse_only
&& do_header
)
5005 write_typedef(type
);
5006 if (in_typelib
&& type
->attrs
)
5007 add_typelib_entry(type
);
5014 static void check_arg(var_t
*arg
)
5016 type_t
*t
= arg
->type
;
5018 if (t
->type
== 0 && ! is_var_ptr(arg
))
5019 error_loc("argument '%s' has void type\n", arg
->name
);
5022 static void check_all_user_types(ifref_list_t
*ifrefs
)
5024 const ifref_t
*ifref
;
5027 if (ifrefs
) LIST_FOR_EACH_ENTRY(ifref
, ifrefs
, const ifref_t
, entry
)
5029 const func_list_t
*fs
= ifref
->iface
->funcs
;
5030 if (fs
) LIST_FOR_EACH_ENTRY(f
, fs
, const func_t
, entry
)
5031 check_for_user_types_and_context_handles(f
->args
);
5035 int is_valid_uuid(const char *s
)
5039 for (i
= 0; i
< 36; ++i
)
5040 if (i
== 8 || i
== 13 || i
== 18 || i
== 23)
5046 if (!isxdigit(s
[i
]))
5049 return s
[i
] == '\0';