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
105 tCONTEXTHANDLE
= 296,
106 tCONTEXTHANDLENOSERIALIZE
= 297,
107 tCONTEXTHANDLESERIALIZE
= 298,
111 tDEFAULTCOLLELEM
= 302,
113 tDEFAULTVTABLE
= 304,
115 tDISPINTERFACE
= 306,
123 tEXPLICITHANDLE
= 314,
133 tHELPSTRINGCONTEXT
= 324,
134 tHELPSTRINGDLL
= 325,
140 tIMMEDIATEBIND
= 331,
141 tIMPLICITHANDLE
= 332,
160 tNONEXTENSIBLE
= 351,
164 tOLEAUTOMATION
= 355,
168 tPOINTERDEFAULT
= 359,
192 tSTRICTCONTEXTHANDLE
= 383,
219 #define aIDENTIFIER 258
220 #define aKNOWNTYPE 259
230 #define MEMBERPTR 269
232 #define INEQUALITY 271
233 #define GREATEREQUAL 272
234 #define LESSEQUAL 273
235 #define LOGICALOR 274
236 #define LOGICALAND 275
237 #define tAGGREGATABLE 276
238 #define tALLOCATE 277
239 #define tAPPOBJECT 278
241 #define tASYNCUUID 280
242 #define tAUTOHANDLE 281
243 #define tBINDABLE 282
245 #define tBROADCAST 284
247 #define tBYTECOUNT 286
249 #define tCALLBACK 288
255 #define tCOMMSTATUS 294
257 #define tCONTEXTHANDLE 296
258 #define tCONTEXTHANDLENOSERIALIZE 297
259 #define tCONTEXTHANDLESERIALIZE 298
261 #define tCPPQUOTE 300
263 #define tDEFAULTCOLLELEM 302
264 #define tDEFAULTVALUE 303
265 #define tDEFAULTVTABLE 304
266 #define tDISPLAYBIND 305
267 #define tDISPINTERFACE 306
271 #define tENDPOINT 310
274 #define tERRORSTATUST 313
275 #define tEXPLICITHANDLE 314
278 #define tFASTCALL 317
282 #define tHELPCONTEXT 321
283 #define tHELPFILE 322
284 #define tHELPSTRING 323
285 #define tHELPSTRINGCONTEXT 324
286 #define tHELPSTRINGDLL 325
290 #define tIDEMPOTENT 329
292 #define tIMMEDIATEBIND 331
293 #define tIMPLICITHANDLE 332
295 #define tIMPORTLIB 334
299 #define tINPUTSYNC 338
302 #define tINTERFACE 341
304 #define tLENGTHIS 343
310 #define tNONBROWSABLE 349
311 #define tNONCREATABLE 350
312 #define tNONEXTENSIBLE 351
316 #define tOLEAUTOMATION 355
317 #define tOPTIONAL 356
320 #define tPOINTERDEFAULT 359
321 #define tPROPERTIES 360
324 #define tPROPPUTREF 363
328 #define tREADONLY 367
330 #define tREGISTER 369
331 #define tREQUESTEDIT 370
332 #define tRESTRICTED 371
334 #define tSAFEARRAY 373
344 #define tSTRICTCONTEXTHANDLE 383
348 #define tSWITCHIS 387
349 #define tSWITCHTYPE 388
350 #define tTRANSMITAS 389
355 #define tUNSIGNED 394
362 #define tWIREMARSHAL 401
363 #define ADDRESSOF 402
372 /* Copy the first part of user declarations. */
378 * Copyright 2002 Ove Kaaven
379 * Copyright 2006-2008 Robert Shearman
381 * This library is free software; you can redistribute it and/or
382 * modify it under the terms of the GNU Lesser General Public
383 * License as published by the Free Software Foundation; either
384 * version 2.1 of the License, or (at your option) any later version.
386 * This library is distributed in the hope that it will be useful,
387 * but WITHOUT ANY WARRANTY; without even the implied warranty of
388 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
389 * Lesser General Public License for more details.
391 * You should have received a copy of the GNU Lesser General Public
392 * License along with this library; if not, write to the Free Software
393 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
417 /* Berkeley yacc (byacc) doesn't seem to know about these */
418 /* Some *BSD supplied versions do define these though */
420 # define YYEMPTY (-1) /* Empty lookahead value of yychar */
423 # define YYLEX yylex()
426 #elif defined(YYBISON)
427 /* Bison was used for original development */
428 /* #define YYEMPTY -2 */
429 /* #define YYLEX yylex() */
432 /* No yacc we know yet */
433 # if !defined(YYEMPTY) || !defined(YYLEX)
434 # error Yacc version/type unknown. This version needs to be verified for settings of YYEMPTY and YYLEX.
435 # elif defined(__GNUC__) /* gcc defines the #warning directive */
436 # warning Yacc version/type unknown. It defines YYEMPTY and YYLEX, but is not tested
437 /* #else we just take a chance that it works... */
441 #define YYERROR_VERBOSE
443 unsigned char pointer_default
= RPC_FC_UP
;
444 static int is_in_interface
= FALSE
;
445 static int is_object_interface
= FALSE
;
446 /* are we inside a library block? */
447 static int is_inside_library
= FALSE
;
449 typedef struct list typelist_t
;
458 int import_performed
;
461 typedef struct _decl_spec_t
465 enum storage_class stgclass
;
468 typelist_t incomplete_types
= LIST_INIT(incomplete_types
);
470 static void add_incomplete(type_t
*t
);
471 static void fix_incomplete(void);
473 static str_list_t
*append_str(str_list_t
*list
, char *str
);
474 static attr_list_t
*append_attr(attr_list_t
*list
, attr_t
*attr
);
475 static attr_list_t
*append_attr_list(attr_list_t
*new_list
, attr_list_t
*old_list
);
476 static decl_spec_t
*make_decl_spec(type_t
*type
, decl_spec_t
*left
, decl_spec_t
*right
, attr_t
*attr
, enum storage_class stgclass
);
477 static attr_t
*make_attr(enum attr_type type
);
478 static attr_t
*make_attrv(enum attr_type type
, unsigned long val
);
479 static attr_t
*make_attrp(enum attr_type type
, void *val
);
480 static expr_list_t
*append_expr(expr_list_t
*list
, expr_t
*expr
);
481 static array_dims_t
*append_array(array_dims_t
*list
, expr_t
*expr
);
482 static void set_type(var_t
*v
, decl_spec_t
*decl_spec
, const declarator_t
*decl
, int top
);
483 static var_list_t
*set_var_types(attr_list_t
*attrs
, decl_spec_t
*decl_spec
, declarator_list_t
*decls
);
484 static ifref_list_t
*append_ifref(ifref_list_t
*list
, ifref_t
*iface
);
485 static ifref_t
*make_ifref(type_t
*iface
);
486 static var_list_t
*append_var(var_list_t
*list
, var_t
*var
);
487 static var_list_t
*append_var_list(var_list_t
*list
, var_list_t
*vars
);
488 static var_t
*make_var(char *name
);
489 static declarator_list_t
*append_declarator(declarator_list_t
*list
, declarator_t
*p
);
490 static declarator_t
*make_declarator(var_t
*var
);
491 static func_list_t
*append_func(func_list_t
*list
, func_t
*func
);
492 static func_t
*make_func(var_t
*def
);
493 static type_t
*make_class(char *name
);
494 static type_t
*make_safearray(type_t
*type
);
495 static type_t
*make_builtin(char *name
);
496 static type_t
*make_int(int sign
);
497 static typelib_t
*make_library(const char *name
, const attr_list_t
*attrs
);
498 static type_t
*make_func_type(var_list_t
*args
);
499 static type_t
*make_pointer_type(type_t
*ref
, attr_list_t
*attrs
);
500 static type_t
*append_ptrchain_type(type_t
*ptrchain
, type_t
*type
);
502 static type_t
*reg_type(type_t
*type
, const char *name
, int t
);
503 static type_t
*reg_typedefs(decl_spec_t
*decl_spec
, var_list_t
*names
, attr_list_t
*attrs
);
504 static type_t
*find_type2(char *name
, int t
);
505 static type_t
*get_type(unsigned char type
, char *name
, int t
);
506 static type_t
*get_typev(unsigned char type
, var_t
*name
, int t
);
507 static int get_struct_type(var_list_t
*fields
);
509 static var_t
*reg_const(var_t
*var
);
511 static void write_libid(const typelib_t
*typelib
);
512 static void write_clsid(type_t
*cls
);
513 static void write_diid(type_t
*iface
);
514 static void write_iid(type_t
*iface
);
516 static int compute_method_indexes(type_t
*iface
);
517 static char *gen_name(void);
518 static statement_t
*process_typedefs(var_list_t
*names
);
519 static void check_arg(var_t
*arg
);
520 static void check_functions(const type_t
*iface
);
521 static void check_all_user_types(const statement_list_t
*stmts
);
522 static attr_list_t
*check_iface_attrs(const char *name
, attr_list_t
*attrs
);
523 static attr_list_t
*check_function_attrs(const char *name
, attr_list_t
*attrs
);
524 static attr_list_t
*check_typedef_attrs(attr_list_t
*attrs
);
525 static attr_list_t
*check_field_attrs(const char *name
, attr_list_t
*attrs
);
526 static attr_list_t
*check_library_attrs(const char *name
, attr_list_t
*attrs
);
527 static attr_list_t
*check_dispiface_attrs(const char *name
, attr_list_t
*attrs
);
528 static attr_list_t
*check_module_attrs(const char *name
, attr_list_t
*attrs
);
529 static attr_list_t
*check_coclass_attrs(const char *name
, attr_list_t
*attrs
);
530 const char *get_attr_display_name(enum attr_type type
);
531 static void add_explicit_handle_if_necessary(func_t
*func
);
532 static type_t
*find_type_helper(const char *name
, int t
);
533 static void check_def(const type_t
*t
);
535 static statement_t
*make_statement(enum statement_type type
);
536 static statement_t
*make_statement_type_decl(type_t
*type
);
537 static statement_t
*make_statement_reference(type_t
*type
);
538 static statement_t
*make_statement_declaration(var_t
*var
);
539 static statement_t
*make_statement_library(typelib_t
*typelib
);
540 static statement_t
*make_statement_cppquote(const char *str
);
541 static statement_t
*make_statement_importlib(const char *str
);
542 static statement_t
*make_statement_module(type_t
*type
);
543 static statement_t
*make_statement_import(const char *str
);
544 static statement_list_t
*append_statement(statement_list_t
*list
, statement_t
*stmt
);
545 static func_list_t
*append_func_from_statement(func_list_t
*list
, statement_t
*stmt
);
553 /* Enabling traces. */
558 /* Enabling verbose error messages. */
559 #ifdef YYERROR_VERBOSE
560 # undef YYERROR_VERBOSE
561 # define YYERROR_VERBOSE 1
563 # define YYERROR_VERBOSE 0
566 /* Enabling the token table. */
567 #ifndef YYTOKEN_TABLE
568 # define YYTOKEN_TABLE 0
571 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
573 typedef union YYSTYPE
{
575 attr_list_t
*attr_list
;
576 str_list_t
*str_list
;
578 expr_list_t
*expr_list
;
579 array_dims_t
*array_dims
;
582 var_list_t
*var_list
;
583 declarator_t
*declarator
;
584 declarator_list_t
*declarator_list
;
586 func_list_t
*func_list
;
587 statement_t
*statement
;
588 statement_list_t
*stmt_list
;
590 ifref_list_t
*ifref_list
;
595 interface_info_t ifinfo
;
597 struct _import_t
*import
;
598 struct _decl_spec_t
*declspec
;
599 enum storage_class stgclass
;
601 /* Line 196 of yacc.c. */
602 #line 603 "parser.tab.c"
603 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
604 # define YYSTYPE_IS_DECLARED 1
605 # define YYSTYPE_IS_TRIVIAL 1
610 /* Copy the second part of user declarations. */
613 /* Line 219 of yacc.c. */
614 #line 615 "parser.tab.c"
616 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
617 # define YYSIZE_T __SIZE_TYPE__
619 #if ! defined (YYSIZE_T) && defined (size_t)
620 # define YYSIZE_T size_t
622 #if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus))
623 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
624 # define YYSIZE_T size_t
626 #if ! defined (YYSIZE_T)
627 # define YYSIZE_T unsigned int
633 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
634 # define YY_(msgid) dgettext ("bison-runtime", msgid)
638 # define YY_(msgid) msgid
642 #if ! defined (yyoverflow) || YYERROR_VERBOSE
644 /* The parser invokes alloca or malloc; define the necessary symbols. */
646 # ifdef YYSTACK_USE_ALLOCA
647 # if YYSTACK_USE_ALLOCA
649 # define YYSTACK_ALLOC __builtin_alloca
651 # define YYSTACK_ALLOC alloca
652 # if defined (__STDC__) || defined (__cplusplus)
653 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
654 # define YYINCLUDED_STDLIB_H
660 # ifdef YYSTACK_ALLOC
661 /* Pacify GCC's `empty if-body' warning. */
662 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
663 # ifndef YYSTACK_ALLOC_MAXIMUM
664 /* The OS might guarantee only one guard page at the bottom of the stack,
665 and a page size can be as small as 4096 bytes. So we cannot safely
666 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
667 to allow for a few compiler-allocated temporary stack slots. */
668 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */
671 # define YYSTACK_ALLOC YYMALLOC
672 # define YYSTACK_FREE YYFREE
673 # ifndef YYSTACK_ALLOC_MAXIMUM
674 # define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1)
680 # define YYMALLOC malloc
681 # if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \
682 && (defined (__STDC__) || defined (__cplusplus)))
683 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
688 # if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \
689 && (defined (__STDC__) || defined (__cplusplus)))
690 void free (void *); /* INFRINGES ON USER NAME SPACE */
697 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
700 #if (! defined (yyoverflow) \
701 && (! defined (__cplusplus) \
702 || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
704 /* A type that is properly aligned for any stack member. */
711 /* The size of the maximum gap between one aligned stack and the next. */
712 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
714 /* The size of an array large to enough to hold all stacks, each with
716 # define YYSTACK_BYTES(N) \
717 ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \
718 + YYSTACK_GAP_MAXIMUM)
720 /* Copy COUNT objects from FROM to TO. The source and destination do
723 # if defined (__GNUC__) && 1 < __GNUC__
724 # define YYCOPY(To, From, Count) \
725 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
727 # define YYCOPY(To, From, Count) \
731 for (yyi = 0; yyi < (Count); yyi++) \
732 (To)[yyi] = (From)[yyi]; \
738 /* Relocate STACK from its old location to the new one. The
739 local variables YYSIZE and YYSTACKSIZE give the old and new number of
740 elements in the stack, and YYPTR gives the new location of the
741 stack. Advance YYPTR to a properly aligned location for the next
743 # define YYSTACK_RELOCATE(Stack) \
746 YYSIZE_T yynewbytes; \
747 YYCOPY (&yyptr->Stack, Stack, yysize); \
748 Stack = &yyptr->Stack; \
749 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
750 yyptr += yynewbytes / sizeof (*yyptr); \
756 #if defined (__STDC__) || defined (__cplusplus)
757 typedef signed char yysigned_char
;
759 typedef short int yysigned_char
;
762 /* YYFINAL -- State number of the termination state. */
764 /* YYLAST -- Last index in YYTABLE. */
767 /* YYNTOKENS -- Number of terminals. */
768 #define YYNTOKENS 176
769 /* YYNNTS -- Number of nonterminals. */
771 /* YYNRULES -- Number of rules. */
773 /* YYNRULES -- Number of states. */
774 #define YYNSTATES 545
776 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
778 #define YYMAXUTOK 406
780 #define YYTRANSLATE(YYX) \
781 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
783 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
784 static const unsigned char yytranslate
[] =
786 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
787 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
788 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
789 2, 2, 2, 160, 2, 2, 2, 159, 152, 2,
790 171, 172, 157, 156, 147, 155, 167, 158, 2, 2,
791 2, 2, 2, 2, 2, 2, 2, 2, 149, 170,
792 153, 175, 154, 148, 2, 2, 2, 2, 2, 2,
793 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
794 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
795 2, 168, 2, 169, 151, 2, 2, 2, 2, 2,
796 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
797 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
798 2, 2, 2, 173, 150, 174, 161, 2, 2, 2,
799 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
800 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
801 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
802 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
803 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
804 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
805 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
806 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
807 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
808 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
809 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
810 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
811 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
812 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
813 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
814 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
815 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
816 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
817 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
818 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
819 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
820 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
821 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
822 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
823 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
824 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
825 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
826 145, 146, 162, 163, 164, 165, 166
830 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
832 static const unsigned short int yyprhs
[] =
834 0, 0, 3, 5, 6, 9, 12, 16, 19, 22,
835 25, 28, 29, 32, 35, 39, 42, 45, 48, 51,
836 54, 55, 58, 59, 61, 63, 66, 69, 71, 74,
837 76, 78, 80, 85, 89, 93, 99, 102, 106, 111,
838 112, 114, 116, 118, 122, 124, 128, 131, 135, 139,
839 140, 142, 146, 148, 152, 157, 159, 163, 164, 166,
840 168, 170, 172, 174, 176, 181, 186, 188, 190, 192,
841 194, 196, 198, 203, 205, 207, 212, 214, 219, 224,
842 226, 228, 233, 238, 243, 248, 253, 255, 260, 262,
843 267, 269, 275, 277, 279, 284, 289, 291, 293, 295,
844 297, 299, 301, 303, 305, 307, 312, 314, 316, 318,
845 320, 327, 329, 331, 333, 335, 340, 342, 344, 346,
846 351, 356, 361, 366, 368, 370, 375, 380, 382, 384,
847 386, 388, 390, 392, 394, 395, 398, 403, 407, 408,
848 411, 413, 415, 419, 423, 425, 431, 433, 437, 438,
849 440, 442, 444, 446, 448, 450, 452, 454, 456, 458,
850 464, 468, 472, 476, 480, 484, 488, 492, 496, 500,
851 504, 508, 512, 516, 520, 524, 528, 532, 536, 539,
852 542, 545, 548, 551, 554, 558, 562, 567, 572, 577,
853 581, 583, 587, 589, 591, 592, 595, 600, 604, 607,
854 610, 611, 614, 617, 619, 623, 627, 631, 634, 635,
855 637, 638, 640, 642, 644, 646, 648, 650, 652, 655,
856 658, 660, 662, 664, 666, 668, 670, 672, 673, 675,
857 677, 680, 682, 685, 688, 690, 692, 695, 698, 701,
858 707, 708, 711, 714, 717, 720, 723, 726, 730, 733,
859 737, 743, 749, 750, 753, 756, 759, 762, 769, 778,
860 781, 784, 787, 790, 793, 796, 802, 804, 806, 808,
861 810, 812, 813, 816, 819, 823, 824, 826, 829, 832,
862 835, 839, 842, 844, 846, 850, 853, 858, 860, 864,
863 866, 870, 872, 874, 876, 882, 884, 886, 888, 890,
864 893, 895, 898, 900, 903, 908, 913, 919, 930, 932
867 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
868 static const short int yyrhs
[] =
870 177, 0, -1, 178, -1, -1, 178, 243, -1, 178,
871 242, -1, 178, 229, 170, -1, 178, 231, -1, 178,
872 246, -1, 178, 190, -1, 178, 182, -1, -1, 179,
873 243, -1, 179, 242, -1, 179, 229, 170, -1, 179,
874 231, -1, 179, 246, -1, 179, 182, -1, 179, 187,
875 -1, 179, 190, -1, -1, 180, 182, -1, -1, 170,
876 -1, 184, -1, 183, 170, -1, 222, 170, -1, 186,
877 -1, 261, 170, -1, 208, -1, 259, -1, 262, -1,
878 45, 171, 8, 172, -1, 78, 8, 170, -1, 185,
879 179, 11, -1, 79, 171, 8, 172, 181, -1, 89,
880 3, -1, 197, 188, 173, -1, 189, 179, 174, 181,
881 -1, -1, 193, -1, 144, -1, 194, -1, 193, 147,
882 194, -1, 192, -1, 197, 251, 254, -1, 251, 254,
883 -1, 168, 210, 169, -1, 168, 157, 169, -1, -1,
884 197, -1, 168, 198, 169, -1, 200, -1, 198, 147,
885 200, -1, 198, 169, 168, 200, -1, 8, -1, 199,
886 147, 8, -1, -1, 21, -1, 23, -1, 24, -1,
887 26, -1, 27, -1, 29, -1, 32, 171, 225, 172,
888 -1, 34, 171, 212, 172, -1, 41, -1, 42, -1,
889 43, -1, 44, -1, 46, -1, 47, -1, 48, 171,
890 214, 172, -1, 49, -1, 50, -1, 52, 171, 8,
891 172, -1, 54, -1, 55, 171, 199, 172, -1, 56,
892 171, 214, 172, -1, 59, -1, 64, -1, 66, 171,
893 213, 172, -1, 67, 171, 8, 172, -1, 68, 171,
894 8, 172, -1, 69, 171, 213, 172, -1, 70, 171,
895 8, 172, -1, 71, -1, 73, 171, 213, 172, -1,
896 74, -1, 75, 171, 211, 172, -1, 76, -1, 77,
897 171, 65, 3, 172, -1, 80, -1, 83, -1, 88,
898 171, 209, 172, -1, 87, 171, 213, 172, -1, 90,
899 -1, 94, -1, 95, -1, 96, -1, 98, -1, 99,
900 -1, 100, -1, 101, -1, 102, -1, 104, 171, 258,
901 172, -1, 106, -1, 107, -1, 108, -1, 110, -1,
902 111, 171, 213, 147, 213, 172, -1, 112, -1, 115,
903 -1, 116, -1, 117, -1, 122, 171, 209, 172, -1,
904 125, -1, 128, -1, 129, -1, 132, 171, 211, 172,
905 -1, 133, 171, 260, 172, -1, 134, 171, 260, 172,
906 -1, 140, 171, 201, 172, -1, 141, -1, 142, -1,
907 143, 171, 263, 172, -1, 146, 171, 260, 172, -1,
908 258, -1, 10, -1, 8, -1, 35, -1, 62, -1,
909 103, -1, 127, -1, -1, 203, 204, -1, 34, 213,
910 149, 219, -1, 46, 149, 219, -1, -1, 206, 147,
911 -1, 206, -1, 207, -1, 206, 147, 207, -1, 225,
912 175, 213, -1, 225, -1, 57, 224, 173, 205, 174,
913 -1, 210, -1, 209, 147, 210, -1, -1, 211, -1,
914 5, -1, 6, -1, 7, -1, 61, -1, 97, -1,
915 135, -1, 8, -1, 9, -1, 3, -1, 211, 148,
916 211, 149, 211, -1, 211, 19, 211, -1, 211, 20,
917 211, -1, 211, 150, 211, -1, 211, 151, 211, -1,
918 211, 152, 211, -1, 211, 15, 211, -1, 211, 16,
919 211, -1, 211, 154, 211, -1, 211, 153, 211, -1,
920 211, 17, 211, -1, 211, 18, 211, -1, 211, 12,
921 211, -1, 211, 13, 211, -1, 211, 156, 211, -1,
922 211, 155, 211, -1, 211, 159, 211, -1, 211, 157,
923 211, -1, 211, 158, 211, -1, 160, 211, -1, 161,
924 211, -1, 156, 211, -1, 155, 211, -1, 152, 211,
925 -1, 157, 211, -1, 211, 14, 3, -1, 211, 167,
926 3, -1, 171, 260, 172, 211, -1, 123, 171, 260,
927 172, -1, 211, 168, 211, 169, -1, 171, 211, 172,
928 -1, 213, -1, 212, 147, 213, -1, 211, -1, 211,
929 -1, -1, 215, 216, -1, 196, 251, 256, 170, -1,
930 196, 262, 170, -1, 220, 170, -1, 197, 170, -1,
931 -1, 218, 217, -1, 220, 170, -1, 170, -1, 196,
932 251, 254, -1, 196, 251, 254, -1, 197, 251, 257,
933 -1, 251, 257, -1, -1, 225, -1, -1, 3, -1,
934 4, -1, 3, -1, 4, -1, 30, -1, 145, -1,
935 228, -1, 120, 228, -1, 139, 228, -1, 139, -1,
936 63, -1, 121, -1, 53, -1, 28, -1, 58, -1,
937 65, -1, -1, 84, -1, 84, -1, 119, 227, -1,
938 124, -1, 91, 227, -1, 72, 227, -1, 85, -1,
939 36, -1, 37, 3, -1, 37, 4, -1, 197, 229,
940 -1, 230, 173, 232, 174, 181, -1, -1, 232, 233,
941 -1, 196, 243, -1, 51, 3, -1, 51, 4, -1,
942 197, 234, -1, 105, 149, -1, 236, 220, 170, -1,
943 92, 149, -1, 237, 221, 170, -1, 235, 173, 236,
944 237, 174, -1, 235, 173, 240, 170, 174, -1, -1,
945 149, 4, -1, 86, 3, -1, 86, 4, -1, 197,
946 240, -1, 241, 239, 173, 180, 174, 181, -1, 241,
947 149, 3, 173, 186, 180, 174, 181, -1, 238, 181,
948 -1, 240, 170, -1, 234, 170, -1, 93, 3, -1,
949 93, 4, -1, 197, 244, -1, 245, 173, 180, 174,
950 181, -1, 60, -1, 126, -1, 114, -1, 82, -1,
951 40, -1, -1, 250, 249, -1, 260, 252, -1, 253,
952 260, 252, -1, -1, 253, -1, 249, 252, -1, 248,
953 252, -1, 247, 252, -1, 157, 250, 254, -1, 202,
954 254, -1, 255, -1, 225, -1, 171, 254, 172, -1,
955 255, 195, -1, 255, 171, 191, 172, -1, 254, -1,
956 256, 147, 254, -1, 254, -1, 254, 175, 214, -1,
957 113, -1, 138, -1, 109, -1, 130, 224, 173, 215,
958 174, -1, 144, -1, 4, -1, 226, -1, 208, -1,
959 57, 3, -1, 259, -1, 130, 3, -1, 262, -1,
960 137, 3, -1, 118, 171, 260, 172, -1, 136, 196,
961 251, 256, -1, 137, 224, 173, 218, 174, -1, 137,
962 224, 131, 171, 220, 172, 223, 173, 203, 174, -1,
966 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
967 static const unsigned short int yyrline
[] =
969 0, 351, 351, 360, 361, 362, 363, 367, 372, 375,
970 376, 379, 380, 381, 382, 383, 388, 389, 390, 391,
971 394, 395, 398, 399, 403, 404, 410, 413, 414, 418,
972 419, 420, 423, 425, 433, 440, 444, 446, 453, 461,
973 462, 465, 468, 469, 470, 474, 481, 489, 490, 493,
974 494, 498, 504, 505, 506, 509, 510, 513, 514, 515,
975 516, 517, 518, 519, 520, 521, 522, 523, 524, 525,
976 526, 527, 528, 529, 530, 531, 532, 533, 534, 535,
977 536, 537, 538, 539, 540, 541, 542, 543, 544, 545,
978 546, 547, 548, 549, 550, 551, 552, 553, 554, 555,
979 556, 557, 558, 559, 560, 561, 562, 563, 564, 565,
980 566, 570, 571, 572, 573, 574, 575, 576, 577, 578,
981 579, 580, 581, 582, 583, 584, 585, 586, 590, 591,
982 596, 597, 598, 599, 602, 603, 606, 610, 616, 617,
983 618, 621, 625, 634, 638, 643, 652, 653, 666, 667,
984 670, 671, 672, 673, 674, 675, 676, 677, 678, 679,
985 680, 681, 682, 683, 684, 685, 686, 687, 688, 689,
986 690, 691, 692, 693, 694, 695, 696, 697, 698, 699,
987 700, 701, 702, 703, 704, 705, 706, 707, 708, 709,
988 712, 713, 716, 722, 728, 729, 732, 737, 744, 745,
989 748, 749, 753, 754, 757, 765, 774, 780, 786, 787,
990 790, 791, 792, 795, 797, 800, 801, 802, 803, 804,
991 820, 821, 822, 823, 824, 825, 826, 829, 830, 833,
992 834, 835, 836, 837, 838, 839, 842, 843, 851, 861,
993 868, 869, 873, 876, 877, 880, 894, 895, 898, 899,
994 902, 912, 922, 923, 926, 927, 930, 943, 957, 970,
995 974, 975, 978, 979, 982, 987, 995, 996, 997, 1001,
996 1005, 1008, 1009, 1012, 1013, 1017, 1018, 1022, 1023, 1024,
997 1028, 1030, 1031, 1035, 1036, 1037, 1038, 1045, 1046, 1050,
998 1051, 1055, 1056, 1057, 1060, 1072, 1073, 1074, 1075, 1076,
999 1077, 1078, 1079, 1080, 1081, 1084, 1090, 1097, 1115, 1116
1003 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
1004 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1005 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
1006 static const char *const yytname
[] =
1008 "$end", "error", "$undefined", "aIDENTIFIER", "aKNOWNTYPE", "aNUM",
1009 "aHEXNUM", "aDOUBLE", "aSTRING", "aWSTRING", "aUUID", "aEOF", "SHL",
1010 "SHR", "MEMBERPTR", "EQUALITY", "INEQUALITY", "GREATEREQUAL",
1011 "LESSEQUAL", "LOGICALOR", "LOGICALAND", "tAGGREGATABLE", "tALLOCATE",
1012 "tAPPOBJECT", "tASYNC", "tASYNCUUID", "tAUTOHANDLE", "tBINDABLE",
1013 "tBOOLEAN", "tBROADCAST", "tBYTE", "tBYTECOUNT", "tCALLAS", "tCALLBACK",
1014 "tCASE", "tCDECL", "tCHAR", "tCOCLASS", "tCODE", "tCOMMSTATUS", "tCONST",
1015 "tCONTEXTHANDLE", "tCONTEXTHANDLENOSERIALIZE", "tCONTEXTHANDLESERIALIZE",
1016 "tCONTROL", "tCPPQUOTE", "tDEFAULT", "tDEFAULTCOLLELEM", "tDEFAULTVALUE",
1017 "tDEFAULTVTABLE", "tDISPLAYBIND", "tDISPINTERFACE", "tDLLNAME",
1018 "tDOUBLE", "tDUAL", "tENDPOINT", "tENTRY", "tENUM", "tERRORSTATUST",
1019 "tEXPLICITHANDLE", "tEXTERN", "tFALSE", "tFASTCALL", "tFLOAT", "tHANDLE",
1020 "tHANDLET", "tHELPCONTEXT", "tHELPFILE", "tHELPSTRING",
1021 "tHELPSTRINGCONTEXT", "tHELPSTRINGDLL", "tHIDDEN", "tHYPER", "tID",
1022 "tIDEMPOTENT", "tIIDIS", "tIMMEDIATEBIND", "tIMPLICITHANDLE", "tIMPORT",
1023 "tIMPORTLIB", "tIN", "tIN_LINE", "tINLINE", "tINPUTSYNC", "tINT",
1024 "tINT64", "tINTERFACE", "tLCID", "tLENGTHIS", "tLIBRARY", "tLOCAL",
1025 "tLONG", "tMETHODS", "tMODULE", "tNONBROWSABLE", "tNONCREATABLE",
1026 "tNONEXTENSIBLE", "tNULL", "tOBJECT", "tODL", "tOLEAUTOMATION",
1027 "tOPTIONAL", "tOUT", "tPASCAL", "tPOINTERDEFAULT", "tPROPERTIES",
1028 "tPROPGET", "tPROPPUT", "tPROPPUTREF", "tPTR", "tPUBLIC", "tRANGE",
1029 "tREADONLY", "tREF", "tREGISTER", "tREQUESTEDIT", "tRESTRICTED",
1030 "tRETVAL", "tSAFEARRAY", "tSHORT", "tSIGNED", "tSINGLE", "tSIZEIS",
1031 "tSIZEOF", "tSMALL", "tSOURCE", "tSTATIC", "tSTDCALL",
1032 "tSTRICTCONTEXTHANDLE", "tSTRING", "tSTRUCT", "tSWITCH", "tSWITCHIS",
1033 "tSWITCHTYPE", "tTRANSMITAS", "tTRUE", "tTYPEDEF", "tUNION", "tUNIQUE",
1034 "tUNSIGNED", "tUUID", "tV1ENUM", "tVARARG", "tVERSION", "tVOID",
1035 "tWCHAR", "tWIREMARSHAL", "','", "'?'", "':'", "'|'", "'^'", "'&'",
1036 "'<'", "'>'", "'-'", "'+'", "'*'", "'/'", "'%'", "'!'", "'~'",
1037 "ADDRESSOF", "NEG", "POS", "PPTR", "CAST", "'.'", "'['", "']'", "';'",
1038 "'('", "')'", "'{'", "'}'", "'='", "$accept", "input", "gbl_statements",
1039 "imp_statements", "int_statements", "semicolon_opt", "statement",
1040 "typedecl", "cppquote", "import_start", "import", "importlib",
1041 "libraryhdr", "library_start", "librarydef", "m_args", "no_args", "args",
1042 "arg", "array", "m_attributes", "attributes", "attrib_list", "str_list",
1043 "attribute", "uuid_string", "callconv", "cases", "case", "enums",
1044 "enum_list", "enum", "enumdef", "m_exprs", "m_expr", "expr",
1045 "expr_list_int_const", "expr_int_const", "expr_const", "fields", "field",
1046 "ne_union_field", "ne_union_fields", "union_field", "s_field", "funcdef",
1047 "declaration", "m_ident", "t_ident", "ident", "base_type", "m_int",
1048 "int_std", "coclass", "coclasshdr", "coclassdef", "coclass_ints",
1049 "coclass_int", "dispinterface", "dispinterfacehdr", "dispint_props",
1050 "dispint_meths", "dispinterfacedef", "inherit", "interface",
1051 "interfacehdr", "interfacedef", "interfacedec", "module", "modulehdr",
1052 "moduledef", "storage_cls_spec", "function_specifier", "type_qualifier",
1053 "m_type_qual_list", "decl_spec", "m_decl_spec_no_type",
1054 "decl_spec_no_type", "declarator", "direct_declarator",
1055 "declarator_list", "init_declarator", "pointer_type", "structdef",
1056 "type", "typedef", "uniondef", "version", 0
1061 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
1063 static const unsigned short int yytoknum
[] =
1065 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1066 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1067 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
1068 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
1069 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
1070 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
1071 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
1072 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
1073 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
1074 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
1075 355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
1076 365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
1077 375, 376, 377, 378, 379, 380, 381, 382, 383, 384,
1078 385, 386, 387, 388, 389, 390, 391, 392, 393, 394,
1079 395, 396, 397, 398, 399, 400, 401, 44, 63, 58,
1080 124, 94, 38, 60, 62, 45, 43, 42, 47, 37,
1081 33, 126, 402, 403, 404, 405, 406, 46, 91, 93,
1082 59, 40, 41, 123, 125, 61
1086 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
1087 static const unsigned short int yyr1
[] =
1089 0, 176, 177, 178, 178, 178, 178, 178, 178, 178,
1090 178, 179, 179, 179, 179, 179, 179, 179, 179, 179,
1091 180, 180, 181, 181, 182, 182, 182, 182, 182, 183,
1092 183, 183, 184, 185, 186, 187, 188, 189, 190, 191,
1093 191, 192, 193, 193, 193, 194, 194, 195, 195, 196,
1094 196, 197, 198, 198, 198, 199, 199, 200, 200, 200,
1095 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
1096 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
1097 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
1098 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
1099 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
1100 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
1101 200, 200, 200, 200, 200, 200, 200, 200, 201, 201,
1102 202, 202, 202, 202, 203, 203, 204, 204, 205, 205,
1103 205, 206, 206, 207, 207, 208, 209, 209, 210, 210,
1104 211, 211, 211, 211, 211, 211, 211, 211, 211, 211,
1105 211, 211, 211, 211, 211, 211, 211, 211, 211, 211,
1106 211, 211, 211, 211, 211, 211, 211, 211, 211, 211,
1107 211, 211, 211, 211, 211, 211, 211, 211, 211, 211,
1108 212, 212, 213, 214, 215, 215, 216, 216, 217, 217,
1109 218, 218, 219, 219, 220, 221, 222, 222, 223, 223,
1110 224, 224, 224, 225, 225, 226, 226, 226, 226, 226,
1111 226, 226, 226, 226, 226, 226, 226, 227, 227, 228,
1112 228, 228, 228, 228, 228, 228, 229, 229, 230, 231,
1113 232, 232, 233, 234, 234, 235, 236, 236, 237, 237,
1114 238, 238, 239, 239, 240, 240, 241, 242, 242, 242,
1115 243, 243, 244, 244, 245, 246, 247, 247, 247, 248,
1116 249, 250, 250, 251, 251, 252, 252, 253, 253, 253,
1117 254, 254, 254, 255, 255, 255, 255, 256, 256, 257,
1118 257, 258, 258, 258, 259, 260, 260, 260, 260, 260,
1119 260, 260, 260, 260, 260, 261, 262, 262, 263, 263
1122 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
1123 static const unsigned char yyr2
[] =
1125 0, 2, 1, 0, 2, 2, 3, 2, 2, 2,
1126 2, 0, 2, 2, 3, 2, 2, 2, 2, 2,
1127 0, 2, 0, 1, 1, 2, 2, 1, 2, 1,
1128 1, 1, 4, 3, 3, 5, 2, 3, 4, 0,
1129 1, 1, 1, 3, 1, 3, 2, 3, 3, 0,
1130 1, 3, 1, 3, 4, 1, 3, 0, 1, 1,
1131 1, 1, 1, 1, 4, 4, 1, 1, 1, 1,
1132 1, 1, 4, 1, 1, 4, 1, 4, 4, 1,
1133 1, 4, 4, 4, 4, 4, 1, 4, 1, 4,
1134 1, 5, 1, 1, 4, 4, 1, 1, 1, 1,
1135 1, 1, 1, 1, 1, 4, 1, 1, 1, 1,
1136 6, 1, 1, 1, 1, 4, 1, 1, 1, 4,
1137 4, 4, 4, 1, 1, 4, 4, 1, 1, 1,
1138 1, 1, 1, 1, 0, 2, 4, 3, 0, 2,
1139 1, 1, 3, 3, 1, 5, 1, 3, 0, 1,
1140 1, 1, 1, 1, 1, 1, 1, 1, 1, 5,
1141 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
1142 3, 3, 3, 3, 3, 3, 3, 3, 2, 2,
1143 2, 2, 2, 2, 3, 3, 4, 4, 4, 3,
1144 1, 3, 1, 1, 0, 2, 4, 3, 2, 2,
1145 0, 2, 2, 1, 3, 3, 3, 2, 0, 1,
1146 0, 1, 1, 1, 1, 1, 1, 1, 2, 2,
1147 1, 1, 1, 1, 1, 1, 1, 0, 1, 1,
1148 2, 1, 2, 2, 1, 1, 2, 2, 2, 5,
1149 0, 2, 2, 2, 2, 2, 2, 3, 2, 3,
1150 5, 5, 0, 2, 2, 2, 2, 6, 8, 2,
1151 2, 2, 2, 2, 2, 5, 1, 1, 1, 1,
1152 1, 0, 2, 2, 3, 0, 1, 2, 2, 2,
1153 3, 2, 1, 1, 3, 2, 4, 1, 3, 1,
1154 3, 1, 1, 1, 5, 1, 1, 1, 1, 2,
1155 1, 2, 1, 2, 4, 4, 5, 10, 1, 3
1158 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
1159 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
1160 means the default is an error. */
1161 static const unsigned short int yydefact
[] =
1163 3, 0, 2, 1, 296, 224, 215, 235, 0, 270,
1164 0, 0, 223, 210, 225, 266, 221, 226, 227, 0,
1165 269, 229, 234, 0, 227, 268, 0, 227, 0, 222,
1166 231, 267, 210, 49, 210, 220, 295, 216, 57, 10,
1167 0, 24, 11, 27, 11, 9, 0, 298, 0, 297,
1168 217, 0, 0, 7, 0, 0, 22, 0, 252, 5,
1169 4, 0, 8, 275, 275, 275, 0, 0, 300, 275,
1170 0, 302, 236, 237, 0, 243, 244, 299, 212, 0,
1171 228, 233, 0, 254, 255, 232, 0, 230, 218, 301,
1172 0, 0, 50, 303, 0, 219, 58, 59, 60, 61,
1173 62, 63, 0, 0, 66, 67, 68, 69, 70, 71,
1174 0, 73, 74, 0, 76, 0, 0, 79, 80, 0,
1175 0, 0, 0, 0, 86, 0, 88, 0, 90, 0,
1176 92, 93, 0, 0, 96, 97, 98, 99, 100, 101,
1177 102, 103, 104, 0, 106, 107, 108, 293, 109, 0,
1178 111, 291, 112, 113, 114, 0, 116, 117, 118, 0,
1179 0, 0, 292, 0, 123, 124, 0, 0, 0, 52,
1180 127, 25, 0, 0, 0, 0, 0, 298, 238, 245,
1181 256, 264, 0, 300, 302, 26, 6, 240, 261, 0,
1182 23, 259, 260, 0, 0, 20, 279, 276, 278, 277,
1183 213, 214, 130, 131, 132, 133, 271, 0, 0, 283,
1184 289, 282, 207, 275, 273, 28, 0, 138, 33, 0,
1185 194, 0, 0, 200, 0, 0, 0, 0, 0, 0,
1186 0, 0, 0, 0, 0, 0, 0, 0, 0, 148,
1187 0, 0, 148, 0, 0, 0, 0, 0, 0, 57,
1188 51, 34, 0, 17, 18, 19, 0, 15, 13, 12,
1189 16, 22, 36, 262, 263, 37, 206, 49, 0, 49,
1190 0, 0, 253, 20, 0, 0, 0, 281, 0, 148,
1191 39, 285, 274, 32, 0, 140, 141, 144, 304, 49,
1192 287, 305, 49, 49, 0, 158, 150, 151, 152, 156,
1193 157, 153, 154, 0, 155, 0, 0, 0, 0, 0,
1194 0, 0, 192, 0, 190, 193, 0, 0, 55, 0,
1195 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1196 0, 146, 149, 0, 0, 0, 0, 0, 0, 129,
1197 128, 0, 308, 0, 0, 53, 57, 0, 14, 38,
1198 22, 0, 241, 246, 0, 0, 0, 49, 0, 0,
1199 0, 22, 21, 0, 272, 280, 284, 290, 0, 0,
1200 295, 0, 44, 40, 42, 0, 0, 145, 139, 0,
1201 294, 0, 195, 0, 0, 306, 50, 201, 0, 64,
1202 0, 182, 181, 180, 183, 178, 179, 0, 0, 0,
1203 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1204 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1205 0, 0, 65, 72, 75, 0, 77, 78, 81, 82,
1206 83, 84, 85, 87, 89, 0, 95, 148, 94, 105,
1207 0, 115, 119, 120, 121, 122, 0, 125, 126, 54,
1208 0, 239, 242, 248, 0, 247, 250, 0, 0, 251,
1209 20, 22, 265, 48, 47, 286, 0, 0, 46, 142,
1210 143, 0, 302, 288, 208, 199, 198, 0, 189, 0,
1211 171, 172, 184, 165, 166, 169, 170, 160, 161, 0,
1212 162, 163, 164, 168, 167, 174, 173, 176, 177, 175,
1213 185, 0, 191, 56, 91, 147, 0, 309, 22, 204,
1214 0, 249, 0, 257, 43, 45, 0, 197, 0, 209,
1215 187, 186, 0, 188, 110, 35, 205, 22, 196, 134,
1216 159, 258, 0, 0, 0, 307, 135, 0, 49, 49,
1217 203, 137, 0, 136, 202
1220 /* YYDEFGOTO[NTERM-NUM]. */
1221 static const short int yydefgoto
[] =
1223 -1, 1, 2, 172, 274, 191, 362, 40, 41, 42,
1224 43, 254, 176, 44, 255, 371, 372, 373, 374, 281,
1225 355, 92, 168, 319, 169, 341, 208, 532, 536, 284,
1226 285, 286, 177, 330, 331, 312, 313, 314, 316, 289,
1227 382, 387, 293, 541, 542, 458, 48, 518, 79, 209,
1228 49, 81, 50, 256, 52, 257, 267, 352, 54, 55,
1229 269, 357, 56, 194, 57, 58, 258, 259, 181, 61,
1230 260, 63, 64, 65, 275, 66, 196, 67, 210, 211,
1231 291, 212, 170, 183, 69, 70, 184, 343
1234 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1236 #define YYPACT_NINF -271
1237 static const short int yypact
[] =
1239 -271, 69, 1074, -271, -271, -271, -271, -271, 58, -271,
1240 -62, 123, -271, 126, -271, -271, -271, -271, 53, 107,
1241 -271, -271, -271, 128, 53, -271, -26, 53, -17, -271,
1242 -271, -271, 130, -22, 132, -17, -271, -271, 1946, -271,
1243 -21, -271, -271, -271, -271, -271, 1708, -19, -10, -271,
1244 -271, -9, -25, -271, -4, -23, -1, 6, 4, -271,
1245 -271, -18, -271, -6, -6, -6, 35, 1821, 32, -6,
1246 37, 40, -271, -271, 156, -271, -271, -5, -271, 15,
1247 -271, -271, 41, -271, -271, -271, 1821, -271, -271, -5,
1248 39, 1751, -271, -96, -87, -271, -271, -271, -271, -271,
1249 -271, -271, 34, 43, -271, -271, -271, -271, -271, -271,
1250 44, -271, -271, 47, -271, 48, 51, -271, -271, 54,
1251 56, 57, 60, 61, -271, 62, -271, 63, -271, 65,
1252 -271, -271, 66, 73, -271, -271, -271, -271, -271, -271,
1253 -271, -271, -271, 74, -271, -271, -271, -271, -271, 77,
1254 -271, -271, -271, -271, -271, 78, -271, -271, -271, 79,
1255 80, 82, -271, 83, -271, -271, 85, 88, -105, -271,
1256 -271, -271, 979, 402, 205, 136, 67, -271, -271, -271,
1257 -271, -271, 35, -271, -271, -271, -271, -271, -271, -15,
1258 -271, -271, -271, 138, 89, -271, -271, -271, -271, -271,
1259 -271, -271, -271, -271, -271, -271, -271, 35, 35, -271,
1260 49, -70, -271, -6, -271, -271, 95, 140, -271, 96,
1261 -271, 35, 92, -271, 140, 443, 443, 252, 261, 443,
1262 443, 262, 265, 443, 269, 443, 443, 216, 443, 443,
1263 -57, 443, 443, 443, 1821, 1821, 111, 277, 1821, 1946,
1264 116, -271, 114, -271, -271, -271, 117, -271, -271, -271,
1265 -271, -1, -271, -271, -271, -271, -271, -123, 137, -68,
1266 118, 142, -271, -271, 497, 25, 147, -271, 443, 843,
1267 1149, -271, -271, -271, 115, 143, -271, 134, -271, -69,
1268 -271, 173, -22, -58, 153, -271, -271, -271, -271, -271,
1269 -271, -271, -271, 150, -271, 443, 443, 443, 443, 443,
1270 443, 782, 1444, -100, -271, 1444, 154, 155, -271, -97,
1271 162, 163, 166, 174, 175, 176, 177, 1283, 325, 178,
1272 -90, -271, 1444, 179, 190, -89, 1326, 184, 185, -271,
1273 -271, 187, 194, 191, 192, -271, 1946, 358, -271, -271,
1274 -1, -8, -271, -271, 218, 1751, 198, -56, 195, 292,
1275 592, -1, -271, 1751, -271, -271, -271, -271, 86, 202,
1276 -84, 200, -271, 226, -271, 1751, 35, -271, 140, 443,
1277 -271, 1751, -271, 35, 203, -271, 204, -271, 206, -271,
1278 1821, 27, 27, 27, 27, 27, 27, 1349, 207, 443,
1279 443, 374, 443, 443, 443, 443, 443, 443, 443, 443,
1280 443, 443, 443, 443, 443, 443, 443, 443, 443, 375,
1281 443, 443, -271, -271, -271, 372, -271, -271, -271, -271,
1282 -271, -271, -271, -271, -271, 210, -271, 443, -271, -271,
1283 443, -271, -271, -271, -271, -271, 378, -271, -271, -271,
1284 212, -271, -271, -271, 35, -271, -271, 1751, 215, -271,
1285 -271, -1, -271, -271, -271, -271, 1192, 35, -271, -271,
1286 -271, 35, 238, -271, 140, -271, -271, 237, -271, 443,
1287 149, 149, -271, 186, 186, 144, 144, 1551, 1474, 1394,
1288 1497, 1520, 1567, 144, 144, 165, 165, 27, 27, 27,
1289 -271, 1372, -271, -271, -271, -271, 239, -271, -1, -271,
1290 35, -271, 687, -271, -271, -271, -74, -271, 240, -271,
1291 -271, 27, 443, -271, -271, -271, -271, -1, -271, -271,
1292 1444, -271, -20, 443, 266, -271, -271, 267, -46, -46,
1293 -271, -271, 244, -271, -271
1296 /* YYPGOTO[NTERM-NUM]. */
1297 static const short int yypgoto
[] =
1299 -271, -271, -271, 344, -267, -244, 18, -271, -271, -271,
1300 59, -271, -271, -271, 408, -271, -271, -271, -49, -271,
1301 -28, -2, -271, -271, -233, -271, -271, -271, -271, -271,
1302 -271, 42, 2, 180, -270, -13, -271, -220, -193, -271,
1303 -271, -271, -271, -120, -189, -271, -271, -271, 91, -194,
1304 -271, 87, 31, 38, -271, 421, -271, -271, 379, -271,
1305 -271, -271, -271, -271, -24, -271, 424, 1, -271, -271,
1306 425, -271, -271, 158, -271, -45, -16, -32, -196, -271,
1307 -43, 247, 196, 5, -59, -271, 0, -271
1310 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
1311 positive, shift that token. If negative, reduce the rule which
1312 number is the opposite. If zero, do what YYDEFACT says.
1313 If YYTABLE_NINF, syntax error. */
1314 #define YYTABLE_NINF -212
1315 static const short int yytable
[] =
1317 46, 182, 71, 60, 47, 91, 360, 68, 213, 369,
1318 321, 276, 277, 324, 533, 326, 345, 349, 329, 7,
1319 39, 334, 180, 287, 354, 290, 534, 219, 200, 201,
1320 294, 197, 197, 197, 9, -211, 320, 197, 200, 201,
1321 51, 401, 249, 11, 222, 38, 221, 421, 198, 199,
1322 425, 350, 147, 214, 15, 18, 151, 437, 437, 88,
1323 202, 72, 73, -41, 250, 9, 95, 21, 22, 3,
1324 202, 23, 422, 383, 24, 426, 20, -211, 23, 365,
1325 356, 162, 438, 441, 178, 367, 223, 203, -41, 295,
1326 268, 296, 297, 298, 299, 300, 528, 203, 279, 38,
1327 38, 280, 27, 384, 388, 380, 451, 30, 25, 74,
1328 38, 85, 38, 449, 87, 82, 385, 462, 456, 339,
1329 31, 340, 38, 90, 540, 94, 75, 76, 204, 77,
1330 78, 83, 84, 89, 78, 93, 78, 80, 204, 263,
1331 264, 271, 272, 200, 201, 86, 38, 301, 187, 171,
1332 189, -29, 205, 193, 535, 195, 399, 400, 401, 470,
1333 185, 186, 205, 401, 216, 270, 188, 505, -211, 190,
1334 46, 46, 71, 71, 47, 47, 192, 68, 68, 401,
1335 468, 197, 206, 302, 287, 337, 338, 473, 217, 344,
1336 253, 253, 206, 512, 419, 420, 207, 282, 399, 400,
1337 401, 502, -30, 404, 405, 224, 207, 215, 262, 303,
1338 -31, 218, 220, 315, 225, 226, 315, 513, 227, 228,
1339 506, 304, 229, 327, 278, 230, 332, 231, 232, 332,
1340 336, 233, 234, 235, 236, 376, 237, 238, 305, 351,
1341 265, 306, 307, 308, 239, 240, 309, 310, 241, 242,
1342 243, 244, 398, 245, 246, 463, 247, 311, 509, 248,
1343 317, 381, 273, 292, 525, 315, 332, 283, 288, 318,
1344 322, 515, 363, 323, 71, 290, 47, 325, 375, 68,
1345 519, 328, 342, 531, 346, 347, 353, 348, 358, 377,
1346 378, 386, 391, 392, 393, 394, 395, 396, 397, 414,
1347 415, 416, 417, 418, 414, 415, 416, 417, 418, 379,
1348 454, 419, 420, 537, 526, 359, 419, 420, 182, 366,
1349 383, 390, 416, 417, 418, 389, 423, 424, 435, 457,
1350 467, 477, 419, 420, 427, 428, 471, 440, 429, 412,
1351 413, 414, 415, 416, 417, 418, 430, 431, 432, 433,
1352 436, 439, 452, 419, 420, 394, 443, 444, 363, 445,
1353 71, 446, 47, 447, 448, 68, 450, 453, 455, 459,
1354 19, 464, 465, 466, 475, 474, 476, 482, 500, 479,
1355 503, 472, 504, 507, 508, 511, 480, 481, 173, 483,
1356 484, 485, 486, 487, 488, 489, 490, 491, 492, 493,
1357 494, 495, 496, 497, 498, 499, 4, 501, 517, 520,
1358 45, 524, 510, 529, 544, 538, 539, 514, 460, 543,
1359 469, 376, 335, 53, 332, 179, 59, 62, 516, 266,
1360 5, 0, 6, 364, 0, 0, 333, 0, 7, 8,
1361 0, 0, 9, 0, 0, 0, 295, 10, 296, 297,
1362 298, 299, 300, 11, 0, 12, 0, 0, 0, 13,
1363 14, 0, 15, 0, 375, 16, 521, 17, 0, 0,
1364 0, 0, 0, 0, 18, 0, 0, 0, 0, 0,
1365 19, 252, 0, 0, 20, 0, 21, 22, 23, 0,
1366 0, 0, 0, 24, 0, 0, 0, 0, 0, 0,
1367 0, 4, 0, 0, 301, 0, 0, 0, 0, 530,
1368 363, 0, 71, 0, 47, 0, 25, 68, 0, 0,
1369 26, 27, 28, 29, 0, 5, 30, 6, 31, 0,
1370 0, 0, 32, 7, 0, 0, 0, 9, 33, 34,
1371 302, 35, 10, 0, 0, 0, 36, 37, 0, 0,
1372 12, 0, 0, 0, 13, 14, 0, 15, 0, 0,
1373 16, 0, 17, 0, 0, 0, 303, 0, 0, 18,
1374 38, 0, 0, 0, 0, 19, 261, 0, 304, 20,
1375 0, 21, 22, 0, 0, 0, 0, 0, 24, 0,
1376 0, 0, 0, 0, 0, 305, 4, 0, 306, 307,
1377 308, 0, 0, 309, 310, 0, 0, 0, 0, 0,
1378 0, 25, 0, 0, 311, 26, 27, 28, 29, 0,
1379 5, 30, 6, 31, 0, 0, 0, 32, 7, 0,
1380 0, 0, 9, 33, 34, 0, 35, 10, 0, 0,
1381 0, 36, 37, 0, 0, 12, 0, 0, 0, 13,
1382 14, 0, 15, 0, 0, 16, 0, 17, 0, 0,
1383 0, 0, 0, 0, 18, 38, 0, 0, 0, 0,
1384 19, 361, 0, 0, 20, 0, 21, 22, 0, 0,
1385 0, 0, 0, 24, 0, 0, 0, 0, 0, 0,
1386 0, 4, 0, 0, 0, 0, 0, 0, 0, 0,
1387 0, 0, 0, 0, 0, 0, 25, 0, 0, 0,
1388 26, 27, 28, 29, 0, 5, 30, 6, 31, 0,
1389 0, 0, 32, 7, 0, 0, 0, 9, 33, 34,
1390 0, 35, 10, 0, 0, 0, 36, 37, 0, 0,
1391 12, 0, 0, 0, 13, 14, 0, 15, 0, 0,
1392 16, 0, 17, 0, 0, 0, 0, 0, 0, 18,
1393 38, 0, 0, 0, 0, 19, 461, 0, 0, 20,
1394 0, 21, 22, 0, 0, 0, 0, 0, 24, 0,
1395 0, 0, 0, 0, 0, 295, 4, 296, 297, 298,
1396 299, 300, 0, 0, 0, 0, 0, 0, 0, 0,
1397 0, 25, 0, 0, 0, 26, 27, 28, 29, 0,
1398 5, 30, 6, 31, 0, 0, 0, 32, 7, 0,
1399 0, 0, 0, 33, 34, 0, 35, 0, 0, 0,
1400 0, 36, 37, 0, 0, 12, 0, 0, 0, 13,
1401 14, 0, 0, 301, 0, 16, 295, 17, 296, 297,
1402 298, 299, 300, 0, 18, 38, 0, 0, 0, 0,
1403 0, 527, 0, 0, 0, 0, 21, 22, 0, 0,
1404 0, 0, 0, 24, 0, 0, 0, 0, 0, 302,
1405 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1406 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1407 26, 27, 28, 29, 301, 303, 30, 0, 0, 0,
1408 0, 0, 32, 0, 0, 0, 0, 304, 0, 34,
1409 0, 35, 0, 0, 0, 0, 36, 37, 0, 0,
1410 0, 0, 0, 0, 305, 0, 0, 306, 307, 308,
1411 302, 0, 309, 310, 0, 0, 0, 0, 0, 0,
1412 0, 0, 0, 311, 0, 0, 0, 0, 0, 0,
1413 0, 0, 0, 0, 0, 0, 303, 0, 0, 0,
1414 0, 0, 0, 0, 0, 0, 0, 0, 304, 0,
1415 0, 0, 0, 4, 0, 0, 0, 0, 0, 0,
1416 251, 0, 0, 0, 0, 305, 0, 0, 306, 307,
1417 368, 0, 0, 309, 310, 0, 0, 5, 0, 6,
1418 0, 0, 0, 0, 311, 7, 8, 0, 0, 9,
1419 0, 0, 0, 0, 10, 0, 0, 0, 0, 0,
1420 11, 0, 12, 0, 0, 0, 13, 14, 0, 15,
1421 0, 0, 16, 0, 17, 0, 0, 0, 0, 0,
1422 0, 18, 0, 0, 0, 0, 0, 19, 252, 0,
1423 0, 20, 0, 21, 22, 23, 0, 0, 0, 0,
1424 24, 0, 0, 0, 0, 0, 0, 0, 4, 0,
1425 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1426 0, 0, 0, 25, 0, 0, 0, 26, 27, 28,
1427 29, 0, 5, 30, 6, 31, 0, 0, 0, 32,
1428 7, 8, 0, 0, 9, 33, 34, 0, 35, 10,
1429 0, 0, 0, 36, 37, 11, 0, 12, 0, 0,
1430 0, 13, 14, 0, 15, 0, 0, 16, 0, 17,
1431 0, 0, 0, 0, 0, 0, 18, 38, 0, 0,
1432 0, 0, 19, 4, 0, 0, 20, 0, 21, 22,
1433 23, 0, 0, 0, 0, 24, 0, 0, 0, 0,
1434 0, 0, 0, 0, 0, 0, 0, 5, 0, 6,
1435 0, 0, 0, 0, 0, 7, 0, 0, 25, 9,
1436 0, 0, 26, 27, 28, 29, 4, 0, 30, 0,
1437 31, 0, 12, 0, 32, 0, 13, 14, 0, 15,
1438 33, 34, 16, 35, 17, 0, 0, 0, 36, 37,
1439 5, 18, 6, 0, 0, 0, 0, 0, 7, 0,
1440 0, 20, 9, 21, 22, 0, 0, 0, 0, 0,
1441 24, 0, 38, 0, 0, 12, 0, 0, 0, 13,
1442 14, 0, 15, 0, 0, 16, 0, 17, 0, 0,
1443 0, 0, 0, 25, 18, 0, 0, 26, 27, 28,
1444 29, 0, 0, 30, 20, 31, 21, 22, 0, 32,
1445 0, 0, 0, 24, 0, 0, 34, 0, 35, 0,
1446 0, 0, 0, 370, 37, 399, 400, 401, 402, 403,
1447 404, 405, 406, 407, 0, 0, 25, 0, 0, 0,
1448 26, 27, 28, 29, 0, 0, 30, 38, 31, 0,
1449 0, 0, 32, 0, 0, 0, 0, 0, 0, 34,
1450 0, 35, 0, 0, 0, 0, 36, 37, 399, 400,
1451 401, 402, 403, 404, 405, 406, 407, 0, 0, 0,
1452 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1453 38, 399, 400, 401, 402, 403, 404, 405, 406, 407,
1454 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1455 0, 0, 0, 0, 399, 400, 401, 402, 403, 404,
1456 405, 406, 407, 0, 0, 0, 0, 0, 0, 0,
1457 0, 0, 0, 0, 0, 0, 399, 400, 401, 402,
1458 403, 404, 405, 406, 407, 0, 0, 0, 0, 0,
1459 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1460 0, 408, 0, 409, 410, 411, 412, 413, 414, 415,
1461 416, 417, 418, 0, 0, 0, 0, 0, 0, 0,
1462 419, 420, 0, 0, 0, 434, 399, 400, 401, 402,
1463 403, 404, 405, 406, 407, 0, 0, 0, 0, 0,
1464 0, 0, 0, 0, 408, 0, 409, 410, 411, 412,
1465 413, 414, 415, 416, 417, 418, 399, 400, 401, 402,
1466 403, 404, 405, 419, 420, 0, 0, 408, 442, 409,
1467 410, 411, 412, 413, 414, 415, 416, 417, 418, 399,
1468 400, 401, 402, 403, 404, 405, 419, 420, 0, 0,
1469 408, 478, 409, 410, 411, 412, 413, 414, 415, 416,
1470 417, 418, 399, 400, 401, 402, 403, 404, 405, 419,
1471 420, 523, 408, 522, 409, 410, 411, 412, 413, 414,
1472 415, 416, 417, 418, 0, 0, 0, 0, 0, 0,
1473 0, 419, 420, 399, 400, 401, 402, 403, 404, 405,
1474 0, 407, 0, 0, 0, 0, 0, 0, 0, 399,
1475 400, 401, 402, 403, 404, 405, 0, 0, 0, 0,
1476 0, 0, 408, 0, 409, 410, 411, 412, 413, 414,
1477 415, 416, 417, 418, 0, 0, 0, 0, 0, 0,
1478 0, 419, 420, 0, 0, 0, 0, 0, 0, 0,
1479 0, 0, 0, 0, 409, 410, 411, 412, 413, 414,
1480 415, 416, 417, 418, 0, 0, 0, 0, 0, 0,
1481 0, 419, 420, 0, 0, 0, 0, 0, 410, 411,
1482 412, 413, 414, 415, 416, 417, 418, 0, 0, 0,
1483 0, 0, 0, 0, 419, 420, 0, 0, 0, 0,
1484 0, 0, 411, 412, 413, 414, 415, 416, 417, 418,
1485 0, 0, 0, 0, 0, 0, 0, 419, 420, 0,
1486 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1487 0, 409, 410, 411, 412, 413, 414, 415, 416, 417,
1488 418, 0, 4, 0, 0, 0, 0, 0, 419, 420,
1489 412, 413, 414, 415, 416, 417, 418, 0, 0, 0,
1490 0, 0, 0, 0, 419, 420, 5, 0, 6, 0,
1491 0, 0, 0, 0, 7, 8, 0, 0, 9, 0,
1492 0, 0, 0, 0, 0, 4, 0, 0, 0, 11,
1493 0, 12, 0, 0, 0, 13, 14, 0, 15, 0,
1494 0, 16, 0, 17, 0, 0, 0, 0, 0, 5,
1495 18, 6, 0, 0, 0, 0, 0, 7, 0, 0,
1496 20, 9, 21, 22, 23, 0, 0, 174, 0, 24,
1497 0, 175, 0, 0, 12, 0, 0, 0, 13, 14,
1498 0, 15, 0, 0, 16, 0, 17, 0, 0, 0,
1499 0, 0, 25, 18, 0, 4, 26, 27, 28, 29,
1500 0, 0, 30, 20, 31, 21, 22, 0, 32, 0,
1501 0, 0, 24, 0, 0, 34, 0, 35, 0, 5,
1502 0, 6, 36, 37, 0, 0, 0, 7, 0, 0,
1503 0, 0, 0, 0, 0, 25, 0, 0, 0, 26,
1504 27, 28, 29, 0, 12, 30, 0, 31, 13, 14,
1505 0, 32, 0, 0, 16, 0, 17, 0, 34, 0,
1506 35, 0, 0, 18, 0, 36, 37, 0, 0, 0,
1507 0, 0, 0, 0, 0, 21, 22, 0, 0, 0,
1508 0, 0, 24, 0, 0, 0, 0, 0, 0, 0,
1509 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1510 0, 0, 0, 0, 0, 0, 0, 0, 0, 26,
1511 27, 28, 29, 0, 0, 30, 0, 0, 0, 0,
1512 0, 32, 0, 0, 0, 0, 0, 0, 34, 0,
1513 35, 0, 0, 0, 0, 36, 37, 96, 0, 97,
1514 98, 0, 99, 100, 0, 101, 0, 0, 102, 0,
1515 103, 0, 0, 0, 0, 0, 0, 104, 105, 106,
1516 107, 0, 108, 109, 110, 111, 112, 0, 113, 0,
1517 114, 115, 116, 0, 0, 117, 0, 0, 0, 0,
1518 118, 0, 119, 120, 121, 122, 123, 124, 0, 125,
1519 126, 127, 128, 129, 0, 0, 130, 0, 0, 131,
1520 0, 0, 0, 132, 133, 0, 134, 0, 0, 0,
1521 135, 136, 137, 0, 138, 139, 140, 141, 142, 0,
1522 143, 0, 144, 145, 146, 147, 148, 149, 150, 151,
1523 0, 152, 153, 154, 0, 0, 0, 0, 155, 0,
1524 0, 156, 0, 0, 157, 158, 0, 0, 159, 160,
1525 161, 0, 0, 0, 162, 0, 163, 164, 165, 166,
1529 static const short int yycheck
[] =
1531 2, 46, 2, 2, 2, 33, 273, 2, 67, 279,
1532 230, 207, 208, 233, 34, 235, 249, 261, 238, 36,
1533 2, 241, 46, 217, 92, 221, 46, 86, 3, 4,
1534 224, 63, 64, 65, 40, 131, 229, 69, 3, 4,
1535 2, 14, 147, 51, 131, 168, 91, 147, 64, 65,
1536 147, 174, 109, 69, 60, 72, 113, 147, 147, 28,
1537 35, 3, 4, 147, 169, 40, 35, 84, 85, 0,
1538 35, 86, 172, 147, 91, 172, 82, 173, 86, 275,
1539 269, 138, 172, 172, 46, 278, 173, 62, 172, 3,
1540 105, 5, 6, 7, 8, 9, 170, 62, 168, 168,
1541 168, 171, 119, 292, 293, 174, 350, 124, 114, 171,
1542 168, 24, 168, 346, 27, 8, 174, 361, 174, 8,
1543 126, 10, 168, 32, 170, 34, 3, 4, 103, 3,
1544 4, 3, 4, 3, 4, 3, 4, 84, 103, 3,
1545 4, 3, 4, 3, 4, 171, 168, 61, 173, 170,
1546 173, 170, 127, 149, 174, 173, 12, 13, 14, 379,
1547 170, 170, 127, 14, 8, 189, 170, 437, 173, 170,
1548 172, 173, 172, 173, 172, 173, 170, 172, 173, 14,
1549 376, 213, 157, 97, 378, 244, 245, 383, 173, 248,
1550 172, 173, 157, 460, 167, 168, 171, 213, 12, 13,
1551 14, 421, 170, 17, 18, 171, 171, 170, 3, 123,
1552 170, 170, 173, 226, 171, 171, 229, 461, 171, 171,
1553 440, 135, 171, 236, 175, 171, 239, 171, 171, 242,
1554 243, 171, 171, 171, 171, 280, 171, 171, 152, 267,
1555 173, 155, 156, 157, 171, 171, 160, 161, 171, 171,
1556 171, 171, 311, 171, 171, 169, 171, 171, 454, 171,
1557 8, 289, 173, 171, 508, 278, 279, 172, 172, 8,
1558 8, 467, 274, 8, 274, 471, 274, 8, 280, 274,
1559 474, 65, 5, 527, 168, 171, 149, 170, 170, 174,
1560 147, 293, 305, 306, 307, 308, 309, 310, 311, 155,
1561 156, 157, 158, 159, 155, 156, 157, 158, 159, 175,
1562 355, 167, 168, 533, 510, 173, 167, 168, 363, 172,
1563 147, 171, 157, 158, 159, 172, 172, 172, 3, 357,
1564 375, 390, 167, 168, 172, 172, 381, 147, 172, 153,
1565 154, 155, 156, 157, 158, 159, 172, 172, 172, 172,
1566 172, 172, 351, 167, 168, 368, 172, 172, 360, 172,
1567 360, 167, 360, 172, 172, 360, 8, 149, 170, 174,
1568 78, 169, 172, 147, 170, 172, 170, 3, 3, 172,
1569 8, 381, 172, 5, 172, 170, 399, 400, 44, 402,
1570 403, 404, 405, 406, 407, 408, 409, 410, 411, 412,
1571 413, 414, 415, 416, 417, 418, 4, 420, 170, 172,
1572 2, 172, 457, 173, 170, 149, 149, 466, 359, 539,
1573 378, 466, 242, 2, 437, 46, 2, 2, 471, 182,
1574 28, -1, 30, 275, -1, -1, 240, -1, 36, 37,
1575 -1, -1, 40, -1, -1, -1, 3, 45, 5, 6,
1576 7, 8, 9, 51, -1, 53, -1, -1, -1, 57,
1577 58, -1, 60, -1, 466, 63, 479, 65, -1, -1,
1578 -1, -1, -1, -1, 72, -1, -1, -1, -1, -1,
1579 78, 79, -1, -1, 82, -1, 84, 85, 86, -1,
1580 -1, -1, -1, 91, -1, -1, -1, -1, -1, -1,
1581 -1, 4, -1, -1, 61, -1, -1, -1, -1, 522,
1582 512, -1, 512, -1, 512, -1, 114, 512, -1, -1,
1583 118, 119, 120, 121, -1, 28, 124, 30, 126, -1,
1584 -1, -1, 130, 36, -1, -1, -1, 40, 136, 137,
1585 97, 139, 45, -1, -1, -1, 144, 145, -1, -1,
1586 53, -1, -1, -1, 57, 58, -1, 60, -1, -1,
1587 63, -1, 65, -1, -1, -1, 123, -1, -1, 72,
1588 168, -1, -1, -1, -1, 78, 174, -1, 135, 82,
1589 -1, 84, 85, -1, -1, -1, -1, -1, 91, -1,
1590 -1, -1, -1, -1, -1, 152, 4, -1, 155, 156,
1591 157, -1, -1, 160, 161, -1, -1, -1, -1, -1,
1592 -1, 114, -1, -1, 171, 118, 119, 120, 121, -1,
1593 28, 124, 30, 126, -1, -1, -1, 130, 36, -1,
1594 -1, -1, 40, 136, 137, -1, 139, 45, -1, -1,
1595 -1, 144, 145, -1, -1, 53, -1, -1, -1, 57,
1596 58, -1, 60, -1, -1, 63, -1, 65, -1, -1,
1597 -1, -1, -1, -1, 72, 168, -1, -1, -1, -1,
1598 78, 174, -1, -1, 82, -1, 84, 85, -1, -1,
1599 -1, -1, -1, 91, -1, -1, -1, -1, -1, -1,
1600 -1, 4, -1, -1, -1, -1, -1, -1, -1, -1,
1601 -1, -1, -1, -1, -1, -1, 114, -1, -1, -1,
1602 118, 119, 120, 121, -1, 28, 124, 30, 126, -1,
1603 -1, -1, 130, 36, -1, -1, -1, 40, 136, 137,
1604 -1, 139, 45, -1, -1, -1, 144, 145, -1, -1,
1605 53, -1, -1, -1, 57, 58, -1, 60, -1, -1,
1606 63, -1, 65, -1, -1, -1, -1, -1, -1, 72,
1607 168, -1, -1, -1, -1, 78, 174, -1, -1, 82,
1608 -1, 84, 85, -1, -1, -1, -1, -1, 91, -1,
1609 -1, -1, -1, -1, -1, 3, 4, 5, 6, 7,
1610 8, 9, -1, -1, -1, -1, -1, -1, -1, -1,
1611 -1, 114, -1, -1, -1, 118, 119, 120, 121, -1,
1612 28, 124, 30, 126, -1, -1, -1, 130, 36, -1,
1613 -1, -1, -1, 136, 137, -1, 139, -1, -1, -1,
1614 -1, 144, 145, -1, -1, 53, -1, -1, -1, 57,
1615 58, -1, -1, 61, -1, 63, 3, 65, 5, 6,
1616 7, 8, 9, -1, 72, 168, -1, -1, -1, -1,
1617 -1, 174, -1, -1, -1, -1, 84, 85, -1, -1,
1618 -1, -1, -1, 91, -1, -1, -1, -1, -1, 97,
1619 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1620 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1621 118, 119, 120, 121, 61, 123, 124, -1, -1, -1,
1622 -1, -1, 130, -1, -1, -1, -1, 135, -1, 137,
1623 -1, 139, -1, -1, -1, -1, 144, 145, -1, -1,
1624 -1, -1, -1, -1, 152, -1, -1, 155, 156, 157,
1625 97, -1, 160, 161, -1, -1, -1, -1, -1, -1,
1626 -1, -1, -1, 171, -1, -1, -1, -1, -1, -1,
1627 -1, -1, -1, -1, -1, -1, 123, -1, -1, -1,
1628 -1, -1, -1, -1, -1, -1, -1, -1, 135, -1,
1629 -1, -1, -1, 4, -1, -1, -1, -1, -1, -1,
1630 11, -1, -1, -1, -1, 152, -1, -1, 155, 156,
1631 157, -1, -1, 160, 161, -1, -1, 28, -1, 30,
1632 -1, -1, -1, -1, 171, 36, 37, -1, -1, 40,
1633 -1, -1, -1, -1, 45, -1, -1, -1, -1, -1,
1634 51, -1, 53, -1, -1, -1, 57, 58, -1, 60,
1635 -1, -1, 63, -1, 65, -1, -1, -1, -1, -1,
1636 -1, 72, -1, -1, -1, -1, -1, 78, 79, -1,
1637 -1, 82, -1, 84, 85, 86, -1, -1, -1, -1,
1638 91, -1, -1, -1, -1, -1, -1, -1, 4, -1,
1639 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1640 -1, -1, -1, 114, -1, -1, -1, 118, 119, 120,
1641 121, -1, 28, 124, 30, 126, -1, -1, -1, 130,
1642 36, 37, -1, -1, 40, 136, 137, -1, 139, 45,
1643 -1, -1, -1, 144, 145, 51, -1, 53, -1, -1,
1644 -1, 57, 58, -1, 60, -1, -1, 63, -1, 65,
1645 -1, -1, -1, -1, -1, -1, 72, 168, -1, -1,
1646 -1, -1, 78, 4, -1, -1, 82, -1, 84, 85,
1647 86, -1, -1, -1, -1, 91, -1, -1, -1, -1,
1648 -1, -1, -1, -1, -1, -1, -1, 28, -1, 30,
1649 -1, -1, -1, -1, -1, 36, -1, -1, 114, 40,
1650 -1, -1, 118, 119, 120, 121, 4, -1, 124, -1,
1651 126, -1, 53, -1, 130, -1, 57, 58, -1, 60,
1652 136, 137, 63, 139, 65, -1, -1, -1, 144, 145,
1653 28, 72, 30, -1, -1, -1, -1, -1, 36, -1,
1654 -1, 82, 40, 84, 85, -1, -1, -1, -1, -1,
1655 91, -1, 168, -1, -1, 53, -1, -1, -1, 57,
1656 58, -1, 60, -1, -1, 63, -1, 65, -1, -1,
1657 -1, -1, -1, 114, 72, -1, -1, 118, 119, 120,
1658 121, -1, -1, 124, 82, 126, 84, 85, -1, 130,
1659 -1, -1, -1, 91, -1, -1, 137, -1, 139, -1,
1660 -1, -1, -1, 144, 145, 12, 13, 14, 15, 16,
1661 17, 18, 19, 20, -1, -1, 114, -1, -1, -1,
1662 118, 119, 120, 121, -1, -1, 124, 168, 126, -1,
1663 -1, -1, 130, -1, -1, -1, -1, -1, -1, 137,
1664 -1, 139, -1, -1, -1, -1, 144, 145, 12, 13,
1665 14, 15, 16, 17, 18, 19, 20, -1, -1, -1,
1666 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1667 168, 12, 13, 14, 15, 16, 17, 18, 19, 20,
1668 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1669 -1, -1, -1, -1, 12, 13, 14, 15, 16, 17,
1670 18, 19, 20, -1, -1, -1, -1, -1, -1, -1,
1671 -1, -1, -1, -1, -1, -1, 12, 13, 14, 15,
1672 16, 17, 18, 19, 20, -1, -1, -1, -1, -1,
1673 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1674 -1, 148, -1, 150, 151, 152, 153, 154, 155, 156,
1675 157, 158, 159, -1, -1, -1, -1, -1, -1, -1,
1676 167, 168, -1, -1, -1, 172, 12, 13, 14, 15,
1677 16, 17, 18, 19, 20, -1, -1, -1, -1, -1,
1678 -1, -1, -1, -1, 148, -1, 150, 151, 152, 153,
1679 154, 155, 156, 157, 158, 159, 12, 13, 14, 15,
1680 16, 17, 18, 167, 168, -1, -1, 148, 172, 150,
1681 151, 152, 153, 154, 155, 156, 157, 158, 159, 12,
1682 13, 14, 15, 16, 17, 18, 167, 168, -1, -1,
1683 148, 172, 150, 151, 152, 153, 154, 155, 156, 157,
1684 158, 159, 12, 13, 14, 15, 16, 17, 18, 167,
1685 168, 169, 148, 149, 150, 151, 152, 153, 154, 155,
1686 156, 157, 158, 159, -1, -1, -1, -1, -1, -1,
1687 -1, 167, 168, 12, 13, 14, 15, 16, 17, 18,
1688 -1, 20, -1, -1, -1, -1, -1, -1, -1, 12,
1689 13, 14, 15, 16, 17, 18, -1, -1, -1, -1,
1690 -1, -1, 148, -1, 150, 151, 152, 153, 154, 155,
1691 156, 157, 158, 159, -1, -1, -1, -1, -1, -1,
1692 -1, 167, 168, -1, -1, -1, -1, -1, -1, -1,
1693 -1, -1, -1, -1, 150, 151, 152, 153, 154, 155,
1694 156, 157, 158, 159, -1, -1, -1, -1, -1, -1,
1695 -1, 167, 168, -1, -1, -1, -1, -1, 151, 152,
1696 153, 154, 155, 156, 157, 158, 159, -1, -1, -1,
1697 -1, -1, -1, -1, 167, 168, -1, -1, -1, -1,
1698 -1, -1, 152, 153, 154, 155, 156, 157, 158, 159,
1699 -1, -1, -1, -1, -1, -1, -1, 167, 168, -1,
1700 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1701 -1, 150, 151, 152, 153, 154, 155, 156, 157, 158,
1702 159, -1, 4, -1, -1, -1, -1, -1, 167, 168,
1703 153, 154, 155, 156, 157, 158, 159, -1, -1, -1,
1704 -1, -1, -1, -1, 167, 168, 28, -1, 30, -1,
1705 -1, -1, -1, -1, 36, 37, -1, -1, 40, -1,
1706 -1, -1, -1, -1, -1, 4, -1, -1, -1, 51,
1707 -1, 53, -1, -1, -1, 57, 58, -1, 60, -1,
1708 -1, 63, -1, 65, -1, -1, -1, -1, -1, 28,
1709 72, 30, -1, -1, -1, -1, -1, 36, -1, -1,
1710 82, 40, 84, 85, 86, -1, -1, 89, -1, 91,
1711 -1, 93, -1, -1, 53, -1, -1, -1, 57, 58,
1712 -1, 60, -1, -1, 63, -1, 65, -1, -1, -1,
1713 -1, -1, 114, 72, -1, 4, 118, 119, 120, 121,
1714 -1, -1, 124, 82, 126, 84, 85, -1, 130, -1,
1715 -1, -1, 91, -1, -1, 137, -1, 139, -1, 28,
1716 -1, 30, 144, 145, -1, -1, -1, 36, -1, -1,
1717 -1, -1, -1, -1, -1, 114, -1, -1, -1, 118,
1718 119, 120, 121, -1, 53, 124, -1, 126, 57, 58,
1719 -1, 130, -1, -1, 63, -1, 65, -1, 137, -1,
1720 139, -1, -1, 72, -1, 144, 145, -1, -1, -1,
1721 -1, -1, -1, -1, -1, 84, 85, -1, -1, -1,
1722 -1, -1, 91, -1, -1, -1, -1, -1, -1, -1,
1723 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1724 -1, -1, -1, -1, -1, -1, -1, -1, -1, 118,
1725 119, 120, 121, -1, -1, 124, -1, -1, -1, -1,
1726 -1, 130, -1, -1, -1, -1, -1, -1, 137, -1,
1727 139, -1, -1, -1, -1, 144, 145, 21, -1, 23,
1728 24, -1, 26, 27, -1, 29, -1, -1, 32, -1,
1729 34, -1, -1, -1, -1, -1, -1, 41, 42, 43,
1730 44, -1, 46, 47, 48, 49, 50, -1, 52, -1,
1731 54, 55, 56, -1, -1, 59, -1, -1, -1, -1,
1732 64, -1, 66, 67, 68, 69, 70, 71, -1, 73,
1733 74, 75, 76, 77, -1, -1, 80, -1, -1, 83,
1734 -1, -1, -1, 87, 88, -1, 90, -1, -1, -1,
1735 94, 95, 96, -1, 98, 99, 100, 101, 102, -1,
1736 104, -1, 106, 107, 108, 109, 110, 111, 112, 113,
1737 -1, 115, 116, 117, -1, -1, -1, -1, 122, -1,
1738 -1, 125, -1, -1, 128, 129, -1, -1, 132, 133,
1739 134, -1, -1, -1, 138, -1, 140, 141, 142, 143,
1743 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1744 symbol of state STATE-NUM. */
1745 static const unsigned short int yystos
[] =
1747 0, 177, 178, 0, 4, 28, 30, 36, 37, 40,
1748 45, 51, 53, 57, 58, 60, 63, 65, 72, 78,
1749 82, 84, 85, 86, 91, 114, 118, 119, 120, 121,
1750 124, 126, 130, 136, 137, 139, 144, 145, 168, 182,
1751 183, 184, 185, 186, 189, 190, 197, 208, 222, 226,
1752 228, 229, 230, 231, 234, 235, 238, 240, 241, 242,
1753 243, 245, 246, 247, 248, 249, 251, 253, 259, 260,
1754 261, 262, 3, 4, 171, 3, 4, 3, 4, 224,
1755 84, 227, 8, 3, 4, 227, 171, 227, 228, 3,
1756 224, 196, 197, 3, 224, 228, 21, 23, 24, 26,
1757 27, 29, 32, 34, 41, 42, 43, 44, 46, 47,
1758 48, 49, 50, 52, 54, 55, 56, 59, 64, 66,
1759 67, 68, 69, 70, 71, 73, 74, 75, 76, 77,
1760 80, 83, 87, 88, 90, 94, 95, 96, 98, 99,
1761 100, 101, 102, 104, 106, 107, 108, 109, 110, 111,
1762 112, 113, 115, 116, 117, 122, 125, 128, 129, 132,
1763 133, 134, 138, 140, 141, 142, 143, 146, 198, 200,
1764 258, 170, 179, 179, 89, 93, 188, 208, 229, 234,
1765 240, 244, 251, 259, 262, 170, 170, 173, 170, 173,
1766 170, 181, 170, 149, 239, 173, 252, 253, 252, 252,
1767 3, 4, 35, 62, 103, 127, 157, 171, 202, 225,
1768 254, 255, 257, 260, 252, 170, 8, 173, 170, 260,
1769 173, 251, 131, 173, 171, 171, 171, 171, 171, 171,
1770 171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
1771 171, 171, 171, 171, 171, 171, 171, 171, 171, 147,
1772 169, 11, 79, 182, 187, 190, 229, 231, 242, 243,
1773 246, 174, 3, 3, 4, 173, 257, 232, 105, 236,
1774 240, 3, 4, 173, 180, 250, 254, 254, 175, 168,
1775 171, 195, 252, 172, 205, 206, 207, 225, 172, 215,
1776 254, 256, 171, 218, 225, 3, 5, 6, 7, 8,
1777 9, 61, 97, 123, 135, 152, 155, 156, 157, 160,
1778 161, 171, 211, 212, 213, 211, 214, 8, 8, 199,
1779 214, 213, 8, 8, 213, 8, 213, 211, 65, 213,
1780 209, 210, 211, 258, 213, 209, 211, 260, 260, 8,
1781 10, 201, 5, 263, 260, 200, 168, 171, 170, 181,
1782 174, 196, 233, 149, 92, 196, 220, 237, 170, 173,
1783 180, 174, 182, 197, 249, 254, 172, 214, 157, 210,
1784 144, 191, 192, 193, 194, 197, 251, 174, 147, 175,
1785 174, 196, 216, 147, 220, 174, 197, 217, 220, 172,
1786 171, 211, 211, 211, 211, 211, 211, 211, 260, 12,
1787 13, 14, 15, 16, 17, 18, 19, 20, 148, 150,
1788 151, 152, 153, 154, 155, 156, 157, 158, 159, 167,
1789 168, 147, 172, 172, 172, 147, 172, 172, 172, 172,
1790 172, 172, 172, 172, 172, 3, 172, 147, 172, 172,
1791 147, 172, 172, 172, 172, 172, 167, 172, 172, 200,
1792 8, 181, 243, 149, 251, 170, 174, 196, 221, 174,
1793 186, 174, 181, 169, 169, 172, 147, 251, 254, 207,
1794 213, 251, 262, 254, 172, 170, 170, 260, 172, 172,
1795 211, 211, 3, 211, 211, 211, 211, 211, 211, 211,
1796 211, 211, 211, 211, 211, 211, 211, 211, 211, 211,
1797 3, 211, 213, 8, 172, 210, 213, 5, 172, 254,
1798 251, 170, 180, 181, 194, 254, 256, 170, 223, 225,
1799 172, 211, 149, 169, 172, 181, 254, 174, 170, 173,
1800 211, 181, 203, 34, 46, 174, 204, 213, 149, 149,
1801 170, 219, 220, 219, 170
1804 #define yyerrok (yyerrstatus = 0)
1805 #define yyclearin (yychar = YYEMPTY)
1806 #define YYEMPTY (-2)
1809 #define YYACCEPT goto yyacceptlab
1810 #define YYABORT goto yyabortlab
1811 #define YYERROR goto yyerrorlab
1814 /* Like YYERROR except do call yyerror. This remains here temporarily
1815 to ease the transition to the new meaning of YYERROR, for GCC.
1816 Once GCC version 2 has supplanted version 1, this can go. */
1818 #define YYFAIL goto yyerrlab
1820 #define YYRECOVERING() (!!yyerrstatus)
1822 #define YYBACKUP(Token, Value) \
1824 if (yychar == YYEMPTY && yylen == 1) \
1828 yytoken = YYTRANSLATE (yychar); \
1834 yyerror (YY_("syntax error: cannot back up")); \
1841 #define YYERRCODE 256
1844 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1845 If N is 0, then set CURRENT to the empty location which ends
1846 the previous symbol: RHS[0] (always defined). */
1848 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
1849 #ifndef YYLLOC_DEFAULT
1850 # define YYLLOC_DEFAULT(Current, Rhs, N) \
1854 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1855 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1856 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1857 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1861 (Current).first_line = (Current).last_line = \
1862 YYRHSLOC (Rhs, 0).last_line; \
1863 (Current).first_column = (Current).last_column = \
1864 YYRHSLOC (Rhs, 0).last_column; \
1870 /* YY_LOCATION_PRINT -- Print the location on the stream.
1871 This macro was not mandated originally: define only if we know
1872 we won't break user code: when these are the locations we know. */
1874 #ifndef YY_LOCATION_PRINT
1875 # if YYLTYPE_IS_TRIVIAL
1876 # define YY_LOCATION_PRINT(File, Loc) \
1877 fprintf (File, "%d.%d-%d.%d", \
1878 (Loc).first_line, (Loc).first_column, \
1879 (Loc).last_line, (Loc).last_column)
1881 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1886 /* YYLEX -- calling `yylex' with the right arguments. */
1889 # define YYLEX yylex (YYLEX_PARAM)
1891 # define YYLEX yylex ()
1894 /* Enable debugging if requested. */
1898 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1899 # define YYFPRINTF fprintf
1902 # define YYDPRINTF(Args) \
1908 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1912 YYFPRINTF (stderr, "%s ", Title); \
1913 yysymprint (stderr, \
1915 YYFPRINTF (stderr, "\n"); \
1919 /*------------------------------------------------------------------.
1920 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1922 `------------------------------------------------------------------*/
1924 #if defined (__STDC__) || defined (__cplusplus)
1926 yy_stack_print (short int *bottom
, short int *top
)
1929 yy_stack_print (bottom
, top
)
1934 YYFPRINTF (stderr
, "Stack now");
1935 for (/* Nothing. */; bottom
<= top
; ++bottom
)
1936 YYFPRINTF (stderr
, " %d", *bottom
);
1937 YYFPRINTF (stderr
, "\n");
1940 # define YY_STACK_PRINT(Bottom, Top) \
1943 yy_stack_print ((Bottom), (Top)); \
1947 /*------------------------------------------------.
1948 | Report that the YYRULE is going to be reduced. |
1949 `------------------------------------------------*/
1951 #if defined (__STDC__) || defined (__cplusplus)
1953 yy_reduce_print (int yyrule
)
1956 yy_reduce_print (yyrule
)
1961 unsigned long int yylno
= yyrline
[yyrule
];
1962 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu), ",
1964 /* Print the symbols being reduced, and their result. */
1965 for (yyi
= yyprhs
[yyrule
]; 0 <= yyrhs
[yyi
]; yyi
++)
1966 YYFPRINTF (stderr
, "%s ", yytname
[yyrhs
[yyi
]]);
1967 YYFPRINTF (stderr
, "-> %s\n", yytname
[yyr1
[yyrule
]]);
1970 # define YY_REDUCE_PRINT(Rule) \
1973 yy_reduce_print (Rule); \
1976 /* Nonzero means print parse trace. It is left uninitialized so that
1977 multiple parsers can coexist. */
1979 #else /* !YYDEBUG */
1980 # define YYDPRINTF(Args)
1981 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1982 # define YY_STACK_PRINT(Bottom, Top)
1983 # define YY_REDUCE_PRINT(Rule)
1984 #endif /* !YYDEBUG */
1987 /* YYINITDEPTH -- initial size of the parser's stacks. */
1989 # define YYINITDEPTH 200
1992 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1993 if the built-in stack extension method is used).
1995 Do not make this value too large; the results are undefined if
1996 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1997 evaluated with infinite-precision integer arithmetic. */
2000 # define YYMAXDEPTH 10000
2008 # if defined (__GLIBC__) && defined (_STRING_H)
2009 # define yystrlen strlen
2011 /* Return the length of YYSTR. */
2013 # if defined (__STDC__) || defined (__cplusplus)
2014 yystrlen (const char *yystr
)
2020 const char *yys
= yystr
;
2022 while (*yys
++ != '\0')
2025 return yys
- yystr
- 1;
2031 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
2032 # define yystpcpy stpcpy
2034 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
2037 # if defined (__STDC__) || defined (__cplusplus)
2038 yystpcpy (char *yydest
, const char *yysrc
)
2040 yystpcpy (yydest
, yysrc
)
2046 const char *yys
= yysrc
;
2048 while ((*yyd
++ = *yys
++) != '\0')
2057 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
2058 quotes and backslashes, so that it's suitable for yyerror. The
2059 heuristic is that double-quoting is unnecessary unless the string
2060 contains an apostrophe, a comma, or backslash (other than
2061 backslash-backslash). YYSTR is taken from yytname. If YYRES is
2062 null, do not copy; instead, return the length of what the result
2065 yytnamerr (char *yyres
, const char *yystr
)
2070 char const *yyp
= yystr
;
2077 goto do_not_strip_quotes
;
2081 goto do_not_strip_quotes
;
2094 do_not_strip_quotes
: ;
2098 return yystrlen (yystr
);
2100 return yystpcpy (yyres
, yystr
) - yyres
;
2104 #endif /* YYERROR_VERBOSE */
2109 /*--------------------------------.
2110 | Print this symbol on YYOUTPUT. |
2111 `--------------------------------*/
2113 #if defined (__STDC__) || defined (__cplusplus)
2115 yysymprint (FILE *yyoutput
, int yytype
, YYSTYPE
*yyvaluep
)
2118 yysymprint (yyoutput
, yytype
, yyvaluep
)
2124 /* Pacify ``unused variable'' warnings. */
2127 if (yytype
< YYNTOKENS
)
2128 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
2130 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
2134 if (yytype
< YYNTOKENS
)
2135 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
2142 YYFPRINTF (yyoutput
, ")");
2145 #endif /* ! YYDEBUG */
2146 /*-----------------------------------------------.
2147 | Release the memory associated to this symbol. |
2148 `-----------------------------------------------*/
2150 #if defined (__STDC__) || defined (__cplusplus)
2152 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
)
2155 yydestruct (yymsg
, yytype
, yyvaluep
)
2161 /* Pacify ``unused variable'' warnings. */
2166 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
2177 /* Prevent warnings from -Wmissing-prototypes. */
2179 #ifdef YYPARSE_PARAM
2180 # if defined (__STDC__) || defined (__cplusplus)
2181 int yyparse (void *YYPARSE_PARAM
);
2185 #else /* ! YYPARSE_PARAM */
2186 #if defined (__STDC__) || defined (__cplusplus)
2191 #endif /* ! YYPARSE_PARAM */
2195 /* The look-ahead symbol. */
2198 /* The semantic value of the look-ahead symbol. */
2201 /* Number of syntax errors so far. */
2210 #ifdef YYPARSE_PARAM
2211 # if defined (__STDC__) || defined (__cplusplus)
2212 int yyparse (void *YYPARSE_PARAM
)
2214 int yyparse (YYPARSE_PARAM
)
2215 void *YYPARSE_PARAM
;
2217 #else /* ! YYPARSE_PARAM */
2218 #if defined (__STDC__) || defined (__cplusplus)
2232 /* Number of tokens to shift before error messages enabled. */
2234 /* Look-ahead token as an internal (translated) token number. */
2237 /* Three stacks and their tools:
2238 `yyss': related to states,
2239 `yyvs': related to semantic values,
2240 `yyls': related to locations.
2242 Refer to the stacks thru separate pointers, to allow yyoverflow
2243 to reallocate them elsewhere. */
2245 /* The state stack. */
2246 short int yyssa
[YYINITDEPTH
];
2247 short int *yyss
= yyssa
;
2250 /* The semantic value stack. */
2251 YYSTYPE yyvsa
[YYINITDEPTH
];
2252 YYSTYPE
*yyvs
= yyvsa
;
2257 #define YYPOPSTACK (yyvsp--, yyssp--)
2259 YYSIZE_T yystacksize
= YYINITDEPTH
;
2261 /* The variables used to return semantic value and location from the
2266 /* When reducing, the number of symbols on the RHS of the reduced
2270 YYDPRINTF ((stderr
, "Starting parse\n"));
2275 yychar
= YYEMPTY
; /* Cause a token to be read. */
2277 /* Initialize stack pointers.
2278 Waste one element of value and location stack
2279 so that they stay on the same level as the state stack.
2280 The wasted elements are never initialized. */
2287 /*------------------------------------------------------------.
2288 | yynewstate -- Push a new state, which is found in yystate. |
2289 `------------------------------------------------------------*/
2291 /* In all cases, when you get here, the value and location stacks
2292 have just been pushed. so pushing a state here evens the stacks.
2299 if (yyss
+ yystacksize
- 1 <= yyssp
)
2301 /* Get the current used size of the three stacks, in elements. */
2302 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
2306 /* Give user a chance to reallocate the stack. Use copies of
2307 these so that the &'s don't force the real ones into
2309 YYSTYPE
*yyvs1
= yyvs
;
2310 short int *yyss1
= yyss
;
2313 /* Each stack pointer address is followed by the size of the
2314 data in use in that stack, in bytes. This used to be a
2315 conditional around just the two extra args, but that might
2316 be undefined if yyoverflow is a macro. */
2317 yyoverflow (YY_("memory exhausted"),
2318 &yyss1
, yysize
* sizeof (*yyssp
),
2319 &yyvs1
, yysize
* sizeof (*yyvsp
),
2326 #else /* no yyoverflow */
2327 # ifndef YYSTACK_RELOCATE
2328 goto yyexhaustedlab
;
2330 /* Extend the stack our own way. */
2331 if (YYMAXDEPTH
<= yystacksize
)
2332 goto yyexhaustedlab
;
2334 if (YYMAXDEPTH
< yystacksize
)
2335 yystacksize
= YYMAXDEPTH
;
2338 short int *yyss1
= yyss
;
2339 union yyalloc
*yyptr
=
2340 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
2342 goto yyexhaustedlab
;
2343 YYSTACK_RELOCATE (yyss
);
2344 YYSTACK_RELOCATE (yyvs
);
2346 # undef YYSTACK_RELOCATE
2348 YYSTACK_FREE (yyss1
);
2351 #endif /* no yyoverflow */
2353 yyssp
= yyss
+ yysize
- 1;
2354 yyvsp
= yyvs
+ yysize
- 1;
2357 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
2358 (unsigned long int) yystacksize
));
2360 if (yyss
+ yystacksize
- 1 <= yyssp
)
2364 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
2373 /* Do appropriate processing given the current state. */
2374 /* Read a look-ahead token if we need one and don't already have one. */
2377 /* First try to decide what to do without reference to look-ahead token. */
2379 yyn
= yypact
[yystate
];
2380 if (yyn
== YYPACT_NINF
)
2383 /* Not known => get a look-ahead token if don't already have one. */
2385 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
2386 if (yychar
== YYEMPTY
)
2388 YYDPRINTF ((stderr
, "Reading a token: "));
2392 if (yychar
<= YYEOF
)
2394 yychar
= yytoken
= YYEOF
;
2395 YYDPRINTF ((stderr
, "Now at end of input.\n"));
2399 yytoken
= YYTRANSLATE (yychar
);
2400 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
2403 /* If the proper action on seeing token YYTOKEN is to reduce or to
2404 detect an error, take that action. */
2406 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
2411 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
2420 /* Shift the look-ahead token. */
2421 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
2423 /* Discard the token being shifted unless it is eof. */
2424 if (yychar
!= YYEOF
)
2430 /* Count tokens shifted since error; after three, turn off error
2439 /*-----------------------------------------------------------.
2440 | yydefault -- do the default action for the current state. |
2441 `-----------------------------------------------------------*/
2443 yyn
= yydefact
[yystate
];
2449 /*-----------------------------.
2450 | yyreduce -- Do a reduction. |
2451 `-----------------------------*/
2453 /* yyn is the number of a rule to reduce with. */
2456 /* If YYLEN is nonzero, implement the default value of the action:
2459 Otherwise, the following line sets YYVAL to garbage.
2460 This behavior is undocumented and Bison
2461 users should not rely upon it. Assigning to YYVAL
2462 unconditionally makes the parser a bit smaller, and it avoids a
2463 GCC warning that YYVAL may be used uninitialized. */
2464 yyval
= yyvsp
[1-yylen
];
2467 YY_REDUCE_PRINT (yyn
);
2471 #line 351 "parser.y"
2473 check_all_user_types((yyvsp
[0].stmt_list
));
2474 write_proxies((yyvsp
[0].stmt_list
));
2475 write_client((yyvsp
[0].stmt_list
));
2476 write_server((yyvsp
[0].stmt_list
));
2477 write_dlldata((yyvsp
[0].stmt_list
));
2482 #line 360 "parser.y"
2483 { (yyval
.stmt_list
) = NULL
; ;}
2487 #line 361 "parser.y"
2488 { (yyval
.stmt_list
) = (yyvsp
[-1].stmt_list
); ;}
2492 #line 362 "parser.y"
2493 { (yyval
.stmt_list
) = append_statement((yyvsp
[-1].stmt_list
), make_statement_type_decl((yyvsp
[0].type
))); ;}
2497 #line 363 "parser.y"
2498 { (yyval
.stmt_list
) = (yyvsp
[-2].stmt_list
);
2499 reg_type((yyvsp
[-1].type
), (yyvsp
[-1].type
)->name
, 0);
2500 if (!parse_only
&& do_header
) write_coclass_forward((yyvsp
[-1].type
));
2505 #line 367 "parser.y"
2506 { (yyval
.stmt_list
) = append_statement((yyvsp
[-1].stmt_list
), make_statement_type_decl((yyvsp
[0].type
)));
2507 add_typelib_entry((yyvsp
[0].type
));
2508 reg_type((yyvsp
[0].type
), (yyvsp
[0].type
)->name
, 0);
2509 if (!parse_only
&& do_header
) write_coclass_forward((yyvsp
[0].type
));
2514 #line 372 "parser.y"
2515 { (yyval
.stmt_list
) = append_statement((yyvsp
[-1].stmt_list
), make_statement_module((yyvsp
[0].type
)));
2516 add_typelib_entry((yyvsp
[0].type
));
2521 #line 375 "parser.y"
2522 { (yyval
.stmt_list
) = append_statement((yyvsp
[-1].stmt_list
), make_statement_library((yyvsp
[0].typelib
))); ;}
2526 #line 376 "parser.y"
2527 { (yyval
.stmt_list
) = append_statement((yyvsp
[-1].stmt_list
), (yyvsp
[0].statement
)); ;}
2531 #line 379 "parser.y"
2532 { (yyval
.stmt_list
) = NULL
; ;}
2536 #line 380 "parser.y"
2537 { (yyval
.stmt_list
) = append_statement((yyvsp
[-1].stmt_list
), make_statement_reference((yyvsp
[0].type
))); if (!parse_only
) add_typelib_entry((yyvsp
[0].type
)); ;}
2541 #line 381 "parser.y"
2542 { (yyval
.stmt_list
) = append_statement((yyvsp
[-1].stmt_list
), make_statement_type_decl((yyvsp
[0].type
))); if (!parse_only
) add_typelib_entry((yyvsp
[0].type
)); ;}
2546 #line 382 "parser.y"
2547 { (yyval
.stmt_list
) = (yyvsp
[-2].stmt_list
); reg_type((yyvsp
[-1].type
), (yyvsp
[-1].type
)->name
, 0); if (!parse_only
&& do_header
) write_coclass_forward((yyvsp
[-1].type
)); ;}
2551 #line 383 "parser.y"
2552 { (yyval
.stmt_list
) = append_statement((yyvsp
[-1].stmt_list
), make_statement_type_decl((yyvsp
[0].type
)));
2553 if (!parse_only
) add_typelib_entry((yyvsp
[0].type
));
2554 reg_type((yyvsp
[0].type
), (yyvsp
[0].type
)->name
, 0);
2555 if (!parse_only
&& do_header
) write_coclass_forward((yyvsp
[0].type
));
2560 #line 388 "parser.y"
2561 { (yyval
.stmt_list
) = append_statement((yyvsp
[-1].stmt_list
), make_statement_module((yyvsp
[0].type
))); if (!parse_only
) add_typelib_entry((yyvsp
[0].type
)); ;}
2565 #line 389 "parser.y"
2566 { (yyval
.stmt_list
) = append_statement((yyvsp
[-1].stmt_list
), (yyvsp
[0].statement
)); ;}
2570 #line 390 "parser.y"
2571 { (yyval
.stmt_list
) = append_statement((yyvsp
[-1].stmt_list
), make_statement_importlib((yyvsp
[0].str
))); ;}
2575 #line 391 "parser.y"
2576 { (yyval
.stmt_list
) = append_statement((yyvsp
[-1].stmt_list
), make_statement_library((yyvsp
[0].typelib
))); ;}
2580 #line 394 "parser.y"
2581 { (yyval
.func_list
) = NULL
; ;}
2585 #line 395 "parser.y"
2586 { (yyval
.func_list
) = append_func_from_statement( (yyvsp
[-1].func_list
), (yyvsp
[0].statement
) ); ;}
2590 #line 403 "parser.y"
2591 { (yyval
.statement
) = make_statement_cppquote((yyvsp
[0].str
)); ;}
2595 #line 404 "parser.y"
2596 { (yyval
.statement
) = make_statement_type_decl((yyvsp
[-1].type
));
2597 if (!parse_only
&& do_header
) {
2598 write_type_def_or_decl(header
, (yyvsp
[-1].type
), FALSE
, NULL
);
2599 fprintf(header
, ";\n\n");
2605 #line 410 "parser.y"
2606 { (yyval
.statement
) = make_statement_declaration((yyvsp
[-1].var
));
2607 if (!parse_only
&& do_header
) write_declaration((yyvsp
[-1].var
), is_in_interface
);
2612 #line 413 "parser.y"
2613 { (yyval
.statement
) = make_statement_import((yyvsp
[0].str
)); ;}
2617 #line 414 "parser.y"
2618 { (yyval
.statement
) = (yyvsp
[-1].statement
); ;}
2622 #line 423 "parser.y"
2623 { (yyval
.str
) = (yyvsp
[-1].str
); if (!parse_only
&& do_header
) fprintf(header
, "%s\n", (yyvsp
[-1].str
)); ;}
2627 #line 425 "parser.y"
2628 { assert(yychar
== YYEMPTY
);
2629 (yyval
.import
) = xmalloc(sizeof(struct _import_t
));
2630 (yyval
.import
)->name
= (yyvsp
[-1].str
);
2631 (yyval
.import
)->import_performed
= do_import((yyvsp
[-1].str
));
2632 if (!(yyval
.import
)->import_performed
) yychar
= aEOF
;
2637 #line 433 "parser.y"
2638 { (yyval
.str
) = (yyvsp
[-2].import
)->name
;
2639 if ((yyvsp
[-2].import
)->import_performed
) pop_import();
2640 free((yyvsp
[-2].import
));
2641 if (!parse_only
&& do_header
) write_import((yyval
.str
));
2646 #line 441 "parser.y"
2647 { (yyval
.str
) = (yyvsp
[-2].str
); if(!parse_only
) add_importlib((yyvsp
[-2].str
)); ;}
2651 #line 444 "parser.y"
2652 { (yyval
.str
) = (yyvsp
[0].str
); ;}
2656 #line 446 "parser.y"
2657 { (yyval
.typelib
) = make_library((yyvsp
[-1].str
), check_library_attrs((yyvsp
[-1].str
), (yyvsp
[-2].attr_list
)));
2658 if (!parse_only
) start_typelib((yyval
.typelib
));
2659 if (!parse_only
&& do_header
) write_library((yyval
.typelib
));
2660 if (!parse_only
&& do_idfile
) write_libid((yyval
.typelib
));
2661 is_inside_library
= TRUE
;
2666 #line 454 "parser.y"
2667 { (yyval
.typelib
) = (yyvsp
[-3].typelib
);
2668 (yyval
.typelib
)->stmts
= (yyvsp
[-2].stmt_list
);
2669 if (!parse_only
) end_typelib();
2670 is_inside_library
= FALSE
;
2675 #line 461 "parser.y"
2676 { (yyval
.var_list
) = NULL
; ;}
2680 #line 465 "parser.y"
2681 { (yyval
.var_list
) = NULL
; ;}
2685 #line 468 "parser.y"
2686 { check_arg((yyvsp
[0].var
)); (yyval
.var_list
) = append_var( NULL
, (yyvsp
[0].var
) ); ;}
2690 #line 469 "parser.y"
2691 { check_arg((yyvsp
[0].var
)); (yyval
.var_list
) = append_var( (yyvsp
[-2].var_list
), (yyvsp
[0].var
)); ;}
2695 #line 474 "parser.y"
2696 { (yyval
.var
) = (yyvsp
[0].declarator
)->var
;
2697 (yyval
.var
)->attrs
= (yyvsp
[-2].attr_list
);
2698 if ((yyvsp
[-1].declspec
)->stgclass
!= STG_NONE
&& (yyvsp
[-1].declspec
)->stgclass
!= STG_REGISTER
)
2699 error_loc("invalid storage class for function parameter\n");
2700 set_type((yyval
.var
), (yyvsp
[-1].declspec
), (yyvsp
[0].declarator
), TRUE
);
2701 free((yyvsp
[0].declarator
));
2706 #line 481 "parser.y"
2707 { (yyval
.var
) = (yyvsp
[0].declarator
)->var
;
2708 if ((yyvsp
[-1].declspec
)->stgclass
!= STG_NONE
&& (yyvsp
[-1].declspec
)->stgclass
!= STG_REGISTER
)
2709 error_loc("invalid storage class for function parameter\n");
2710 set_type((yyval
.var
), (yyvsp
[-1].declspec
), (yyvsp
[0].declarator
), TRUE
);
2711 free((yyvsp
[0].declarator
));
2716 #line 489 "parser.y"
2717 { (yyval
.expr
) = (yyvsp
[-1].expr
); ;}
2721 #line 490 "parser.y"
2722 { (yyval
.expr
) = make_expr(EXPR_VOID
); ;}
2726 #line 493 "parser.y"
2727 { (yyval
.attr_list
) = NULL
; ;}
2731 #line 498 "parser.y"
2732 { (yyval
.attr_list
) = (yyvsp
[-1].attr_list
);
2733 if (!(yyval
.attr_list
))
2734 error_loc("empty attribute lists unsupported\n");
2739 #line 504 "parser.y"
2740 { (yyval
.attr_list
) = append_attr( NULL
, (yyvsp
[0].attr
) ); ;}
2744 #line 505 "parser.y"
2745 { (yyval
.attr_list
) = append_attr( (yyvsp
[-2].attr_list
), (yyvsp
[0].attr
) ); ;}
2749 #line 506 "parser.y"
2750 { (yyval
.attr_list
) = append_attr( (yyvsp
[-3].attr_list
), (yyvsp
[0].attr
) ); ;}
2754 #line 509 "parser.y"
2755 { (yyval
.str_list
) = append_str( NULL
, (yyvsp
[0].str
) ); ;}
2759 #line 510 "parser.y"
2760 { (yyval
.str_list
) = append_str( (yyvsp
[-2].str_list
), (yyvsp
[0].str
) ); ;}
2764 #line 513 "parser.y"
2765 { (yyval
.attr
) = NULL
; ;}
2769 #line 514 "parser.y"
2770 { (yyval
.attr
) = make_attr(ATTR_AGGREGATABLE
); ;}
2774 #line 515 "parser.y"
2775 { (yyval
.attr
) = make_attr(ATTR_APPOBJECT
); ;}
2779 #line 516 "parser.y"
2780 { (yyval
.attr
) = make_attr(ATTR_ASYNC
); ;}
2784 #line 517 "parser.y"
2785 { (yyval
.attr
) = make_attr(ATTR_AUTO_HANDLE
); ;}
2789 #line 518 "parser.y"
2790 { (yyval
.attr
) = make_attr(ATTR_BINDABLE
); ;}
2794 #line 519 "parser.y"
2795 { (yyval
.attr
) = make_attr(ATTR_BROADCAST
); ;}
2799 #line 520 "parser.y"
2800 { (yyval
.attr
) = make_attrp(ATTR_CALLAS
, (yyvsp
[-1].var
)); ;}
2804 #line 521 "parser.y"
2805 { (yyval
.attr
) = make_attrp(ATTR_CASE
, (yyvsp
[-1].expr_list
)); ;}
2809 #line 522 "parser.y"
2810 { (yyval
.attr
) = make_attrv(ATTR_CONTEXTHANDLE
, 0); ;}
2814 #line 523 "parser.y"
2815 { (yyval
.attr
) = make_attrv(ATTR_CONTEXTHANDLE
, 0); /* RPC_CONTEXT_HANDLE_DONT_SERIALIZE */ ;}
2819 #line 524 "parser.y"
2820 { (yyval
.attr
) = make_attrv(ATTR_CONTEXTHANDLE
, 0); /* RPC_CONTEXT_HANDLE_SERIALIZE */ ;}
2824 #line 525 "parser.y"
2825 { (yyval
.attr
) = make_attr(ATTR_CONTROL
); ;}
2829 #line 526 "parser.y"
2830 { (yyval
.attr
) = make_attr(ATTR_DEFAULT
); ;}
2834 #line 527 "parser.y"
2835 { (yyval
.attr
) = make_attr(ATTR_DEFAULTCOLLELEM
); ;}
2839 #line 528 "parser.y"
2840 { (yyval
.attr
) = make_attrp(ATTR_DEFAULTVALUE
, (yyvsp
[-1].expr
)); ;}
2844 #line 529 "parser.y"
2845 { (yyval
.attr
) = make_attr(ATTR_DEFAULTVTABLE
); ;}
2849 #line 530 "parser.y"
2850 { (yyval
.attr
) = make_attr(ATTR_DISPLAYBIND
); ;}
2854 #line 531 "parser.y"
2855 { (yyval
.attr
) = make_attrp(ATTR_DLLNAME
, (yyvsp
[-1].str
)); ;}
2859 #line 532 "parser.y"
2860 { (yyval
.attr
) = make_attr(ATTR_DUAL
); ;}
2864 #line 533 "parser.y"
2865 { (yyval
.attr
) = make_attrp(ATTR_ENDPOINT
, (yyvsp
[-1].str_list
)); ;}
2869 #line 534 "parser.y"
2870 { (yyval
.attr
) = make_attrp(ATTR_ENTRY
, (yyvsp
[-1].expr
)); ;}
2874 #line 535 "parser.y"
2875 { (yyval
.attr
) = make_attr(ATTR_EXPLICIT_HANDLE
); ;}
2879 #line 536 "parser.y"
2880 { (yyval
.attr
) = make_attr(ATTR_HANDLE
); ;}
2884 #line 537 "parser.y"
2885 { (yyval
.attr
) = make_attrp(ATTR_HELPCONTEXT
, (yyvsp
[-1].expr
)); ;}
2889 #line 538 "parser.y"
2890 { (yyval
.attr
) = make_attrp(ATTR_HELPFILE
, (yyvsp
[-1].str
)); ;}
2894 #line 539 "parser.y"
2895 { (yyval
.attr
) = make_attrp(ATTR_HELPSTRING
, (yyvsp
[-1].str
)); ;}
2899 #line 540 "parser.y"
2900 { (yyval
.attr
) = make_attrp(ATTR_HELPSTRINGCONTEXT
, (yyvsp
[-1].expr
)); ;}
2904 #line 541 "parser.y"
2905 { (yyval
.attr
) = make_attrp(ATTR_HELPSTRINGDLL
, (yyvsp
[-1].str
)); ;}
2909 #line 542 "parser.y"
2910 { (yyval
.attr
) = make_attr(ATTR_HIDDEN
); ;}
2914 #line 543 "parser.y"
2915 { (yyval
.attr
) = make_attrp(ATTR_ID
, (yyvsp
[-1].expr
)); ;}
2919 #line 544 "parser.y"
2920 { (yyval
.attr
) = make_attr(ATTR_IDEMPOTENT
); ;}
2924 #line 545 "parser.y"
2925 { (yyval
.attr
) = make_attrp(ATTR_IIDIS
, (yyvsp
[-1].expr
)); ;}
2929 #line 546 "parser.y"
2930 { (yyval
.attr
) = make_attr(ATTR_IMMEDIATEBIND
); ;}
2934 #line 547 "parser.y"
2935 { (yyval
.attr
) = make_attrp(ATTR_IMPLICIT_HANDLE
, (yyvsp
[-1].str
)); ;}
2939 #line 548 "parser.y"
2940 { (yyval
.attr
) = make_attr(ATTR_IN
); ;}
2944 #line 549 "parser.y"
2945 { (yyval
.attr
) = make_attr(ATTR_INPUTSYNC
); ;}
2949 #line 550 "parser.y"
2950 { (yyval
.attr
) = make_attrp(ATTR_LENGTHIS
, (yyvsp
[-1].expr_list
)); ;}
2954 #line 551 "parser.y"
2955 { (yyval
.attr
) = make_attrp(ATTR_LIBLCID
, (yyvsp
[-1].expr
)); ;}
2959 #line 552 "parser.y"
2960 { (yyval
.attr
) = make_attr(ATTR_LOCAL
); ;}
2964 #line 553 "parser.y"
2965 { (yyval
.attr
) = make_attr(ATTR_NONBROWSABLE
); ;}
2969 #line 554 "parser.y"
2970 { (yyval
.attr
) = make_attr(ATTR_NONCREATABLE
); ;}
2974 #line 555 "parser.y"
2975 { (yyval
.attr
) = make_attr(ATTR_NONEXTENSIBLE
); ;}
2979 #line 556 "parser.y"
2980 { (yyval
.attr
) = make_attr(ATTR_OBJECT
); ;}
2984 #line 557 "parser.y"
2985 { (yyval
.attr
) = make_attr(ATTR_ODL
); ;}
2989 #line 558 "parser.y"
2990 { (yyval
.attr
) = make_attr(ATTR_OLEAUTOMATION
); ;}
2994 #line 559 "parser.y"
2995 { (yyval
.attr
) = make_attr(ATTR_OPTIONAL
); ;}
2999 #line 560 "parser.y"
3000 { (yyval
.attr
) = make_attr(ATTR_OUT
); ;}
3004 #line 561 "parser.y"
3005 { (yyval
.attr
) = make_attrv(ATTR_POINTERDEFAULT
, (yyvsp
[-1].num
)); ;}
3009 #line 562 "parser.y"
3010 { (yyval
.attr
) = make_attr(ATTR_PROPGET
); ;}
3014 #line 563 "parser.y"
3015 { (yyval
.attr
) = make_attr(ATTR_PROPPUT
); ;}
3019 #line 564 "parser.y"
3020 { (yyval
.attr
) = make_attr(ATTR_PROPPUTREF
); ;}
3024 #line 565 "parser.y"
3025 { (yyval
.attr
) = make_attr(ATTR_PUBLIC
); ;}
3029 #line 567 "parser.y"
3030 { expr_list_t
*list
= append_expr( NULL
, (yyvsp
[-3].expr
) );
3031 list
= append_expr( list
, (yyvsp
[-1].expr
) );
3032 (yyval
.attr
) = make_attrp(ATTR_RANGE
, list
); ;}
3036 #line 570 "parser.y"
3037 { (yyval
.attr
) = make_attr(ATTR_READONLY
); ;}
3041 #line 571 "parser.y"
3042 { (yyval
.attr
) = make_attr(ATTR_REQUESTEDIT
); ;}
3046 #line 572 "parser.y"
3047 { (yyval
.attr
) = make_attr(ATTR_RESTRICTED
); ;}
3051 #line 573 "parser.y"
3052 { (yyval
.attr
) = make_attr(ATTR_RETVAL
); ;}
3056 #line 574 "parser.y"
3057 { (yyval
.attr
) = make_attrp(ATTR_SIZEIS
, (yyvsp
[-1].expr_list
)); ;}
3061 #line 575 "parser.y"
3062 { (yyval
.attr
) = make_attr(ATTR_SOURCE
); ;}
3066 #line 576 "parser.y"
3067 { (yyval
.attr
) = make_attr(ATTR_STRICTCONTEXTHANDLE
); ;}
3071 #line 577 "parser.y"
3072 { (yyval
.attr
) = make_attr(ATTR_STRING
); ;}
3076 #line 578 "parser.y"
3077 { (yyval
.attr
) = make_attrp(ATTR_SWITCHIS
, (yyvsp
[-1].expr
)); ;}
3081 #line 579 "parser.y"
3082 { (yyval
.attr
) = make_attrp(ATTR_SWITCHTYPE
, (yyvsp
[-1].type
)); ;}
3086 #line 580 "parser.y"
3087 { (yyval
.attr
) = make_attrp(ATTR_TRANSMITAS
, (yyvsp
[-1].type
)); ;}
3091 #line 581 "parser.y"
3092 { (yyval
.attr
) = make_attrp(ATTR_UUID
, (yyvsp
[-1].uuid
)); ;}
3096 #line 582 "parser.y"
3097 { (yyval
.attr
) = make_attr(ATTR_V1ENUM
); ;}
3101 #line 583 "parser.y"
3102 { (yyval
.attr
) = make_attr(ATTR_VARARG
); ;}
3106 #line 584 "parser.y"
3107 { (yyval
.attr
) = make_attrv(ATTR_VERSION
, (yyvsp
[-1].num
)); ;}
3111 #line 585 "parser.y"
3112 { (yyval
.attr
) = make_attrp(ATTR_WIREMARSHAL
, (yyvsp
[-1].type
)); ;}
3116 #line 586 "parser.y"
3117 { (yyval
.attr
) = make_attrv(ATTR_POINTERTYPE
, (yyvsp
[0].num
)); ;}
3121 #line 591 "parser.y"
3122 { if (!is_valid_uuid((yyvsp
[0].str
)))
3123 error_loc("invalid UUID: %s\n", (yyvsp
[0].str
));
3124 (yyval
.uuid
) = parse_uuid((yyvsp
[0].str
)); ;}
3128 #line 596 "parser.y"
3129 { (yyval
.str
) = (yyvsp
[0].str
); ;}
3133 #line 597 "parser.y"
3134 { (yyval
.str
) = (yyvsp
[0].str
); ;}
3138 #line 598 "parser.y"
3139 { (yyval
.str
) = (yyvsp
[0].str
); ;}
3143 #line 599 "parser.y"
3144 { (yyval
.str
) = (yyvsp
[0].str
); ;}
3148 #line 602 "parser.y"
3149 { (yyval
.var_list
) = NULL
; ;}
3153 #line 603 "parser.y"
3154 { (yyval
.var_list
) = append_var( (yyvsp
[-1].var_list
), (yyvsp
[0].var
) ); ;}
3158 #line 606 "parser.y"
3159 { attr_t
*a
= make_attrp(ATTR_CASE
, append_expr( NULL
, (yyvsp
[-2].expr
) ));
3160 (yyval
.var
) = (yyvsp
[0].var
); if (!(yyval
.var
)) (yyval
.var
) = make_var(NULL
);
3161 (yyval
.var
)->attrs
= append_attr( (yyval
.var
)->attrs
, a
);
3166 #line 610 "parser.y"
3167 { attr_t
*a
= make_attr(ATTR_DEFAULT
);
3168 (yyval
.var
) = (yyvsp
[0].var
); if (!(yyval
.var
)) (yyval
.var
) = make_var(NULL
);
3169 (yyval
.var
)->attrs
= append_attr( (yyval
.var
)->attrs
, a
);
3174 #line 616 "parser.y"
3175 { (yyval
.var_list
) = NULL
; ;}
3179 #line 617 "parser.y"
3180 { (yyval
.var_list
) = (yyvsp
[-1].var_list
); ;}
3184 #line 621 "parser.y"
3185 { if (!(yyvsp
[0].var
)->eval
)
3186 (yyvsp
[0].var
)->eval
= make_exprl(EXPR_NUM
, 0 /* default for first enum entry */);
3187 (yyval
.var_list
) = append_var( NULL
, (yyvsp
[0].var
) );
3192 #line 625 "parser.y"
3193 { if (!(yyvsp
[0].var
)->eval
)
3195 var_t
*last
= LIST_ENTRY( list_tail((yyval
.var_list
)), var_t
, entry
);
3196 (yyvsp
[0].var
)->eval
= make_exprl(EXPR_NUM
, last
->eval
->cval
+ 1);
3198 (yyval
.var_list
) = append_var( (yyvsp
[-2].var_list
), (yyvsp
[0].var
) );
3203 #line 634 "parser.y"
3204 { (yyval
.var
) = reg_const((yyvsp
[-2].var
));
3205 (yyval
.var
)->eval
= (yyvsp
[0].expr
);
3206 (yyval
.var
)->type
= make_int(0);
3211 #line 638 "parser.y"
3212 { (yyval
.var
) = reg_const((yyvsp
[0].var
));
3213 (yyval
.var
)->type
= make_int(0);
3218 #line 643 "parser.y"
3219 { (yyval
.type
) = get_typev(RPC_FC_ENUM16
, (yyvsp
[-3].var
), tsENUM
);
3220 (yyval
.type
)->kind
= TKIND_ENUM
;
3221 (yyval
.type
)->fields_or_args
= (yyvsp
[-1].var_list
);
3222 (yyval
.type
)->defined
= TRUE
;
3224 add_typelib_entry((yyval
.type
));
3229 #line 652 "parser.y"
3230 { (yyval
.expr_list
) = append_expr( NULL
, (yyvsp
[0].expr
) ); ;}
3234 #line 653 "parser.y"
3235 { (yyval
.expr_list
) = append_expr( (yyvsp
[-2].expr_list
), (yyvsp
[0].expr
) ); ;}
3239 #line 666 "parser.y"
3240 { (yyval
.expr
) = make_expr(EXPR_VOID
); ;}
3244 #line 670 "parser.y"
3245 { (yyval
.expr
) = make_exprl(EXPR_NUM
, (yyvsp
[0].num
)); ;}
3249 #line 671 "parser.y"
3250 { (yyval
.expr
) = make_exprl(EXPR_HEXNUM
, (yyvsp
[0].num
)); ;}
3254 #line 672 "parser.y"
3255 { (yyval
.expr
) = make_exprd(EXPR_DOUBLE
, (yyvsp
[0].dbl
)); ;}
3259 #line 673 "parser.y"
3260 { (yyval
.expr
) = make_exprl(EXPR_TRUEFALSE
, 0); ;}
3264 #line 674 "parser.y"
3265 { (yyval
.expr
) = make_exprl(EXPR_NUM
, 0); ;}
3269 #line 675 "parser.y"
3270 { (yyval
.expr
) = make_exprl(EXPR_TRUEFALSE
, 1); ;}
3274 #line 676 "parser.y"
3275 { (yyval
.expr
) = make_exprs(EXPR_STRLIT
, (yyvsp
[0].str
)); ;}
3279 #line 677 "parser.y"
3280 { (yyval
.expr
) = make_exprs(EXPR_WSTRLIT
, (yyvsp
[0].str
)); ;}
3284 #line 678 "parser.y"
3285 { (yyval
.expr
) = make_exprs(EXPR_IDENTIFIER
, (yyvsp
[0].str
)); ;}
3289 #line 679 "parser.y"
3290 { (yyval
.expr
) = make_expr3(EXPR_COND
, (yyvsp
[-4].expr
), (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3294 #line 680 "parser.y"
3295 { (yyval
.expr
) = make_expr2(EXPR_LOGOR
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3299 #line 681 "parser.y"
3300 { (yyval
.expr
) = make_expr2(EXPR_LOGAND
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3304 #line 682 "parser.y"
3305 { (yyval
.expr
) = make_expr2(EXPR_OR
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3309 #line 683 "parser.y"
3310 { (yyval
.expr
) = make_expr2(EXPR_XOR
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3314 #line 684 "parser.y"
3315 { (yyval
.expr
) = make_expr2(EXPR_AND
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3319 #line 685 "parser.y"
3320 { (yyval
.expr
) = make_expr2(EXPR_EQUALITY
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3324 #line 686 "parser.y"
3325 { (yyval
.expr
) = make_expr2(EXPR_INEQUALITY
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3329 #line 687 "parser.y"
3330 { (yyval
.expr
) = make_expr2(EXPR_GTR
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3334 #line 688 "parser.y"
3335 { (yyval
.expr
) = make_expr2(EXPR_LESS
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3339 #line 689 "parser.y"
3340 { (yyval
.expr
) = make_expr2(EXPR_GTREQL
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3344 #line 690 "parser.y"
3345 { (yyval
.expr
) = make_expr2(EXPR_LESSEQL
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3349 #line 691 "parser.y"
3350 { (yyval
.expr
) = make_expr2(EXPR_SHL
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3354 #line 692 "parser.y"
3355 { (yyval
.expr
) = make_expr2(EXPR_SHR
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3359 #line 693 "parser.y"
3360 { (yyval
.expr
) = make_expr2(EXPR_ADD
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3364 #line 694 "parser.y"
3365 { (yyval
.expr
) = make_expr2(EXPR_SUB
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3369 #line 695 "parser.y"
3370 { (yyval
.expr
) = make_expr2(EXPR_MOD
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3374 #line 696 "parser.y"
3375 { (yyval
.expr
) = make_expr2(EXPR_MUL
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3379 #line 697 "parser.y"
3380 { (yyval
.expr
) = make_expr2(EXPR_DIV
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3384 #line 698 "parser.y"
3385 { (yyval
.expr
) = make_expr1(EXPR_LOGNOT
, (yyvsp
[0].expr
)); ;}
3389 #line 699 "parser.y"
3390 { (yyval
.expr
) = make_expr1(EXPR_NOT
, (yyvsp
[0].expr
)); ;}
3394 #line 700 "parser.y"
3395 { (yyval
.expr
) = make_expr1(EXPR_POS
, (yyvsp
[0].expr
)); ;}
3399 #line 701 "parser.y"
3400 { (yyval
.expr
) = make_expr1(EXPR_NEG
, (yyvsp
[0].expr
)); ;}
3404 #line 702 "parser.y"
3405 { (yyval
.expr
) = make_expr1(EXPR_ADDRESSOF
, (yyvsp
[0].expr
)); ;}
3409 #line 703 "parser.y"
3410 { (yyval
.expr
) = make_expr1(EXPR_PPTR
, (yyvsp
[0].expr
)); ;}
3414 #line 704 "parser.y"
3415 { (yyval
.expr
) = make_expr2(EXPR_MEMBER
, make_expr1(EXPR_PPTR
, (yyvsp
[-2].expr
)), make_exprs(EXPR_IDENTIFIER
, (yyvsp
[0].str
))); ;}
3419 #line 705 "parser.y"
3420 { (yyval
.expr
) = make_expr2(EXPR_MEMBER
, (yyvsp
[-2].expr
), make_exprs(EXPR_IDENTIFIER
, (yyvsp
[0].str
))); ;}
3424 #line 706 "parser.y"
3425 { (yyval
.expr
) = make_exprt(EXPR_CAST
, (yyvsp
[-2].type
), (yyvsp
[0].expr
)); ;}
3429 #line 707 "parser.y"
3430 { (yyval
.expr
) = make_exprt(EXPR_SIZEOF
, (yyvsp
[-1].type
), NULL
); ;}
3434 #line 708 "parser.y"
3435 { (yyval
.expr
) = make_expr2(EXPR_ARRAY
, (yyvsp
[-3].expr
), (yyvsp
[-1].expr
)); ;}
3439 #line 709 "parser.y"
3440 { (yyval
.expr
) = (yyvsp
[-1].expr
); ;}
3444 #line 712 "parser.y"
3445 { (yyval
.expr_list
) = append_expr( NULL
, (yyvsp
[0].expr
) ); ;}
3449 #line 713 "parser.y"
3450 { (yyval
.expr_list
) = append_expr( (yyvsp
[-2].expr_list
), (yyvsp
[0].expr
) ); ;}
3454 #line 716 "parser.y"
3455 { (yyval
.expr
) = (yyvsp
[0].expr
);
3456 if (!(yyval
.expr
)->is_const
)
3457 error_loc("expression is not an integer constant\n");
3462 #line 722 "parser.y"
3463 { (yyval
.expr
) = (yyvsp
[0].expr
);
3464 if (!(yyval
.expr
)->is_const
&& (yyval
.expr
)->type
!= EXPR_STRLIT
&& (yyval
.expr
)->type
!= EXPR_WSTRLIT
)
3465 error_loc("expression is not constant\n");
3470 #line 728 "parser.y"
3471 { (yyval
.var_list
) = NULL
; ;}
3475 #line 729 "parser.y"
3476 { (yyval
.var_list
) = append_var_list((yyvsp
[-1].var_list
), (yyvsp
[0].var_list
)); ;}
3480 #line 733 "parser.y"
3481 { const char *first
= LIST_ENTRY(list_head((yyvsp
[-1].declarator_list
)), declarator_t
, entry
)->var
->name
;
3482 check_field_attrs(first
, (yyvsp
[-3].attr_list
));
3483 (yyval
.var_list
) = set_var_types((yyvsp
[-3].attr_list
), (yyvsp
[-2].declspec
), (yyvsp
[-1].declarator_list
));
3488 #line 737 "parser.y"
3489 { var_t
*v
= make_var(NULL
);
3490 v
->type
= (yyvsp
[-1].type
); v
->attrs
= (yyvsp
[-2].attr_list
);
3491 (yyval
.var_list
) = append_var(NULL
, v
);
3496 #line 744 "parser.y"
3497 { (yyval
.var
) = (yyvsp
[-1].var
); ;}
3501 #line 745 "parser.y"
3502 { (yyval
.var
) = make_var(NULL
); (yyval
.var
)->attrs
= (yyvsp
[-1].attr_list
); ;}
3506 #line 748 "parser.y"
3507 { (yyval
.var_list
) = NULL
; ;}
3511 #line 749 "parser.y"
3512 { (yyval
.var_list
) = append_var( (yyvsp
[-1].var_list
), (yyvsp
[0].var
) ); ;}
3516 #line 753 "parser.y"
3517 { (yyval
.var
) = (yyvsp
[-1].var
); ;}
3521 #line 754 "parser.y"
3522 { (yyval
.var
) = NULL
; ;}
3526 #line 757 "parser.y"
3527 { (yyval
.var
) = (yyvsp
[0].declarator
)->var
;
3528 (yyval
.var
)->attrs
= check_field_attrs((yyval
.var
)->name
, (yyvsp
[-2].attr_list
));
3529 set_type((yyval
.var
), (yyvsp
[-1].declspec
), (yyvsp
[0].declarator
), FALSE
);
3530 free((yyvsp
[0].declarator
));
3535 #line 765 "parser.y"
3536 { var_t
*v
= (yyvsp
[0].declarator
)->var
;
3537 v
->attrs
= check_function_attrs(v
->name
, (yyvsp
[-2].attr_list
));
3538 set_type(v
, (yyvsp
[-1].declspec
), (yyvsp
[0].declarator
), FALSE
);
3539 free((yyvsp
[0].declarator
));
3540 (yyval
.func
) = make_func(v
);
3545 #line 775 "parser.y"
3546 { (yyval
.var
) = (yyvsp
[0].declarator
)->var
;
3547 (yyval
.var
)->attrs
= (yyvsp
[-2].attr_list
);
3548 set_type((yyval
.var
), (yyvsp
[-1].declspec
), (yyvsp
[0].declarator
), FALSE
);
3549 free((yyvsp
[0].declarator
));
3554 #line 780 "parser.y"
3555 { (yyval
.var
) = (yyvsp
[0].declarator
)->var
;
3556 set_type((yyval
.var
), (yyvsp
[-1].declspec
), (yyvsp
[0].declarator
), FALSE
);
3557 free((yyvsp
[0].declarator
));
3562 #line 786 "parser.y"
3563 { (yyval
.var
) = NULL
; ;}
3567 #line 790 "parser.y"
3568 { (yyval
.var
) = NULL
; ;}
3572 #line 791 "parser.y"
3573 { (yyval
.var
) = make_var((yyvsp
[0].str
)); ;}
3577 #line 792 "parser.y"
3578 { (yyval
.var
) = make_var((yyvsp
[0].str
)); ;}
3582 #line 795 "parser.y"
3583 { (yyval
.var
) = make_var((yyvsp
[0].str
)); ;}
3587 #line 797 "parser.y"
3588 { (yyval
.var
) = make_var((yyvsp
[0].str
)); ;}
3592 #line 800 "parser.y"
3593 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3597 #line 801 "parser.y"
3598 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3602 #line 803 "parser.y"
3603 { (yyval
.type
) = (yyvsp
[0].type
); (yyval
.type
)->sign
= 1; ;}
3607 #line 804 "parser.y"
3608 { (yyval
.type
) = (yyvsp
[0].type
); (yyval
.type
)->sign
= -1;
3609 switch ((yyval
.type
)->type
) {
3610 case RPC_FC_CHAR
: break;
3611 case RPC_FC_SMALL
: (yyval
.type
)->type
= RPC_FC_USMALL
; break;
3612 case RPC_FC_SHORT
: (yyval
.type
)->type
= RPC_FC_USHORT
; break;
3613 case RPC_FC_LONG
: (yyval
.type
)->type
= RPC_FC_ULONG
; break;
3615 if ((yyval
.type
)->name
[0] == 'h') /* hyper, as opposed to __int64 */
3617 (yyval
.type
) = alias((yyval
.type
), "MIDL_uhyper");
3618 (yyval
.type
)->sign
= 0;
3627 #line 820 "parser.y"
3628 { (yyval
.type
) = make_int(-1); ;}
3632 #line 821 "parser.y"
3633 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3637 #line 822 "parser.y"
3638 { (yyval
.type
) = duptype(find_type("float", 0), 1); ;}
3642 #line 823 "parser.y"
3643 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3647 #line 824 "parser.y"
3648 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3652 #line 825 "parser.y"
3653 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3657 #line 826 "parser.y"
3658 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3662 #line 833 "parser.y"
3663 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3667 #line 834 "parser.y"
3668 { (yyval
.type
) = make_builtin((yyvsp
[-1].str
)); ;}
3672 #line 835 "parser.y"
3673 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3677 #line 836 "parser.y"
3678 { (yyval
.type
) = make_builtin((yyvsp
[-1].str
)); ;}
3682 #line 837 "parser.y"
3683 { (yyval
.type
) = make_builtin((yyvsp
[-1].str
)); ;}
3687 #line 838 "parser.y"
3688 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3692 #line 839 "parser.y"
3693 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3697 #line 842 "parser.y"
3698 { (yyval
.type
) = make_class((yyvsp
[0].str
)); ;}
3702 #line 843 "parser.y"
3703 { (yyval
.type
) = find_type((yyvsp
[0].str
), 0);
3704 if ((yyval
.type
)->kind
!= TKIND_COCLASS
)
3705 error_loc("%s was not declared a coclass at %s:%d\n",
3706 (yyvsp
[0].str
), (yyval
.type
)->loc_info
.input_name
,
3707 (yyval
.type
)->loc_info
.line_number
);
3712 #line 851 "parser.y"
3713 { (yyval
.type
) = (yyvsp
[0].type
);
3714 check_def((yyval
.type
));
3715 (yyval
.type
)->attrs
= check_coclass_attrs((yyvsp
[0].type
)->name
, (yyvsp
[-1].attr_list
));
3716 if (!parse_only
&& do_header
)
3717 write_coclass((yyval
.type
));
3718 if (!parse_only
&& do_idfile
)
3719 write_clsid((yyval
.type
));
3724 #line 862 "parser.y"
3725 { (yyval
.type
) = (yyvsp
[-4].type
);
3726 (yyval
.type
)->ifaces
= (yyvsp
[-2].ifref_list
);
3727 (yyval
.type
)->defined
= TRUE
;
3732 #line 868 "parser.y"
3733 { (yyval
.ifref_list
) = NULL
; ;}
3737 #line 869 "parser.y"
3738 { (yyval
.ifref_list
) = append_ifref( (yyvsp
[-1].ifref_list
), (yyvsp
[0].ifref
) ); ;}
3742 #line 873 "parser.y"
3743 { (yyval
.ifref
) = make_ifref((yyvsp
[0].type
)); (yyval
.ifref
)->attrs
= (yyvsp
[-1].attr_list
); ;}
3747 #line 876 "parser.y"
3748 { (yyval
.type
) = get_type(RPC_FC_IP
, (yyvsp
[0].str
), 0); (yyval
.type
)->kind
= TKIND_DISPATCH
; ;}
3752 #line 877 "parser.y"
3753 { (yyval
.type
) = get_type(RPC_FC_IP
, (yyvsp
[0].str
), 0); (yyval
.type
)->kind
= TKIND_DISPATCH
; ;}
3757 #line 880 "parser.y"
3759 is_in_interface
= TRUE
;
3760 is_object_interface
= TRUE
;
3761 (yyval
.type
) = (yyvsp
[0].type
);
3762 check_def((yyval
.type
));
3763 attrs
= make_attr(ATTR_DISPINTERFACE
);
3764 (yyval
.type
)->attrs
= append_attr( check_dispiface_attrs((yyvsp
[0].type
)->name
, (yyvsp
[-1].attr_list
)), attrs
);
3765 (yyval
.type
)->ref
= find_type("IDispatch", 0);
3766 if (!(yyval
.type
)->ref
) error_loc("IDispatch is undefined\n");
3767 (yyval
.type
)->defined
= TRUE
;
3768 if (!parse_only
&& do_header
) write_forward((yyval
.type
));
3773 #line 894 "parser.y"
3774 { (yyval
.var_list
) = NULL
; ;}
3778 #line 895 "parser.y"
3779 { (yyval
.var_list
) = append_var( (yyvsp
[-2].var_list
), (yyvsp
[-1].var
) ); ;}
3783 #line 898 "parser.y"
3784 { (yyval
.func_list
) = NULL
; ;}
3788 #line 899 "parser.y"
3789 { (yyval
.func_list
) = append_func( (yyvsp
[-2].func_list
), (yyvsp
[-1].func
) ); ;}
3793 #line 905 "parser.y"
3794 { (yyval
.type
) = (yyvsp
[-4].type
);
3795 (yyval
.type
)->fields_or_args
= (yyvsp
[-2].var_list
);
3796 (yyval
.type
)->funcs
= (yyvsp
[-1].func_list
);
3797 if (!parse_only
&& do_header
) write_interface((yyval
.type
));
3798 if (!parse_only
&& do_idfile
) write_diid((yyval
.type
));
3799 is_in_interface
= FALSE
;
3804 #line 913 "parser.y"
3805 { (yyval
.type
) = (yyvsp
[-4].type
);
3806 (yyval
.type
)->fields_or_args
= (yyvsp
[-2].type
)->fields_or_args
;
3807 (yyval
.type
)->funcs
= (yyvsp
[-2].type
)->funcs
;
3808 if (!parse_only
&& do_header
) write_interface((yyval
.type
));
3809 if (!parse_only
&& do_idfile
) write_diid((yyval
.type
));
3810 is_in_interface
= FALSE
;
3815 #line 922 "parser.y"
3816 { (yyval
.type
) = NULL
; ;}
3820 #line 923 "parser.y"
3821 { (yyval
.type
) = find_type2((yyvsp
[0].str
), 0); ;}
3825 #line 926 "parser.y"
3826 { (yyval
.type
) = get_type(RPC_FC_IP
, (yyvsp
[0].str
), 0); (yyval
.type
)->kind
= TKIND_INTERFACE
; ;}
3830 #line 927 "parser.y"
3831 { (yyval
.type
) = get_type(RPC_FC_IP
, (yyvsp
[0].str
), 0); (yyval
.type
)->kind
= TKIND_INTERFACE
; ;}
3835 #line 930 "parser.y"
3836 { (yyval
.ifinfo
).interface
= (yyvsp
[0].type
);
3837 (yyval
.ifinfo
).old_pointer_default
= pointer_default
;
3838 if (is_attr((yyvsp
[-1].attr_list
), ATTR_POINTERDEFAULT
))
3839 pointer_default
= get_attrv((yyvsp
[-1].attr_list
), ATTR_POINTERDEFAULT
);
3840 is_object_interface
= is_object((yyvsp
[-1].attr_list
));
3841 is_in_interface
= TRUE
;
3842 check_def((yyvsp
[0].type
));
3843 (yyvsp
[0].type
)->attrs
= check_iface_attrs((yyvsp
[0].type
)->name
, (yyvsp
[-1].attr_list
));
3844 (yyvsp
[0].type
)->defined
= TRUE
;
3845 if (!parse_only
&& do_header
) write_forward((yyvsp
[0].type
));
3850 #line 944 "parser.y"
3851 { (yyval
.type
) = (yyvsp
[-5].ifinfo
).interface
;
3852 (yyval
.type
)->ref
= (yyvsp
[-4].type
);
3853 (yyval
.type
)->funcs
= (yyvsp
[-2].func_list
);
3854 check_functions((yyval
.type
));
3855 compute_method_indexes((yyval
.type
));
3856 if (!parse_only
&& do_header
) write_interface((yyval
.type
));
3857 if (!parse_only
&& local_stubs
) write_locals(local_stubs
, (yyval
.type
), TRUE
);
3858 if (!parse_only
&& do_idfile
) write_iid((yyval
.type
));
3859 pointer_default
= (yyvsp
[-5].ifinfo
).old_pointer_default
;
3860 is_in_interface
= FALSE
;
3865 #line 959 "parser.y"
3866 { (yyval
.type
) = (yyvsp
[-7].ifinfo
).interface
;
3867 (yyval
.type
)->ref
= find_type2((yyvsp
[-5].str
), 0);
3868 if (!(yyval
.type
)->ref
) error_loc("base class '%s' not found in import\n", (yyvsp
[-5].str
));
3869 (yyval
.type
)->funcs
= (yyvsp
[-2].func_list
);
3870 compute_method_indexes((yyval
.type
));
3871 if (!parse_only
&& do_header
) write_interface((yyval
.type
));
3872 if (!parse_only
&& local_stubs
) write_locals(local_stubs
, (yyval
.type
), TRUE
);
3873 if (!parse_only
&& do_idfile
) write_iid((yyval
.type
));
3874 pointer_default
= (yyvsp
[-7].ifinfo
).old_pointer_default
;
3875 is_in_interface
= FALSE
;
3880 #line 970 "parser.y"
3881 { (yyval
.type
) = (yyvsp
[-1].type
); ;}
3885 #line 974 "parser.y"
3886 { (yyval
.type
) = (yyvsp
[-1].type
); if (!parse_only
&& do_header
) write_forward((yyval
.type
)); ;}
3890 #line 975 "parser.y"
3891 { (yyval
.type
) = (yyvsp
[-1].type
); if (!parse_only
&& do_header
) write_forward((yyval
.type
)); ;}
3895 #line 978 "parser.y"
3896 { (yyval
.type
) = make_type(0, NULL
); (yyval
.type
)->name
= (yyvsp
[0].str
); (yyval
.type
)->kind
= TKIND_MODULE
; ;}
3900 #line 979 "parser.y"
3901 { (yyval
.type
) = make_type(0, NULL
); (yyval
.type
)->name
= (yyvsp
[0].str
); (yyval
.type
)->kind
= TKIND_MODULE
; ;}
3905 #line 982 "parser.y"
3906 { (yyval
.type
) = (yyvsp
[0].type
);
3907 (yyval
.type
)->attrs
= check_module_attrs((yyvsp
[0].type
)->name
, (yyvsp
[-1].attr_list
));
3912 #line 988 "parser.y"
3913 { (yyval
.type
) = (yyvsp
[-4].type
);
3914 (yyval
.type
)->funcs
= (yyvsp
[-2].func_list
);
3915 /* FIXME: if (!parse_only && do_header) write_module($$); */
3920 #line 995 "parser.y"
3921 { (yyval
.stgclass
) = STG_EXTERN
; ;}
3925 #line 996 "parser.y"
3926 { (yyval
.stgclass
) = STG_STATIC
; ;}
3930 #line 997 "parser.y"
3931 { (yyval
.stgclass
) = STG_REGISTER
; ;}
3935 #line 1001 "parser.y"
3936 { (yyval
.attr
) = make_attr(ATTR_INLINE
); ;}
3940 #line 1005 "parser.y"
3941 { (yyval
.attr
) = make_attr(ATTR_CONST
); ;}
3945 #line 1008 "parser.y"
3946 { (yyval
.attr_list
) = NULL
; ;}
3950 #line 1009 "parser.y"
3951 { (yyval
.attr_list
) = append_attr((yyvsp
[-1].attr_list
), (yyvsp
[0].attr
)); ;}
3955 #line 1012 "parser.y"
3956 { (yyval
.declspec
) = make_decl_spec((yyvsp
[-1].type
), (yyvsp
[0].declspec
), NULL
, NULL
, STG_NONE
); ;}
3960 #line 1014 "parser.y"
3961 { (yyval
.declspec
) = make_decl_spec((yyvsp
[-1].type
), (yyvsp
[-2].declspec
), (yyvsp
[0].declspec
), NULL
, STG_NONE
); ;}
3965 #line 1017 "parser.y"
3966 { (yyval
.declspec
) = NULL
; ;}
3970 #line 1022 "parser.y"
3971 { (yyval
.declspec
) = make_decl_spec(NULL
, (yyvsp
[0].declspec
), NULL
, (yyvsp
[-1].attr
), STG_NONE
); ;}
3975 #line 1023 "parser.y"
3976 { (yyval
.declspec
) = make_decl_spec(NULL
, (yyvsp
[0].declspec
), NULL
, (yyvsp
[-1].attr
), STG_NONE
); ;}
3980 #line 1024 "parser.y"
3981 { (yyval
.declspec
) = make_decl_spec(NULL
, (yyvsp
[0].declspec
), NULL
, NULL
, (yyvsp
[-1].stgclass
)); ;}
3985 #line 1029 "parser.y"
3986 { (yyval
.declarator
) = (yyvsp
[0].declarator
); (yyval
.declarator
)->type
= append_ptrchain_type((yyval
.declarator
)->type
, make_pointer_type(NULL
, (yyvsp
[-1].attr_list
))); ;}
3990 #line 1030 "parser.y"
3991 { (yyval
.declarator
) = (yyvsp
[0].declarator
); (yyval
.declarator
)->type
->attrs
= append_attr((yyval
.declarator
)->type
->attrs
, make_attrp(ATTR_CALLCONV
, (yyvsp
[-1].str
))); ;}
3995 #line 1035 "parser.y"
3996 { (yyval
.declarator
) = make_declarator((yyvsp
[0].var
)); ;}
4000 #line 1036 "parser.y"
4001 { (yyval
.declarator
) = (yyvsp
[-1].declarator
); ;}
4005 #line 1037 "parser.y"
4006 { (yyval
.declarator
) = (yyvsp
[-1].declarator
); (yyval
.declarator
)->array
= append_array((yyval
.declarator
)->array
, (yyvsp
[0].expr
)); ;}
4010 #line 1038 "parser.y"
4011 { (yyval
.declarator
) = (yyvsp
[-3].declarator
);
4012 (yyval
.declarator
)->func_type
= append_ptrchain_type((yyval
.declarator
)->type
, make_func_type((yyvsp
[-1].var_list
)));
4013 (yyval
.declarator
)->type
= NULL
;
4018 #line 1045 "parser.y"
4019 { (yyval
.declarator_list
) = append_declarator( NULL
, (yyvsp
[0].declarator
) ); ;}
4023 #line 1046 "parser.y"
4024 { (yyval
.declarator_list
) = append_declarator( (yyvsp
[-2].declarator_list
), (yyvsp
[0].declarator
) ); ;}
4028 #line 1050 "parser.y"
4029 { (yyval
.declarator
) = (yyvsp
[0].declarator
); ;}
4033 #line 1051 "parser.y"
4034 { (yyval
.declarator
) = (yyvsp
[-2].declarator
); (yyvsp
[-2].declarator
)->var
->eval
= (yyvsp
[0].expr
); ;}
4038 #line 1055 "parser.y"
4039 { (yyval
.num
) = RPC_FC_RP
; ;}
4043 #line 1056 "parser.y"
4044 { (yyval
.num
) = RPC_FC_UP
; ;}
4048 #line 1057 "parser.y"
4049 { (yyval
.num
) = RPC_FC_FP
; ;}
4053 #line 1060 "parser.y"
4054 { (yyval
.type
) = get_typev(RPC_FC_STRUCT
, (yyvsp
[-3].var
), tsSTRUCT
);
4055 /* overwrite RPC_FC_STRUCT with a more exact type */
4056 check_def((yyval
.type
));
4057 (yyval
.type
)->type
= get_struct_type( (yyvsp
[-1].var_list
) );
4058 (yyval
.type
)->kind
= TKIND_RECORD
;
4059 (yyval
.type
)->fields_or_args
= (yyvsp
[-1].var_list
);
4060 (yyval
.type
)->defined
= TRUE
;
4062 add_typelib_entry((yyval
.type
));
4067 #line 1072 "parser.y"
4068 { (yyval
.type
) = duptype(find_type("void", 0), 1); ;}
4072 #line 1073 "parser.y"
4073 { (yyval
.type
) = find_type((yyvsp
[0].str
), 0); ;}
4077 #line 1074 "parser.y"
4078 { (yyval
.type
) = (yyvsp
[0].type
); ;}
4082 #line 1075 "parser.y"
4083 { (yyval
.type
) = (yyvsp
[0].type
); ;}
4087 #line 1076 "parser.y"
4088 { (yyval
.type
) = find_type2((yyvsp
[0].str
), tsENUM
); ;}
4092 #line 1077 "parser.y"
4093 { (yyval
.type
) = (yyvsp
[0].type
); ;}
4097 #line 1078 "parser.y"
4098 { (yyval
.type
) = get_type(RPC_FC_STRUCT
, (yyvsp
[0].str
), tsSTRUCT
); ;}
4102 #line 1079 "parser.y"
4103 { (yyval
.type
) = (yyvsp
[0].type
); ;}
4107 #line 1080 "parser.y"
4108 { (yyval
.type
) = find_type2((yyvsp
[0].str
), tsUNION
); ;}
4112 #line 1081 "parser.y"
4113 { (yyval
.type
) = make_safearray((yyvsp
[-1].type
)); ;}
4117 #line 1085 "parser.y"
4118 { reg_typedefs((yyvsp
[-1].declspec
), (yyvsp
[0].declarator_list
), check_typedef_attrs((yyvsp
[-2].attr_list
)));
4119 (yyval
.statement
) = process_typedefs((yyvsp
[0].declarator_list
));
4124 #line 1091 "parser.y"
4125 { (yyval
.type
) = get_typev(RPC_FC_NON_ENCAPSULATED_UNION
, (yyvsp
[-3].var
), tsUNION
);
4126 check_def((yyval
.type
));
4127 (yyval
.type
)->kind
= TKIND_UNION
;
4128 (yyval
.type
)->fields_or_args
= (yyvsp
[-1].var_list
);
4129 (yyval
.type
)->defined
= TRUE
;
4134 #line 1099 "parser.y"
4135 { var_t
*u
= (yyvsp
[-3].var
);
4136 (yyval
.type
) = get_typev(RPC_FC_ENCAPSULATED_UNION
, (yyvsp
[-8].var
), tsUNION
);
4137 check_def((yyval
.type
));
4138 (yyval
.type
)->kind
= TKIND_UNION
;
4139 if (!u
) u
= make_var( xstrdup("tagged_union") );
4140 u
->type
= make_type(RPC_FC_NON_ENCAPSULATED_UNION
, NULL
);
4141 u
->type
->kind
= TKIND_UNION
;
4142 u
->type
->fields_or_args
= (yyvsp
[-1].var_list
);
4143 u
->type
->defined
= TRUE
;
4144 (yyval
.type
)->fields_or_args
= append_var( (yyval
.type
)->fields_or_args
, (yyvsp
[-5].var
) );
4145 (yyval
.type
)->fields_or_args
= append_var( (yyval
.type
)->fields_or_args
, u
);
4146 (yyval
.type
)->defined
= TRUE
;
4151 #line 1115 "parser.y"
4152 { (yyval
.num
) = MAKEVERSION((yyvsp
[0].num
), 0); ;}
4156 #line 1116 "parser.y"
4157 { (yyval
.num
) = MAKEVERSION((yyvsp
[-2].num
), (yyvsp
[0].num
)); ;}
4164 /* Line 1126 of yacc.c. */
4165 #line 4166 "parser.tab.c"
4171 YY_STACK_PRINT (yyss
, yyssp
);
4176 /* Now `shift' the result of the reduction. Determine what state
4177 that goes to, based on the state we popped back to and the rule
4178 number reduced by. */
4182 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
4183 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
4184 yystate
= yytable
[yystate
];
4186 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
4191 /*------------------------------------.
4192 | yyerrlab -- here on detecting error |
4193 `------------------------------------*/
4195 /* If not already recovering from an error, report this error. */
4200 yyn
= yypact
[yystate
];
4202 if (YYPACT_NINF
< yyn
&& yyn
< YYLAST
)
4204 int yytype
= YYTRANSLATE (yychar
);
4205 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytype
]);
4206 YYSIZE_T yysize
= yysize0
;
4208 int yysize_overflow
= 0;
4210 # define YYERROR_VERBOSE_ARGS_MAXIMUM 5
4211 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
4215 /* This is so xgettext sees the translatable formats that are
4216 constructed on the fly. */
4217 YY_("syntax error, unexpected %s");
4218 YY_("syntax error, unexpected %s, expecting %s");
4219 YY_("syntax error, unexpected %s, expecting %s or %s");
4220 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
4221 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
4225 static char const yyunexpected
[] = "syntax error, unexpected %s";
4226 static char const yyexpecting
[] = ", expecting %s";
4227 static char const yyor
[] = " or %s";
4228 char yyformat
[sizeof yyunexpected
4229 + sizeof yyexpecting
- 1
4230 + ((YYERROR_VERBOSE_ARGS_MAXIMUM
- 2)
4231 * (sizeof yyor
- 1))];
4232 char const *yyprefix
= yyexpecting
;
4234 /* Start YYX at -YYN if negative to avoid negative indexes in
4236 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
4238 /* Stay within bounds of both yycheck and yytname. */
4239 int yychecklim
= YYLAST
- yyn
;
4240 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
4243 yyarg
[0] = yytname
[yytype
];
4244 yyfmt
= yystpcpy (yyformat
, yyunexpected
);
4246 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
4247 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
4249 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
4253 yyformat
[sizeof yyunexpected
- 1] = '\0';
4256 yyarg
[yycount
++] = yytname
[yyx
];
4257 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
4258 yysize_overflow
|= yysize1
< yysize
;
4260 yyfmt
= yystpcpy (yyfmt
, yyprefix
);
4264 yyf
= YY_(yyformat
);
4265 yysize1
= yysize
+ yystrlen (yyf
);
4266 yysize_overflow
|= yysize1
< yysize
;
4269 if (!yysize_overflow
&& yysize
<= YYSTACK_ALLOC_MAXIMUM
)
4270 yymsg
= (char *) YYSTACK_ALLOC (yysize
);
4273 /* Avoid sprintf, as that infringes on the user's name space.
4274 Don't have undefined behavior even if the translation
4275 produced a string with the wrong number of "%s"s. */
4278 while ((*yyp
= *yyf
))
4280 if (*yyp
== '%' && yyf
[1] == 's' && yyi
< yycount
)
4282 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
4292 YYSTACK_FREE (yymsg
);
4296 yyerror (YY_("syntax error"));
4297 goto yyexhaustedlab
;
4301 #endif /* YYERROR_VERBOSE */
4302 yyerror (YY_("syntax error"));
4307 if (yyerrstatus
== 3)
4309 /* If just tried and failed to reuse look-ahead token after an
4310 error, discard it. */
4312 if (yychar
<= YYEOF
)
4314 /* Return failure if at end of input. */
4315 if (yychar
== YYEOF
)
4320 yydestruct ("Error: discarding", yytoken
, &yylval
);
4325 /* Else will try to reuse look-ahead token after shifting the error
4330 /*---------------------------------------------------.
4331 | yyerrorlab -- error raised explicitly by YYERROR. |
4332 `---------------------------------------------------*/
4335 /* Pacify compilers like GCC when the user code never invokes
4336 YYERROR and the label yyerrorlab therefore never appears in user
4347 /*-------------------------------------------------------------.
4348 | yyerrlab1 -- common code for both syntax error and YYERROR. |
4349 `-------------------------------------------------------------*/
4351 yyerrstatus
= 3; /* Each real token shifted decrements this. */
4355 yyn
= yypact
[yystate
];
4356 if (yyn
!= YYPACT_NINF
)
4359 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
4367 /* Pop the current state because it cannot handle the error token. */
4372 yydestruct ("Error: popping", yystos
[yystate
], yyvsp
);
4375 YY_STACK_PRINT (yyss
, yyssp
);
4384 /* Shift the error token. */
4385 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
4391 /*-------------------------------------.
4392 | yyacceptlab -- YYACCEPT comes here. |
4393 `-------------------------------------*/
4398 /*-----------------------------------.
4399 | yyabortlab -- YYABORT comes here. |
4400 `-----------------------------------*/
4406 /*-------------------------------------------------.
4407 | yyexhaustedlab -- memory exhaustion comes here. |
4408 `-------------------------------------------------*/
4410 yyerror (YY_("memory exhausted"));
4416 if (yychar
!= YYEOF
&& yychar
!= YYEMPTY
)
4417 yydestruct ("Cleanup: discarding lookahead",
4419 while (yyssp
!= yyss
)
4421 yydestruct ("Cleanup: popping",
4422 yystos
[*yyssp
], yyvsp
);
4427 YYSTACK_FREE (yyss
);
4433 #line 1119 "parser.y"
4436 static void decl_builtin(const char *name
, unsigned char type
)
4438 type_t
*t
= make_type(type
, NULL
);
4439 t
->name
= xstrdup(name
);
4440 reg_type(t
, name
, 0);
4443 static type_t
*make_builtin(char *name
)
4445 /* NAME is strdup'd in the lexer */
4446 type_t
*t
= duptype(find_type(name
, 0), 0);
4451 static type_t
*make_int(int sign
)
4453 type_t
*t
= duptype(find_type("int", 0), 1);
4457 t
->type
= t
->type
== RPC_FC_LONG
? RPC_FC_ULONG
: RPC_FC_USHORT
;
4462 void init_types(void)
4464 decl_builtin("void", 0);
4465 decl_builtin("byte", RPC_FC_BYTE
);
4466 decl_builtin("wchar_t", RPC_FC_WCHAR
);
4467 decl_builtin("int", RPC_FC_LONG
); /* win32 */
4468 decl_builtin("short", RPC_FC_SHORT
);
4469 decl_builtin("small", RPC_FC_SMALL
);
4470 decl_builtin("long", RPC_FC_LONG
);
4471 decl_builtin("hyper", RPC_FC_HYPER
);
4472 decl_builtin("__int64", RPC_FC_HYPER
);
4473 decl_builtin("char", RPC_FC_CHAR
);
4474 decl_builtin("float", RPC_FC_FLOAT
);
4475 decl_builtin("double", RPC_FC_DOUBLE
);
4476 decl_builtin("boolean", RPC_FC_BYTE
);
4477 decl_builtin("error_status_t", RPC_FC_ERROR_STATUS_T
);
4478 decl_builtin("handle_t", RPC_FC_BIND_PRIMITIVE
);
4481 static str_list_t
*append_str(str_list_t
*list
, char *str
)
4483 struct str_list_entry_t
*entry
;
4485 if (!str
) return list
;
4488 list
= xmalloc( sizeof(*list
) );
4491 entry
= xmalloc( sizeof(*entry
) );
4493 list_add_tail( list
, &entry
->entry
);
4497 static attr_list_t
*append_attr(attr_list_t
*list
, attr_t
*attr
)
4499 attr_t
*attr_existing
;
4500 if (!attr
) return list
;
4503 list
= xmalloc( sizeof(*list
) );
4506 LIST_FOR_EACH_ENTRY(attr_existing
, list
, attr_t
, entry
)
4507 if (attr_existing
->type
== attr
->type
)
4509 parser_warning("duplicate attribute %s\n", get_attr_display_name(attr
->type
));
4510 /* use the last attribute, like MIDL does */
4511 list_remove(&attr_existing
->entry
);
4514 list_add_tail( list
, &attr
->entry
);
4518 static attr_list_t
*move_attr(attr_list_t
*dst
, attr_list_t
*src
, enum attr_type type
)
4521 if (!src
) return dst
;
4522 LIST_FOR_EACH_ENTRY(attr
, src
, attr_t
, entry
)
4523 if (attr
->type
== type
)
4525 list_remove(&attr
->entry
);
4526 return append_attr(dst
, attr
);
4531 static attr_list_t
*append_attr_list(attr_list_t
*new_list
, attr_list_t
*old_list
)
4535 if (!old_list
) return new_list
;
4537 while ((entry
= list_head(old_list
)))
4539 attr_t
*attr
= LIST_ENTRY(entry
, attr_t
, entry
);
4541 new_list
= append_attr(new_list
, attr
);
4546 static attr_list_t
*dupattrs(const attr_list_t
*list
)
4548 attr_list_t
*new_list
;
4551 if (!list
) return NULL
;
4553 new_list
= xmalloc( sizeof(*list
) );
4554 list_init( new_list
);
4555 LIST_FOR_EACH_ENTRY(attr
, list
, const attr_t
, entry
)
4557 attr_t
*new_attr
= xmalloc(sizeof(*new_attr
));
4559 list_add_tail(new_list
, &new_attr
->entry
);
4564 static decl_spec_t
*make_decl_spec(type_t
*type
, decl_spec_t
*left
, decl_spec_t
*right
, attr_t
*attr
, enum storage_class stgclass
)
4566 decl_spec_t
*declspec
= left
? left
: right
;
4569 declspec
= xmalloc(sizeof(*declspec
));
4570 declspec
->type
= NULL
;
4571 declspec
->attrs
= NULL
;
4572 declspec
->stgclass
= STG_NONE
;
4574 declspec
->type
= type
;
4575 if (left
&& declspec
!= left
)
4577 declspec
->attrs
= append_attr_list(declspec
->attrs
, left
->attrs
);
4578 if (declspec
->stgclass
== STG_NONE
)
4579 declspec
->stgclass
= left
->stgclass
;
4580 else if (left
->stgclass
!= STG_NONE
)
4581 error_loc("only one storage class can be specified\n");
4582 assert(!left
->type
);
4585 if (right
&& declspec
!= right
)
4587 declspec
->attrs
= append_attr_list(declspec
->attrs
, right
->attrs
);
4588 if (declspec
->stgclass
== STG_NONE
)
4589 declspec
->stgclass
= right
->stgclass
;
4590 else if (right
->stgclass
!= STG_NONE
)
4591 error_loc("only one storage class can be specified\n");
4592 assert(!right
->type
);
4596 declspec
->attrs
= append_attr(declspec
->attrs
, attr
);
4597 if (declspec
->stgclass
== STG_NONE
)
4598 declspec
->stgclass
= stgclass
;
4599 else if (stgclass
!= STG_NONE
)
4600 error_loc("only one storage class can be specified\n");
4602 /* apply attributes to type */
4603 if (type
&& declspec
->attrs
)
4606 declspec
->type
= duptype(type
, 1);
4607 attrs
= dupattrs(type
->attrs
);
4608 declspec
->type
->attrs
= append_attr_list(attrs
, declspec
->attrs
);
4609 declspec
->attrs
= NULL
;
4615 static attr_t
*make_attr(enum attr_type type
)
4617 attr_t
*a
= xmalloc(sizeof(attr_t
));
4623 static attr_t
*make_attrv(enum attr_type type
, unsigned long val
)
4625 attr_t
*a
= xmalloc(sizeof(attr_t
));
4631 static attr_t
*make_attrp(enum attr_type type
, void *val
)
4633 attr_t
*a
= xmalloc(sizeof(attr_t
));
4639 static expr_list_t
*append_expr(expr_list_t
*list
, expr_t
*expr
)
4641 if (!expr
) return list
;
4644 list
= xmalloc( sizeof(*list
) );
4647 list_add_tail( list
, &expr
->entry
);
4651 static array_dims_t
*append_array(array_dims_t
*list
, expr_t
*expr
)
4653 if (!expr
) return list
;
4656 list
= xmalloc( sizeof(*list
) );
4659 list_add_tail( list
, &expr
->entry
);
4663 static struct list type_pool
= LIST_INIT(type_pool
);
4670 type_t
*alloc_type(void)
4672 type_pool_node_t
*node
= xmalloc(sizeof *node
);
4673 list_add_tail(&type_pool
, &node
->link
);
4677 void set_all_tfswrite(int val
)
4679 type_pool_node_t
*node
;
4680 LIST_FOR_EACH_ENTRY(node
, &type_pool
, type_pool_node_t
, link
)
4681 node
->data
.tfswrite
= val
;
4684 type_t
*make_type(unsigned char type
, type_t
*ref
)
4686 type_t
*t
= alloc_type();
4688 t
->kind
= TKIND_PRIMITIVE
;
4694 t
->fields_or_args
= NULL
;
4698 t
->length_is
= NULL
;
4699 t
->typestring_offset
= 0;
4701 t
->declarray
= FALSE
;
4702 t
->ignore
= (parse_only
!= 0);
4706 t
->user_types_registered
= FALSE
;
4707 t
->tfswrite
= FALSE
;
4709 t
->typelib_idx
= -1;
4710 init_loc_info(&t
->loc_info
);
4714 static type_t
*make_func_type(var_list_t
*args
)
4716 type_t
*t
= make_type(RPC_FC_FUNCTION
, NULL
);
4717 t
->fields_or_args
= args
;
4721 static type_t
*make_pointer_type(type_t
*ref
, attr_list_t
*attrs
)
4723 type_t
*t
= make_type(pointer_default
, ref
);
4728 static type_t
*append_ptrchain_type(type_t
*ptrchain
, type_t
*type
)
4730 type_t
*ptrchain_type
;
4733 for (ptrchain_type
= ptrchain
; ptrchain_type
->ref
; ptrchain_type
= ptrchain_type
->ref
)
4735 ptrchain_type
->ref
= type
;
4739 static void set_type(var_t
*v
, decl_spec_t
*decl_spec
, const declarator_t
*decl
,
4742 expr_list_t
*sizes
= get_attrp(v
->attrs
, ATTR_SIZEIS
);
4743 expr_list_t
*lengs
= get_attrp(v
->attrs
, ATTR_LENGTHIS
);
4744 int ptr_attr
= get_attrv(v
->attrs
, ATTR_POINTERTYPE
);
4745 int sizeless
, has_varconf
;
4747 type_t
*atype
, **ptype
;
4748 array_dims_t
*arr
= decl
? decl
->array
: NULL
;
4749 type_t
*func_type
= decl
? decl
->func_type
: NULL
;
4750 type_t
*type
= decl_spec
->type
;
4752 if (is_attr(type
->attrs
, ATTR_INLINE
))
4755 error_loc("inline attribute applied to non-function type\n");
4759 /* move inline attribute from return type node to function node */
4760 for (t
= func_type
; is_ptr(t
); t
= t
->ref
)
4762 t
->attrs
= move_attr(t
->attrs
, type
->attrs
, ATTR_INLINE
);
4766 /* add type onto the end of the pointers in pident->type */
4767 v
->type
= append_ptrchain_type(decl
? decl
->type
: NULL
, type
);
4768 v
->stgclass
= decl_spec
->stgclass
;
4770 /* the highest level of pointer specified should default to the var's ptr attr
4771 * or (RPC_FC_RP if not specified and it's a top level ptr), not
4772 * pointer_default so we need to fix that up here */
4775 const type_t
*ptr
= NULL
;
4776 /* pointer attributes on the left side of the type belong to the function
4777 * pointer, if one is being declared */
4778 type_t
**pt
= func_type
? &func_type
: &v
->type
;
4779 for (ptr
= *pt
; ptr
; )
4781 if (ptr
->kind
== TKIND_ALIAS
)
4786 if (ptr
&& is_ptr(ptr
) && (ptr_attr
|| top
))
4788 /* duplicate type to avoid changing original type */
4789 *pt
= duptype(*pt
, 1);
4790 (*pt
)->type
= ptr_attr
? ptr_attr
: RPC_FC_RP
;
4793 error_loc("%s: pointer attribute applied to non-pointer type\n", v
->name
);
4796 if (is_attr(v
->attrs
, ATTR_STRING
) && !is_ptr(v
->type
) && !arr
)
4797 error_loc("'%s': [string] attribute applied to non-pointer, non-array type\n",
4800 if (is_attr(v
->attrs
, ATTR_V1ENUM
))
4802 if (v
->type
->type
== RPC_FC_ENUM16
)
4803 v
->type
->type
= RPC_FC_ENUM32
;
4805 error_loc("'%s': [v1_enum] attribute applied to non-enum type\n", v
->name
);
4809 if (arr
) LIST_FOR_EACH_ENTRY_REV(dim
, arr
, expr_t
, entry
)
4812 error_loc("%s: only the first array dimension can be unspecified\n", v
->name
);
4816 unsigned int align
= 0;
4817 size_t size
= type_memsize(v
->type
, &align
);
4820 error_loc("%s: array dimension must be positive\n", v
->name
);
4822 if (0xffffffffuL
/ size
< (unsigned long) dim
->cval
)
4823 error_loc("%s: total array size is too large\n", v
->name
);
4824 else if (0xffffuL
< size
* dim
->cval
)
4825 v
->type
= make_type(RPC_FC_LGFARRAY
, v
->type
);
4827 v
->type
= make_type(RPC_FC_SMFARRAY
, v
->type
);
4832 v
->type
= make_type(RPC_FC_CARRAY
, v
->type
);
4835 v
->type
->declarray
= TRUE
;
4836 v
->type
->dim
= dim
->cval
;
4840 has_varconf
= FALSE
;
4841 if (sizes
) LIST_FOR_EACH_ENTRY(dim
, sizes
, expr_t
, entry
)
4843 if (dim
->type
!= EXPR_VOID
)
4846 atype
= *ptype
= duptype(*ptype
, 0);
4848 if (atype
->type
== RPC_FC_SMFARRAY
|| atype
->type
== RPC_FC_LGFARRAY
)
4849 error_loc("%s: cannot specify size_is for a fixed sized array\n", v
->name
);
4851 if (atype
->type
!= RPC_FC_CARRAY
&& !is_ptr(atype
))
4852 error_loc("%s: size_is attribute applied to illegal type\n", v
->name
);
4854 atype
->type
= RPC_FC_CARRAY
;
4855 atype
->size_is
= dim
;
4858 ptype
= &(*ptype
)->ref
;
4860 error_loc("%s: too many expressions in size_is attribute\n", v
->name
);
4864 if (lengs
) LIST_FOR_EACH_ENTRY(dim
, lengs
, expr_t
, entry
)
4866 if (dim
->type
!= EXPR_VOID
)
4869 atype
= *ptype
= duptype(*ptype
, 0);
4871 if (atype
->type
== RPC_FC_SMFARRAY
)
4872 atype
->type
= RPC_FC_SMVARRAY
;
4873 else if (atype
->type
== RPC_FC_LGFARRAY
)
4874 atype
->type
= RPC_FC_LGVARRAY
;
4875 else if (atype
->type
== RPC_FC_CARRAY
)
4876 atype
->type
= RPC_FC_CVARRAY
;
4878 error_loc("%s: length_is attribute applied to illegal type\n", v
->name
);
4880 atype
->length_is
= dim
;
4883 ptype
= &(*ptype
)->ref
;
4885 error_loc("%s: too many expressions in length_is attribute\n", v
->name
);
4888 if (has_varconf
&& !last_array(v
->type
))
4891 for (ptype
= &v
->type
; is_array(*ptype
); ptype
= &(*ptype
)->ref
)
4893 *ptype
= duptype(*ptype
, 0);
4894 (*ptype
)->type
= RPC_FC_BOGUS_ARRAY
;
4898 if (is_array(v
->type
))
4900 const type_t
*rt
= v
->type
->ref
;
4901 if (is_user_type(rt
))
4902 v
->type
->type
= RPC_FC_BOGUS_ARRAY
;
4906 case RPC_FC_BOGUS_STRUCT
:
4907 case RPC_FC_NON_ENCAPSULATED_UNION
:
4908 case RPC_FC_ENCAPSULATED_UNION
:
4910 v
->type
->type
= RPC_FC_BOGUS_ARRAY
;
4912 /* FC_RP should be above, but widl overuses these, and will break things. */
4915 if (rt
->ref
->type
== RPC_FC_IP
)
4916 v
->type
->type
= RPC_FC_BOGUS_ARRAY
;
4921 /* v->type is currently pointing to the type on the left-side of the
4922 * declaration, so we need to fix this up so that it is the return type of the
4923 * function and make v->type point to the function side of the declaration */
4927 type_t
*return_type
= v
->type
;
4928 v
->type
= func_type
;
4929 for (ft
= v
->type
; is_ptr(ft
); ft
= ft
->ref
)
4931 assert(ft
->type
== RPC_FC_FUNCTION
);
4932 ft
->ref
= return_type
;
4933 /* move calling convention attribute, if present, from pointer nodes to
4935 for (t
= v
->type
; is_ptr(t
); t
= t
->ref
)
4936 ft
->attrs
= move_attr(ft
->attrs
, t
->attrs
, ATTR_CALLCONV
);
4937 if (is_object_interface
&& !is_attr(ft
->attrs
, ATTR_CALLCONV
))
4939 static char *stdmethodcalltype
;
4940 if (!stdmethodcalltype
) stdmethodcalltype
= strdup("STDMETHODCALLTYPE");
4941 ft
->attrs
= append_attr(NULL
, make_attrp(ATTR_CALLCONV
, stdmethodcalltype
));
4947 for (t
= v
->type
; is_ptr(t
); t
= t
->ref
)
4948 if (is_attr(t
->attrs
, ATTR_CALLCONV
))
4949 error_loc("calling convention applied to non-function-pointer type\n");
4953 static var_list_t
*set_var_types(attr_list_t
*attrs
, decl_spec_t
*decl_spec
, declarator_list_t
*decls
)
4955 declarator_t
*decl
, *next
;
4956 var_list_t
*var_list
= NULL
;
4958 LIST_FOR_EACH_ENTRY_SAFE( decl
, next
, decls
, declarator_t
, entry
)
4960 var_t
*var
= decl
->var
;
4963 set_type(var
, decl_spec
, decl
, 0);
4964 var_list
= append_var(var_list
, var
);
4970 static ifref_list_t
*append_ifref(ifref_list_t
*list
, ifref_t
*iface
)
4972 if (!iface
) return list
;
4975 list
= xmalloc( sizeof(*list
) );
4978 list_add_tail( list
, &iface
->entry
);
4982 static ifref_t
*make_ifref(type_t
*iface
)
4984 ifref_t
*l
= xmalloc(sizeof(ifref_t
));
4990 static var_list_t
*append_var(var_list_t
*list
, var_t
*var
)
4992 if (!var
) return list
;
4995 list
= xmalloc( sizeof(*list
) );
4998 list_add_tail( list
, &var
->entry
);
5002 static var_list_t
*append_var_list(var_list_t
*list
, var_list_t
*vars
)
5004 if (!vars
) return list
;
5007 list
= xmalloc( sizeof(*list
) );
5010 list_move_tail( list
, vars
);
5014 static var_t
*make_var(char *name
)
5016 var_t
*v
= xmalloc(sizeof(var_t
));
5021 v
->stgclass
= STG_NONE
;
5022 init_loc_info(&v
->loc_info
);
5026 static declarator_list_t
*append_declarator(declarator_list_t
*list
, declarator_t
*d
)
5028 if (!d
) return list
;
5030 list
= xmalloc(sizeof(*list
));
5033 list_add_tail(list
, &d
->entry
);
5037 static declarator_t
*make_declarator(var_t
*var
)
5039 declarator_t
*d
= xmalloc(sizeof(*d
));
5042 d
->func_type
= NULL
;
5047 static func_list_t
*append_func(func_list_t
*list
, func_t
*func
)
5049 if (!func
) return list
;
5052 list
= xmalloc( sizeof(*list
) );
5055 list_add_tail( list
, &func
->entry
);
5059 static func_t
*make_func(var_t
*def
)
5061 func_t
*f
= xmalloc(sizeof(func_t
));
5063 f
->args
= def
->type
->fields_or_args
;
5064 f
->ignore
= parse_only
;
5069 static type_t
*make_class(char *name
)
5071 type_t
*c
= make_type(RPC_FC_COCLASS
, NULL
);
5073 c
->kind
= TKIND_COCLASS
;
5077 static type_t
*make_safearray(type_t
*type
)
5079 type_t
*sa
= duptype(find_type("SAFEARRAY", 0), 1);
5081 return make_type(pointer_default
, sa
);
5084 static typelib_t
*make_library(const char *name
, const attr_list_t
*attrs
)
5086 typelib_t
*typelib
= xmalloc(sizeof(*typelib
));
5087 typelib
->name
= xstrdup(name
);
5088 typelib
->filename
= NULL
;
5089 typelib
->attrs
= attrs
;
5090 list_init( &typelib
->entries
);
5091 list_init( &typelib
->importlibs
);
5097 static int hash_ident(const char *name
)
5099 const char *p
= name
;
5101 /* a simple sum hash is probably good enough */
5106 return sum
& (HASHMAX
-1);
5109 /***** type repository *****/
5118 struct rtype
*type_hash
[HASHMAX
];
5120 static type_t
*reg_type(type_t
*type
, const char *name
, int t
)
5125 error_loc("registering named type without name\n");
5128 hash
= hash_ident(name
);
5129 nt
= xmalloc(sizeof(struct rtype
));
5133 nt
->next
= type_hash
[hash
];
5134 type_hash
[hash
] = nt
;
5138 static int is_incomplete(const type_t
*t
)
5140 return !t
->defined
&& (is_struct(t
->type
) || is_union(t
->type
));
5143 static void add_incomplete(type_t
*t
)
5145 struct typenode
*tn
= xmalloc(sizeof *tn
);
5147 list_add_tail(&incomplete_types
, &tn
->entry
);
5150 static void fix_type(type_t
*t
)
5152 if (t
->kind
== TKIND_ALIAS
&& is_incomplete(t
)) {
5153 type_t
*ot
= t
->orig
;
5155 t
->fields_or_args
= ot
->fields_or_args
;
5156 t
->defined
= ot
->defined
;
5160 static void fix_incomplete(void)
5162 struct typenode
*tn
, *next
;
5164 LIST_FOR_EACH_ENTRY_SAFE(tn
, next
, &incomplete_types
, struct typenode
, entry
) {
5170 static type_t
*reg_typedefs(decl_spec_t
*decl_spec
, declarator_list_t
*decls
, attr_list_t
*attrs
)
5172 const declarator_t
*decl
;
5173 int is_str
= is_attr(attrs
, ATTR_STRING
);
5174 type_t
*type
= decl_spec
->type
;
5178 type_t
*t
= decl_spec
->type
;
5185 if (c
!= RPC_FC_CHAR
&& c
!= RPC_FC_BYTE
&& c
!= RPC_FC_WCHAR
)
5187 decl
= LIST_ENTRY( list_head( decls
), const declarator_t
, entry
);
5188 error_loc("'%s': [string] attribute is only valid on 'char', 'byte', or 'wchar_t' pointers and arrays\n",
5193 /* We must generate names for tagless enum, struct or union.
5194 Typedef-ing a tagless enum, struct or union means we want the typedef
5195 to be included in a library hence the public attribute. */
5196 if ((type
->kind
== TKIND_ENUM
|| type
->kind
== TKIND_RECORD
5197 || type
->kind
== TKIND_UNION
) && ! type
->name
&& ! parse_only
)
5199 if (! is_attr(attrs
, ATTR_PUBLIC
))
5200 attrs
= append_attr( attrs
, make_attr(ATTR_PUBLIC
) );
5201 type
->name
= gen_name();
5203 else if (is_attr(attrs
, ATTR_UUID
) && !is_attr(attrs
, ATTR_PUBLIC
))
5204 attrs
= append_attr( attrs
, make_attr(ATTR_PUBLIC
) );
5206 LIST_FOR_EACH_ENTRY( decl
, decls
, const declarator_t
, entry
)
5208 var_t
*name
= decl
->var
;
5213 cur
= find_type_helper(name
->name
, 0);
5215 error_loc("%s: redefinition error; original definition was at %s:%d\n",
5216 cur
->name
, cur
->loc_info
.input_name
,
5217 cur
->loc_info
.line_number
);
5219 /* set the attributes to allow set_type to do some checks on them */
5220 name
->attrs
= attrs
;
5221 set_type(name
, decl_spec
, decl
, 0);
5222 cur
= alias(name
->type
, name
->name
);
5225 if (is_incomplete(cur
))
5226 add_incomplete(cur
);
5227 reg_type(cur
, cur
->name
, 0);
5233 static type_t
*find_type_helper(const char *name
, int t
)
5235 struct rtype
*cur
= type_hash
[hash_ident(name
)];
5236 while (cur
&& (cur
->t
!= t
|| strcmp(cur
->name
, name
)))
5238 return cur
? cur
->type
: NULL
;
5241 type_t
*find_type(const char *name
, int t
)
5243 type_t
*type
= find_type_helper(name
, t
);
5245 error_loc("type '%s' not found\n", name
);
5251 static type_t
*find_type2(char *name
, int t
)
5253 type_t
*tp
= find_type(name
, t
);
5258 int is_type(const char *name
)
5260 return find_type_helper(name
, 0) != NULL
;
5263 static type_t
*get_type(unsigned char type
, char *name
, int t
)
5267 tp
= find_type_helper(name
, t
);
5273 tp
= make_type(type
, NULL
);
5275 if (!name
) return tp
;
5276 return reg_type(tp
, name
, t
);
5279 static type_t
*get_typev(unsigned char type
, var_t
*name
, int t
)
5286 return get_type(type
, sname
, t
);
5289 static int get_struct_type(var_list_t
*fields
)
5291 int has_pointer
= 0;
5292 int has_conformance
= 0;
5293 int has_variance
= 0;
5296 if (get_padding(fields
))
5297 return RPC_FC_BOGUS_STRUCT
;
5299 if (fields
) LIST_FOR_EACH_ENTRY( field
, fields
, var_t
, entry
)
5301 type_t
*t
= field
->type
;
5303 if (is_user_type(t
))
5304 return RPC_FC_BOGUS_STRUCT
;
5315 case RPC_FC_ENCAPSULATED_UNION
:
5316 case RPC_FC_NON_ENCAPSULATED_UNION
:
5317 case RPC_FC_BOGUS_STRUCT
:
5318 return RPC_FC_BOGUS_STRUCT
;
5325 if (field
->type
->declarray
)
5327 if (is_string_type(field
->attrs
, field
->type
))
5329 if (is_conformant_array(field
->type
))
5330 has_conformance
= 1;
5335 if (is_array(field
->type
->ref
))
5336 return RPC_FC_BOGUS_STRUCT
;
5338 if (is_conformant_array(field
->type
))
5340 has_conformance
= 1;
5341 if (field
->type
->declarray
&& list_next(fields
, &field
->entry
))
5342 error_loc("field '%s' deriving from a conformant array must be the last field in the structure\n",
5345 if (field
->type
->length_is
)
5348 t
= field
->type
->ref
;
5354 * RPC_FC_BYTE, RPC_FC_STRUCT, etc
5355 * Simple types don't effect the type of struct.
5356 * A struct containing a simple struct is still a simple struct.
5357 * So long as we can block copy the data, we return RPC_FC_STRUCT.
5359 case 0: /* void pointer */
5369 case RPC_FC_INT3264
:
5370 case RPC_FC_UINT3264
:
5383 case RPC_FC_CVARRAY
:
5384 case RPC_FC_BOGUS_ARRAY
:
5389 * Propagate member attributes
5390 * a struct should be at least as complex as its member
5392 case RPC_FC_CVSTRUCT
:
5393 has_conformance
= 1;
5398 case RPC_FC_CPSTRUCT
:
5399 has_conformance
= 1;
5400 if (list_next( fields
, &field
->entry
))
5401 error_loc("field '%s' deriving from a conformant array must be the last field in the structure\n",
5406 case RPC_FC_CSTRUCT
:
5407 has_conformance
= 1;
5408 if (list_next( fields
, &field
->entry
))
5409 error_loc("field '%s' deriving from a conformant array must be the last field in the structure\n",
5413 case RPC_FC_PSTRUCT
:
5418 error_loc("Unknown struct member %s with type (0x%02x)\n", field
->name
, t
->type
);
5419 /* fallthru - treat it as complex */
5421 /* as soon as we see one of these these members, it's bogus... */
5422 case RPC_FC_ENCAPSULATED_UNION
:
5423 case RPC_FC_NON_ENCAPSULATED_UNION
:
5424 case RPC_FC_BOGUS_STRUCT
:
5426 return RPC_FC_BOGUS_STRUCT
;
5432 if ( has_conformance
)
5433 return RPC_FC_CVSTRUCT
;
5435 return RPC_FC_BOGUS_STRUCT
;
5437 if( has_conformance
&& has_pointer
)
5438 return RPC_FC_CPSTRUCT
;
5439 if( has_conformance
)
5440 return RPC_FC_CSTRUCT
;
5442 return RPC_FC_PSTRUCT
;
5443 return RPC_FC_STRUCT
;
5446 /***** constant repository *****/
5451 struct rconst
*next
;
5454 struct rconst
*const_hash
[HASHMAX
];
5456 static var_t
*reg_const(var_t
*var
)
5461 error_loc("registering constant without name\n");
5464 hash
= hash_ident(var
->name
);
5465 nc
= xmalloc(sizeof(struct rconst
));
5466 nc
->name
= var
->name
;
5468 nc
->next
= const_hash
[hash
];
5469 const_hash
[hash
] = nc
;
5473 var_t
*find_const(const char *name
, int f
)
5475 struct rconst
*cur
= const_hash
[hash_ident(name
)];
5476 while (cur
&& strcmp(cur
->name
, name
))
5479 if (f
) error_loc("constant '%s' not found\n", name
);
5485 static void write_libid(const typelib_t
*typelib
)
5487 const UUID
*uuid
= get_attrp(typelib
->attrs
, ATTR_UUID
);
5488 write_guid(idfile
, "LIBID", typelib
->name
, uuid
);
5491 static void write_clsid(type_t
*cls
)
5493 const UUID
*uuid
= get_attrp(cls
->attrs
, ATTR_UUID
);
5494 write_guid(idfile
, "CLSID", cls
->name
, uuid
);
5497 static void write_diid(type_t
*iface
)
5499 const UUID
*uuid
= get_attrp(iface
->attrs
, ATTR_UUID
);
5500 write_guid(idfile
, "DIID", iface
->name
, uuid
);
5503 static void write_iid(type_t
*iface
)
5505 const UUID
*uuid
= get_attrp(iface
->attrs
, ATTR_UUID
);
5506 write_guid(idfile
, "IID", iface
->name
, uuid
);
5509 static int compute_method_indexes(type_t
*iface
)
5515 idx
= compute_method_indexes(iface
->ref
);
5522 LIST_FOR_EACH_ENTRY( f
, iface
->funcs
, func_t
, entry
)
5523 if (! is_callas(f
->def
->attrs
))
5529 static char *gen_name(void)
5531 static const char format
[] = "__WIDL_%s_generated_name_%08lX";
5532 static unsigned long n
= 0;
5533 static const char *file_id
;
5539 char *dst
= dup_basename(input_name
, ".idl");
5543 if (! isalnum((unsigned char) *dst
))
5546 size
= sizeof format
- 7 + strlen(file_id
) + 8;
5549 name
= xmalloc(size
);
5550 sprintf(name
, format
, file_id
, n
++);
5556 unsigned int dce_compatible
: 1;
5557 unsigned int acf
: 1;
5558 unsigned int on_interface
: 1;
5559 unsigned int on_function
: 1;
5560 unsigned int on_arg
: 1;
5561 unsigned int on_type
: 1;
5562 unsigned int on_field
: 1;
5563 unsigned int on_library
: 1;
5564 unsigned int on_dispinterface
: 1;
5565 unsigned int on_module
: 1;
5566 unsigned int on_coclass
: 1;
5567 const char *display_name
;
5570 struct allowed_attr allowed_attr
[] =
5572 /* attr { D ACF I Fn ARG T Fi L DI M C <display name> } */
5573 /* ATTR_AGGREGATABLE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "aggregatable" },
5574 /* ATTR_APPOBJECT */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "appobject" },
5575 /* ATTR_ASYNC */ { 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, "async" },
5576 /* ATTR_AUTO_HANDLE */ { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, "auto_handle" },
5577 /* ATTR_BINDABLE */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "bindable" },
5578 /* ATTR_BROADCAST */ { 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "broadcast" },
5579 /* ATTR_CALLAS */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "call_as" },
5580 /* ATTR_CALLCONV */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, NULL
},
5581 /* ATTR_CASE */ { 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, "case" },
5582 /* ATTR_CONST */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "const" },
5583 /* ATTR_CONTEXTHANDLE */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, "context_handle" },
5584 /* ATTR_CONTROL */ { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, "control" },
5585 /* ATTR_DEFAULT */ { 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, "default" },
5586 /* ATTR_DEFAULTCOLLELEM */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "defaultcollelem" },
5587 /* ATTR_DEFAULTVALUE */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, "defaultvalue" },
5588 /* ATTR_DEFAULTVTABLE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "defaultvtable" },
5589 /* ATTR_DISPINTERFACE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL
},
5590 /* ATTR_DISPLAYBIND */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "displaybind" },
5591 /* ATTR_DLLNAME */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, "dllname" },
5592 /* ATTR_DUAL */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "dual" },
5593 /* ATTR_ENDPOINT */ { 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "endpoint" },
5594 /* ATTR_ENTRY */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "entry" },
5595 /* ATTR_EXPLICIT_HANDLE */ { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, "explicit_handle" },
5596 /* ATTR_HANDLE */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, "handle" },
5597 /* ATTR_HELPCONTEXT */ { 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, "helpcontext" },
5598 /* ATTR_HELPFILE */ { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, "helpfile" },
5599 /* ATTR_HELPSTRING */ { 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, "helpstring" },
5600 /* ATTR_HELPSTRINGCONTEXT */ { 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, "helpstringcontext" },
5601 /* ATTR_HELPSTRINGDLL */ { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, "helpstringdll" },
5602 /* ATTR_HIDDEN */ { 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, "hidden" },
5603 /* ATTR_ID */ { 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, "id" },
5604 /* ATTR_IDEMPOTENT */ { 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "idempotent" },
5605 /* ATTR_IIDIS */ { 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, "iid_is" },
5606 /* ATTR_IMMEDIATEBIND */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "immediatebind" },
5607 /* ATTR_IMPLICIT_HANDLE */ { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, "implicit_handle" },
5608 /* ATTR_IN */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, "in" },
5609 /* ATTR_INLINE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "inline" },
5610 /* ATTR_INPUTSYNC */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "inputsync" },
5611 /* ATTR_LENGTHIS */ { 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, "length_is" },
5612 /* ATTR_LIBLCID */ { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, "lcid" },
5613 /* ATTR_LOCAL */ { 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, "local" },
5614 /* ATTR_NONBROWSABLE */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "nonbrowsable" },
5615 /* ATTR_NONCREATABLE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "noncreatable" },
5616 /* ATTR_NONEXTENSIBLE */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "nonextensible" },
5617 /* ATTR_OBJECT */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "object" },
5618 /* ATTR_ODL */ { 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, "odl" },
5619 /* ATTR_OLEAUTOMATION */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "oleautomation" },
5620 /* ATTR_OPTIONAL */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, "optional" },
5621 /* ATTR_OUT */ { 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, "out" },
5622 /* ATTR_POINTERDEFAULT */ { 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "pointer_default" },
5623 /* ATTR_POINTERTYPE */ { 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, "ref, unique or ptr" },
5624 /* ATTR_PROPGET */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "propget" },
5625 /* ATTR_PROPPUT */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "propput" },
5626 /* ATTR_PROPPUTREF */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "propputref" },
5627 /* ATTR_PUBLIC */ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, "public" },
5628 /* ATTR_RANGE */ { 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, "range" },
5629 /* ATTR_READONLY */ { 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, "readonly" },
5630 /* ATTR_REQUESTEDIT */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "requestedit" },
5631 /* ATTR_RESTRICTED */ { 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, "restricted" },
5632 /* ATTR_RETVAL */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, "retval" },
5633 /* ATTR_SIZEIS */ { 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, "size_is" },
5634 /* ATTR_SOURCE */ { 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, "source" },
5635 /* ATTR_STRICTCONTEXTHANDLE */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "strict_context_handle" },
5636 /* ATTR_STRING */ { 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, "string" },
5637 /* ATTR_SWITCHIS */ { 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, "switch_is" },
5638 /* ATTR_SWITCHTYPE */ { 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, "switch_type" },
5639 /* ATTR_TRANSMITAS */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, "transmit_as" },
5640 /* ATTR_UUID */ { 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, "uuid" },
5641 /* ATTR_V1ENUM */ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, "v1_enum" },
5642 /* ATTR_VARARG */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "vararg" },
5643 /* ATTR_VERSION */ { 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, "version" },
5644 /* ATTR_WIREMARSHAL */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, "wire_marshal" },
5647 const char *get_attr_display_name(enum attr_type type
)
5649 return allowed_attr
[type
].display_name
;
5652 static attr_list_t
*check_iface_attrs(const char *name
, attr_list_t
*attrs
)
5655 if (!attrs
) return attrs
;
5656 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
5658 if (!allowed_attr
[attr
->type
].on_interface
)
5659 error_loc("inapplicable attribute %s for interface %s\n",
5660 allowed_attr
[attr
->type
].display_name
, name
);
5665 static attr_list_t
*check_function_attrs(const char *name
, attr_list_t
*attrs
)
5668 if (!attrs
) return attrs
;
5669 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
5671 if (!allowed_attr
[attr
->type
].on_function
)
5672 error_loc("inapplicable attribute %s for function %s\n",
5673 allowed_attr
[attr
->type
].display_name
, name
);
5678 static void check_arg(var_t
*arg
)
5680 const type_t
*t
= arg
->type
;
5683 if (t
->type
== 0 && ! is_var_ptr(arg
))
5684 error_loc("argument '%s' has void type\n", arg
->name
);
5688 LIST_FOR_EACH_ENTRY(attr
, arg
->attrs
, const attr_t
, entry
)
5690 if (!allowed_attr
[attr
->type
].on_arg
)
5691 error_loc("inapplicable attribute %s for argument %s\n",
5692 allowed_attr
[attr
->type
].display_name
, arg
->name
);
5697 static attr_list_t
*check_typedef_attrs(attr_list_t
*attrs
)
5700 if (!attrs
) return attrs
;
5701 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
5703 if (!allowed_attr
[attr
->type
].on_type
)
5704 error_loc("inapplicable attribute %s for typedef\n",
5705 allowed_attr
[attr
->type
].display_name
);
5710 static attr_list_t
*check_field_attrs(const char *name
, attr_list_t
*attrs
)
5713 if (!attrs
) return attrs
;
5714 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
5716 if (!allowed_attr
[attr
->type
].on_field
)
5717 error_loc("inapplicable attribute %s for field %s\n",
5718 allowed_attr
[attr
->type
].display_name
, name
);
5723 static attr_list_t
*check_library_attrs(const char *name
, attr_list_t
*attrs
)
5726 if (!attrs
) return attrs
;
5727 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
5729 if (!allowed_attr
[attr
->type
].on_library
)
5730 error_loc("inapplicable attribute %s for library %s\n",
5731 allowed_attr
[attr
->type
].display_name
, name
);
5736 static attr_list_t
*check_dispiface_attrs(const char *name
, attr_list_t
*attrs
)
5739 if (!attrs
) return attrs
;
5740 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
5742 if (!allowed_attr
[attr
->type
].on_dispinterface
)
5743 error_loc("inapplicable attribute %s for dispinterface %s\n",
5744 allowed_attr
[attr
->type
].display_name
, name
);
5749 static attr_list_t
*check_module_attrs(const char *name
, attr_list_t
*attrs
)
5752 if (!attrs
) return attrs
;
5753 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
5755 if (!allowed_attr
[attr
->type
].on_module
)
5756 error_loc("inapplicable attribute %s for module %s\n",
5757 allowed_attr
[attr
->type
].display_name
, name
);
5762 static attr_list_t
*check_coclass_attrs(const char *name
, attr_list_t
*attrs
)
5765 if (!attrs
) return attrs
;
5766 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
5768 if (!allowed_attr
[attr
->type
].on_coclass
)
5769 error_loc("inapplicable attribute %s for coclass %s\n",
5770 allowed_attr
[attr
->type
].display_name
, name
);
5775 static int is_allowed_conf_type(const type_t
*type
)
5796 static int is_ptr_guid_type(const type_t
*type
)
5798 unsigned int align
= 0;
5801 if (type
->kind
== TKIND_ALIAS
)
5803 else if (is_ptr(type
))
5811 return (type_memsize(type
, &align
) == 16);
5814 static void check_conformance_expr_list(const char *attr_name
, const var_t
*arg
, const type_t
*container_type
, expr_list_t
*expr_list
)
5817 struct expr_loc expr_loc
;
5819 expr_loc
.attr
= attr_name
;
5820 if (expr_list
) LIST_FOR_EACH_ENTRY(dim
, expr_list
, expr_t
, entry
)
5822 if (dim
->type
!= EXPR_VOID
)
5824 const type_t
*expr_type
= expr_resolve_type(&expr_loc
, container_type
, dim
);
5825 if (!is_allowed_conf_type(expr_type
))
5826 error_loc_info(&arg
->loc_info
, "expression must resolve to integral type <= 32bits for attribute %s\n",
5832 static void check_remoting_fields(const var_t
*var
, type_t
*type
);
5834 /* checks that properties common to fields and arguments are consistent */
5835 static void check_field_common(const type_t
*container_type
,
5836 const char *container_name
, const var_t
*arg
)
5838 type_t
*type
= arg
->type
;
5839 int is_wire_marshal
= 0;
5840 int is_context_handle
= 0;
5841 const char *container_type_name
= NULL
;
5843 if (is_struct(container_type
->type
))
5844 container_type_name
= "struct";
5845 else if (is_union(container_type
->type
))
5846 container_type_name
= "union";
5847 else if (container_type
->type
== RPC_FC_FUNCTION
)
5848 container_type_name
= "function";
5850 if (is_attr(arg
->attrs
, ATTR_LENGTHIS
) &&
5851 (is_attr(arg
->attrs
, ATTR_STRING
) || is_aliaschain_attr(arg
->type
, ATTR_STRING
)))
5852 error_loc_info(&arg
->loc_info
,
5853 "string and length_is specified for argument %s are mutually exclusive attributes\n",
5856 if (is_attr(arg
->attrs
, ATTR_SIZEIS
))
5858 expr_list_t
*size_is_exprs
= get_attrp(arg
->attrs
, ATTR_SIZEIS
);
5859 check_conformance_expr_list("size_is", arg
, container_type
, size_is_exprs
);
5861 if (is_attr(arg
->attrs
, ATTR_LENGTHIS
))
5863 expr_list_t
*length_is_exprs
= get_attrp(arg
->attrs
, ATTR_LENGTHIS
);
5864 check_conformance_expr_list("length_is", arg
, container_type
, length_is_exprs
);
5866 if (is_attr(arg
->attrs
, ATTR_IIDIS
))
5868 struct expr_loc expr_loc
;
5869 expr_t
*expr
= get_attrp(arg
->attrs
, ATTR_IIDIS
);
5870 if (expr
->type
!= EXPR_VOID
)
5872 const type_t
*expr_type
;
5874 expr_loc
.attr
= "iid_is";
5875 expr_type
= expr_resolve_type(&expr_loc
, container_type
, expr
);
5876 if (!expr_type
|| !is_ptr_guid_type(expr_type
))
5877 error_loc_info(&arg
->loc_info
, "expression must resolve to pointer to GUID type for attribute iid_is\n");
5880 if (is_attr(arg
->attrs
, ATTR_SWITCHIS
))
5882 struct expr_loc expr_loc
;
5883 expr_t
*expr
= get_attrp(arg
->attrs
, ATTR_SWITCHIS
);
5884 if (expr
->type
!= EXPR_VOID
)
5886 const type_t
*expr_type
;
5888 expr_loc
.attr
= "switch_is";
5889 expr_type
= expr_resolve_type(&expr_loc
, container_type
, expr
);
5890 if (!expr_type
|| !is_allowed_conf_type(expr_type
))
5891 error_loc_info(&arg
->loc_info
, "expression must resolve to integral type <= 32bits for attribute %s\n",
5896 /* get fundamental type for the argument */
5899 if (is_attr(type
->attrs
, ATTR_WIREMARSHAL
))
5901 is_wire_marshal
= 1;
5904 if (is_attr(type
->attrs
, ATTR_CONTEXTHANDLE
))
5906 is_context_handle
= 1;
5909 if (type
->kind
== TKIND_ALIAS
)
5911 else if (is_ptr(type
) || is_array(type
))
5917 if (type
->type
== 0 && !is_attr(arg
->attrs
, ATTR_IIDIS
) && !is_wire_marshal
&& !is_context_handle
)
5918 error_loc_info(&arg
->loc_info
, "parameter \'%s\' of %s \'%s\' cannot derive from void *\n", arg
->name
, container_type_name
, container_name
);
5919 else if (type
->type
== RPC_FC_FUNCTION
)
5920 error_loc_info(&arg
->loc_info
, "parameter \'%s\' of %s \'%s\' cannot be a function pointer\n", arg
->name
, container_type_name
, container_name
);
5921 else if (!is_wire_marshal
&& (is_struct(type
->type
) || is_union(type
->type
)))
5922 check_remoting_fields(arg
, type
);
5925 static void check_remoting_fields(const var_t
*var
, type_t
*type
)
5928 const var_list_t
*fields
= NULL
;
5933 type
->checked
= TRUE
;
5935 if (is_struct(type
->type
))
5938 fields
= type
->fields_or_args
;
5940 error_loc_info(&var
->loc_info
, "undefined type declaration %s\n", type
->name
);
5942 else if (is_union(type
->type
))
5944 if (type
->type
== RPC_FC_ENCAPSULATED_UNION
)
5946 const var_t
*uv
= LIST_ENTRY(list_tail(type
->fields_or_args
), const var_t
, entry
);
5947 fields
= uv
->type
->fields_or_args
;
5950 fields
= type
->fields_or_args
;
5953 if (fields
) LIST_FOR_EACH_ENTRY( field
, fields
, const var_t
, entry
)
5954 if (field
->type
) check_field_common(type
, type
->name
, field
);
5957 /* checks that arguments for a function make sense for marshalling and unmarshalling */
5958 static void check_remoting_args(const func_t
*func
)
5960 const char *funcname
= func
->def
->name
;
5963 if (func
->args
) LIST_FOR_EACH_ENTRY( arg
, func
->args
, const var_t
, entry
)
5966 const type_t
*type
= arg
->type
;
5968 /* get pointer level and fundamental type for the argument */
5971 if (is_attr(type
->attrs
, ATTR_WIREMARSHAL
))
5973 if (is_attr(type
->attrs
, ATTR_CONTEXTHANDLE
))
5975 if (type
->kind
== TKIND_ALIAS
)
5977 else if (is_ptr(type
))
5986 /* check that [out] parameters have enough pointer levels */
5987 if (is_attr(arg
->attrs
, ATTR_OUT
))
5989 if (!is_array(type
))
5992 error_loc_info(&arg
->loc_info
, "out parameter \'%s\' of function \'%s\' is not a pointer\n", arg
->name
, funcname
);
5993 if (type
->type
== RPC_FC_IP
&& ptr_level
== 1)
5994 error_loc_info(&arg
->loc_info
, "out interface pointer \'%s\' of function \'%s\' is not a double pointer\n", arg
->name
, funcname
);
5998 check_field_common(func
->def
->type
, funcname
, arg
);
6002 static void add_explicit_handle_if_necessary(func_t
*func
)
6004 const var_t
* explicit_handle_var
;
6005 const var_t
* explicit_generic_handle_var
= NULL
;
6006 const var_t
* context_handle_var
= NULL
;
6008 /* check for a defined binding handle */
6009 explicit_handle_var
= get_explicit_handle_var(func
);
6010 if (!explicit_handle_var
)
6012 explicit_generic_handle_var
= get_explicit_generic_handle_var(func
);
6013 if (!explicit_generic_handle_var
)
6015 context_handle_var
= get_context_handle_var(func
);
6016 if (!context_handle_var
)
6018 /* no explicit handle specified so add
6019 * "[in] handle_t IDL_handle" as the first parameter to the
6021 var_t
*idl_handle
= make_var(xstrdup("IDL_handle"));
6022 idl_handle
->attrs
= append_attr(NULL
, make_attr(ATTR_IN
));
6023 idl_handle
->type
= find_type("handle_t", 0);
6024 if (!func
->def
->type
->fields_or_args
)
6026 func
->def
->type
->fields_or_args
= xmalloc( sizeof(*func
->def
->type
->fields_or_args
) );
6027 list_init( func
->def
->type
->fields_or_args
);
6029 list_add_head( func
->def
->type
->fields_or_args
, &idl_handle
->entry
);
6030 func
->args
= func
->def
->type
->fields_or_args
;
6036 static void check_functions(const type_t
*iface
)
6038 if (is_attr(iface
->attrs
, ATTR_EXPLICIT_HANDLE
) && iface
->funcs
)
6041 LIST_FOR_EACH_ENTRY( func
, iface
->funcs
, func_t
, entry
)
6042 add_explicit_handle_if_necessary(func
);
6044 if (!is_inside_library
&& !is_attr(iface
->attrs
, ATTR_LOCAL
))
6047 if (iface
->funcs
) LIST_FOR_EACH_ENTRY( func
, iface
->funcs
, const func_t
, entry
)
6049 if (!is_attr(func
->def
->attrs
, ATTR_LOCAL
))
6050 check_remoting_args(func
);
6055 static void check_all_user_types(const statement_list_t
*stmts
)
6057 const statement_t
*stmt
;
6059 if (stmts
) LIST_FOR_EACH_ENTRY(stmt
, stmts
, const statement_t
, entry
)
6061 if (stmt
->type
== STMT_LIBRARY
)
6062 check_all_user_types(stmt
->u
.lib
->stmts
);
6063 else if (stmt
->type
== STMT_TYPE
&& stmt
->u
.type
->type
== RPC_FC_IP
)
6066 const func_list_t
*fs
= stmt
->u
.type
->funcs
;
6067 if (fs
) LIST_FOR_EACH_ENTRY(f
, fs
, const func_t
, entry
)
6068 check_for_additional_prototype_types(f
->args
);
6073 int is_valid_uuid(const char *s
)
6077 for (i
= 0; i
< 36; ++i
)
6078 if (i
== 8 || i
== 13 || i
== 18 || i
== 23)
6084 if (!isxdigit(s
[i
]))
6087 return s
[i
] == '\0';
6090 static statement_t
*make_statement(enum statement_type type
)
6092 statement_t
*stmt
= xmalloc(sizeof(*stmt
));
6097 static statement_t
*make_statement_type_decl(type_t
*type
)
6099 statement_t
*stmt
= make_statement(STMT_TYPE
);
6100 stmt
->u
.type
= type
;
6104 static statement_t
*make_statement_reference(type_t
*type
)
6106 statement_t
*stmt
= make_statement(STMT_TYPEREF
);
6107 stmt
->u
.type
= type
;
6111 static statement_t
*make_statement_declaration(var_t
*var
)
6113 statement_t
*stmt
= make_statement(STMT_DECLARATION
);
6115 if (var
->stgclass
== STG_EXTERN
&& var
->eval
)
6116 warning("'%s' initialised and declared extern\n", var
->name
);
6117 if (is_const_decl(var
))
6122 else if ((var
->stgclass
== STG_NONE
|| var
->stgclass
== STG_REGISTER
) &&
6123 var
->type
->type
!= RPC_FC_FUNCTION
)
6124 error_loc("instantiation of data is illegal\n");
6128 static statement_t
*make_statement_library(typelib_t
*typelib
)
6130 statement_t
*stmt
= make_statement(STMT_LIBRARY
);
6131 stmt
->u
.lib
= typelib
;
6135 static statement_t
*make_statement_cppquote(const char *str
)
6137 statement_t
*stmt
= make_statement(STMT_CPPQUOTE
);
6142 static statement_t
*make_statement_importlib(const char *str
)
6144 statement_t
*stmt
= make_statement(STMT_IMPORTLIB
);
6149 static statement_t
*make_statement_import(const char *str
)
6151 statement_t
*stmt
= make_statement(STMT_IMPORT
);
6156 static statement_t
*make_statement_module(type_t
*type
)
6158 statement_t
*stmt
= make_statement(STMT_MODULE
);
6159 stmt
->u
.type
= type
;
6163 static statement_t
*process_typedefs(declarator_list_t
*decls
)
6165 declarator_t
*decl
, *next
;
6167 type_list_t
**type_list
;
6169 if (!decls
) return NULL
;
6171 stmt
= make_statement(STMT_TYPEDEF
);
6172 stmt
->u
.type_list
= NULL
;
6173 type_list
= &stmt
->u
.type_list
;
6175 LIST_FOR_EACH_ENTRY_SAFE( decl
, next
, decls
, declarator_t
, entry
)
6177 var_t
*var
= decl
->var
;
6178 type_t
*type
= find_type(var
->name
, 0);
6179 *type_list
= xmalloc(sizeof(type_list_t
));
6180 (*type_list
)->type
= type
;
6181 (*type_list
)->next
= NULL
;
6183 if (! parse_only
&& do_header
)
6184 write_typedef(type
);
6185 if (in_typelib
&& is_attr(type
->attrs
, ATTR_PUBLIC
))
6186 add_typelib_entry(type
);
6188 type_list
= &(*type_list
)->next
;
6196 static statement_list_t
*append_statement(statement_list_t
*list
, statement_t
*stmt
)
6198 if (!stmt
) return list
;
6201 list
= xmalloc( sizeof(*list
) );
6204 list_add_tail( list
, &stmt
->entry
);
6208 static func_list_t
*append_func_from_statement(func_list_t
*list
, statement_t
*stmt
)
6210 if (stmt
->type
== STMT_DECLARATION
)
6212 var_t
*var
= stmt
->u
.var
;
6213 if (var
->stgclass
== STG_NONE
&& var
->type
->type
== RPC_FC_FUNCTION
)
6215 check_function_attrs(var
->name
, var
->type
->attrs
);
6216 return append_func(list
, make_func(stmt
->u
.var
));
6222 void init_loc_info(loc_info_t
*i
)
6224 i
->input_name
= input_name
? input_name
: "stdin";
6225 i
->line_number
= line_number
;
6226 i
->near_text
= parser_text
;
6229 static void check_def(const type_t
*t
)
6232 error_loc("%s: redefinition error; original definition was at %s:%d\n",
6233 t
->name
, t
->loc_info
.input_name
, t
->loc_info
.line_number
);