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 546
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 77, 80, 85, 89, 93, 99, 102, 106, 111, 112,
838 114, 116, 118, 122, 124, 128, 131, 135, 139, 140,
839 142, 146, 148, 152, 157, 159, 163, 164, 166, 168,
840 170, 172, 174, 176, 181, 186, 188, 190, 192, 194,
841 196, 198, 203, 205, 207, 212, 214, 219, 224, 226,
842 228, 233, 238, 243, 248, 253, 255, 260, 262, 267,
843 269, 275, 277, 279, 284, 289, 291, 293, 295, 297,
844 299, 301, 303, 305, 307, 312, 314, 316, 318, 320,
845 327, 329, 331, 333, 335, 340, 342, 344, 346, 351,
846 356, 361, 366, 368, 370, 375, 380, 382, 384, 386,
847 388, 390, 392, 394, 395, 398, 403, 407, 408, 411,
848 413, 415, 419, 423, 425, 431, 433, 437, 438, 440,
849 442, 444, 446, 448, 450, 452, 454, 456, 458, 464,
850 468, 472, 476, 480, 484, 488, 492, 496, 500, 504,
851 508, 512, 516, 520, 524, 528, 532, 536, 539, 542,
852 545, 548, 551, 554, 558, 562, 567, 572, 577, 581,
853 583, 587, 589, 591, 592, 595, 600, 604, 607, 610,
854 611, 614, 617, 619, 623, 627, 631, 634, 635, 637,
855 638, 640, 642, 644, 646, 648, 650, 652, 655, 658,
856 660, 662, 664, 666, 668, 670, 672, 673, 675, 677,
857 680, 682, 685, 688, 690, 692, 695, 698, 701, 707,
858 708, 711, 714, 717, 720, 723, 726, 730, 733, 737,
859 743, 749, 750, 753, 756, 759, 762, 769, 778, 781,
860 784, 787, 790, 793, 796, 802, 804, 806, 808, 810,
861 812, 813, 816, 819, 823, 824, 826, 829, 832, 835,
862 839, 842, 844, 846, 850, 853, 858, 860, 864, 866,
863 870, 872, 874, 876, 882, 884, 886, 888, 890, 893,
864 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, 242, -1, 178,
871 241, -1, 178, 228, 170, -1, 178, 230, -1, 178,
872 245, -1, 178, 189, -1, 178, 182, -1, -1, 179,
873 242, -1, 179, 241, -1, 179, 228, 170, -1, 179,
874 230, -1, 179, 245, -1, 179, 182, -1, 179, 186,
875 -1, 179, 189, -1, -1, 180, 182, -1, -1, 170,
876 -1, 183, -1, 207, 170, -1, 221, 170, -1, 185,
877 -1, 258, 170, -1, 260, 170, -1, 261, 170, -1,
878 45, 171, 8, 172, -1, 78, 8, 170, -1, 184,
879 179, 11, -1, 79, 171, 8, 172, 181, -1, 89,
880 3, -1, 196, 187, 173, -1, 188, 179, 174, 181,
881 -1, -1, 192, -1, 144, -1, 193, -1, 192, 147,
882 193, -1, 191, -1, 196, 250, 253, -1, 250, 253,
883 -1, 168, 209, 169, -1, 168, 157, 169, -1, -1,
884 196, -1, 168, 197, 169, -1, 199, -1, 197, 147,
885 199, -1, 197, 169, 168, 199, -1, 8, -1, 198,
886 147, 8, -1, -1, 21, -1, 23, -1, 24, -1,
887 26, -1, 27, -1, 29, -1, 32, 171, 224, 172,
888 -1, 34, 171, 211, 172, -1, 41, -1, 42, -1,
889 43, -1, 44, -1, 46, -1, 47, -1, 48, 171,
890 213, 172, -1, 49, -1, 50, -1, 52, 171, 8,
891 172, -1, 54, -1, 55, 171, 198, 172, -1, 56,
892 171, 213, 172, -1, 59, -1, 64, -1, 66, 171,
893 212, 172, -1, 67, 171, 8, 172, -1, 68, 171,
894 8, 172, -1, 69, 171, 212, 172, -1, 70, 171,
895 8, 172, -1, 71, -1, 73, 171, 212, 172, -1,
896 74, -1, 75, 171, 210, 172, -1, 76, -1, 77,
897 171, 65, 3, 172, -1, 80, -1, 83, -1, 88,
898 171, 208, 172, -1, 87, 171, 212, 172, -1, 90,
899 -1, 94, -1, 95, -1, 96, -1, 98, -1, 99,
900 -1, 100, -1, 101, -1, 102, -1, 104, 171, 257,
901 172, -1, 106, -1, 107, -1, 108, -1, 110, -1,
902 111, 171, 212, 147, 212, 172, -1, 112, -1, 115,
903 -1, 116, -1, 117, -1, 122, 171, 208, 172, -1,
904 125, -1, 128, -1, 129, -1, 132, 171, 210, 172,
905 -1, 133, 171, 259, 172, -1, 134, 171, 259, 172,
906 -1, 140, 171, 200, 172, -1, 141, -1, 142, -1,
907 143, 171, 262, 172, -1, 146, 171, 259, 172, -1,
908 257, -1, 10, -1, 8, -1, 35, -1, 62, -1,
909 103, -1, 127, -1, -1, 202, 203, -1, 34, 212,
910 149, 218, -1, 46, 149, 218, -1, -1, 205, 147,
911 -1, 205, -1, 206, -1, 205, 147, 206, -1, 224,
912 175, 212, -1, 224, -1, 57, 223, 173, 204, 174,
913 -1, 209, -1, 208, 147, 209, -1, -1, 210, -1,
914 5, -1, 6, -1, 7, -1, 61, -1, 97, -1,
915 135, -1, 8, -1, 9, -1, 3, -1, 210, 148,
916 210, 149, 210, -1, 210, 19, 210, -1, 210, 20,
917 210, -1, 210, 150, 210, -1, 210, 151, 210, -1,
918 210, 152, 210, -1, 210, 15, 210, -1, 210, 16,
919 210, -1, 210, 154, 210, -1, 210, 153, 210, -1,
920 210, 17, 210, -1, 210, 18, 210, -1, 210, 12,
921 210, -1, 210, 13, 210, -1, 210, 156, 210, -1,
922 210, 155, 210, -1, 210, 159, 210, -1, 210, 157,
923 210, -1, 210, 158, 210, -1, 160, 210, -1, 161,
924 210, -1, 156, 210, -1, 155, 210, -1, 152, 210,
925 -1, 157, 210, -1, 210, 14, 3, -1, 210, 167,
926 3, -1, 171, 259, 172, 210, -1, 123, 171, 259,
927 172, -1, 210, 168, 210, 169, -1, 171, 210, 172,
928 -1, 212, -1, 211, 147, 212, -1, 210, -1, 210,
929 -1, -1, 214, 215, -1, 195, 250, 255, 170, -1,
930 195, 261, 170, -1, 219, 170, -1, 196, 170, -1,
931 -1, 217, 216, -1, 219, 170, -1, 170, -1, 195,
932 250, 253, -1, 195, 250, 253, -1, 196, 250, 256,
933 -1, 250, 256, -1, -1, 224, -1, -1, 3, -1,
934 4, -1, 3, -1, 4, -1, 30, -1, 145, -1,
935 227, -1, 120, 227, -1, 139, 227, -1, 139, -1,
936 63, -1, 121, -1, 53, -1, 28, -1, 58, -1,
937 65, -1, -1, 84, -1, 84, -1, 119, 226, -1,
938 124, -1, 91, 226, -1, 72, 226, -1, 85, -1,
939 36, -1, 37, 3, -1, 37, 4, -1, 196, 228,
940 -1, 229, 173, 231, 174, 181, -1, -1, 231, 232,
941 -1, 195, 242, -1, 51, 3, -1, 51, 4, -1,
942 196, 233, -1, 105, 149, -1, 235, 219, 170, -1,
943 92, 149, -1, 236, 220, 170, -1, 234, 173, 235,
944 236, 174, -1, 234, 173, 239, 170, 174, -1, -1,
945 149, 4, -1, 86, 3, -1, 86, 4, -1, 196,
946 239, -1, 240, 238, 173, 180, 174, 181, -1, 240,
947 149, 3, 173, 185, 180, 174, 181, -1, 237, 181,
948 -1, 239, 170, -1, 233, 170, -1, 93, 3, -1,
949 93, 4, -1, 196, 243, -1, 244, 173, 180, 174,
950 181, -1, 60, -1, 126, -1, 114, -1, 82, -1,
951 40, -1, -1, 249, 248, -1, 259, 251, -1, 252,
952 259, 251, -1, -1, 252, -1, 248, 251, -1, 247,
953 251, -1, 246, 251, -1, 157, 249, 253, -1, 201,
954 253, -1, 254, -1, 224, -1, 171, 253, 172, -1,
955 254, 194, -1, 254, 171, 190, 172, -1, 253, -1,
956 255, 147, 253, -1, 253, -1, 253, 175, 213, -1,
957 113, -1, 138, -1, 109, -1, 130, 223, 173, 214,
958 174, -1, 144, -1, 4, -1, 225, -1, 207, -1,
959 57, 3, -1, 258, -1, 130, 3, -1, 261, -1,
960 137, 3, -1, 118, 171, 259, 172, -1, 136, 195,
961 250, 255, -1, 137, 223, 173, 217, 174, -1, 137,
962 223, 131, 171, 219, 172, 222, 173, 202, 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, 420,
972 421, 429, 431, 439, 446, 450, 452, 459, 467, 468,
973 471, 474, 475, 476, 480, 487, 495, 496, 499, 500,
974 504, 510, 511, 512, 515, 516, 519, 520, 521, 522,
975 523, 524, 525, 526, 527, 528, 529, 530, 531, 532,
976 533, 534, 535, 536, 537, 538, 539, 540, 541, 542,
977 543, 544, 545, 546, 547, 548, 549, 550, 551, 552,
978 553, 554, 555, 556, 557, 558, 559, 560, 561, 562,
979 563, 564, 565, 566, 567, 568, 569, 570, 571, 572,
980 576, 577, 578, 579, 580, 581, 582, 583, 584, 585,
981 586, 587, 588, 589, 590, 591, 592, 596, 597, 602,
982 603, 604, 605, 608, 609, 612, 616, 622, 623, 624,
983 627, 631, 640, 644, 649, 658, 659, 672, 673, 676,
984 677, 678, 679, 680, 681, 682, 683, 684, 685, 686,
985 687, 688, 689, 690, 691, 692, 693, 694, 695, 696,
986 697, 698, 699, 700, 701, 702, 703, 704, 705, 706,
987 707, 708, 709, 710, 711, 712, 713, 714, 715, 718,
988 719, 722, 728, 734, 735, 738, 743, 750, 751, 754,
989 755, 759, 760, 763, 771, 780, 786, 792, 793, 796,
990 797, 798, 801, 803, 806, 807, 808, 809, 810, 826,
991 827, 828, 829, 830, 831, 832, 835, 836, 839, 840,
992 841, 842, 843, 844, 845, 848, 849, 857, 867, 874,
993 875, 879, 882, 883, 886, 900, 901, 904, 905, 908,
994 918, 928, 929, 932, 933, 936, 949, 963, 976, 980,
995 981, 984, 985, 988, 993, 1001, 1002, 1003, 1007, 1011,
996 1014, 1015, 1018, 1019, 1023, 1024, 1028, 1029, 1030, 1034,
997 1036, 1037, 1041, 1042, 1043, 1044, 1051, 1052, 1056, 1057,
998 1061, 1062, 1063, 1066, 1078, 1079, 1080, 1081, 1082, 1083,
999 1084, 1085, 1086, 1087, 1090, 1096, 1103, 1121, 1122
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 "cppquote", "import_start", "import", "importlib", "libraryhdr",
1041 "library_start", "librarydef", "m_args", "no_args", "args", "arg",
1042 "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, 182,
1092 182, 183, 184, 185, 186, 187, 188, 189, 190, 190,
1093 191, 192, 192, 192, 193, 193, 194, 194, 195, 195,
1094 196, 197, 197, 197, 198, 198, 199, 199, 199, 199,
1095 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
1096 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
1097 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
1098 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
1099 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
1100 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
1101 199, 199, 199, 199, 199, 199, 199, 200, 200, 201,
1102 201, 201, 201, 202, 202, 203, 203, 204, 204, 204,
1103 205, 205, 206, 206, 207, 208, 208, 209, 209, 210,
1104 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
1105 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
1106 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
1107 210, 210, 210, 210, 210, 210, 210, 210, 210, 211,
1108 211, 212, 213, 214, 214, 215, 215, 216, 216, 217,
1109 217, 218, 218, 219, 220, 221, 221, 222, 222, 223,
1110 223, 223, 224, 224, 225, 225, 225, 225, 225, 225,
1111 225, 225, 225, 225, 225, 225, 226, 226, 227, 227,
1112 227, 227, 227, 227, 227, 228, 228, 229, 230, 231,
1113 231, 232, 233, 233, 234, 235, 235, 236, 236, 237,
1114 237, 238, 238, 239, 239, 240, 241, 241, 241, 242,
1115 242, 243, 243, 244, 245, 246, 246, 246, 247, 248,
1116 249, 249, 250, 250, 251, 251, 252, 252, 252, 253,
1117 253, 253, 254, 254, 254, 254, 255, 255, 256, 256,
1118 257, 257, 257, 258, 259, 259, 259, 259, 259, 259,
1119 259, 259, 259, 259, 260, 261, 261, 262, 262
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, 2,
1128 2, 4, 3, 3, 5, 2, 3, 4, 0, 1,
1129 1, 1, 3, 1, 3, 2, 3, 3, 0, 1,
1130 3, 1, 3, 4, 1, 3, 0, 1, 1, 1,
1131 1, 1, 1, 4, 4, 1, 1, 1, 1, 1,
1132 1, 4, 1, 1, 4, 1, 4, 4, 1, 1,
1133 4, 4, 4, 4, 4, 1, 4, 1, 4, 1,
1134 5, 1, 1, 4, 4, 1, 1, 1, 1, 1,
1135 1, 1, 1, 1, 4, 1, 1, 1, 1, 6,
1136 1, 1, 1, 1, 4, 1, 1, 1, 4, 4,
1137 4, 4, 1, 1, 4, 4, 1, 1, 1, 1,
1138 1, 1, 1, 0, 2, 4, 3, 0, 2, 1,
1139 1, 3, 3, 1, 5, 1, 3, 0, 1, 1,
1140 1, 1, 1, 1, 1, 1, 1, 1, 5, 3,
1141 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
1142 3, 3, 3, 3, 3, 3, 3, 2, 2, 2,
1143 2, 2, 2, 3, 3, 4, 4, 4, 3, 1,
1144 3, 1, 1, 0, 2, 4, 3, 2, 2, 0,
1145 2, 2, 1, 3, 3, 3, 2, 0, 1, 0,
1146 1, 1, 1, 1, 1, 1, 1, 2, 2, 1,
1147 1, 1, 1, 1, 1, 1, 0, 1, 1, 2,
1148 1, 2, 2, 1, 1, 2, 2, 2, 5, 0,
1149 2, 2, 2, 2, 2, 2, 3, 2, 3, 5,
1150 5, 0, 2, 2, 2, 2, 6, 8, 2, 2,
1151 2, 2, 2, 2, 5, 1, 1, 1, 1, 1,
1152 0, 2, 2, 3, 0, 1, 2, 2, 2, 3,
1153 2, 1, 1, 3, 2, 4, 1, 3, 1, 3,
1154 1, 1, 1, 5, 1, 1, 1, 1, 2, 1,
1155 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, 295, 223, 214, 234, 0, 269,
1164 0, 0, 222, 209, 224, 265, 220, 225, 226, 0,
1165 268, 228, 233, 0, 226, 267, 0, 226, 0, 221,
1166 230, 266, 209, 48, 209, 219, 294, 215, 56, 10,
1167 24, 11, 27, 11, 9, 0, 297, 0, 296, 216,
1168 0, 0, 7, 0, 0, 22, 0, 251, 5, 4,
1169 0, 8, 274, 274, 274, 0, 0, 299, 274, 0,
1170 301, 235, 236, 0, 242, 243, 298, 211, 0, 227,
1171 232, 0, 253, 254, 231, 0, 229, 217, 300, 0,
1172 0, 49, 302, 0, 218, 57, 58, 59, 60, 61,
1173 62, 0, 0, 65, 66, 67, 68, 69, 70, 0,
1174 72, 73, 0, 75, 0, 0, 78, 79, 0, 0,
1175 0, 0, 0, 85, 0, 87, 0, 89, 0, 91,
1176 92, 0, 0, 95, 96, 97, 98, 99, 100, 101,
1177 102, 103, 0, 105, 106, 107, 292, 108, 0, 110,
1178 290, 111, 112, 113, 0, 115, 116, 117, 0, 0,
1179 0, 291, 0, 122, 123, 0, 0, 0, 51, 126,
1180 0, 0, 0, 0, 0, 297, 237, 244, 255, 263,
1181 0, 299, 301, 25, 26, 6, 239, 260, 0, 23,
1182 258, 259, 0, 0, 20, 278, 275, 277, 276, 212,
1183 213, 129, 130, 131, 132, 270, 0, 0, 282, 288,
1184 281, 206, 274, 28, 272, 29, 30, 0, 137, 32,
1185 0, 193, 0, 0, 199, 0, 0, 0, 0, 0,
1186 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1187 147, 0, 0, 147, 0, 0, 0, 0, 0, 0,
1188 56, 50, 33, 0, 17, 18, 19, 0, 15, 13,
1189 12, 16, 22, 35, 261, 262, 36, 205, 48, 0,
1190 48, 0, 0, 252, 20, 0, 0, 0, 280, 0,
1191 147, 38, 284, 273, 31, 0, 139, 140, 143, 303,
1192 48, 286, 304, 48, 48, 0, 157, 149, 150, 151,
1193 155, 156, 152, 153, 0, 154, 0, 0, 0, 0,
1194 0, 0, 0, 191, 0, 189, 192, 0, 0, 54,
1195 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1196 0, 0, 145, 148, 0, 0, 0, 0, 0, 0,
1197 128, 127, 0, 307, 0, 0, 52, 56, 0, 14,
1198 37, 22, 0, 240, 245, 0, 0, 0, 48, 0,
1199 0, 0, 22, 21, 0, 271, 279, 283, 289, 0,
1200 0, 294, 0, 43, 39, 41, 0, 0, 144, 138,
1201 0, 293, 0, 194, 0, 0, 305, 49, 200, 0,
1202 63, 0, 181, 180, 179, 182, 177, 178, 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, 0, 64, 71, 74, 0, 76, 77, 80,
1206 81, 82, 83, 84, 86, 88, 0, 94, 147, 93,
1207 104, 0, 114, 118, 119, 120, 121, 0, 124, 125,
1208 53, 0, 238, 241, 247, 0, 246, 249, 0, 0,
1209 250, 20, 22, 264, 47, 46, 285, 0, 0, 45,
1210 141, 142, 0, 301, 287, 207, 198, 197, 0, 188,
1211 0, 170, 171, 183, 164, 165, 168, 169, 159, 160,
1212 0, 161, 162, 163, 167, 166, 173, 172, 175, 176,
1213 174, 184, 0, 190, 55, 90, 146, 0, 308, 22,
1214 203, 0, 248, 0, 256, 42, 44, 0, 196, 0,
1215 208, 186, 185, 0, 187, 109, 34, 204, 22, 195,
1216 133, 158, 257, 0, 0, 0, 306, 134, 0, 48,
1217 48, 202, 136, 0, 135, 201
1220 /* YYDEFGOTO[NTERM-NUM]. */
1221 static const short int yydefgoto
[] =
1223 -1, 1, 2, 170, 275, 190, 363, 40, 41, 42,
1224 255, 174, 43, 256, 372, 373, 374, 375, 282, 356,
1225 91, 167, 320, 168, 342, 207, 533, 537, 285, 286,
1226 287, 175, 331, 332, 313, 314, 315, 317, 290, 383,
1227 388, 294, 542, 543, 459, 47, 519, 78, 208, 48,
1228 80, 49, 257, 51, 258, 268, 353, 53, 54, 270,
1229 358, 55, 193, 56, 57, 259, 260, 179, 60, 261,
1230 62, 63, 64, 276, 65, 195, 66, 209, 210, 292,
1231 211, 169, 181, 68, 69, 182, 344
1234 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1236 #define YYPACT_NINF -267
1237 static const short int yypact
[] =
1239 -267, 42, 1020, -267, -267, -267, -267, -267, 47, -267,
1240 -94, 86, -267, 144, -267, -267, -267, -267, 40, 137,
1241 -267, -267, -267, 150, 40, -267, -20, 40, 199, -267,
1242 -267, -267, 161, -7, 194, 199, -267, -267, 1869, -267,
1243 -267, -267, -267, -267, -267, 1631, -14, 4, -267, -267,
1244 10, -6, -267, 12, 21, 38, 43, 73, -267, -267,
1245 59, -267, -3, -3, -3, 52, 1744, 55, -3, 56,
1246 63, -267, -267, 226, -267, -267, 65, -267, 66, -267,
1247 -267, 70, -267, -267, -267, 1744, -267, -267, 65, 69,
1248 1674, -267, -110, -108, -267, -267, -267, -267, -267, -267,
1249 -267, 77, 78, -267, -267, -267, -267, -267, -267, 79,
1250 -267, -267, 81, -267, 82, 83, -267, -267, 87, 89,
1251 91, 93, 98, -267, 99, -267, 101, -267, 110, -267,
1252 -267, 115, 116, -267, -267, -267, -267, -267, -267, -267,
1253 -267, -267, 117, -267, -267, -267, -267, -267, 118, -267,
1254 -267, -267, -267, -267, 120, -267, -267, -267, 129, 130,
1255 131, -267, 138, -267, -267, 139, 140, -107, -267, -267,
1256 925, 403, 233, 203, 95, -267, -267, -267, -267, -267,
1257 52, -267, -267, -267, -267, -267, -267, -267, -12, -267,
1258 -267, -267, 208, 135, -267, -267, -267, -267, -267, -267,
1259 -267, -267, -267, -267, -267, -267, 52, 52, -267, 84,
1260 -42, -267, -3, -267, -267, -267, -267, 113, 212, -267,
1261 141, -267, 52, 151, -267, 212, 749, 749, 311, 313,
1262 749, 749, 316, 317, 749, 318, 749, 749, 262, 749,
1263 749, -79, 749, 749, 749, 1744, 1744, 97, 323, 1744,
1264 1869, 165, -267, 158, -267, -267, -267, 164, -267, -267,
1265 -267, -267, 38, -267, -267, -267, -267, -267, -114, 186,
1266 -65, 166, 174, -267, -267, 13, 32, 167, -267, 749,
1267 789, 1095, -267, -267, -267, 163, 201, -267, 175, -267,
1268 -82, -267, 202, -7, -46, 179, -267, -267, -267, -267,
1269 -267, -267, -267, -267, 181, -267, 749, 749, 749, 749,
1270 749, 749, 688, 1390, -103, -267, 1390, 185, 188, -267,
1271 -66, 190, 192, 193, 195, 196, 197, 198, 1229, 355,
1272 200, -64, -267, 1390, 204, 224, -63, 1272, 205, 206,
1273 -267, -267, 207, 213, 209, 211, -267, 1869, 365, -267,
1274 -267, 38, -22, -267, -267, 225, 1674, 214, -38, 215,
1275 297, 498, 38, -267, 1674, -267, -267, -267, -267, 444,
1276 216, -59, 237, -267, 239, -267, 1674, 52, -267, 212,
1277 749, -267, 1674, -267, 52, 238, -267, 241, -267, 242,
1278 -267, 1744, 25, 25, 25, 25, 25, 25, 1295, 243,
1279 749, 749, 410, 749, 749, 749, 749, 749, 749, 749,
1280 749, 749, 749, 749, 749, 749, 749, 749, 749, 749,
1281 413, 749, 749, -267, -267, -267, 409, -267, -267, -267,
1282 -267, -267, -267, -267, -267, -267, 246, -267, 749, -267,
1283 -267, 749, -267, -267, -267, -267, -267, 414, -267, -267,
1284 -267, 248, -267, -267, -267, 52, -267, -267, 1674, 251,
1285 -267, -267, 38, -267, -267, -267, -267, 1138, 52, -267,
1286 -267, -267, 52, 252, -267, 212, -267, -267, 254, -267,
1287 749, 148, 148, -267, 187, 187, 88, 88, 1497, 1420,
1288 1340, 1443, 1466, 864, 88, 88, 61, 61, 25, 25,
1289 25, -267, 1318, -267, -267, -267, -267, 255, -267, 38,
1290 -267, 52, -267, 593, -267, -267, -267, -102, -267, 256,
1291 -267, -267, 25, 749, -267, -267, -267, -267, 38, -267,
1292 -267, 1390, -267, -8, 749, 275, -267, -267, 279, -28,
1293 -28, -267, -267, 260, -267, -267
1296 /* YYPGOTO[NTERM-NUM]. */
1297 static const short int yypgoto
[] =
1299 -267, -267, -267, 389, -266, -252, 7, -267, -267, 74,
1300 -267, -267, -267, 433, -267, -267, -267, -31, -267, -27,
1301 -2, -267, -267, -235, -267, -267, -267, -267, -267, -267,
1302 58, 2, 219, -247, -13, -267, -220, -199, -267, -267,
1303 -267, -267, -99, -174, -267, -267, -267, 112, -193, -267,
1304 114, 90, 16, -267, 436, -267, -267, 397, -267, -267,
1305 -267, -267, -267, -25, -267, 442, 1, -267, -267, 443,
1306 -267, -267, 170, -267, -44, -16, 53, -194, -267, -17,
1307 277, 217, 5, -61, -267, 0, -267
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 -211
1315 static const short int yytable
[] =
1317 45, 180, 70, 59, 46, 212, 90, 67, 361, 39,
1318 350, 322, 277, 278, 325, 346, 327, 4, 50, 330,
1319 178, -210, 335, 223, 220, 288, 534, 355, 291, 11,
1320 146, 321, 295, 370, 150, 199, 200, 9, 535, 402,
1321 250, 5, 3, 6, 422, 384, 222, 197, 198, 7,
1322 71, 72, 214, 9, 38, 199, 200, 15, 10, 161,
1323 351, 176, 251, -210, 23, 224, 12, 201, 529, 423,
1324 13, 14, 9, 15, 23, 402, 16, 73, 17, 20,
1325 368, 426, 366, 438, 438, 18, 38, 201, -40, 74,
1326 75, 19, 381, 269, 202, 20, 357, 21, 22, 452,
1327 400, 401, 402, 38, 24, 340, 427, 341, 439, 442,
1328 463, 25, 450, -40, 202, 196, 196, 196, 87, 385,
1329 389, 196, 38, 31, 79, 94, 280, 25, 386, 281,
1330 38, 26, 27, 28, 29, 203, 457, 30, 84, 31,
1331 38, 86, 541, 32, 89, 81, 93, 76, 77, 33,
1332 34, 85, 35, 82, 83, 203, 183, 36, 37, 204,
1333 471, 38, 402, 271, 88, 77, 536, 186, 45, 45,
1334 70, 70, 46, 46, 184, 67, 67, 254, 254, 204,
1335 185, 38, 187, 469, 338, 339, 288, 362, 345, 205,
1336 474, 506, 420, 421, 188, 513, 283, 92, 77, 400,
1337 401, 402, 503, 206, 405, 406, 264, 265, 189, 205,
1338 514, 272, 273, 191, 316, 199, 200, 316, 417, 418,
1339 419, 507, 192, 206, 328, 213, 215, 333, 420, 421,
1340 333, 337, 194, 216, 217, 7, 263, 377, -210, 218,
1341 219, 352, 221, 415, 416, 417, 418, 419, 225, 226,
1342 227, 399, 228, 229, 230, 420, 421, 526, 231, 279,
1343 232, 510, 233, 382, 234, 196, 316, 333, 266, 235,
1344 236, 18, 237, 364, 516, 70, 532, 46, 291, 376,
1345 67, 238, 520, 21, 22, 284, 239, 240, 241, 242,
1346 24, 243, 387, 392, 393, 394, 395, 396, 397, 398,
1347 244, 245, 246, 415, 416, 417, 418, 419, 274, 247,
1348 248, 249, 455, 289, 538, 420, 421, 527, 27, 318,
1349 180, 319, 293, 30, 323, 324, 326, 329, 343, 348,
1350 478, 458, 468, 347, 349, 354, 359, 378, 472, 367,
1351 413, 414, 415, 416, 417, 418, 419, 360, 379, 384,
1352 380, 390, 391, 453, 420, 421, 395, 424, 436, 364,
1353 425, 70, 428, 46, 429, 430, 67, 431, 432, 433,
1354 434, 441, 437, 451, 454, 19, 440, 444, 445, 446,
1355 447, 448, 473, 449, 456, 465, 467, 481, 482, 460,
1356 484, 485, 486, 487, 488, 489, 490, 491, 492, 493,
1357 494, 495, 496, 497, 498, 499, 500, 4, 502, 466,
1358 475, 476, 477, 483, 511, 480, 501, 504, 505, 508,
1359 509, 512, 518, 377, 539, 333, 521, 525, 540, 530,
1360 545, 5, 171, 6, 461, 44, 515, 470, 52, 7,
1361 8, 544, 177, 9, 58, 61, 365, 296, 10, 297,
1362 298, 299, 300, 301, 11, 517, 12, 267, 334, 0,
1363 13, 14, 336, 15, 0, 376, 16, 522, 17, 0,
1364 0, 0, 0, 0, 0, 18, 0, 0, 0, 0,
1365 0, 19, 253, 0, 0, 20, 0, 21, 22, 23,
1366 0, 0, 0, 0, 24, 0, 0, 0, 0, 0,
1367 0, 0, 4, 0, 0, 302, 0, 0, 0, 0,
1368 531, 364, 0, 70, 0, 46, 0, 25, 67, 0,
1369 0, 26, 27, 28, 29, 0, 5, 30, 6, 31,
1370 0, 0, 0, 32, 7, 0, 0, 0, 9, 33,
1371 34, 303, 35, 10, 0, 0, 0, 36, 37, 0,
1372 0, 12, 0, 0, 0, 13, 14, 0, 15, 0,
1373 0, 16, 0, 17, 0, 0, 0, 304, 0, 0,
1374 18, 38, 0, 0, 0, 0, 19, 262, 0, 305,
1375 20, 0, 21, 22, 0, 0, 0, 0, 0, 24,
1376 0, 0, 0, 0, 0, 0, 306, 4, 0, 307,
1377 308, 309, 0, 0, 310, 311, 0, 0, 0, 0,
1378 0, 0, 25, 464, 0, 312, 26, 27, 28, 29,
1379 0, 5, 30, 6, 31, 0, 0, 0, 32, 7,
1380 0, 0, 0, 9, 33, 34, 0, 35, 10, 0,
1381 0, 0, 36, 37, 0, 0, 12, 0, 0, 0,
1382 13, 14, 0, 15, 0, 0, 16, 0, 17, 0,
1383 0, 0, 0, 0, 0, 18, 38, 0, 0, 0,
1384 0, 19, 462, 0, 0, 20, 0, 21, 22, 0,
1385 0, 0, 0, 0, 24, 0, 0, 0, 0, 0,
1386 0, 296, 4, 297, 298, 299, 300, 301, 0, 0,
1387 0, 0, 0, 0, 0, 0, 0, 25, 0, 0,
1388 0, 26, 27, 28, 29, 0, 5, 30, 6, 31,
1389 0, 0, 0, 32, 7, 0, 0, 0, 0, 33,
1390 34, 0, 35, 0, 0, 0, 0, 36, 37, 0,
1391 0, 12, 0, 0, 0, 13, 14, 0, 0, 302,
1392 0, 16, 296, 17, 297, 298, 299, 300, 301, 0,
1393 18, 38, 0, 0, 0, 0, 0, 528, 0, 0,
1394 0, 0, 21, 22, 0, 0, 0, 0, 0, 24,
1395 0, 0, 0, 0, 0, 303, 0, 0, 0, 0,
1396 0, 0, 296, 0, 297, 298, 299, 300, 301, 0,
1397 0, 0, 0, 0, 0, 0, 26, 27, 28, 29,
1398 302, 304, 30, 0, 0, 0, 0, 0, 32, 0,
1399 0, 0, 0, 305, 0, 34, 0, 35, 0, 0,
1400 0, 0, 36, 37, 0, 0, 0, 0, 0, 0,
1401 306, 0, 0, 307, 308, 309, 303, 0, 310, 311,
1402 302, 0, 0, 0, 0, 0, 0, 0, 0, 312,
1403 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1404 0, 0, 304, 0, 0, 0, 400, 401, 402, 403,
1405 404, 405, 406, 0, 305, 0, 303, 0, 0, 0,
1406 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1407 0, 306, 0, 0, 307, 308, 309, 0, 0, 310,
1408 311, 0, 304, 0, 0, 0, 0, 0, 0, 0,
1409 312, 0, 0, 0, 305, 0, 0, 0, 0, 4,
1410 0, 0, 0, 0, 0, 0, 252, 0, 0, 0,
1411 0, 306, 0, 0, 307, 308, 369, 0, 0, 310,
1412 311, 0, 0, 5, 0, 6, 0, 0, 0, 0,
1413 312, 7, 8, 0, 0, 9, 0, 0, 0, 0,
1414 10, 0, 0, 0, 0, 0, 11, 0, 12, 0,
1415 0, 0, 13, 14, 0, 15, 0, 0, 16, 0,
1416 17, 0, 0, 0, 0, 0, 0, 18, 0, 0,
1417 0, 0, 0, 19, 253, 0, 0, 20, 0, 21,
1418 22, 23, 0, 0, 0, 0, 24, 413, 414, 415,
1419 416, 417, 418, 419, 4, 0, 0, 0, 0, 0,
1420 0, 420, 421, 0, 0, 0, 0, 0, 0, 25,
1421 0, 0, 0, 26, 27, 28, 29, 0, 5, 30,
1422 6, 31, 0, 0, 0, 32, 7, 8, 0, 0,
1423 9, 33, 34, 0, 35, 10, 0, 0, 0, 36,
1424 37, 11, 0, 12, 0, 0, 0, 13, 14, 0,
1425 15, 0, 0, 16, 0, 17, 0, 0, 0, 0,
1426 0, 0, 18, 38, 0, 0, 0, 0, 19, 4,
1427 0, 0, 20, 0, 21, 22, 23, 0, 0, 0,
1428 0, 24, 0, 0, 0, 0, 0, 0, 0, 0,
1429 0, 0, 0, 5, 0, 6, 0, 0, 0, 0,
1430 0, 7, 0, 0, 25, 9, 0, 0, 26, 27,
1431 28, 29, 4, 0, 30, 0, 31, 0, 12, 0,
1432 32, 0, 13, 14, 0, 15, 33, 34, 16, 35,
1433 17, 0, 0, 0, 36, 37, 5, 18, 6, 0,
1434 0, 0, 0, 0, 7, 0, 0, 20, 9, 21,
1435 22, 0, 0, 0, 0, 0, 24, 0, 38, 0,
1436 0, 12, 0, 0, 0, 13, 14, 0, 15, 0,
1437 0, 16, 0, 17, 0, 0, 0, 0, 0, 25,
1438 18, 0, 0, 26, 27, 28, 29, 0, 0, 30,
1439 20, 31, 21, 22, 0, 32, 0, 0, 0, 24,
1440 0, 0, 34, 0, 35, 0, 0, 0, 0, 371,
1441 37, 400, 401, 402, 403, 404, 405, 406, 407, 408,
1442 0, 0, 25, 0, 0, 0, 26, 27, 28, 29,
1443 0, 0, 30, 38, 31, 0, 0, 0, 32, 0,
1444 0, 0, 0, 0, 0, 34, 0, 35, 0, 0,
1445 0, 0, 36, 37, 400, 401, 402, 403, 404, 405,
1446 406, 407, 408, 0, 0, 0, 0, 0, 0, 0,
1447 0, 0, 0, 0, 0, 0, 38, 400, 401, 402,
1448 403, 404, 405, 406, 407, 408, 0, 0, 0, 0,
1449 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1450 400, 401, 402, 403, 404, 405, 406, 407, 408, 0,
1451 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1452 0, 0, 400, 401, 402, 403, 404, 405, 406, 407,
1453 408, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1454 0, 0, 0, 0, 0, 0, 0, 409, 0, 410,
1455 411, 412, 413, 414, 415, 416, 417, 418, 419, 0,
1456 0, 0, 0, 0, 0, 0, 420, 421, 0, 0,
1457 0, 435, 400, 401, 402, 403, 404, 405, 406, 407,
1458 408, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1459 409, 0, 410, 411, 412, 413, 414, 415, 416, 417,
1460 418, 419, 400, 401, 402, 403, 404, 405, 406, 420,
1461 421, 0, 0, 409, 443, 410, 411, 412, 413, 414,
1462 415, 416, 417, 418, 419, 400, 401, 402, 403, 404,
1463 405, 406, 420, 421, 0, 0, 409, 479, 410, 411,
1464 412, 413, 414, 415, 416, 417, 418, 419, 400, 401,
1465 402, 403, 404, 405, 406, 420, 421, 524, 409, 523,
1466 410, 411, 412, 413, 414, 415, 416, 417, 418, 419,
1467 0, 0, 0, 0, 0, 0, 0, 420, 421, 400,
1468 401, 402, 403, 404, 405, 406, 0, 408, 0, 0,
1469 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1470 0, 0, 0, 0, 0, 0, 0, 0, 409, 0,
1471 410, 411, 412, 413, 414, 415, 416, 417, 418, 419,
1472 0, 0, 0, 0, 0, 0, 0, 420, 421, 0,
1473 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1474 410, 411, 412, 413, 414, 415, 416, 417, 418, 419,
1475 0, 0, 0, 0, 0, 0, 0, 420, 421, 0,
1476 0, 0, 0, 0, 411, 412, 413, 414, 415, 416,
1477 417, 418, 419, 0, 0, 0, 0, 0, 0, 0,
1478 420, 421, 0, 0, 0, 0, 0, 0, 412, 413,
1479 414, 415, 416, 417, 418, 419, 0, 0, 0, 0,
1480 0, 0, 0, 420, 421, 4, 0, 0, 0, 0,
1481 0, 0, 0, 0, 0, 0, 0, 410, 411, 412,
1482 413, 414, 415, 416, 417, 418, 419, 0, 0, 5,
1483 0, 6, 0, 0, 420, 421, 0, 7, 8, 0,
1484 0, 9, 0, 0, 0, 0, 0, 0, 4, 0,
1485 0, 0, 11, 0, 12, 0, 0, 0, 13, 14,
1486 0, 15, 0, 0, 16, 0, 17, 0, 0, 0,
1487 0, 0, 5, 18, 6, 0, 0, 0, 0, 0,
1488 7, 0, 0, 20, 9, 21, 22, 23, 0, 0,
1489 172, 0, 24, 0, 173, 0, 0, 12, 0, 0,
1490 0, 13, 14, 0, 15, 0, 0, 16, 0, 17,
1491 0, 0, 0, 0, 0, 25, 18, 0, 4, 26,
1492 27, 28, 29, 0, 0, 30, 20, 31, 21, 22,
1493 0, 32, 0, 0, 0, 24, 0, 0, 34, 0,
1494 35, 0, 5, 0, 6, 36, 37, 0, 0, 0,
1495 7, 0, 0, 0, 0, 0, 0, 0, 25, 0,
1496 0, 0, 26, 27, 28, 29, 0, 12, 30, 0,
1497 31, 13, 14, 0, 32, 0, 0, 16, 0, 17,
1498 0, 34, 0, 35, 0, 0, 18, 0, 36, 37,
1499 0, 0, 0, 0, 0, 0, 0, 0, 21, 22,
1500 0, 0, 0, 0, 0, 24, 0, 0, 0, 0,
1501 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1502 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1503 0, 0, 26, 27, 28, 29, 0, 0, 30, 0,
1504 0, 0, 0, 0, 32, 0, 0, 0, 0, 0,
1505 0, 34, 0, 35, 0, 0, 0, 0, 36, 37,
1506 95, 0, 96, 97, 0, 98, 99, 0, 100, 0,
1507 0, 101, 0, 102, 0, 0, 0, 0, 0, 0,
1508 103, 104, 105, 106, 0, 107, 108, 109, 110, 111,
1509 0, 112, 0, 113, 114, 115, 0, 0, 116, 0,
1510 0, 0, 0, 117, 0, 118, 119, 120, 121, 122,
1511 123, 0, 124, 125, 126, 127, 128, 0, 0, 129,
1512 0, 0, 130, 0, 0, 0, 131, 132, 0, 133,
1513 0, 0, 0, 134, 135, 136, 0, 137, 138, 139,
1514 140, 141, 0, 142, 0, 143, 144, 145, 146, 147,
1515 148, 149, 150, 0, 151, 152, 153, 0, 0, 0,
1516 0, 154, 0, 0, 155, 0, 0, 156, 157, 0,
1517 0, 158, 159, 160, 0, 0, 0, 161, 0, 162,
1518 163, 164, 165, 0, 0, 166
1521 static const short int yycheck
[] =
1523 2, 45, 2, 2, 2, 66, 33, 2, 274, 2,
1524 262, 231, 206, 207, 234, 250, 236, 4, 2, 239,
1525 45, 131, 242, 131, 85, 218, 34, 92, 222, 51,
1526 109, 230, 225, 280, 113, 3, 4, 40, 46, 14,
1527 147, 28, 0, 30, 147, 147, 90, 63, 64, 36,
1528 3, 4, 68, 40, 168, 3, 4, 60, 45, 138,
1529 174, 45, 169, 173, 86, 173, 53, 35, 170, 172,
1530 57, 58, 40, 60, 86, 14, 63, 171, 65, 82,
1531 279, 147, 276, 147, 147, 72, 168, 35, 147, 3,
1532 4, 78, 174, 105, 62, 82, 270, 84, 85, 351,
1533 12, 13, 14, 168, 91, 8, 172, 10, 172, 172,
1534 362, 114, 347, 172, 62, 62, 63, 64, 28, 293,
1535 294, 68, 168, 126, 84, 35, 168, 114, 174, 171,
1536 168, 118, 119, 120, 121, 103, 174, 124, 24, 126,
1537 168, 27, 170, 130, 32, 8, 34, 3, 4, 136,
1538 137, 171, 139, 3, 4, 103, 170, 144, 145, 127,
1539 380, 168, 14, 188, 3, 4, 174, 173, 170, 171,
1540 170, 171, 170, 171, 170, 170, 171, 170, 171, 127,
1541 170, 168, 170, 377, 245, 246, 379, 174, 249, 157,
1542 384, 438, 167, 168, 173, 461, 212, 3, 4, 12,
1543 13, 14, 422, 171, 17, 18, 3, 4, 170, 157,
1544 462, 3, 4, 170, 227, 3, 4, 230, 157, 158,
1545 159, 441, 149, 171, 237, 170, 170, 240, 167, 168,
1546 243, 244, 173, 170, 8, 36, 3, 281, 173, 173,
1547 170, 268, 173, 155, 156, 157, 158, 159, 171, 171,
1548 171, 312, 171, 171, 171, 167, 168, 509, 171, 175,
1549 171, 455, 171, 290, 171, 212, 279, 280, 173, 171,
1550 171, 72, 171, 275, 468, 275, 528, 275, 472, 281,
1551 275, 171, 475, 84, 85, 172, 171, 171, 171, 171,
1552 91, 171, 294, 306, 307, 308, 309, 310, 311, 312,
1553 171, 171, 171, 155, 156, 157, 158, 159, 173, 171,
1554 171, 171, 356, 172, 534, 167, 168, 511, 119, 8,
1555 364, 8, 171, 124, 8, 8, 8, 65, 5, 171,
1556 391, 358, 376, 168, 170, 149, 170, 174, 382, 172,
1557 153, 154, 155, 156, 157, 158, 159, 173, 147, 147,
1558 175, 172, 171, 352, 167, 168, 369, 172, 3, 361,
1559 172, 361, 172, 361, 172, 172, 361, 172, 172, 172,
1560 172, 147, 172, 8, 149, 78, 172, 172, 172, 172,
1561 167, 172, 382, 172, 170, 169, 147, 400, 401, 174,
1562 403, 404, 405, 406, 407, 408, 409, 410, 411, 412,
1563 413, 414, 415, 416, 417, 418, 419, 4, 421, 172,
1564 172, 170, 170, 3, 458, 172, 3, 8, 172, 5,
1565 172, 170, 170, 467, 149, 438, 172, 172, 149, 173,
1566 170, 28, 43, 30, 360, 2, 467, 379, 2, 36,
1567 37, 540, 45, 40, 2, 2, 276, 3, 45, 5,
1568 6, 7, 8, 9, 51, 472, 53, 180, 241, -1,
1569 57, 58, 243, 60, -1, 467, 63, 480, 65, -1,
1570 -1, -1, -1, -1, -1, 72, -1, -1, -1, -1,
1571 -1, 78, 79, -1, -1, 82, -1, 84, 85, 86,
1572 -1, -1, -1, -1, 91, -1, -1, -1, -1, -1,
1573 -1, -1, 4, -1, -1, 61, -1, -1, -1, -1,
1574 523, 513, -1, 513, -1, 513, -1, 114, 513, -1,
1575 -1, 118, 119, 120, 121, -1, 28, 124, 30, 126,
1576 -1, -1, -1, 130, 36, -1, -1, -1, 40, 136,
1577 137, 97, 139, 45, -1, -1, -1, 144, 145, -1,
1578 -1, 53, -1, -1, -1, 57, 58, -1, 60, -1,
1579 -1, 63, -1, 65, -1, -1, -1, 123, -1, -1,
1580 72, 168, -1, -1, -1, -1, 78, 174, -1, 135,
1581 82, -1, 84, 85, -1, -1, -1, -1, -1, 91,
1582 -1, -1, -1, -1, -1, -1, 152, 4, -1, 155,
1583 156, 157, -1, -1, 160, 161, -1, -1, -1, -1,
1584 -1, -1, 114, 169, -1, 171, 118, 119, 120, 121,
1585 -1, 28, 124, 30, 126, -1, -1, -1, 130, 36,
1586 -1, -1, -1, 40, 136, 137, -1, 139, 45, -1,
1587 -1, -1, 144, 145, -1, -1, 53, -1, -1, -1,
1588 57, 58, -1, 60, -1, -1, 63, -1, 65, -1,
1589 -1, -1, -1, -1, -1, 72, 168, -1, -1, -1,
1590 -1, 78, 174, -1, -1, 82, -1, 84, 85, -1,
1591 -1, -1, -1, -1, 91, -1, -1, -1, -1, -1,
1592 -1, 3, 4, 5, 6, 7, 8, 9, -1, -1,
1593 -1, -1, -1, -1, -1, -1, -1, 114, -1, -1,
1594 -1, 118, 119, 120, 121, -1, 28, 124, 30, 126,
1595 -1, -1, -1, 130, 36, -1, -1, -1, -1, 136,
1596 137, -1, 139, -1, -1, -1, -1, 144, 145, -1,
1597 -1, 53, -1, -1, -1, 57, 58, -1, -1, 61,
1598 -1, 63, 3, 65, 5, 6, 7, 8, 9, -1,
1599 72, 168, -1, -1, -1, -1, -1, 174, -1, -1,
1600 -1, -1, 84, 85, -1, -1, -1, -1, -1, 91,
1601 -1, -1, -1, -1, -1, 97, -1, -1, -1, -1,
1602 -1, -1, 3, -1, 5, 6, 7, 8, 9, -1,
1603 -1, -1, -1, -1, -1, -1, 118, 119, 120, 121,
1604 61, 123, 124, -1, -1, -1, -1, -1, 130, -1,
1605 -1, -1, -1, 135, -1, 137, -1, 139, -1, -1,
1606 -1, -1, 144, 145, -1, -1, -1, -1, -1, -1,
1607 152, -1, -1, 155, 156, 157, 97, -1, 160, 161,
1608 61, -1, -1, -1, -1, -1, -1, -1, -1, 171,
1609 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1610 -1, -1, 123, -1, -1, -1, 12, 13, 14, 15,
1611 16, 17, 18, -1, 135, -1, 97, -1, -1, -1,
1612 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1613 -1, 152, -1, -1, 155, 156, 157, -1, -1, 160,
1614 161, -1, 123, -1, -1, -1, -1, -1, -1, -1,
1615 171, -1, -1, -1, 135, -1, -1, -1, -1, 4,
1616 -1, -1, -1, -1, -1, -1, 11, -1, -1, -1,
1617 -1, 152, -1, -1, 155, 156, 157, -1, -1, 160,
1618 161, -1, -1, 28, -1, 30, -1, -1, -1, -1,
1619 171, 36, 37, -1, -1, 40, -1, -1, -1, -1,
1620 45, -1, -1, -1, -1, -1, 51, -1, 53, -1,
1621 -1, -1, 57, 58, -1, 60, -1, -1, 63, -1,
1622 65, -1, -1, -1, -1, -1, -1, 72, -1, -1,
1623 -1, -1, -1, 78, 79, -1, -1, 82, -1, 84,
1624 85, 86, -1, -1, -1, -1, 91, 153, 154, 155,
1625 156, 157, 158, 159, 4, -1, -1, -1, -1, -1,
1626 -1, 167, 168, -1, -1, -1, -1, -1, -1, 114,
1627 -1, -1, -1, 118, 119, 120, 121, -1, 28, 124,
1628 30, 126, -1, -1, -1, 130, 36, 37, -1, -1,
1629 40, 136, 137, -1, 139, 45, -1, -1, -1, 144,
1630 145, 51, -1, 53, -1, -1, -1, 57, 58, -1,
1631 60, -1, -1, 63, -1, 65, -1, -1, -1, -1,
1632 -1, -1, 72, 168, -1, -1, -1, -1, 78, 4,
1633 -1, -1, 82, -1, 84, 85, 86, -1, -1, -1,
1634 -1, 91, -1, -1, -1, -1, -1, -1, -1, -1,
1635 -1, -1, -1, 28, -1, 30, -1, -1, -1, -1,
1636 -1, 36, -1, -1, 114, 40, -1, -1, 118, 119,
1637 120, 121, 4, -1, 124, -1, 126, -1, 53, -1,
1638 130, -1, 57, 58, -1, 60, 136, 137, 63, 139,
1639 65, -1, -1, -1, 144, 145, 28, 72, 30, -1,
1640 -1, -1, -1, -1, 36, -1, -1, 82, 40, 84,
1641 85, -1, -1, -1, -1, -1, 91, -1, 168, -1,
1642 -1, 53, -1, -1, -1, 57, 58, -1, 60, -1,
1643 -1, 63, -1, 65, -1, -1, -1, -1, -1, 114,
1644 72, -1, -1, 118, 119, 120, 121, -1, -1, 124,
1645 82, 126, 84, 85, -1, 130, -1, -1, -1, 91,
1646 -1, -1, 137, -1, 139, -1, -1, -1, -1, 144,
1647 145, 12, 13, 14, 15, 16, 17, 18, 19, 20,
1648 -1, -1, 114, -1, -1, -1, 118, 119, 120, 121,
1649 -1, -1, 124, 168, 126, -1, -1, -1, 130, -1,
1650 -1, -1, -1, -1, -1, 137, -1, 139, -1, -1,
1651 -1, -1, 144, 145, 12, 13, 14, 15, 16, 17,
1652 18, 19, 20, -1, -1, -1, -1, -1, -1, -1,
1653 -1, -1, -1, -1, -1, -1, 168, 12, 13, 14,
1654 15, 16, 17, 18, 19, 20, -1, -1, -1, -1,
1655 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1656 12, 13, 14, 15, 16, 17, 18, 19, 20, -1,
1657 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1658 -1, -1, 12, 13, 14, 15, 16, 17, 18, 19,
1659 20, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1660 -1, -1, -1, -1, -1, -1, -1, 148, -1, 150,
1661 151, 152, 153, 154, 155, 156, 157, 158, 159, -1,
1662 -1, -1, -1, -1, -1, -1, 167, 168, -1, -1,
1663 -1, 172, 12, 13, 14, 15, 16, 17, 18, 19,
1664 20, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1665 148, -1, 150, 151, 152, 153, 154, 155, 156, 157,
1666 158, 159, 12, 13, 14, 15, 16, 17, 18, 167,
1667 168, -1, -1, 148, 172, 150, 151, 152, 153, 154,
1668 155, 156, 157, 158, 159, 12, 13, 14, 15, 16,
1669 17, 18, 167, 168, -1, -1, 148, 172, 150, 151,
1670 152, 153, 154, 155, 156, 157, 158, 159, 12, 13,
1671 14, 15, 16, 17, 18, 167, 168, 169, 148, 149,
1672 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
1673 -1, -1, -1, -1, -1, -1, -1, 167, 168, 12,
1674 13, 14, 15, 16, 17, 18, -1, 20, -1, -1,
1675 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1676 -1, -1, -1, -1, -1, -1, -1, -1, 148, -1,
1677 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
1678 -1, -1, -1, -1, -1, -1, -1, 167, 168, -1,
1679 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1680 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
1681 -1, -1, -1, -1, -1, -1, -1, 167, 168, -1,
1682 -1, -1, -1, -1, 151, 152, 153, 154, 155, 156,
1683 157, 158, 159, -1, -1, -1, -1, -1, -1, -1,
1684 167, 168, -1, -1, -1, -1, -1, -1, 152, 153,
1685 154, 155, 156, 157, 158, 159, -1, -1, -1, -1,
1686 -1, -1, -1, 167, 168, 4, -1, -1, -1, -1,
1687 -1, -1, -1, -1, -1, -1, -1, 150, 151, 152,
1688 153, 154, 155, 156, 157, 158, 159, -1, -1, 28,
1689 -1, 30, -1, -1, 167, 168, -1, 36, 37, -1,
1690 -1, 40, -1, -1, -1, -1, -1, -1, 4, -1,
1691 -1, -1, 51, -1, 53, -1, -1, -1, 57, 58,
1692 -1, 60, -1, -1, 63, -1, 65, -1, -1, -1,
1693 -1, -1, 28, 72, 30, -1, -1, -1, -1, -1,
1694 36, -1, -1, 82, 40, 84, 85, 86, -1, -1,
1695 89, -1, 91, -1, 93, -1, -1, 53, -1, -1,
1696 -1, 57, 58, -1, 60, -1, -1, 63, -1, 65,
1697 -1, -1, -1, -1, -1, 114, 72, -1, 4, 118,
1698 119, 120, 121, -1, -1, 124, 82, 126, 84, 85,
1699 -1, 130, -1, -1, -1, 91, -1, -1, 137, -1,
1700 139, -1, 28, -1, 30, 144, 145, -1, -1, -1,
1701 36, -1, -1, -1, -1, -1, -1, -1, 114, -1,
1702 -1, -1, 118, 119, 120, 121, -1, 53, 124, -1,
1703 126, 57, 58, -1, 130, -1, -1, 63, -1, 65,
1704 -1, 137, -1, 139, -1, -1, 72, -1, 144, 145,
1705 -1, -1, -1, -1, -1, -1, -1, -1, 84, 85,
1706 -1, -1, -1, -1, -1, 91, -1, -1, -1, -1,
1707 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1708 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1709 -1, -1, 118, 119, 120, 121, -1, -1, 124, -1,
1710 -1, -1, -1, -1, 130, -1, -1, -1, -1, -1,
1711 -1, 137, -1, 139, -1, -1, -1, -1, 144, 145,
1712 21, -1, 23, 24, -1, 26, 27, -1, 29, -1,
1713 -1, 32, -1, 34, -1, -1, -1, -1, -1, -1,
1714 41, 42, 43, 44, -1, 46, 47, 48, 49, 50,
1715 -1, 52, -1, 54, 55, 56, -1, -1, 59, -1,
1716 -1, -1, -1, 64, -1, 66, 67, 68, 69, 70,
1717 71, -1, 73, 74, 75, 76, 77, -1, -1, 80,
1718 -1, -1, 83, -1, -1, -1, 87, 88, -1, 90,
1719 -1, -1, -1, 94, 95, 96, -1, 98, 99, 100,
1720 101, 102, -1, 104, -1, 106, 107, 108, 109, 110,
1721 111, 112, 113, -1, 115, 116, 117, -1, -1, -1,
1722 -1, 122, -1, -1, 125, -1, -1, 128, 129, -1,
1723 -1, 132, 133, 134, -1, -1, -1, 138, -1, 140,
1724 141, 142, 143, -1, -1, 146
1727 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1728 symbol of state STATE-NUM. */
1729 static const unsigned short int yystos
[] =
1731 0, 177, 178, 0, 4, 28, 30, 36, 37, 40,
1732 45, 51, 53, 57, 58, 60, 63, 65, 72, 78,
1733 82, 84, 85, 86, 91, 114, 118, 119, 120, 121,
1734 124, 126, 130, 136, 137, 139, 144, 145, 168, 182,
1735 183, 184, 185, 188, 189, 196, 207, 221, 225, 227,
1736 228, 229, 230, 233, 234, 237, 239, 240, 241, 242,
1737 244, 245, 246, 247, 248, 250, 252, 258, 259, 260,
1738 261, 3, 4, 171, 3, 4, 3, 4, 223, 84,
1739 226, 8, 3, 4, 226, 171, 226, 227, 3, 223,
1740 195, 196, 3, 223, 227, 21, 23, 24, 26, 27,
1741 29, 32, 34, 41, 42, 43, 44, 46, 47, 48,
1742 49, 50, 52, 54, 55, 56, 59, 64, 66, 67,
1743 68, 69, 70, 71, 73, 74, 75, 76, 77, 80,
1744 83, 87, 88, 90, 94, 95, 96, 98, 99, 100,
1745 101, 102, 104, 106, 107, 108, 109, 110, 111, 112,
1746 113, 115, 116, 117, 122, 125, 128, 129, 132, 133,
1747 134, 138, 140, 141, 142, 143, 146, 197, 199, 257,
1748 179, 179, 89, 93, 187, 207, 228, 233, 239, 243,
1749 250, 258, 261, 170, 170, 170, 173, 170, 173, 170,
1750 181, 170, 149, 238, 173, 251, 252, 251, 251, 3,
1751 4, 35, 62, 103, 127, 157, 171, 201, 224, 253,
1752 254, 256, 259, 170, 251, 170, 170, 8, 173, 170,
1753 259, 173, 250, 131, 173, 171, 171, 171, 171, 171,
1754 171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
1755 171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
1756 147, 169, 11, 79, 182, 186, 189, 228, 230, 241,
1757 242, 245, 174, 3, 3, 4, 173, 256, 231, 105,
1758 235, 239, 3, 4, 173, 180, 249, 253, 253, 175,
1759 168, 171, 194, 251, 172, 204, 205, 206, 224, 172,
1760 214, 253, 255, 171, 217, 224, 3, 5, 6, 7,
1761 8, 9, 61, 97, 123, 135, 152, 155, 156, 157,
1762 160, 161, 171, 210, 211, 212, 210, 213, 8, 8,
1763 198, 213, 212, 8, 8, 212, 8, 212, 210, 65,
1764 212, 208, 209, 210, 257, 212, 208, 210, 259, 259,
1765 8, 10, 200, 5, 262, 259, 199, 168, 171, 170,
1766 181, 174, 195, 232, 149, 92, 195, 219, 236, 170,
1767 173, 180, 174, 182, 196, 248, 253, 172, 213, 157,
1768 209, 144, 190, 191, 192, 193, 196, 250, 174, 147,
1769 175, 174, 195, 215, 147, 219, 174, 196, 216, 219,
1770 172, 171, 210, 210, 210, 210, 210, 210, 210, 259,
1771 12, 13, 14, 15, 16, 17, 18, 19, 20, 148,
1772 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
1773 167, 168, 147, 172, 172, 172, 147, 172, 172, 172,
1774 172, 172, 172, 172, 172, 172, 3, 172, 147, 172,
1775 172, 147, 172, 172, 172, 172, 172, 167, 172, 172,
1776 199, 8, 181, 242, 149, 250, 170, 174, 195, 220,
1777 174, 185, 174, 181, 169, 169, 172, 147, 250, 253,
1778 206, 212, 250, 261, 253, 172, 170, 170, 259, 172,
1779 172, 210, 210, 3, 210, 210, 210, 210, 210, 210,
1780 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
1781 210, 3, 210, 212, 8, 172, 209, 212, 5, 172,
1782 253, 250, 170, 180, 181, 193, 253, 255, 170, 222,
1783 224, 172, 210, 149, 169, 172, 181, 253, 174, 170,
1784 173, 210, 181, 202, 34, 46, 174, 203, 212, 149,
1785 149, 170, 218, 219, 218, 170
1788 #define yyerrok (yyerrstatus = 0)
1789 #define yyclearin (yychar = YYEMPTY)
1790 #define YYEMPTY (-2)
1793 #define YYACCEPT goto yyacceptlab
1794 #define YYABORT goto yyabortlab
1795 #define YYERROR goto yyerrorlab
1798 /* Like YYERROR except do call yyerror. This remains here temporarily
1799 to ease the transition to the new meaning of YYERROR, for GCC.
1800 Once GCC version 2 has supplanted version 1, this can go. */
1802 #define YYFAIL goto yyerrlab
1804 #define YYRECOVERING() (!!yyerrstatus)
1806 #define YYBACKUP(Token, Value) \
1808 if (yychar == YYEMPTY && yylen == 1) \
1812 yytoken = YYTRANSLATE (yychar); \
1818 yyerror (YY_("syntax error: cannot back up")); \
1825 #define YYERRCODE 256
1828 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1829 If N is 0, then set CURRENT to the empty location which ends
1830 the previous symbol: RHS[0] (always defined). */
1832 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
1833 #ifndef YYLLOC_DEFAULT
1834 # define YYLLOC_DEFAULT(Current, Rhs, N) \
1838 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1839 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1840 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1841 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1845 (Current).first_line = (Current).last_line = \
1846 YYRHSLOC (Rhs, 0).last_line; \
1847 (Current).first_column = (Current).last_column = \
1848 YYRHSLOC (Rhs, 0).last_column; \
1854 /* YY_LOCATION_PRINT -- Print the location on the stream.
1855 This macro was not mandated originally: define only if we know
1856 we won't break user code: when these are the locations we know. */
1858 #ifndef YY_LOCATION_PRINT
1859 # if YYLTYPE_IS_TRIVIAL
1860 # define YY_LOCATION_PRINT(File, Loc) \
1861 fprintf (File, "%d.%d-%d.%d", \
1862 (Loc).first_line, (Loc).first_column, \
1863 (Loc).last_line, (Loc).last_column)
1865 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1870 /* YYLEX -- calling `yylex' with the right arguments. */
1873 # define YYLEX yylex (YYLEX_PARAM)
1875 # define YYLEX yylex ()
1878 /* Enable debugging if requested. */
1882 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1883 # define YYFPRINTF fprintf
1886 # define YYDPRINTF(Args) \
1892 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1896 YYFPRINTF (stderr, "%s ", Title); \
1897 yysymprint (stderr, \
1899 YYFPRINTF (stderr, "\n"); \
1903 /*------------------------------------------------------------------.
1904 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1906 `------------------------------------------------------------------*/
1908 #if defined (__STDC__) || defined (__cplusplus)
1910 yy_stack_print (short int *bottom
, short int *top
)
1913 yy_stack_print (bottom
, top
)
1918 YYFPRINTF (stderr
, "Stack now");
1919 for (/* Nothing. */; bottom
<= top
; ++bottom
)
1920 YYFPRINTF (stderr
, " %d", *bottom
);
1921 YYFPRINTF (stderr
, "\n");
1924 # define YY_STACK_PRINT(Bottom, Top) \
1927 yy_stack_print ((Bottom), (Top)); \
1931 /*------------------------------------------------.
1932 | Report that the YYRULE is going to be reduced. |
1933 `------------------------------------------------*/
1935 #if defined (__STDC__) || defined (__cplusplus)
1937 yy_reduce_print (int yyrule
)
1940 yy_reduce_print (yyrule
)
1945 unsigned long int yylno
= yyrline
[yyrule
];
1946 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu), ",
1948 /* Print the symbols being reduced, and their result. */
1949 for (yyi
= yyprhs
[yyrule
]; 0 <= yyrhs
[yyi
]; yyi
++)
1950 YYFPRINTF (stderr
, "%s ", yytname
[yyrhs
[yyi
]]);
1951 YYFPRINTF (stderr
, "-> %s\n", yytname
[yyr1
[yyrule
]]);
1954 # define YY_REDUCE_PRINT(Rule) \
1957 yy_reduce_print (Rule); \
1960 /* Nonzero means print parse trace. It is left uninitialized so that
1961 multiple parsers can coexist. */
1963 #else /* !YYDEBUG */
1964 # define YYDPRINTF(Args)
1965 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1966 # define YY_STACK_PRINT(Bottom, Top)
1967 # define YY_REDUCE_PRINT(Rule)
1968 #endif /* !YYDEBUG */
1971 /* YYINITDEPTH -- initial size of the parser's stacks. */
1973 # define YYINITDEPTH 200
1976 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1977 if the built-in stack extension method is used).
1979 Do not make this value too large; the results are undefined if
1980 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1981 evaluated with infinite-precision integer arithmetic. */
1984 # define YYMAXDEPTH 10000
1992 # if defined (__GLIBC__) && defined (_STRING_H)
1993 # define yystrlen strlen
1995 /* Return the length of YYSTR. */
1997 # if defined (__STDC__) || defined (__cplusplus)
1998 yystrlen (const char *yystr
)
2004 const char *yys
= yystr
;
2006 while (*yys
++ != '\0')
2009 return yys
- yystr
- 1;
2015 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
2016 # define yystpcpy stpcpy
2018 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
2021 # if defined (__STDC__) || defined (__cplusplus)
2022 yystpcpy (char *yydest
, const char *yysrc
)
2024 yystpcpy (yydest
, yysrc
)
2030 const char *yys
= yysrc
;
2032 while ((*yyd
++ = *yys
++) != '\0')
2041 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
2042 quotes and backslashes, so that it's suitable for yyerror. The
2043 heuristic is that double-quoting is unnecessary unless the string
2044 contains an apostrophe, a comma, or backslash (other than
2045 backslash-backslash). YYSTR is taken from yytname. If YYRES is
2046 null, do not copy; instead, return the length of what the result
2049 yytnamerr (char *yyres
, const char *yystr
)
2054 char const *yyp
= yystr
;
2061 goto do_not_strip_quotes
;
2065 goto do_not_strip_quotes
;
2078 do_not_strip_quotes
: ;
2082 return yystrlen (yystr
);
2084 return yystpcpy (yyres
, yystr
) - yyres
;
2088 #endif /* YYERROR_VERBOSE */
2093 /*--------------------------------.
2094 | Print this symbol on YYOUTPUT. |
2095 `--------------------------------*/
2097 #if defined (__STDC__) || defined (__cplusplus)
2099 yysymprint (FILE *yyoutput
, int yytype
, YYSTYPE
*yyvaluep
)
2102 yysymprint (yyoutput
, yytype
, yyvaluep
)
2108 /* Pacify ``unused variable'' warnings. */
2111 if (yytype
< YYNTOKENS
)
2112 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
2114 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
2118 if (yytype
< YYNTOKENS
)
2119 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
2126 YYFPRINTF (yyoutput
, ")");
2129 #endif /* ! YYDEBUG */
2130 /*-----------------------------------------------.
2131 | Release the memory associated to this symbol. |
2132 `-----------------------------------------------*/
2134 #if defined (__STDC__) || defined (__cplusplus)
2136 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
)
2139 yydestruct (yymsg
, yytype
, yyvaluep
)
2145 /* Pacify ``unused variable'' warnings. */
2150 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
2161 /* Prevent warnings from -Wmissing-prototypes. */
2163 #ifdef YYPARSE_PARAM
2164 # if defined (__STDC__) || defined (__cplusplus)
2165 int yyparse (void *YYPARSE_PARAM
);
2169 #else /* ! YYPARSE_PARAM */
2170 #if defined (__STDC__) || defined (__cplusplus)
2175 #endif /* ! YYPARSE_PARAM */
2179 /* The look-ahead symbol. */
2182 /* The semantic value of the look-ahead symbol. */
2185 /* Number of syntax errors so far. */
2194 #ifdef YYPARSE_PARAM
2195 # if defined (__STDC__) || defined (__cplusplus)
2196 int yyparse (void *YYPARSE_PARAM
)
2198 int yyparse (YYPARSE_PARAM
)
2199 void *YYPARSE_PARAM
;
2201 #else /* ! YYPARSE_PARAM */
2202 #if defined (__STDC__) || defined (__cplusplus)
2216 /* Number of tokens to shift before error messages enabled. */
2218 /* Look-ahead token as an internal (translated) token number. */
2221 /* Three stacks and their tools:
2222 `yyss': related to states,
2223 `yyvs': related to semantic values,
2224 `yyls': related to locations.
2226 Refer to the stacks thru separate pointers, to allow yyoverflow
2227 to reallocate them elsewhere. */
2229 /* The state stack. */
2230 short int yyssa
[YYINITDEPTH
];
2231 short int *yyss
= yyssa
;
2234 /* The semantic value stack. */
2235 YYSTYPE yyvsa
[YYINITDEPTH
];
2236 YYSTYPE
*yyvs
= yyvsa
;
2241 #define YYPOPSTACK (yyvsp--, yyssp--)
2243 YYSIZE_T yystacksize
= YYINITDEPTH
;
2245 /* The variables used to return semantic value and location from the
2250 /* When reducing, the number of symbols on the RHS of the reduced
2254 YYDPRINTF ((stderr
, "Starting parse\n"));
2259 yychar
= YYEMPTY
; /* Cause a token to be read. */
2261 /* Initialize stack pointers.
2262 Waste one element of value and location stack
2263 so that they stay on the same level as the state stack.
2264 The wasted elements are never initialized. */
2271 /*------------------------------------------------------------.
2272 | yynewstate -- Push a new state, which is found in yystate. |
2273 `------------------------------------------------------------*/
2275 /* In all cases, when you get here, the value and location stacks
2276 have just been pushed. so pushing a state here evens the stacks.
2283 if (yyss
+ yystacksize
- 1 <= yyssp
)
2285 /* Get the current used size of the three stacks, in elements. */
2286 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
2290 /* Give user a chance to reallocate the stack. Use copies of
2291 these so that the &'s don't force the real ones into
2293 YYSTYPE
*yyvs1
= yyvs
;
2294 short int *yyss1
= yyss
;
2297 /* Each stack pointer address is followed by the size of the
2298 data in use in that stack, in bytes. This used to be a
2299 conditional around just the two extra args, but that might
2300 be undefined if yyoverflow is a macro. */
2301 yyoverflow (YY_("memory exhausted"),
2302 &yyss1
, yysize
* sizeof (*yyssp
),
2303 &yyvs1
, yysize
* sizeof (*yyvsp
),
2310 #else /* no yyoverflow */
2311 # ifndef YYSTACK_RELOCATE
2312 goto yyexhaustedlab
;
2314 /* Extend the stack our own way. */
2315 if (YYMAXDEPTH
<= yystacksize
)
2316 goto yyexhaustedlab
;
2318 if (YYMAXDEPTH
< yystacksize
)
2319 yystacksize
= YYMAXDEPTH
;
2322 short int *yyss1
= yyss
;
2323 union yyalloc
*yyptr
=
2324 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
2326 goto yyexhaustedlab
;
2327 YYSTACK_RELOCATE (yyss
);
2328 YYSTACK_RELOCATE (yyvs
);
2330 # undef YYSTACK_RELOCATE
2332 YYSTACK_FREE (yyss1
);
2335 #endif /* no yyoverflow */
2337 yyssp
= yyss
+ yysize
- 1;
2338 yyvsp
= yyvs
+ yysize
- 1;
2341 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
2342 (unsigned long int) yystacksize
));
2344 if (yyss
+ yystacksize
- 1 <= yyssp
)
2348 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
2357 /* Do appropriate processing given the current state. */
2358 /* Read a look-ahead token if we need one and don't already have one. */
2361 /* First try to decide what to do without reference to look-ahead token. */
2363 yyn
= yypact
[yystate
];
2364 if (yyn
== YYPACT_NINF
)
2367 /* Not known => get a look-ahead token if don't already have one. */
2369 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
2370 if (yychar
== YYEMPTY
)
2372 YYDPRINTF ((stderr
, "Reading a token: "));
2376 if (yychar
<= YYEOF
)
2378 yychar
= yytoken
= YYEOF
;
2379 YYDPRINTF ((stderr
, "Now at end of input.\n"));
2383 yytoken
= YYTRANSLATE (yychar
);
2384 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
2387 /* If the proper action on seeing token YYTOKEN is to reduce or to
2388 detect an error, take that action. */
2390 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
2395 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
2404 /* Shift the look-ahead token. */
2405 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
2407 /* Discard the token being shifted unless it is eof. */
2408 if (yychar
!= YYEOF
)
2414 /* Count tokens shifted since error; after three, turn off error
2423 /*-----------------------------------------------------------.
2424 | yydefault -- do the default action for the current state. |
2425 `-----------------------------------------------------------*/
2427 yyn
= yydefact
[yystate
];
2433 /*-----------------------------.
2434 | yyreduce -- Do a reduction. |
2435 `-----------------------------*/
2437 /* yyn is the number of a rule to reduce with. */
2440 /* If YYLEN is nonzero, implement the default value of the action:
2443 Otherwise, the following line sets YYVAL to garbage.
2444 This behavior is undocumented and Bison
2445 users should not rely upon it. Assigning to YYVAL
2446 unconditionally makes the parser a bit smaller, and it avoids a
2447 GCC warning that YYVAL may be used uninitialized. */
2448 yyval
= yyvsp
[1-yylen
];
2451 YY_REDUCE_PRINT (yyn
);
2455 #line 351 "parser.y"
2457 check_all_user_types((yyvsp
[0].stmt_list
));
2458 write_proxies((yyvsp
[0].stmt_list
));
2459 write_client((yyvsp
[0].stmt_list
));
2460 write_server((yyvsp
[0].stmt_list
));
2461 write_dlldata((yyvsp
[0].stmt_list
));
2466 #line 360 "parser.y"
2467 { (yyval
.stmt_list
) = NULL
; ;}
2471 #line 361 "parser.y"
2472 { (yyval
.stmt_list
) = (yyvsp
[-1].stmt_list
); ;}
2476 #line 362 "parser.y"
2477 { (yyval
.stmt_list
) = append_statement((yyvsp
[-1].stmt_list
), make_statement_type_decl((yyvsp
[0].type
))); ;}
2481 #line 363 "parser.y"
2482 { (yyval
.stmt_list
) = (yyvsp
[-2].stmt_list
);
2483 reg_type((yyvsp
[-1].type
), (yyvsp
[-1].type
)->name
, 0);
2484 if (!parse_only
&& do_header
) write_coclass_forward((yyvsp
[-1].type
));
2489 #line 367 "parser.y"
2490 { (yyval
.stmt_list
) = append_statement((yyvsp
[-1].stmt_list
), make_statement_type_decl((yyvsp
[0].type
)));
2491 add_typelib_entry((yyvsp
[0].type
));
2492 reg_type((yyvsp
[0].type
), (yyvsp
[0].type
)->name
, 0);
2493 if (!parse_only
&& do_header
) write_coclass_forward((yyvsp
[0].type
));
2498 #line 372 "parser.y"
2499 { (yyval
.stmt_list
) = append_statement((yyvsp
[-1].stmt_list
), make_statement_module((yyvsp
[0].type
)));
2500 add_typelib_entry((yyvsp
[0].type
));
2505 #line 375 "parser.y"
2506 { (yyval
.stmt_list
) = append_statement((yyvsp
[-1].stmt_list
), make_statement_library((yyvsp
[0].typelib
))); ;}
2510 #line 376 "parser.y"
2511 { (yyval
.stmt_list
) = append_statement((yyvsp
[-1].stmt_list
), (yyvsp
[0].statement
)); ;}
2515 #line 379 "parser.y"
2516 { (yyval
.stmt_list
) = NULL
; ;}
2520 #line 380 "parser.y"
2521 { (yyval
.stmt_list
) = append_statement((yyvsp
[-1].stmt_list
), make_statement_reference((yyvsp
[0].type
))); if (!parse_only
) add_typelib_entry((yyvsp
[0].type
)); ;}
2525 #line 381 "parser.y"
2526 { (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
)); ;}
2530 #line 382 "parser.y"
2531 { (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
)); ;}
2535 #line 383 "parser.y"
2536 { (yyval
.stmt_list
) = append_statement((yyvsp
[-1].stmt_list
), make_statement_type_decl((yyvsp
[0].type
)));
2537 if (!parse_only
) add_typelib_entry((yyvsp
[0].type
));
2538 reg_type((yyvsp
[0].type
), (yyvsp
[0].type
)->name
, 0);
2539 if (!parse_only
&& do_header
) write_coclass_forward((yyvsp
[0].type
));
2544 #line 388 "parser.y"
2545 { (yyval
.stmt_list
) = append_statement((yyvsp
[-1].stmt_list
), make_statement_module((yyvsp
[0].type
))); if (!parse_only
) add_typelib_entry((yyvsp
[0].type
)); ;}
2549 #line 389 "parser.y"
2550 { (yyval
.stmt_list
) = append_statement((yyvsp
[-1].stmt_list
), (yyvsp
[0].statement
)); ;}
2554 #line 390 "parser.y"
2555 { (yyval
.stmt_list
) = append_statement((yyvsp
[-1].stmt_list
), make_statement_importlib((yyvsp
[0].str
))); ;}
2559 #line 391 "parser.y"
2560 { (yyval
.stmt_list
) = append_statement((yyvsp
[-1].stmt_list
), make_statement_library((yyvsp
[0].typelib
))); ;}
2564 #line 394 "parser.y"
2565 { (yyval
.func_list
) = NULL
; ;}
2569 #line 395 "parser.y"
2570 { (yyval
.func_list
) = append_func_from_statement( (yyvsp
[-1].func_list
), (yyvsp
[0].statement
) ); ;}
2574 #line 403 "parser.y"
2575 { (yyval
.statement
) = make_statement_cppquote((yyvsp
[0].str
)); ;}
2579 #line 404 "parser.y"
2580 { (yyval
.statement
) = make_statement_type_decl((yyvsp
[-1].type
));
2581 if (!parse_only
&& do_header
) {
2582 write_type_def_or_decl(header
, (yyvsp
[-1].type
), FALSE
, NULL
);
2583 fprintf(header
, ";\n\n");
2589 #line 410 "parser.y"
2590 { (yyval
.statement
) = make_statement_declaration((yyvsp
[-1].var
));
2591 if (!parse_only
&& do_header
) write_declaration((yyvsp
[-1].var
), is_in_interface
);
2596 #line 413 "parser.y"
2597 { (yyval
.statement
) = make_statement_import((yyvsp
[0].str
)); ;}
2601 #line 414 "parser.y"
2602 { (yyval
.statement
) = make_statement_type_decl((yyvsp
[-1].type
));
2603 if (!parse_only
&& do_header
) {
2604 write_type_def_or_decl(header
, (yyvsp
[-1].type
), FALSE
, NULL
);
2605 fprintf(header
, ";\n\n");
2611 #line 420 "parser.y"
2612 { (yyval
.statement
) = (yyvsp
[-1].statement
); ;}
2616 #line 421 "parser.y"
2617 { (yyval
.statement
) = make_statement_type_decl((yyvsp
[-1].type
));
2618 if (!parse_only
&& do_header
) {
2619 write_type_def_or_decl(header
, (yyvsp
[-1].type
), FALSE
, NULL
);
2620 fprintf(header
, ";\n\n");
2626 #line 429 "parser.y"
2627 { (yyval
.str
) = (yyvsp
[-1].str
); if (!parse_only
&& do_header
) fprintf(header
, "%s\n", (yyvsp
[-1].str
)); ;}
2631 #line 431 "parser.y"
2632 { assert(yychar
== YYEMPTY
);
2633 (yyval
.import
) = xmalloc(sizeof(struct _import_t
));
2634 (yyval
.import
)->name
= (yyvsp
[-1].str
);
2635 (yyval
.import
)->import_performed
= do_import((yyvsp
[-1].str
));
2636 if (!(yyval
.import
)->import_performed
) yychar
= aEOF
;
2641 #line 439 "parser.y"
2642 { (yyval
.str
) = (yyvsp
[-2].import
)->name
;
2643 if ((yyvsp
[-2].import
)->import_performed
) pop_import();
2644 free((yyvsp
[-2].import
));
2645 if (!parse_only
&& do_header
) write_import((yyval
.str
));
2650 #line 447 "parser.y"
2651 { (yyval
.str
) = (yyvsp
[-2].str
); if(!parse_only
) add_importlib((yyvsp
[-2].str
)); ;}
2655 #line 450 "parser.y"
2656 { (yyval
.str
) = (yyvsp
[0].str
); ;}
2660 #line 452 "parser.y"
2661 { (yyval
.typelib
) = make_library((yyvsp
[-1].str
), check_library_attrs((yyvsp
[-1].str
), (yyvsp
[-2].attr_list
)));
2662 if (!parse_only
) start_typelib((yyval
.typelib
));
2663 if (!parse_only
&& do_header
) write_library((yyval
.typelib
));
2664 if (!parse_only
&& do_idfile
) write_libid((yyval
.typelib
));
2665 is_inside_library
= TRUE
;
2670 #line 460 "parser.y"
2671 { (yyval
.typelib
) = (yyvsp
[-3].typelib
);
2672 (yyval
.typelib
)->stmts
= (yyvsp
[-2].stmt_list
);
2673 if (!parse_only
) end_typelib();
2674 is_inside_library
= FALSE
;
2679 #line 467 "parser.y"
2680 { (yyval
.var_list
) = NULL
; ;}
2684 #line 471 "parser.y"
2685 { (yyval
.var_list
) = NULL
; ;}
2689 #line 474 "parser.y"
2690 { check_arg((yyvsp
[0].var
)); (yyval
.var_list
) = append_var( NULL
, (yyvsp
[0].var
) ); ;}
2694 #line 475 "parser.y"
2695 { check_arg((yyvsp
[0].var
)); (yyval
.var_list
) = append_var( (yyvsp
[-2].var_list
), (yyvsp
[0].var
)); ;}
2699 #line 480 "parser.y"
2700 { (yyval
.var
) = (yyvsp
[0].declarator
)->var
;
2701 (yyval
.var
)->attrs
= (yyvsp
[-2].attr_list
);
2702 if ((yyvsp
[-1].declspec
)->stgclass
!= STG_NONE
&& (yyvsp
[-1].declspec
)->stgclass
!= STG_REGISTER
)
2703 error_loc("invalid storage class for function parameter\n");
2704 set_type((yyval
.var
), (yyvsp
[-1].declspec
), (yyvsp
[0].declarator
), TRUE
);
2705 free((yyvsp
[0].declarator
));
2710 #line 487 "parser.y"
2711 { (yyval
.var
) = (yyvsp
[0].declarator
)->var
;
2712 if ((yyvsp
[-1].declspec
)->stgclass
!= STG_NONE
&& (yyvsp
[-1].declspec
)->stgclass
!= STG_REGISTER
)
2713 error_loc("invalid storage class for function parameter\n");
2714 set_type((yyval
.var
), (yyvsp
[-1].declspec
), (yyvsp
[0].declarator
), TRUE
);
2715 free((yyvsp
[0].declarator
));
2720 #line 495 "parser.y"
2721 { (yyval
.expr
) = (yyvsp
[-1].expr
); ;}
2725 #line 496 "parser.y"
2726 { (yyval
.expr
) = make_expr(EXPR_VOID
); ;}
2730 #line 499 "parser.y"
2731 { (yyval
.attr_list
) = NULL
; ;}
2735 #line 504 "parser.y"
2736 { (yyval
.attr_list
) = (yyvsp
[-1].attr_list
);
2737 if (!(yyval
.attr_list
))
2738 error_loc("empty attribute lists unsupported\n");
2743 #line 510 "parser.y"
2744 { (yyval
.attr_list
) = append_attr( NULL
, (yyvsp
[0].attr
) ); ;}
2748 #line 511 "parser.y"
2749 { (yyval
.attr_list
) = append_attr( (yyvsp
[-2].attr_list
), (yyvsp
[0].attr
) ); ;}
2753 #line 512 "parser.y"
2754 { (yyval
.attr_list
) = append_attr( (yyvsp
[-3].attr_list
), (yyvsp
[0].attr
) ); ;}
2758 #line 515 "parser.y"
2759 { (yyval
.str_list
) = append_str( NULL
, (yyvsp
[0].str
) ); ;}
2763 #line 516 "parser.y"
2764 { (yyval
.str_list
) = append_str( (yyvsp
[-2].str_list
), (yyvsp
[0].str
) ); ;}
2768 #line 519 "parser.y"
2769 { (yyval
.attr
) = NULL
; ;}
2773 #line 520 "parser.y"
2774 { (yyval
.attr
) = make_attr(ATTR_AGGREGATABLE
); ;}
2778 #line 521 "parser.y"
2779 { (yyval
.attr
) = make_attr(ATTR_APPOBJECT
); ;}
2783 #line 522 "parser.y"
2784 { (yyval
.attr
) = make_attr(ATTR_ASYNC
); ;}
2788 #line 523 "parser.y"
2789 { (yyval
.attr
) = make_attr(ATTR_AUTO_HANDLE
); ;}
2793 #line 524 "parser.y"
2794 { (yyval
.attr
) = make_attr(ATTR_BINDABLE
); ;}
2798 #line 525 "parser.y"
2799 { (yyval
.attr
) = make_attr(ATTR_BROADCAST
); ;}
2803 #line 526 "parser.y"
2804 { (yyval
.attr
) = make_attrp(ATTR_CALLAS
, (yyvsp
[-1].var
)); ;}
2808 #line 527 "parser.y"
2809 { (yyval
.attr
) = make_attrp(ATTR_CASE
, (yyvsp
[-1].expr_list
)); ;}
2813 #line 528 "parser.y"
2814 { (yyval
.attr
) = make_attrv(ATTR_CONTEXTHANDLE
, 0); ;}
2818 #line 529 "parser.y"
2819 { (yyval
.attr
) = make_attrv(ATTR_CONTEXTHANDLE
, 0); /* RPC_CONTEXT_HANDLE_DONT_SERIALIZE */ ;}
2823 #line 530 "parser.y"
2824 { (yyval
.attr
) = make_attrv(ATTR_CONTEXTHANDLE
, 0); /* RPC_CONTEXT_HANDLE_SERIALIZE */ ;}
2828 #line 531 "parser.y"
2829 { (yyval
.attr
) = make_attr(ATTR_CONTROL
); ;}
2833 #line 532 "parser.y"
2834 { (yyval
.attr
) = make_attr(ATTR_DEFAULT
); ;}
2838 #line 533 "parser.y"
2839 { (yyval
.attr
) = make_attr(ATTR_DEFAULTCOLLELEM
); ;}
2843 #line 534 "parser.y"
2844 { (yyval
.attr
) = make_attrp(ATTR_DEFAULTVALUE
, (yyvsp
[-1].expr
)); ;}
2848 #line 535 "parser.y"
2849 { (yyval
.attr
) = make_attr(ATTR_DEFAULTVTABLE
); ;}
2853 #line 536 "parser.y"
2854 { (yyval
.attr
) = make_attr(ATTR_DISPLAYBIND
); ;}
2858 #line 537 "parser.y"
2859 { (yyval
.attr
) = make_attrp(ATTR_DLLNAME
, (yyvsp
[-1].str
)); ;}
2863 #line 538 "parser.y"
2864 { (yyval
.attr
) = make_attr(ATTR_DUAL
); ;}
2868 #line 539 "parser.y"
2869 { (yyval
.attr
) = make_attrp(ATTR_ENDPOINT
, (yyvsp
[-1].str_list
)); ;}
2873 #line 540 "parser.y"
2874 { (yyval
.attr
) = make_attrp(ATTR_ENTRY
, (yyvsp
[-1].expr
)); ;}
2878 #line 541 "parser.y"
2879 { (yyval
.attr
) = make_attr(ATTR_EXPLICIT_HANDLE
); ;}
2883 #line 542 "parser.y"
2884 { (yyval
.attr
) = make_attr(ATTR_HANDLE
); ;}
2888 #line 543 "parser.y"
2889 { (yyval
.attr
) = make_attrp(ATTR_HELPCONTEXT
, (yyvsp
[-1].expr
)); ;}
2893 #line 544 "parser.y"
2894 { (yyval
.attr
) = make_attrp(ATTR_HELPFILE
, (yyvsp
[-1].str
)); ;}
2898 #line 545 "parser.y"
2899 { (yyval
.attr
) = make_attrp(ATTR_HELPSTRING
, (yyvsp
[-1].str
)); ;}
2903 #line 546 "parser.y"
2904 { (yyval
.attr
) = make_attrp(ATTR_HELPSTRINGCONTEXT
, (yyvsp
[-1].expr
)); ;}
2908 #line 547 "parser.y"
2909 { (yyval
.attr
) = make_attrp(ATTR_HELPSTRINGDLL
, (yyvsp
[-1].str
)); ;}
2913 #line 548 "parser.y"
2914 { (yyval
.attr
) = make_attr(ATTR_HIDDEN
); ;}
2918 #line 549 "parser.y"
2919 { (yyval
.attr
) = make_attrp(ATTR_ID
, (yyvsp
[-1].expr
)); ;}
2923 #line 550 "parser.y"
2924 { (yyval
.attr
) = make_attr(ATTR_IDEMPOTENT
); ;}
2928 #line 551 "parser.y"
2929 { (yyval
.attr
) = make_attrp(ATTR_IIDIS
, (yyvsp
[-1].expr
)); ;}
2933 #line 552 "parser.y"
2934 { (yyval
.attr
) = make_attr(ATTR_IMMEDIATEBIND
); ;}
2938 #line 553 "parser.y"
2939 { (yyval
.attr
) = make_attrp(ATTR_IMPLICIT_HANDLE
, (yyvsp
[-1].str
)); ;}
2943 #line 554 "parser.y"
2944 { (yyval
.attr
) = make_attr(ATTR_IN
); ;}
2948 #line 555 "parser.y"
2949 { (yyval
.attr
) = make_attr(ATTR_INPUTSYNC
); ;}
2953 #line 556 "parser.y"
2954 { (yyval
.attr
) = make_attrp(ATTR_LENGTHIS
, (yyvsp
[-1].expr_list
)); ;}
2958 #line 557 "parser.y"
2959 { (yyval
.attr
) = make_attrp(ATTR_LIBLCID
, (yyvsp
[-1].expr
)); ;}
2963 #line 558 "parser.y"
2964 { (yyval
.attr
) = make_attr(ATTR_LOCAL
); ;}
2968 #line 559 "parser.y"
2969 { (yyval
.attr
) = make_attr(ATTR_NONBROWSABLE
); ;}
2973 #line 560 "parser.y"
2974 { (yyval
.attr
) = make_attr(ATTR_NONCREATABLE
); ;}
2978 #line 561 "parser.y"
2979 { (yyval
.attr
) = make_attr(ATTR_NONEXTENSIBLE
); ;}
2983 #line 562 "parser.y"
2984 { (yyval
.attr
) = make_attr(ATTR_OBJECT
); ;}
2988 #line 563 "parser.y"
2989 { (yyval
.attr
) = make_attr(ATTR_ODL
); ;}
2993 #line 564 "parser.y"
2994 { (yyval
.attr
) = make_attr(ATTR_OLEAUTOMATION
); ;}
2998 #line 565 "parser.y"
2999 { (yyval
.attr
) = make_attr(ATTR_OPTIONAL
); ;}
3003 #line 566 "parser.y"
3004 { (yyval
.attr
) = make_attr(ATTR_OUT
); ;}
3008 #line 567 "parser.y"
3009 { (yyval
.attr
) = make_attrv(ATTR_POINTERDEFAULT
, (yyvsp
[-1].num
)); ;}
3013 #line 568 "parser.y"
3014 { (yyval
.attr
) = make_attr(ATTR_PROPGET
); ;}
3018 #line 569 "parser.y"
3019 { (yyval
.attr
) = make_attr(ATTR_PROPPUT
); ;}
3023 #line 570 "parser.y"
3024 { (yyval
.attr
) = make_attr(ATTR_PROPPUTREF
); ;}
3028 #line 571 "parser.y"
3029 { (yyval
.attr
) = make_attr(ATTR_PUBLIC
); ;}
3033 #line 573 "parser.y"
3034 { expr_list_t
*list
= append_expr( NULL
, (yyvsp
[-3].expr
) );
3035 list
= append_expr( list
, (yyvsp
[-1].expr
) );
3036 (yyval
.attr
) = make_attrp(ATTR_RANGE
, list
); ;}
3040 #line 576 "parser.y"
3041 { (yyval
.attr
) = make_attr(ATTR_READONLY
); ;}
3045 #line 577 "parser.y"
3046 { (yyval
.attr
) = make_attr(ATTR_REQUESTEDIT
); ;}
3050 #line 578 "parser.y"
3051 { (yyval
.attr
) = make_attr(ATTR_RESTRICTED
); ;}
3055 #line 579 "parser.y"
3056 { (yyval
.attr
) = make_attr(ATTR_RETVAL
); ;}
3060 #line 580 "parser.y"
3061 { (yyval
.attr
) = make_attrp(ATTR_SIZEIS
, (yyvsp
[-1].expr_list
)); ;}
3065 #line 581 "parser.y"
3066 { (yyval
.attr
) = make_attr(ATTR_SOURCE
); ;}
3070 #line 582 "parser.y"
3071 { (yyval
.attr
) = make_attr(ATTR_STRICTCONTEXTHANDLE
); ;}
3075 #line 583 "parser.y"
3076 { (yyval
.attr
) = make_attr(ATTR_STRING
); ;}
3080 #line 584 "parser.y"
3081 { (yyval
.attr
) = make_attrp(ATTR_SWITCHIS
, (yyvsp
[-1].expr
)); ;}
3085 #line 585 "parser.y"
3086 { (yyval
.attr
) = make_attrp(ATTR_SWITCHTYPE
, (yyvsp
[-1].type
)); ;}
3090 #line 586 "parser.y"
3091 { (yyval
.attr
) = make_attrp(ATTR_TRANSMITAS
, (yyvsp
[-1].type
)); ;}
3095 #line 587 "parser.y"
3096 { (yyval
.attr
) = make_attrp(ATTR_UUID
, (yyvsp
[-1].uuid
)); ;}
3100 #line 588 "parser.y"
3101 { (yyval
.attr
) = make_attr(ATTR_V1ENUM
); ;}
3105 #line 589 "parser.y"
3106 { (yyval
.attr
) = make_attr(ATTR_VARARG
); ;}
3110 #line 590 "parser.y"
3111 { (yyval
.attr
) = make_attrv(ATTR_VERSION
, (yyvsp
[-1].num
)); ;}
3115 #line 591 "parser.y"
3116 { (yyval
.attr
) = make_attrp(ATTR_WIREMARSHAL
, (yyvsp
[-1].type
)); ;}
3120 #line 592 "parser.y"
3121 { (yyval
.attr
) = make_attrv(ATTR_POINTERTYPE
, (yyvsp
[0].num
)); ;}
3125 #line 597 "parser.y"
3126 { if (!is_valid_uuid((yyvsp
[0].str
)))
3127 error_loc("invalid UUID: %s\n", (yyvsp
[0].str
));
3128 (yyval
.uuid
) = parse_uuid((yyvsp
[0].str
)); ;}
3132 #line 602 "parser.y"
3133 { (yyval
.str
) = (yyvsp
[0].str
); ;}
3137 #line 603 "parser.y"
3138 { (yyval
.str
) = (yyvsp
[0].str
); ;}
3142 #line 604 "parser.y"
3143 { (yyval
.str
) = (yyvsp
[0].str
); ;}
3147 #line 605 "parser.y"
3148 { (yyval
.str
) = (yyvsp
[0].str
); ;}
3152 #line 608 "parser.y"
3153 { (yyval
.var_list
) = NULL
; ;}
3157 #line 609 "parser.y"
3158 { (yyval
.var_list
) = append_var( (yyvsp
[-1].var_list
), (yyvsp
[0].var
) ); ;}
3162 #line 612 "parser.y"
3163 { attr_t
*a
= make_attrp(ATTR_CASE
, append_expr( NULL
, (yyvsp
[-2].expr
) ));
3164 (yyval
.var
) = (yyvsp
[0].var
); if (!(yyval
.var
)) (yyval
.var
) = make_var(NULL
);
3165 (yyval
.var
)->attrs
= append_attr( (yyval
.var
)->attrs
, a
);
3170 #line 616 "parser.y"
3171 { attr_t
*a
= make_attr(ATTR_DEFAULT
);
3172 (yyval
.var
) = (yyvsp
[0].var
); if (!(yyval
.var
)) (yyval
.var
) = make_var(NULL
);
3173 (yyval
.var
)->attrs
= append_attr( (yyval
.var
)->attrs
, a
);
3178 #line 622 "parser.y"
3179 { (yyval
.var_list
) = NULL
; ;}
3183 #line 623 "parser.y"
3184 { (yyval
.var_list
) = (yyvsp
[-1].var_list
); ;}
3188 #line 627 "parser.y"
3189 { if (!(yyvsp
[0].var
)->eval
)
3190 (yyvsp
[0].var
)->eval
= make_exprl(EXPR_NUM
, 0 /* default for first enum entry */);
3191 (yyval
.var_list
) = append_var( NULL
, (yyvsp
[0].var
) );
3196 #line 631 "parser.y"
3197 { if (!(yyvsp
[0].var
)->eval
)
3199 var_t
*last
= LIST_ENTRY( list_tail((yyval
.var_list
)), var_t
, entry
);
3200 (yyvsp
[0].var
)->eval
= make_exprl(EXPR_NUM
, last
->eval
->cval
+ 1);
3202 (yyval
.var_list
) = append_var( (yyvsp
[-2].var_list
), (yyvsp
[0].var
) );
3207 #line 640 "parser.y"
3208 { (yyval
.var
) = reg_const((yyvsp
[-2].var
));
3209 (yyval
.var
)->eval
= (yyvsp
[0].expr
);
3210 (yyval
.var
)->type
= make_int(0);
3215 #line 644 "parser.y"
3216 { (yyval
.var
) = reg_const((yyvsp
[0].var
));
3217 (yyval
.var
)->type
= make_int(0);
3222 #line 649 "parser.y"
3223 { (yyval
.type
) = get_typev(RPC_FC_ENUM16
, (yyvsp
[-3].var
), tsENUM
);
3224 (yyval
.type
)->kind
= TKIND_ENUM
;
3225 (yyval
.type
)->fields_or_args
= (yyvsp
[-1].var_list
);
3226 (yyval
.type
)->defined
= TRUE
;
3228 add_typelib_entry((yyval
.type
));
3233 #line 658 "parser.y"
3234 { (yyval
.expr_list
) = append_expr( NULL
, (yyvsp
[0].expr
) ); ;}
3238 #line 659 "parser.y"
3239 { (yyval
.expr_list
) = append_expr( (yyvsp
[-2].expr_list
), (yyvsp
[0].expr
) ); ;}
3243 #line 672 "parser.y"
3244 { (yyval
.expr
) = make_expr(EXPR_VOID
); ;}
3248 #line 676 "parser.y"
3249 { (yyval
.expr
) = make_exprl(EXPR_NUM
, (yyvsp
[0].num
)); ;}
3253 #line 677 "parser.y"
3254 { (yyval
.expr
) = make_exprl(EXPR_HEXNUM
, (yyvsp
[0].num
)); ;}
3258 #line 678 "parser.y"
3259 { (yyval
.expr
) = make_exprd(EXPR_DOUBLE
, (yyvsp
[0].dbl
)); ;}
3263 #line 679 "parser.y"
3264 { (yyval
.expr
) = make_exprl(EXPR_TRUEFALSE
, 0); ;}
3268 #line 680 "parser.y"
3269 { (yyval
.expr
) = make_exprl(EXPR_NUM
, 0); ;}
3273 #line 681 "parser.y"
3274 { (yyval
.expr
) = make_exprl(EXPR_TRUEFALSE
, 1); ;}
3278 #line 682 "parser.y"
3279 { (yyval
.expr
) = make_exprs(EXPR_STRLIT
, (yyvsp
[0].str
)); ;}
3283 #line 683 "parser.y"
3284 { (yyval
.expr
) = make_exprs(EXPR_WSTRLIT
, (yyvsp
[0].str
)); ;}
3288 #line 684 "parser.y"
3289 { (yyval
.expr
) = make_exprs(EXPR_IDENTIFIER
, (yyvsp
[0].str
)); ;}
3293 #line 685 "parser.y"
3294 { (yyval
.expr
) = make_expr3(EXPR_COND
, (yyvsp
[-4].expr
), (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3298 #line 686 "parser.y"
3299 { (yyval
.expr
) = make_expr2(EXPR_LOGOR
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3303 #line 687 "parser.y"
3304 { (yyval
.expr
) = make_expr2(EXPR_LOGAND
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3308 #line 688 "parser.y"
3309 { (yyval
.expr
) = make_expr2(EXPR_OR
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3313 #line 689 "parser.y"
3314 { (yyval
.expr
) = make_expr2(EXPR_XOR
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3318 #line 690 "parser.y"
3319 { (yyval
.expr
) = make_expr2(EXPR_AND
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3323 #line 691 "parser.y"
3324 { (yyval
.expr
) = make_expr2(EXPR_EQUALITY
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3328 #line 692 "parser.y"
3329 { (yyval
.expr
) = make_expr2(EXPR_INEQUALITY
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3333 #line 693 "parser.y"
3334 { (yyval
.expr
) = make_expr2(EXPR_GTR
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3338 #line 694 "parser.y"
3339 { (yyval
.expr
) = make_expr2(EXPR_LESS
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3343 #line 695 "parser.y"
3344 { (yyval
.expr
) = make_expr2(EXPR_GTREQL
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3348 #line 696 "parser.y"
3349 { (yyval
.expr
) = make_expr2(EXPR_LESSEQL
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3353 #line 697 "parser.y"
3354 { (yyval
.expr
) = make_expr2(EXPR_SHL
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3358 #line 698 "parser.y"
3359 { (yyval
.expr
) = make_expr2(EXPR_SHR
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3363 #line 699 "parser.y"
3364 { (yyval
.expr
) = make_expr2(EXPR_ADD
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3368 #line 700 "parser.y"
3369 { (yyval
.expr
) = make_expr2(EXPR_SUB
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3373 #line 701 "parser.y"
3374 { (yyval
.expr
) = make_expr2(EXPR_MOD
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3378 #line 702 "parser.y"
3379 { (yyval
.expr
) = make_expr2(EXPR_MUL
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3383 #line 703 "parser.y"
3384 { (yyval
.expr
) = make_expr2(EXPR_DIV
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3388 #line 704 "parser.y"
3389 { (yyval
.expr
) = make_expr1(EXPR_LOGNOT
, (yyvsp
[0].expr
)); ;}
3393 #line 705 "parser.y"
3394 { (yyval
.expr
) = make_expr1(EXPR_NOT
, (yyvsp
[0].expr
)); ;}
3398 #line 706 "parser.y"
3399 { (yyval
.expr
) = make_expr1(EXPR_POS
, (yyvsp
[0].expr
)); ;}
3403 #line 707 "parser.y"
3404 { (yyval
.expr
) = make_expr1(EXPR_NEG
, (yyvsp
[0].expr
)); ;}
3408 #line 708 "parser.y"
3409 { (yyval
.expr
) = make_expr1(EXPR_ADDRESSOF
, (yyvsp
[0].expr
)); ;}
3413 #line 709 "parser.y"
3414 { (yyval
.expr
) = make_expr1(EXPR_PPTR
, (yyvsp
[0].expr
)); ;}
3418 #line 710 "parser.y"
3419 { (yyval
.expr
) = make_expr2(EXPR_MEMBER
, make_expr1(EXPR_PPTR
, (yyvsp
[-2].expr
)), make_exprs(EXPR_IDENTIFIER
, (yyvsp
[0].str
))); ;}
3423 #line 711 "parser.y"
3424 { (yyval
.expr
) = make_expr2(EXPR_MEMBER
, (yyvsp
[-2].expr
), make_exprs(EXPR_IDENTIFIER
, (yyvsp
[0].str
))); ;}
3428 #line 712 "parser.y"
3429 { (yyval
.expr
) = make_exprt(EXPR_CAST
, (yyvsp
[-2].type
), (yyvsp
[0].expr
)); ;}
3433 #line 713 "parser.y"
3434 { (yyval
.expr
) = make_exprt(EXPR_SIZEOF
, (yyvsp
[-1].type
), NULL
); ;}
3438 #line 714 "parser.y"
3439 { (yyval
.expr
) = make_expr2(EXPR_ARRAY
, (yyvsp
[-3].expr
), (yyvsp
[-1].expr
)); ;}
3443 #line 715 "parser.y"
3444 { (yyval
.expr
) = (yyvsp
[-1].expr
); ;}
3448 #line 718 "parser.y"
3449 { (yyval
.expr_list
) = append_expr( NULL
, (yyvsp
[0].expr
) ); ;}
3453 #line 719 "parser.y"
3454 { (yyval
.expr_list
) = append_expr( (yyvsp
[-2].expr_list
), (yyvsp
[0].expr
) ); ;}
3458 #line 722 "parser.y"
3459 { (yyval
.expr
) = (yyvsp
[0].expr
);
3460 if (!(yyval
.expr
)->is_const
)
3461 error_loc("expression is not an integer constant\n");
3466 #line 728 "parser.y"
3467 { (yyval
.expr
) = (yyvsp
[0].expr
);
3468 if (!(yyval
.expr
)->is_const
&& (yyval
.expr
)->type
!= EXPR_STRLIT
&& (yyval
.expr
)->type
!= EXPR_WSTRLIT
)
3469 error_loc("expression is not constant\n");
3474 #line 734 "parser.y"
3475 { (yyval
.var_list
) = NULL
; ;}
3479 #line 735 "parser.y"
3480 { (yyval
.var_list
) = append_var_list((yyvsp
[-1].var_list
), (yyvsp
[0].var_list
)); ;}
3484 #line 739 "parser.y"
3485 { const char *first
= LIST_ENTRY(list_head((yyvsp
[-1].declarator_list
)), declarator_t
, entry
)->var
->name
;
3486 check_field_attrs(first
, (yyvsp
[-3].attr_list
));
3487 (yyval
.var_list
) = set_var_types((yyvsp
[-3].attr_list
), (yyvsp
[-2].declspec
), (yyvsp
[-1].declarator_list
));
3492 #line 743 "parser.y"
3493 { var_t
*v
= make_var(NULL
);
3494 v
->type
= (yyvsp
[-1].type
); v
->attrs
= (yyvsp
[-2].attr_list
);
3495 (yyval
.var_list
) = append_var(NULL
, v
);
3500 #line 750 "parser.y"
3501 { (yyval
.var
) = (yyvsp
[-1].var
); ;}
3505 #line 751 "parser.y"
3506 { (yyval
.var
) = make_var(NULL
); (yyval
.var
)->attrs
= (yyvsp
[-1].attr_list
); ;}
3510 #line 754 "parser.y"
3511 { (yyval
.var_list
) = NULL
; ;}
3515 #line 755 "parser.y"
3516 { (yyval
.var_list
) = append_var( (yyvsp
[-1].var_list
), (yyvsp
[0].var
) ); ;}
3520 #line 759 "parser.y"
3521 { (yyval
.var
) = (yyvsp
[-1].var
); ;}
3525 #line 760 "parser.y"
3526 { (yyval
.var
) = NULL
; ;}
3530 #line 763 "parser.y"
3531 { (yyval
.var
) = (yyvsp
[0].declarator
)->var
;
3532 (yyval
.var
)->attrs
= check_field_attrs((yyval
.var
)->name
, (yyvsp
[-2].attr_list
));
3533 set_type((yyval
.var
), (yyvsp
[-1].declspec
), (yyvsp
[0].declarator
), FALSE
);
3534 free((yyvsp
[0].declarator
));
3539 #line 771 "parser.y"
3540 { var_t
*v
= (yyvsp
[0].declarator
)->var
;
3541 v
->attrs
= check_function_attrs(v
->name
, (yyvsp
[-2].attr_list
));
3542 set_type(v
, (yyvsp
[-1].declspec
), (yyvsp
[0].declarator
), FALSE
);
3543 free((yyvsp
[0].declarator
));
3544 (yyval
.func
) = make_func(v
);
3549 #line 781 "parser.y"
3550 { (yyval
.var
) = (yyvsp
[0].declarator
)->var
;
3551 (yyval
.var
)->attrs
= (yyvsp
[-2].attr_list
);
3552 set_type((yyval
.var
), (yyvsp
[-1].declspec
), (yyvsp
[0].declarator
), FALSE
);
3553 free((yyvsp
[0].declarator
));
3558 #line 786 "parser.y"
3559 { (yyval
.var
) = (yyvsp
[0].declarator
)->var
;
3560 set_type((yyval
.var
), (yyvsp
[-1].declspec
), (yyvsp
[0].declarator
), FALSE
);
3561 free((yyvsp
[0].declarator
));
3566 #line 792 "parser.y"
3567 { (yyval
.var
) = NULL
; ;}
3571 #line 796 "parser.y"
3572 { (yyval
.var
) = NULL
; ;}
3576 #line 797 "parser.y"
3577 { (yyval
.var
) = make_var((yyvsp
[0].str
)); ;}
3581 #line 798 "parser.y"
3582 { (yyval
.var
) = make_var((yyvsp
[0].str
)); ;}
3586 #line 801 "parser.y"
3587 { (yyval
.var
) = make_var((yyvsp
[0].str
)); ;}
3591 #line 803 "parser.y"
3592 { (yyval
.var
) = make_var((yyvsp
[0].str
)); ;}
3596 #line 806 "parser.y"
3597 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3601 #line 807 "parser.y"
3602 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3606 #line 809 "parser.y"
3607 { (yyval
.type
) = (yyvsp
[0].type
); (yyval
.type
)->sign
= 1; ;}
3611 #line 810 "parser.y"
3612 { (yyval
.type
) = (yyvsp
[0].type
); (yyval
.type
)->sign
= -1;
3613 switch ((yyval
.type
)->type
) {
3614 case RPC_FC_CHAR
: break;
3615 case RPC_FC_SMALL
: (yyval
.type
)->type
= RPC_FC_USMALL
; break;
3616 case RPC_FC_SHORT
: (yyval
.type
)->type
= RPC_FC_USHORT
; break;
3617 case RPC_FC_LONG
: (yyval
.type
)->type
= RPC_FC_ULONG
; break;
3619 if ((yyval
.type
)->name
[0] == 'h') /* hyper, as opposed to __int64 */
3621 (yyval
.type
) = alias((yyval
.type
), "MIDL_uhyper");
3622 (yyval
.type
)->sign
= 0;
3631 #line 826 "parser.y"
3632 { (yyval
.type
) = make_int(-1); ;}
3636 #line 827 "parser.y"
3637 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3641 #line 828 "parser.y"
3642 { (yyval
.type
) = duptype(find_type("float", 0), 1); ;}
3646 #line 829 "parser.y"
3647 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3651 #line 830 "parser.y"
3652 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3656 #line 831 "parser.y"
3657 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3661 #line 832 "parser.y"
3662 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3666 #line 839 "parser.y"
3667 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3671 #line 840 "parser.y"
3672 { (yyval
.type
) = make_builtin((yyvsp
[-1].str
)); ;}
3676 #line 841 "parser.y"
3677 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3681 #line 842 "parser.y"
3682 { (yyval
.type
) = make_builtin((yyvsp
[-1].str
)); ;}
3686 #line 843 "parser.y"
3687 { (yyval
.type
) = make_builtin((yyvsp
[-1].str
)); ;}
3691 #line 844 "parser.y"
3692 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3696 #line 845 "parser.y"
3697 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3701 #line 848 "parser.y"
3702 { (yyval
.type
) = make_class((yyvsp
[0].str
)); ;}
3706 #line 849 "parser.y"
3707 { (yyval
.type
) = find_type((yyvsp
[0].str
), 0);
3708 if ((yyval
.type
)->kind
!= TKIND_COCLASS
)
3709 error_loc("%s was not declared a coclass at %s:%d\n",
3710 (yyvsp
[0].str
), (yyval
.type
)->loc_info
.input_name
,
3711 (yyval
.type
)->loc_info
.line_number
);
3716 #line 857 "parser.y"
3717 { (yyval
.type
) = (yyvsp
[0].type
);
3718 check_def((yyval
.type
));
3719 (yyval
.type
)->attrs
= check_coclass_attrs((yyvsp
[0].type
)->name
, (yyvsp
[-1].attr_list
));
3720 if (!parse_only
&& do_header
)
3721 write_coclass((yyval
.type
));
3722 if (!parse_only
&& do_idfile
)
3723 write_clsid((yyval
.type
));
3728 #line 868 "parser.y"
3729 { (yyval
.type
) = (yyvsp
[-4].type
);
3730 (yyval
.type
)->ifaces
= (yyvsp
[-2].ifref_list
);
3731 (yyval
.type
)->defined
= TRUE
;
3736 #line 874 "parser.y"
3737 { (yyval
.ifref_list
) = NULL
; ;}
3741 #line 875 "parser.y"
3742 { (yyval
.ifref_list
) = append_ifref( (yyvsp
[-1].ifref_list
), (yyvsp
[0].ifref
) ); ;}
3746 #line 879 "parser.y"
3747 { (yyval
.ifref
) = make_ifref((yyvsp
[0].type
)); (yyval
.ifref
)->attrs
= (yyvsp
[-1].attr_list
); ;}
3751 #line 882 "parser.y"
3752 { (yyval
.type
) = get_type(RPC_FC_IP
, (yyvsp
[0].str
), 0); (yyval
.type
)->kind
= TKIND_DISPATCH
; ;}
3756 #line 883 "parser.y"
3757 { (yyval
.type
) = get_type(RPC_FC_IP
, (yyvsp
[0].str
), 0); (yyval
.type
)->kind
= TKIND_DISPATCH
; ;}
3761 #line 886 "parser.y"
3763 is_in_interface
= TRUE
;
3764 is_object_interface
= TRUE
;
3765 (yyval
.type
) = (yyvsp
[0].type
);
3766 check_def((yyval
.type
));
3767 attrs
= make_attr(ATTR_DISPINTERFACE
);
3768 (yyval
.type
)->attrs
= append_attr( check_dispiface_attrs((yyvsp
[0].type
)->name
, (yyvsp
[-1].attr_list
)), attrs
);
3769 (yyval
.type
)->ref
= find_type("IDispatch", 0);
3770 if (!(yyval
.type
)->ref
) error_loc("IDispatch is undefined\n");
3771 (yyval
.type
)->defined
= TRUE
;
3772 if (!parse_only
&& do_header
) write_forward((yyval
.type
));
3777 #line 900 "parser.y"
3778 { (yyval
.var_list
) = NULL
; ;}
3782 #line 901 "parser.y"
3783 { (yyval
.var_list
) = append_var( (yyvsp
[-2].var_list
), (yyvsp
[-1].var
) ); ;}
3787 #line 904 "parser.y"
3788 { (yyval
.func_list
) = NULL
; ;}
3792 #line 905 "parser.y"
3793 { (yyval
.func_list
) = append_func( (yyvsp
[-2].func_list
), (yyvsp
[-1].func
) ); ;}
3797 #line 911 "parser.y"
3798 { (yyval
.type
) = (yyvsp
[-4].type
);
3799 (yyval
.type
)->fields_or_args
= (yyvsp
[-2].var_list
);
3800 (yyval
.type
)->funcs
= (yyvsp
[-1].func_list
);
3801 if (!parse_only
&& do_header
) write_interface((yyval
.type
));
3802 if (!parse_only
&& do_idfile
) write_diid((yyval
.type
));
3803 is_in_interface
= FALSE
;
3808 #line 919 "parser.y"
3809 { (yyval
.type
) = (yyvsp
[-4].type
);
3810 (yyval
.type
)->fields_or_args
= (yyvsp
[-2].type
)->fields_or_args
;
3811 (yyval
.type
)->funcs
= (yyvsp
[-2].type
)->funcs
;
3812 if (!parse_only
&& do_header
) write_interface((yyval
.type
));
3813 if (!parse_only
&& do_idfile
) write_diid((yyval
.type
));
3814 is_in_interface
= FALSE
;
3819 #line 928 "parser.y"
3820 { (yyval
.type
) = NULL
; ;}
3824 #line 929 "parser.y"
3825 { (yyval
.type
) = find_type2((yyvsp
[0].str
), 0); ;}
3829 #line 932 "parser.y"
3830 { (yyval
.type
) = get_type(RPC_FC_IP
, (yyvsp
[0].str
), 0); (yyval
.type
)->kind
= TKIND_INTERFACE
; ;}
3834 #line 933 "parser.y"
3835 { (yyval
.type
) = get_type(RPC_FC_IP
, (yyvsp
[0].str
), 0); (yyval
.type
)->kind
= TKIND_INTERFACE
; ;}
3839 #line 936 "parser.y"
3840 { (yyval
.ifinfo
).interface
= (yyvsp
[0].type
);
3841 (yyval
.ifinfo
).old_pointer_default
= pointer_default
;
3842 if (is_attr((yyvsp
[-1].attr_list
), ATTR_POINTERDEFAULT
))
3843 pointer_default
= get_attrv((yyvsp
[-1].attr_list
), ATTR_POINTERDEFAULT
);
3844 is_object_interface
= is_object((yyvsp
[-1].attr_list
));
3845 is_in_interface
= TRUE
;
3846 check_def((yyvsp
[0].type
));
3847 (yyvsp
[0].type
)->attrs
= check_iface_attrs((yyvsp
[0].type
)->name
, (yyvsp
[-1].attr_list
));
3848 (yyvsp
[0].type
)->defined
= TRUE
;
3849 if (!parse_only
&& do_header
) write_forward((yyvsp
[0].type
));
3854 #line 950 "parser.y"
3855 { (yyval
.type
) = (yyvsp
[-5].ifinfo
).interface
;
3856 (yyval
.type
)->ref
= (yyvsp
[-4].type
);
3857 (yyval
.type
)->funcs
= (yyvsp
[-2].func_list
);
3858 check_functions((yyval
.type
));
3859 compute_method_indexes((yyval
.type
));
3860 if (!parse_only
&& do_header
) write_interface((yyval
.type
));
3861 if (!parse_only
&& local_stubs
) write_locals(local_stubs
, (yyval
.type
), TRUE
);
3862 if (!parse_only
&& do_idfile
) write_iid((yyval
.type
));
3863 pointer_default
= (yyvsp
[-5].ifinfo
).old_pointer_default
;
3864 is_in_interface
= FALSE
;
3869 #line 965 "parser.y"
3870 { (yyval
.type
) = (yyvsp
[-7].ifinfo
).interface
;
3871 (yyval
.type
)->ref
= find_type2((yyvsp
[-5].str
), 0);
3872 if (!(yyval
.type
)->ref
) error_loc("base class '%s' not found in import\n", (yyvsp
[-5].str
));
3873 (yyval
.type
)->funcs
= (yyvsp
[-2].func_list
);
3874 compute_method_indexes((yyval
.type
));
3875 if (!parse_only
&& do_header
) write_interface((yyval
.type
));
3876 if (!parse_only
&& local_stubs
) write_locals(local_stubs
, (yyval
.type
), TRUE
);
3877 if (!parse_only
&& do_idfile
) write_iid((yyval
.type
));
3878 pointer_default
= (yyvsp
[-7].ifinfo
).old_pointer_default
;
3879 is_in_interface
= FALSE
;
3884 #line 976 "parser.y"
3885 { (yyval
.type
) = (yyvsp
[-1].type
); ;}
3889 #line 980 "parser.y"
3890 { (yyval
.type
) = (yyvsp
[-1].type
); if (!parse_only
&& do_header
) write_forward((yyval
.type
)); ;}
3894 #line 981 "parser.y"
3895 { (yyval
.type
) = (yyvsp
[-1].type
); if (!parse_only
&& do_header
) write_forward((yyval
.type
)); ;}
3899 #line 984 "parser.y"
3900 { (yyval
.type
) = make_type(0, NULL
); (yyval
.type
)->name
= (yyvsp
[0].str
); (yyval
.type
)->kind
= TKIND_MODULE
; ;}
3904 #line 985 "parser.y"
3905 { (yyval
.type
) = make_type(0, NULL
); (yyval
.type
)->name
= (yyvsp
[0].str
); (yyval
.type
)->kind
= TKIND_MODULE
; ;}
3909 #line 988 "parser.y"
3910 { (yyval
.type
) = (yyvsp
[0].type
);
3911 (yyval
.type
)->attrs
= check_module_attrs((yyvsp
[0].type
)->name
, (yyvsp
[-1].attr_list
));
3916 #line 994 "parser.y"
3917 { (yyval
.type
) = (yyvsp
[-4].type
);
3918 (yyval
.type
)->funcs
= (yyvsp
[-2].func_list
);
3919 /* FIXME: if (!parse_only && do_header) write_module($$); */
3924 #line 1001 "parser.y"
3925 { (yyval
.stgclass
) = STG_EXTERN
; ;}
3929 #line 1002 "parser.y"
3930 { (yyval
.stgclass
) = STG_STATIC
; ;}
3934 #line 1003 "parser.y"
3935 { (yyval
.stgclass
) = STG_REGISTER
; ;}
3939 #line 1007 "parser.y"
3940 { (yyval
.attr
) = make_attr(ATTR_INLINE
); ;}
3944 #line 1011 "parser.y"
3945 { (yyval
.attr
) = make_attr(ATTR_CONST
); ;}
3949 #line 1014 "parser.y"
3950 { (yyval
.attr_list
) = NULL
; ;}
3954 #line 1015 "parser.y"
3955 { (yyval
.attr_list
) = append_attr((yyvsp
[-1].attr_list
), (yyvsp
[0].attr
)); ;}
3959 #line 1018 "parser.y"
3960 { (yyval
.declspec
) = make_decl_spec((yyvsp
[-1].type
), (yyvsp
[0].declspec
), NULL
, NULL
, STG_NONE
); ;}
3964 #line 1020 "parser.y"
3965 { (yyval
.declspec
) = make_decl_spec((yyvsp
[-1].type
), (yyvsp
[-2].declspec
), (yyvsp
[0].declspec
), NULL
, STG_NONE
); ;}
3969 #line 1023 "parser.y"
3970 { (yyval
.declspec
) = NULL
; ;}
3974 #line 1028 "parser.y"
3975 { (yyval
.declspec
) = make_decl_spec(NULL
, (yyvsp
[0].declspec
), NULL
, (yyvsp
[-1].attr
), STG_NONE
); ;}
3979 #line 1029 "parser.y"
3980 { (yyval
.declspec
) = make_decl_spec(NULL
, (yyvsp
[0].declspec
), NULL
, (yyvsp
[-1].attr
), STG_NONE
); ;}
3984 #line 1030 "parser.y"
3985 { (yyval
.declspec
) = make_decl_spec(NULL
, (yyvsp
[0].declspec
), NULL
, NULL
, (yyvsp
[-1].stgclass
)); ;}
3989 #line 1035 "parser.y"
3990 { (yyval
.declarator
) = (yyvsp
[0].declarator
); (yyval
.declarator
)->type
= append_ptrchain_type((yyval
.declarator
)->type
, make_pointer_type(NULL
, (yyvsp
[-1].attr_list
))); ;}
3994 #line 1036 "parser.y"
3995 { (yyval
.declarator
) = (yyvsp
[0].declarator
); (yyval
.declarator
)->type
->attrs
= append_attr((yyval
.declarator
)->type
->attrs
, make_attrp(ATTR_CALLCONV
, (yyvsp
[-1].str
))); ;}
3999 #line 1041 "parser.y"
4000 { (yyval
.declarator
) = make_declarator((yyvsp
[0].var
)); ;}
4004 #line 1042 "parser.y"
4005 { (yyval
.declarator
) = (yyvsp
[-1].declarator
); ;}
4009 #line 1043 "parser.y"
4010 { (yyval
.declarator
) = (yyvsp
[-1].declarator
); (yyval
.declarator
)->array
= append_array((yyval
.declarator
)->array
, (yyvsp
[0].expr
)); ;}
4014 #line 1044 "parser.y"
4015 { (yyval
.declarator
) = (yyvsp
[-3].declarator
);
4016 (yyval
.declarator
)->func_type
= append_ptrchain_type((yyval
.declarator
)->type
, make_func_type((yyvsp
[-1].var_list
)));
4017 (yyval
.declarator
)->type
= NULL
;
4022 #line 1051 "parser.y"
4023 { (yyval
.declarator_list
) = append_declarator( NULL
, (yyvsp
[0].declarator
) ); ;}
4027 #line 1052 "parser.y"
4028 { (yyval
.declarator_list
) = append_declarator( (yyvsp
[-2].declarator_list
), (yyvsp
[0].declarator
) ); ;}
4032 #line 1056 "parser.y"
4033 { (yyval
.declarator
) = (yyvsp
[0].declarator
); ;}
4037 #line 1057 "parser.y"
4038 { (yyval
.declarator
) = (yyvsp
[-2].declarator
); (yyvsp
[-2].declarator
)->var
->eval
= (yyvsp
[0].expr
); ;}
4042 #line 1061 "parser.y"
4043 { (yyval
.num
) = RPC_FC_RP
; ;}
4047 #line 1062 "parser.y"
4048 { (yyval
.num
) = RPC_FC_UP
; ;}
4052 #line 1063 "parser.y"
4053 { (yyval
.num
) = RPC_FC_FP
; ;}
4057 #line 1066 "parser.y"
4058 { (yyval
.type
) = get_typev(RPC_FC_STRUCT
, (yyvsp
[-3].var
), tsSTRUCT
);
4059 /* overwrite RPC_FC_STRUCT with a more exact type */
4060 check_def((yyval
.type
));
4061 (yyval
.type
)->type
= get_struct_type( (yyvsp
[-1].var_list
) );
4062 (yyval
.type
)->kind
= TKIND_RECORD
;
4063 (yyval
.type
)->fields_or_args
= (yyvsp
[-1].var_list
);
4064 (yyval
.type
)->defined
= TRUE
;
4066 add_typelib_entry((yyval
.type
));
4071 #line 1078 "parser.y"
4072 { (yyval
.type
) = duptype(find_type("void", 0), 1); ;}
4076 #line 1079 "parser.y"
4077 { (yyval
.type
) = find_type((yyvsp
[0].str
), 0); ;}
4081 #line 1080 "parser.y"
4082 { (yyval
.type
) = (yyvsp
[0].type
); ;}
4086 #line 1081 "parser.y"
4087 { (yyval
.type
) = (yyvsp
[0].type
); ;}
4091 #line 1082 "parser.y"
4092 { (yyval
.type
) = find_type2((yyvsp
[0].str
), tsENUM
); ;}
4096 #line 1083 "parser.y"
4097 { (yyval
.type
) = (yyvsp
[0].type
); ;}
4101 #line 1084 "parser.y"
4102 { (yyval
.type
) = get_type(RPC_FC_STRUCT
, (yyvsp
[0].str
), tsSTRUCT
); ;}
4106 #line 1085 "parser.y"
4107 { (yyval
.type
) = (yyvsp
[0].type
); ;}
4111 #line 1086 "parser.y"
4112 { (yyval
.type
) = find_type2((yyvsp
[0].str
), tsUNION
); ;}
4116 #line 1087 "parser.y"
4117 { (yyval
.type
) = make_safearray((yyvsp
[-1].type
)); ;}
4121 #line 1091 "parser.y"
4122 { reg_typedefs((yyvsp
[-1].declspec
), (yyvsp
[0].declarator_list
), check_typedef_attrs((yyvsp
[-2].attr_list
)));
4123 (yyval
.statement
) = process_typedefs((yyvsp
[0].declarator_list
));
4128 #line 1097 "parser.y"
4129 { (yyval
.type
) = get_typev(RPC_FC_NON_ENCAPSULATED_UNION
, (yyvsp
[-3].var
), tsUNION
);
4130 check_def((yyval
.type
));
4131 (yyval
.type
)->kind
= TKIND_UNION
;
4132 (yyval
.type
)->fields_or_args
= (yyvsp
[-1].var_list
);
4133 (yyval
.type
)->defined
= TRUE
;
4138 #line 1105 "parser.y"
4139 { var_t
*u
= (yyvsp
[-3].var
);
4140 (yyval
.type
) = get_typev(RPC_FC_ENCAPSULATED_UNION
, (yyvsp
[-8].var
), tsUNION
);
4141 check_def((yyval
.type
));
4142 (yyval
.type
)->kind
= TKIND_UNION
;
4143 if (!u
) u
= make_var( xstrdup("tagged_union") );
4144 u
->type
= make_type(RPC_FC_NON_ENCAPSULATED_UNION
, NULL
);
4145 u
->type
->kind
= TKIND_UNION
;
4146 u
->type
->fields_or_args
= (yyvsp
[-1].var_list
);
4147 u
->type
->defined
= TRUE
;
4148 (yyval
.type
)->fields_or_args
= append_var( (yyval
.type
)->fields_or_args
, (yyvsp
[-5].var
) );
4149 (yyval
.type
)->fields_or_args
= append_var( (yyval
.type
)->fields_or_args
, u
);
4150 (yyval
.type
)->defined
= TRUE
;
4155 #line 1121 "parser.y"
4156 { (yyval
.num
) = MAKEVERSION((yyvsp
[0].num
), 0); ;}
4160 #line 1122 "parser.y"
4161 { (yyval
.num
) = MAKEVERSION((yyvsp
[-2].num
), (yyvsp
[0].num
)); ;}
4168 /* Line 1126 of yacc.c. */
4169 #line 4170 "parser.tab.c"
4175 YY_STACK_PRINT (yyss
, yyssp
);
4180 /* Now `shift' the result of the reduction. Determine what state
4181 that goes to, based on the state we popped back to and the rule
4182 number reduced by. */
4186 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
4187 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
4188 yystate
= yytable
[yystate
];
4190 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
4195 /*------------------------------------.
4196 | yyerrlab -- here on detecting error |
4197 `------------------------------------*/
4199 /* If not already recovering from an error, report this error. */
4204 yyn
= yypact
[yystate
];
4206 if (YYPACT_NINF
< yyn
&& yyn
< YYLAST
)
4208 int yytype
= YYTRANSLATE (yychar
);
4209 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytype
]);
4210 YYSIZE_T yysize
= yysize0
;
4212 int yysize_overflow
= 0;
4214 # define YYERROR_VERBOSE_ARGS_MAXIMUM 5
4215 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
4219 /* This is so xgettext sees the translatable formats that are
4220 constructed on the fly. */
4221 YY_("syntax error, unexpected %s");
4222 YY_("syntax error, unexpected %s, expecting %s");
4223 YY_("syntax error, unexpected %s, expecting %s or %s");
4224 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
4225 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
4229 static char const yyunexpected
[] = "syntax error, unexpected %s";
4230 static char const yyexpecting
[] = ", expecting %s";
4231 static char const yyor
[] = " or %s";
4232 char yyformat
[sizeof yyunexpected
4233 + sizeof yyexpecting
- 1
4234 + ((YYERROR_VERBOSE_ARGS_MAXIMUM
- 2)
4235 * (sizeof yyor
- 1))];
4236 char const *yyprefix
= yyexpecting
;
4238 /* Start YYX at -YYN if negative to avoid negative indexes in
4240 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
4242 /* Stay within bounds of both yycheck and yytname. */
4243 int yychecklim
= YYLAST
- yyn
;
4244 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
4247 yyarg
[0] = yytname
[yytype
];
4248 yyfmt
= yystpcpy (yyformat
, yyunexpected
);
4250 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
4251 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
4253 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
4257 yyformat
[sizeof yyunexpected
- 1] = '\0';
4260 yyarg
[yycount
++] = yytname
[yyx
];
4261 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
4262 yysize_overflow
|= yysize1
< yysize
;
4264 yyfmt
= yystpcpy (yyfmt
, yyprefix
);
4268 yyf
= YY_(yyformat
);
4269 yysize1
= yysize
+ yystrlen (yyf
);
4270 yysize_overflow
|= yysize1
< yysize
;
4273 if (!yysize_overflow
&& yysize
<= YYSTACK_ALLOC_MAXIMUM
)
4274 yymsg
= (char *) YYSTACK_ALLOC (yysize
);
4277 /* Avoid sprintf, as that infringes on the user's name space.
4278 Don't have undefined behavior even if the translation
4279 produced a string with the wrong number of "%s"s. */
4282 while ((*yyp
= *yyf
))
4284 if (*yyp
== '%' && yyf
[1] == 's' && yyi
< yycount
)
4286 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
4296 YYSTACK_FREE (yymsg
);
4300 yyerror (YY_("syntax error"));
4301 goto yyexhaustedlab
;
4305 #endif /* YYERROR_VERBOSE */
4306 yyerror (YY_("syntax error"));
4311 if (yyerrstatus
== 3)
4313 /* If just tried and failed to reuse look-ahead token after an
4314 error, discard it. */
4316 if (yychar
<= YYEOF
)
4318 /* Return failure if at end of input. */
4319 if (yychar
== YYEOF
)
4324 yydestruct ("Error: discarding", yytoken
, &yylval
);
4329 /* Else will try to reuse look-ahead token after shifting the error
4334 /*---------------------------------------------------.
4335 | yyerrorlab -- error raised explicitly by YYERROR. |
4336 `---------------------------------------------------*/
4339 /* Pacify compilers like GCC when the user code never invokes
4340 YYERROR and the label yyerrorlab therefore never appears in user
4351 /*-------------------------------------------------------------.
4352 | yyerrlab1 -- common code for both syntax error and YYERROR. |
4353 `-------------------------------------------------------------*/
4355 yyerrstatus
= 3; /* Each real token shifted decrements this. */
4359 yyn
= yypact
[yystate
];
4360 if (yyn
!= YYPACT_NINF
)
4363 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
4371 /* Pop the current state because it cannot handle the error token. */
4376 yydestruct ("Error: popping", yystos
[yystate
], yyvsp
);
4379 YY_STACK_PRINT (yyss
, yyssp
);
4388 /* Shift the error token. */
4389 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
4395 /*-------------------------------------.
4396 | yyacceptlab -- YYACCEPT comes here. |
4397 `-------------------------------------*/
4402 /*-----------------------------------.
4403 | yyabortlab -- YYABORT comes here. |
4404 `-----------------------------------*/
4410 /*-------------------------------------------------.
4411 | yyexhaustedlab -- memory exhaustion comes here. |
4412 `-------------------------------------------------*/
4414 yyerror (YY_("memory exhausted"));
4420 if (yychar
!= YYEOF
&& yychar
!= YYEMPTY
)
4421 yydestruct ("Cleanup: discarding lookahead",
4423 while (yyssp
!= yyss
)
4425 yydestruct ("Cleanup: popping",
4426 yystos
[*yyssp
], yyvsp
);
4431 YYSTACK_FREE (yyss
);
4437 #line 1125 "parser.y"
4440 static void decl_builtin(const char *name
, unsigned char type
)
4442 type_t
*t
= make_type(type
, NULL
);
4443 t
->name
= xstrdup(name
);
4444 reg_type(t
, name
, 0);
4447 static type_t
*make_builtin(char *name
)
4449 /* NAME is strdup'd in the lexer */
4450 type_t
*t
= duptype(find_type(name
, 0), 0);
4455 static type_t
*make_int(int sign
)
4457 type_t
*t
= duptype(find_type("int", 0), 1);
4461 t
->type
= t
->type
== RPC_FC_LONG
? RPC_FC_ULONG
: RPC_FC_USHORT
;
4466 void init_types(void)
4468 decl_builtin("void", 0);
4469 decl_builtin("byte", RPC_FC_BYTE
);
4470 decl_builtin("wchar_t", RPC_FC_WCHAR
);
4471 decl_builtin("int", RPC_FC_LONG
); /* win32 */
4472 decl_builtin("short", RPC_FC_SHORT
);
4473 decl_builtin("small", RPC_FC_SMALL
);
4474 decl_builtin("long", RPC_FC_LONG
);
4475 decl_builtin("hyper", RPC_FC_HYPER
);
4476 decl_builtin("__int64", RPC_FC_HYPER
);
4477 decl_builtin("char", RPC_FC_CHAR
);
4478 decl_builtin("float", RPC_FC_FLOAT
);
4479 decl_builtin("double", RPC_FC_DOUBLE
);
4480 decl_builtin("boolean", RPC_FC_BYTE
);
4481 decl_builtin("error_status_t", RPC_FC_ERROR_STATUS_T
);
4482 decl_builtin("handle_t", RPC_FC_BIND_PRIMITIVE
);
4485 static str_list_t
*append_str(str_list_t
*list
, char *str
)
4487 struct str_list_entry_t
*entry
;
4489 if (!str
) return list
;
4492 list
= xmalloc( sizeof(*list
) );
4495 entry
= xmalloc( sizeof(*entry
) );
4497 list_add_tail( list
, &entry
->entry
);
4501 static attr_list_t
*append_attr(attr_list_t
*list
, attr_t
*attr
)
4503 attr_t
*attr_existing
;
4504 if (!attr
) return list
;
4507 list
= xmalloc( sizeof(*list
) );
4510 LIST_FOR_EACH_ENTRY(attr_existing
, list
, attr_t
, entry
)
4511 if (attr_existing
->type
== attr
->type
)
4513 parser_warning("duplicate attribute %s\n", get_attr_display_name(attr
->type
));
4514 /* use the last attribute, like MIDL does */
4515 list_remove(&attr_existing
->entry
);
4518 list_add_tail( list
, &attr
->entry
);
4522 static attr_list_t
*move_attr(attr_list_t
*dst
, attr_list_t
*src
, enum attr_type type
)
4525 if (!src
) return dst
;
4526 LIST_FOR_EACH_ENTRY(attr
, src
, attr_t
, entry
)
4527 if (attr
->type
== type
)
4529 list_remove(&attr
->entry
);
4530 return append_attr(dst
, attr
);
4535 static attr_list_t
*append_attr_list(attr_list_t
*new_list
, attr_list_t
*old_list
)
4539 if (!old_list
) return new_list
;
4541 while ((entry
= list_head(old_list
)))
4543 attr_t
*attr
= LIST_ENTRY(entry
, attr_t
, entry
);
4545 new_list
= append_attr(new_list
, attr
);
4550 static attr_list_t
*dupattrs(const attr_list_t
*list
)
4552 attr_list_t
*new_list
;
4555 if (!list
) return NULL
;
4557 new_list
= xmalloc( sizeof(*list
) );
4558 list_init( new_list
);
4559 LIST_FOR_EACH_ENTRY(attr
, list
, const attr_t
, entry
)
4561 attr_t
*new_attr
= xmalloc(sizeof(*new_attr
));
4563 list_add_tail(new_list
, &new_attr
->entry
);
4568 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
)
4570 decl_spec_t
*declspec
= left
? left
: right
;
4573 declspec
= xmalloc(sizeof(*declspec
));
4574 declspec
->type
= NULL
;
4575 declspec
->attrs
= NULL
;
4576 declspec
->stgclass
= STG_NONE
;
4578 declspec
->type
= type
;
4579 if (left
&& declspec
!= left
)
4581 declspec
->attrs
= append_attr_list(declspec
->attrs
, left
->attrs
);
4582 if (declspec
->stgclass
== STG_NONE
)
4583 declspec
->stgclass
= left
->stgclass
;
4584 else if (left
->stgclass
!= STG_NONE
)
4585 error_loc("only one storage class can be specified\n");
4586 assert(!left
->type
);
4589 if (right
&& declspec
!= right
)
4591 declspec
->attrs
= append_attr_list(declspec
->attrs
, right
->attrs
);
4592 if (declspec
->stgclass
== STG_NONE
)
4593 declspec
->stgclass
= right
->stgclass
;
4594 else if (right
->stgclass
!= STG_NONE
)
4595 error_loc("only one storage class can be specified\n");
4596 assert(!right
->type
);
4600 declspec
->attrs
= append_attr(declspec
->attrs
, attr
);
4601 if (declspec
->stgclass
== STG_NONE
)
4602 declspec
->stgclass
= stgclass
;
4603 else if (stgclass
!= STG_NONE
)
4604 error_loc("only one storage class can be specified\n");
4606 /* apply attributes to type */
4607 if (type
&& declspec
->attrs
)
4610 declspec
->type
= duptype(type
, 1);
4611 attrs
= dupattrs(type
->attrs
);
4612 declspec
->type
->attrs
= append_attr_list(attrs
, declspec
->attrs
);
4613 declspec
->attrs
= NULL
;
4619 static attr_t
*make_attr(enum attr_type type
)
4621 attr_t
*a
= xmalloc(sizeof(attr_t
));
4627 static attr_t
*make_attrv(enum attr_type type
, unsigned long val
)
4629 attr_t
*a
= xmalloc(sizeof(attr_t
));
4635 static attr_t
*make_attrp(enum attr_type type
, void *val
)
4637 attr_t
*a
= xmalloc(sizeof(attr_t
));
4643 static expr_list_t
*append_expr(expr_list_t
*list
, expr_t
*expr
)
4645 if (!expr
) return list
;
4648 list
= xmalloc( sizeof(*list
) );
4651 list_add_tail( list
, &expr
->entry
);
4655 static array_dims_t
*append_array(array_dims_t
*list
, expr_t
*expr
)
4657 if (!expr
) return list
;
4660 list
= xmalloc( sizeof(*list
) );
4663 list_add_tail( list
, &expr
->entry
);
4667 static struct list type_pool
= LIST_INIT(type_pool
);
4674 type_t
*alloc_type(void)
4676 type_pool_node_t
*node
= xmalloc(sizeof *node
);
4677 list_add_tail(&type_pool
, &node
->link
);
4681 void set_all_tfswrite(int val
)
4683 type_pool_node_t
*node
;
4684 LIST_FOR_EACH_ENTRY(node
, &type_pool
, type_pool_node_t
, link
)
4685 node
->data
.tfswrite
= val
;
4688 type_t
*make_type(unsigned char type
, type_t
*ref
)
4690 type_t
*t
= alloc_type();
4692 t
->kind
= TKIND_PRIMITIVE
;
4698 t
->fields_or_args
= NULL
;
4702 t
->length_is
= NULL
;
4703 t
->typestring_offset
= 0;
4705 t
->declarray
= FALSE
;
4706 t
->ignore
= (parse_only
!= 0);
4710 t
->user_types_registered
= FALSE
;
4711 t
->tfswrite
= FALSE
;
4713 t
->typelib_idx
= -1;
4714 init_loc_info(&t
->loc_info
);
4718 static type_t
*make_func_type(var_list_t
*args
)
4720 type_t
*t
= make_type(RPC_FC_FUNCTION
, NULL
);
4721 t
->fields_or_args
= args
;
4725 static type_t
*make_pointer_type(type_t
*ref
, attr_list_t
*attrs
)
4727 type_t
*t
= make_type(pointer_default
, ref
);
4732 static type_t
*append_ptrchain_type(type_t
*ptrchain
, type_t
*type
)
4734 type_t
*ptrchain_type
;
4737 for (ptrchain_type
= ptrchain
; ptrchain_type
->ref
; ptrchain_type
= ptrchain_type
->ref
)
4739 ptrchain_type
->ref
= type
;
4743 static void set_type(var_t
*v
, decl_spec_t
*decl_spec
, const declarator_t
*decl
,
4746 expr_list_t
*sizes
= get_attrp(v
->attrs
, ATTR_SIZEIS
);
4747 expr_list_t
*lengs
= get_attrp(v
->attrs
, ATTR_LENGTHIS
);
4748 int ptr_attr
= get_attrv(v
->attrs
, ATTR_POINTERTYPE
);
4749 int sizeless
, has_varconf
;
4751 type_t
*atype
, **ptype
;
4752 array_dims_t
*arr
= decl
? decl
->array
: NULL
;
4753 type_t
*func_type
= decl
? decl
->func_type
: NULL
;
4754 type_t
*type
= decl_spec
->type
;
4756 if (is_attr(type
->attrs
, ATTR_INLINE
))
4759 error_loc("inline attribute applied to non-function type\n");
4763 /* move inline attribute from return type node to function node */
4764 for (t
= func_type
; is_ptr(t
); t
= t
->ref
)
4766 t
->attrs
= move_attr(t
->attrs
, type
->attrs
, ATTR_INLINE
);
4770 /* add type onto the end of the pointers in pident->type */
4771 v
->type
= append_ptrchain_type(decl
? decl
->type
: NULL
, type
);
4772 v
->stgclass
= decl_spec
->stgclass
;
4774 /* the highest level of pointer specified should default to the var's ptr attr
4775 * or (RPC_FC_RP if not specified and it's a top level ptr), not
4776 * pointer_default so we need to fix that up here */
4779 const type_t
*ptr
= NULL
;
4780 /* pointer attributes on the left side of the type belong to the function
4781 * pointer, if one is being declared */
4782 type_t
**pt
= func_type
? &func_type
: &v
->type
;
4783 for (ptr
= *pt
; ptr
; )
4785 if (ptr
->kind
== TKIND_ALIAS
)
4790 if (ptr
&& is_ptr(ptr
) && (ptr_attr
|| top
))
4792 /* duplicate type to avoid changing original type */
4793 *pt
= duptype(*pt
, 1);
4794 (*pt
)->type
= ptr_attr
? ptr_attr
: RPC_FC_RP
;
4797 error_loc("%s: pointer attribute applied to non-pointer type\n", v
->name
);
4800 if (is_attr(v
->attrs
, ATTR_STRING
) && !is_ptr(v
->type
) && !arr
)
4801 error_loc("'%s': [string] attribute applied to non-pointer, non-array type\n",
4804 if (is_attr(v
->attrs
, ATTR_V1ENUM
))
4806 if (v
->type
->type
== RPC_FC_ENUM16
)
4807 v
->type
->type
= RPC_FC_ENUM32
;
4809 error_loc("'%s': [v1_enum] attribute applied to non-enum type\n", v
->name
);
4813 if (arr
) LIST_FOR_EACH_ENTRY_REV(dim
, arr
, expr_t
, entry
)
4816 error_loc("%s: only the first array dimension can be unspecified\n", v
->name
);
4820 unsigned int align
= 0;
4821 size_t size
= type_memsize(v
->type
, &align
);
4824 error_loc("%s: array dimension must be positive\n", v
->name
);
4826 if (0xffffffffuL
/ size
< (unsigned long) dim
->cval
)
4827 error_loc("%s: total array size is too large\n", v
->name
);
4828 else if (0xffffuL
< size
* dim
->cval
)
4829 v
->type
= make_type(RPC_FC_LGFARRAY
, v
->type
);
4831 v
->type
= make_type(RPC_FC_SMFARRAY
, v
->type
);
4836 v
->type
= make_type(RPC_FC_CARRAY
, v
->type
);
4839 v
->type
->declarray
= TRUE
;
4840 v
->type
->dim
= dim
->cval
;
4844 has_varconf
= FALSE
;
4845 if (sizes
) LIST_FOR_EACH_ENTRY(dim
, sizes
, expr_t
, entry
)
4847 if (dim
->type
!= EXPR_VOID
)
4850 atype
= *ptype
= duptype(*ptype
, 0);
4852 if (atype
->type
== RPC_FC_SMFARRAY
|| atype
->type
== RPC_FC_LGFARRAY
)
4853 error_loc("%s: cannot specify size_is for a fixed sized array\n", v
->name
);
4855 if (atype
->type
!= RPC_FC_CARRAY
&& !is_ptr(atype
))
4856 error_loc("%s: size_is attribute applied to illegal type\n", v
->name
);
4858 atype
->type
= RPC_FC_CARRAY
;
4859 atype
->size_is
= dim
;
4862 ptype
= &(*ptype
)->ref
;
4864 error_loc("%s: too many expressions in size_is attribute\n", v
->name
);
4868 if (lengs
) LIST_FOR_EACH_ENTRY(dim
, lengs
, expr_t
, entry
)
4870 if (dim
->type
!= EXPR_VOID
)
4873 atype
= *ptype
= duptype(*ptype
, 0);
4875 if (atype
->type
== RPC_FC_SMFARRAY
)
4876 atype
->type
= RPC_FC_SMVARRAY
;
4877 else if (atype
->type
== RPC_FC_LGFARRAY
)
4878 atype
->type
= RPC_FC_LGVARRAY
;
4879 else if (atype
->type
== RPC_FC_CARRAY
)
4880 atype
->type
= RPC_FC_CVARRAY
;
4882 error_loc("%s: length_is attribute applied to illegal type\n", v
->name
);
4884 atype
->length_is
= dim
;
4887 ptype
= &(*ptype
)->ref
;
4889 error_loc("%s: too many expressions in length_is attribute\n", v
->name
);
4892 if (has_varconf
&& !last_array(v
->type
))
4895 for (ptype
= &v
->type
; is_array(*ptype
); ptype
= &(*ptype
)->ref
)
4897 *ptype
= duptype(*ptype
, 0);
4898 (*ptype
)->type
= RPC_FC_BOGUS_ARRAY
;
4902 if (is_array(v
->type
))
4904 const type_t
*rt
= v
->type
->ref
;
4905 if (is_user_type(rt
))
4906 v
->type
->type
= RPC_FC_BOGUS_ARRAY
;
4910 case RPC_FC_BOGUS_STRUCT
:
4911 case RPC_FC_NON_ENCAPSULATED_UNION
:
4912 case RPC_FC_ENCAPSULATED_UNION
:
4914 v
->type
->type
= RPC_FC_BOGUS_ARRAY
;
4916 /* FC_RP should be above, but widl overuses these, and will break things. */
4919 if (rt
->ref
->type
== RPC_FC_IP
)
4920 v
->type
->type
= RPC_FC_BOGUS_ARRAY
;
4925 /* v->type is currently pointing to the type on the left-side of the
4926 * declaration, so we need to fix this up so that it is the return type of the
4927 * function and make v->type point to the function side of the declaration */
4931 type_t
*return_type
= v
->type
;
4932 v
->type
= func_type
;
4933 for (ft
= v
->type
; is_ptr(ft
); ft
= ft
->ref
)
4935 assert(ft
->type
== RPC_FC_FUNCTION
);
4936 ft
->ref
= return_type
;
4937 /* move calling convention attribute, if present, from pointer nodes to
4939 for (t
= v
->type
; is_ptr(t
); t
= t
->ref
)
4940 ft
->attrs
= move_attr(ft
->attrs
, t
->attrs
, ATTR_CALLCONV
);
4941 if (is_object_interface
&& !is_attr(ft
->attrs
, ATTR_CALLCONV
))
4943 static char *stdmethodcalltype
;
4944 if (!stdmethodcalltype
) stdmethodcalltype
= strdup("STDMETHODCALLTYPE");
4945 ft
->attrs
= append_attr(NULL
, make_attrp(ATTR_CALLCONV
, stdmethodcalltype
));
4951 for (t
= v
->type
; is_ptr(t
); t
= t
->ref
)
4952 if (is_attr(t
->attrs
, ATTR_CALLCONV
))
4953 error_loc("calling convention applied to non-function-pointer type\n");
4957 static var_list_t
*set_var_types(attr_list_t
*attrs
, decl_spec_t
*decl_spec
, declarator_list_t
*decls
)
4959 declarator_t
*decl
, *next
;
4960 var_list_t
*var_list
= NULL
;
4962 LIST_FOR_EACH_ENTRY_SAFE( decl
, next
, decls
, declarator_t
, entry
)
4964 var_t
*var
= decl
->var
;
4967 set_type(var
, decl_spec
, decl
, 0);
4968 var_list
= append_var(var_list
, var
);
4974 static ifref_list_t
*append_ifref(ifref_list_t
*list
, ifref_t
*iface
)
4976 if (!iface
) return list
;
4979 list
= xmalloc( sizeof(*list
) );
4982 list_add_tail( list
, &iface
->entry
);
4986 static ifref_t
*make_ifref(type_t
*iface
)
4988 ifref_t
*l
= xmalloc(sizeof(ifref_t
));
4994 static var_list_t
*append_var(var_list_t
*list
, var_t
*var
)
4996 if (!var
) return list
;
4999 list
= xmalloc( sizeof(*list
) );
5002 list_add_tail( list
, &var
->entry
);
5006 static var_list_t
*append_var_list(var_list_t
*list
, var_list_t
*vars
)
5008 if (!vars
) return list
;
5011 list
= xmalloc( sizeof(*list
) );
5014 list_move_tail( list
, vars
);
5018 static var_t
*make_var(char *name
)
5020 var_t
*v
= xmalloc(sizeof(var_t
));
5025 v
->stgclass
= STG_NONE
;
5026 init_loc_info(&v
->loc_info
);
5030 static declarator_list_t
*append_declarator(declarator_list_t
*list
, declarator_t
*d
)
5032 if (!d
) return list
;
5034 list
= xmalloc(sizeof(*list
));
5037 list_add_tail(list
, &d
->entry
);
5041 static declarator_t
*make_declarator(var_t
*var
)
5043 declarator_t
*d
= xmalloc(sizeof(*d
));
5046 d
->func_type
= NULL
;
5051 static func_list_t
*append_func(func_list_t
*list
, func_t
*func
)
5053 if (!func
) return list
;
5056 list
= xmalloc( sizeof(*list
) );
5059 list_add_tail( list
, &func
->entry
);
5063 static func_t
*make_func(var_t
*def
)
5065 func_t
*f
= xmalloc(sizeof(func_t
));
5067 f
->args
= def
->type
->fields_or_args
;
5068 f
->ignore
= parse_only
;
5073 static type_t
*make_class(char *name
)
5075 type_t
*c
= make_type(RPC_FC_COCLASS
, NULL
);
5077 c
->kind
= TKIND_COCLASS
;
5081 static type_t
*make_safearray(type_t
*type
)
5083 type_t
*sa
= duptype(find_type("SAFEARRAY", 0), 1);
5085 return make_type(pointer_default
, sa
);
5088 static typelib_t
*make_library(const char *name
, const attr_list_t
*attrs
)
5090 typelib_t
*typelib
= xmalloc(sizeof(*typelib
));
5091 typelib
->name
= xstrdup(name
);
5092 typelib
->filename
= NULL
;
5093 typelib
->attrs
= attrs
;
5094 list_init( &typelib
->entries
);
5095 list_init( &typelib
->importlibs
);
5101 static int hash_ident(const char *name
)
5103 const char *p
= name
;
5105 /* a simple sum hash is probably good enough */
5110 return sum
& (HASHMAX
-1);
5113 /***** type repository *****/
5122 struct rtype
*type_hash
[HASHMAX
];
5124 static type_t
*reg_type(type_t
*type
, const char *name
, int t
)
5129 error_loc("registering named type without name\n");
5132 hash
= hash_ident(name
);
5133 nt
= xmalloc(sizeof(struct rtype
));
5137 nt
->next
= type_hash
[hash
];
5138 type_hash
[hash
] = nt
;
5142 static int is_incomplete(const type_t
*t
)
5144 return !t
->defined
&& (is_struct(t
->type
) || is_union(t
->type
));
5147 static void add_incomplete(type_t
*t
)
5149 struct typenode
*tn
= xmalloc(sizeof *tn
);
5151 list_add_tail(&incomplete_types
, &tn
->entry
);
5154 static void fix_type(type_t
*t
)
5156 if (t
->kind
== TKIND_ALIAS
&& is_incomplete(t
)) {
5157 type_t
*ot
= t
->orig
;
5159 t
->fields_or_args
= ot
->fields_or_args
;
5160 t
->defined
= ot
->defined
;
5164 static void fix_incomplete(void)
5166 struct typenode
*tn
, *next
;
5168 LIST_FOR_EACH_ENTRY_SAFE(tn
, next
, &incomplete_types
, struct typenode
, entry
) {
5174 static type_t
*reg_typedefs(decl_spec_t
*decl_spec
, declarator_list_t
*decls
, attr_list_t
*attrs
)
5176 const declarator_t
*decl
;
5177 int is_str
= is_attr(attrs
, ATTR_STRING
);
5178 type_t
*type
= decl_spec
->type
;
5182 type_t
*t
= decl_spec
->type
;
5189 if (c
!= RPC_FC_CHAR
&& c
!= RPC_FC_BYTE
&& c
!= RPC_FC_WCHAR
)
5191 decl
= LIST_ENTRY( list_head( decls
), const declarator_t
, entry
);
5192 error_loc("'%s': [string] attribute is only valid on 'char', 'byte', or 'wchar_t' pointers and arrays\n",
5197 /* We must generate names for tagless enum, struct or union.
5198 Typedef-ing a tagless enum, struct or union means we want the typedef
5199 to be included in a library hence the public attribute. */
5200 if ((type
->kind
== TKIND_ENUM
|| type
->kind
== TKIND_RECORD
5201 || type
->kind
== TKIND_UNION
) && ! type
->name
&& ! parse_only
)
5203 if (! is_attr(attrs
, ATTR_PUBLIC
))
5204 attrs
= append_attr( attrs
, make_attr(ATTR_PUBLIC
) );
5205 type
->name
= gen_name();
5207 else if (is_attr(attrs
, ATTR_UUID
) && !is_attr(attrs
, ATTR_PUBLIC
))
5208 attrs
= append_attr( attrs
, make_attr(ATTR_PUBLIC
) );
5210 LIST_FOR_EACH_ENTRY( decl
, decls
, const declarator_t
, entry
)
5212 var_t
*name
= decl
->var
;
5217 cur
= find_type_helper(name
->name
, 0);
5219 error_loc("%s: redefinition error; original definition was at %s:%d\n",
5220 cur
->name
, cur
->loc_info
.input_name
,
5221 cur
->loc_info
.line_number
);
5223 /* set the attributes to allow set_type to do some checks on them */
5224 name
->attrs
= attrs
;
5225 set_type(name
, decl_spec
, decl
, 0);
5226 cur
= alias(name
->type
, name
->name
);
5229 if (is_incomplete(cur
))
5230 add_incomplete(cur
);
5231 reg_type(cur
, cur
->name
, 0);
5237 static type_t
*find_type_helper(const char *name
, int t
)
5239 struct rtype
*cur
= type_hash
[hash_ident(name
)];
5240 while (cur
&& (cur
->t
!= t
|| strcmp(cur
->name
, name
)))
5242 return cur
? cur
->type
: NULL
;
5245 type_t
*find_type(const char *name
, int t
)
5247 type_t
*type
= find_type_helper(name
, t
);
5249 error_loc("type '%s' not found\n", name
);
5255 static type_t
*find_type2(char *name
, int t
)
5257 type_t
*tp
= find_type(name
, t
);
5262 int is_type(const char *name
)
5264 return find_type_helper(name
, 0) != NULL
;
5267 static type_t
*get_type(unsigned char type
, char *name
, int t
)
5271 tp
= find_type_helper(name
, t
);
5277 tp
= make_type(type
, NULL
);
5279 if (!name
) return tp
;
5280 return reg_type(tp
, name
, t
);
5283 static type_t
*get_typev(unsigned char type
, var_t
*name
, int t
)
5290 return get_type(type
, sname
, t
);
5293 static int get_struct_type(var_list_t
*fields
)
5295 int has_pointer
= 0;
5296 int has_conformance
= 0;
5297 int has_variance
= 0;
5300 if (get_padding(fields
))
5301 return RPC_FC_BOGUS_STRUCT
;
5303 if (fields
) LIST_FOR_EACH_ENTRY( field
, fields
, var_t
, entry
)
5305 type_t
*t
= field
->type
;
5307 if (is_user_type(t
))
5308 return RPC_FC_BOGUS_STRUCT
;
5319 case RPC_FC_ENCAPSULATED_UNION
:
5320 case RPC_FC_NON_ENCAPSULATED_UNION
:
5321 case RPC_FC_BOGUS_STRUCT
:
5322 return RPC_FC_BOGUS_STRUCT
;
5329 if (field
->type
->declarray
)
5331 if (is_string_type(field
->attrs
, field
->type
))
5333 if (is_conformant_array(field
->type
))
5334 has_conformance
= 1;
5339 if (is_array(field
->type
->ref
))
5340 return RPC_FC_BOGUS_STRUCT
;
5342 if (is_conformant_array(field
->type
))
5344 has_conformance
= 1;
5345 if (field
->type
->declarray
&& list_next(fields
, &field
->entry
))
5346 error_loc("field '%s' deriving from a conformant array must be the last field in the structure\n",
5349 if (field
->type
->length_is
)
5352 t
= field
->type
->ref
;
5358 * RPC_FC_BYTE, RPC_FC_STRUCT, etc
5359 * Simple types don't effect the type of struct.
5360 * A struct containing a simple struct is still a simple struct.
5361 * So long as we can block copy the data, we return RPC_FC_STRUCT.
5363 case 0: /* void pointer */
5373 case RPC_FC_INT3264
:
5374 case RPC_FC_UINT3264
:
5387 case RPC_FC_CVARRAY
:
5388 case RPC_FC_BOGUS_ARRAY
:
5393 * Propagate member attributes
5394 * a struct should be at least as complex as its member
5396 case RPC_FC_CVSTRUCT
:
5397 has_conformance
= 1;
5402 case RPC_FC_CPSTRUCT
:
5403 has_conformance
= 1;
5404 if (list_next( fields
, &field
->entry
))
5405 error_loc("field '%s' deriving from a conformant array must be the last field in the structure\n",
5410 case RPC_FC_CSTRUCT
:
5411 has_conformance
= 1;
5412 if (list_next( fields
, &field
->entry
))
5413 error_loc("field '%s' deriving from a conformant array must be the last field in the structure\n",
5417 case RPC_FC_PSTRUCT
:
5422 error_loc("Unknown struct member %s with type (0x%02x)\n", field
->name
, t
->type
);
5423 /* fallthru - treat it as complex */
5425 /* as soon as we see one of these these members, it's bogus... */
5426 case RPC_FC_ENCAPSULATED_UNION
:
5427 case RPC_FC_NON_ENCAPSULATED_UNION
:
5428 case RPC_FC_BOGUS_STRUCT
:
5430 return RPC_FC_BOGUS_STRUCT
;
5436 if ( has_conformance
)
5437 return RPC_FC_CVSTRUCT
;
5439 return RPC_FC_BOGUS_STRUCT
;
5441 if( has_conformance
&& has_pointer
)
5442 return RPC_FC_CPSTRUCT
;
5443 if( has_conformance
)
5444 return RPC_FC_CSTRUCT
;
5446 return RPC_FC_PSTRUCT
;
5447 return RPC_FC_STRUCT
;
5450 /***** constant repository *****/
5455 struct rconst
*next
;
5458 struct rconst
*const_hash
[HASHMAX
];
5460 static var_t
*reg_const(var_t
*var
)
5465 error_loc("registering constant without name\n");
5468 hash
= hash_ident(var
->name
);
5469 nc
= xmalloc(sizeof(struct rconst
));
5470 nc
->name
= var
->name
;
5472 nc
->next
= const_hash
[hash
];
5473 const_hash
[hash
] = nc
;
5477 var_t
*find_const(const char *name
, int f
)
5479 struct rconst
*cur
= const_hash
[hash_ident(name
)];
5480 while (cur
&& strcmp(cur
->name
, name
))
5483 if (f
) error_loc("constant '%s' not found\n", name
);
5489 static void write_libid(const typelib_t
*typelib
)
5491 const UUID
*uuid
= get_attrp(typelib
->attrs
, ATTR_UUID
);
5492 write_guid(idfile
, "LIBID", typelib
->name
, uuid
);
5495 static void write_clsid(type_t
*cls
)
5497 const UUID
*uuid
= get_attrp(cls
->attrs
, ATTR_UUID
);
5498 write_guid(idfile
, "CLSID", cls
->name
, uuid
);
5501 static void write_diid(type_t
*iface
)
5503 const UUID
*uuid
= get_attrp(iface
->attrs
, ATTR_UUID
);
5504 write_guid(idfile
, "DIID", iface
->name
, uuid
);
5507 static void write_iid(type_t
*iface
)
5509 const UUID
*uuid
= get_attrp(iface
->attrs
, ATTR_UUID
);
5510 write_guid(idfile
, "IID", iface
->name
, uuid
);
5513 static int compute_method_indexes(type_t
*iface
)
5519 idx
= compute_method_indexes(iface
->ref
);
5526 LIST_FOR_EACH_ENTRY( f
, iface
->funcs
, func_t
, entry
)
5527 if (! is_callas(f
->def
->attrs
))
5533 static char *gen_name(void)
5535 static const char format
[] = "__WIDL_%s_generated_name_%08lX";
5536 static unsigned long n
= 0;
5537 static const char *file_id
;
5543 char *dst
= dup_basename(input_name
, ".idl");
5547 if (! isalnum((unsigned char) *dst
))
5550 size
= sizeof format
- 7 + strlen(file_id
) + 8;
5553 name
= xmalloc(size
);
5554 sprintf(name
, format
, file_id
, n
++);
5560 unsigned int dce_compatible
: 1;
5561 unsigned int acf
: 1;
5562 unsigned int on_interface
: 1;
5563 unsigned int on_function
: 1;
5564 unsigned int on_arg
: 1;
5565 unsigned int on_type
: 1;
5566 unsigned int on_field
: 1;
5567 unsigned int on_library
: 1;
5568 unsigned int on_dispinterface
: 1;
5569 unsigned int on_module
: 1;
5570 unsigned int on_coclass
: 1;
5571 const char *display_name
;
5574 struct allowed_attr allowed_attr
[] =
5576 /* attr { D ACF I Fn ARG T Fi L DI M C <display name> } */
5577 /* ATTR_AGGREGATABLE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "aggregatable" },
5578 /* ATTR_APPOBJECT */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "appobject" },
5579 /* ATTR_ASYNC */ { 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, "async" },
5580 /* ATTR_AUTO_HANDLE */ { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, "auto_handle" },
5581 /* ATTR_BINDABLE */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "bindable" },
5582 /* ATTR_BROADCAST */ { 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "broadcast" },
5583 /* ATTR_CALLAS */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "call_as" },
5584 /* ATTR_CALLCONV */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, NULL
},
5585 /* ATTR_CASE */ { 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, "case" },
5586 /* ATTR_CONST */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "const" },
5587 /* ATTR_CONTEXTHANDLE */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, "context_handle" },
5588 /* ATTR_CONTROL */ { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, "control" },
5589 /* ATTR_DEFAULT */ { 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, "default" },
5590 /* ATTR_DEFAULTCOLLELEM */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "defaultcollelem" },
5591 /* ATTR_DEFAULTVALUE */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, "defaultvalue" },
5592 /* ATTR_DEFAULTVTABLE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "defaultvtable" },
5593 /* ATTR_DISPINTERFACE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL
},
5594 /* ATTR_DISPLAYBIND */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "displaybind" },
5595 /* ATTR_DLLNAME */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, "dllname" },
5596 /* ATTR_DUAL */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "dual" },
5597 /* ATTR_ENDPOINT */ { 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "endpoint" },
5598 /* ATTR_ENTRY */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "entry" },
5599 /* ATTR_EXPLICIT_HANDLE */ { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, "explicit_handle" },
5600 /* ATTR_HANDLE */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, "handle" },
5601 /* ATTR_HELPCONTEXT */ { 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, "helpcontext" },
5602 /* ATTR_HELPFILE */ { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, "helpfile" },
5603 /* ATTR_HELPSTRING */ { 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, "helpstring" },
5604 /* ATTR_HELPSTRINGCONTEXT */ { 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, "helpstringcontext" },
5605 /* ATTR_HELPSTRINGDLL */ { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, "helpstringdll" },
5606 /* ATTR_HIDDEN */ { 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, "hidden" },
5607 /* ATTR_ID */ { 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, "id" },
5608 /* ATTR_IDEMPOTENT */ { 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "idempotent" },
5609 /* ATTR_IIDIS */ { 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, "iid_is" },
5610 /* ATTR_IMMEDIATEBIND */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "immediatebind" },
5611 /* ATTR_IMPLICIT_HANDLE */ { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, "implicit_handle" },
5612 /* ATTR_IN */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, "in" },
5613 /* ATTR_INLINE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "inline" },
5614 /* ATTR_INPUTSYNC */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "inputsync" },
5615 /* ATTR_LENGTHIS */ { 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, "length_is" },
5616 /* ATTR_LIBLCID */ { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, "lcid" },
5617 /* ATTR_LOCAL */ { 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, "local" },
5618 /* ATTR_NONBROWSABLE */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "nonbrowsable" },
5619 /* ATTR_NONCREATABLE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "noncreatable" },
5620 /* ATTR_NONEXTENSIBLE */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "nonextensible" },
5621 /* ATTR_OBJECT */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "object" },
5622 /* ATTR_ODL */ { 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, "odl" },
5623 /* ATTR_OLEAUTOMATION */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "oleautomation" },
5624 /* ATTR_OPTIONAL */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, "optional" },
5625 /* ATTR_OUT */ { 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, "out" },
5626 /* ATTR_POINTERDEFAULT */ { 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "pointer_default" },
5627 /* ATTR_POINTERTYPE */ { 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, "ref, unique or ptr" },
5628 /* ATTR_PROPGET */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "propget" },
5629 /* ATTR_PROPPUT */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "propput" },
5630 /* ATTR_PROPPUTREF */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "propputref" },
5631 /* ATTR_PUBLIC */ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, "public" },
5632 /* ATTR_RANGE */ { 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, "range" },
5633 /* ATTR_READONLY */ { 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, "readonly" },
5634 /* ATTR_REQUESTEDIT */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "requestedit" },
5635 /* ATTR_RESTRICTED */ { 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, "restricted" },
5636 /* ATTR_RETVAL */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, "retval" },
5637 /* ATTR_SIZEIS */ { 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, "size_is" },
5638 /* ATTR_SOURCE */ { 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, "source" },
5639 /* ATTR_STRICTCONTEXTHANDLE */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "strict_context_handle" },
5640 /* ATTR_STRING */ { 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, "string" },
5641 /* ATTR_SWITCHIS */ { 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, "switch_is" },
5642 /* ATTR_SWITCHTYPE */ { 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, "switch_type" },
5643 /* ATTR_TRANSMITAS */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, "transmit_as" },
5644 /* ATTR_UUID */ { 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, "uuid" },
5645 /* ATTR_V1ENUM */ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, "v1_enum" },
5646 /* ATTR_VARARG */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "vararg" },
5647 /* ATTR_VERSION */ { 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, "version" },
5648 /* ATTR_WIREMARSHAL */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, "wire_marshal" },
5651 const char *get_attr_display_name(enum attr_type type
)
5653 return allowed_attr
[type
].display_name
;
5656 static attr_list_t
*check_iface_attrs(const char *name
, attr_list_t
*attrs
)
5659 if (!attrs
) return attrs
;
5660 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
5662 if (!allowed_attr
[attr
->type
].on_interface
)
5663 error_loc("inapplicable attribute %s for interface %s\n",
5664 allowed_attr
[attr
->type
].display_name
, name
);
5669 static attr_list_t
*check_function_attrs(const char *name
, attr_list_t
*attrs
)
5672 if (!attrs
) return attrs
;
5673 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
5675 if (!allowed_attr
[attr
->type
].on_function
)
5676 error_loc("inapplicable attribute %s for function %s\n",
5677 allowed_attr
[attr
->type
].display_name
, name
);
5682 static void check_arg(var_t
*arg
)
5684 const type_t
*t
= arg
->type
;
5687 if (t
->type
== 0 && ! is_var_ptr(arg
))
5688 error_loc("argument '%s' has void type\n", arg
->name
);
5692 LIST_FOR_EACH_ENTRY(attr
, arg
->attrs
, const attr_t
, entry
)
5694 if (!allowed_attr
[attr
->type
].on_arg
)
5695 error_loc("inapplicable attribute %s for argument %s\n",
5696 allowed_attr
[attr
->type
].display_name
, arg
->name
);
5701 static attr_list_t
*check_typedef_attrs(attr_list_t
*attrs
)
5704 if (!attrs
) return attrs
;
5705 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
5707 if (!allowed_attr
[attr
->type
].on_type
)
5708 error_loc("inapplicable attribute %s for typedef\n",
5709 allowed_attr
[attr
->type
].display_name
);
5714 static attr_list_t
*check_field_attrs(const char *name
, attr_list_t
*attrs
)
5717 if (!attrs
) return attrs
;
5718 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
5720 if (!allowed_attr
[attr
->type
].on_field
)
5721 error_loc("inapplicable attribute %s for field %s\n",
5722 allowed_attr
[attr
->type
].display_name
, name
);
5727 static attr_list_t
*check_library_attrs(const char *name
, attr_list_t
*attrs
)
5730 if (!attrs
) return attrs
;
5731 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
5733 if (!allowed_attr
[attr
->type
].on_library
)
5734 error_loc("inapplicable attribute %s for library %s\n",
5735 allowed_attr
[attr
->type
].display_name
, name
);
5740 static attr_list_t
*check_dispiface_attrs(const char *name
, attr_list_t
*attrs
)
5743 if (!attrs
) return attrs
;
5744 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
5746 if (!allowed_attr
[attr
->type
].on_dispinterface
)
5747 error_loc("inapplicable attribute %s for dispinterface %s\n",
5748 allowed_attr
[attr
->type
].display_name
, name
);
5753 static attr_list_t
*check_module_attrs(const char *name
, attr_list_t
*attrs
)
5756 if (!attrs
) return attrs
;
5757 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
5759 if (!allowed_attr
[attr
->type
].on_module
)
5760 error_loc("inapplicable attribute %s for module %s\n",
5761 allowed_attr
[attr
->type
].display_name
, name
);
5766 static attr_list_t
*check_coclass_attrs(const char *name
, attr_list_t
*attrs
)
5769 if (!attrs
) return attrs
;
5770 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
5772 if (!allowed_attr
[attr
->type
].on_coclass
)
5773 error_loc("inapplicable attribute %s for coclass %s\n",
5774 allowed_attr
[attr
->type
].display_name
, name
);
5779 static int is_allowed_conf_type(const type_t
*type
)
5800 static int is_ptr_guid_type(const type_t
*type
)
5802 unsigned int align
= 0;
5805 if (type
->kind
== TKIND_ALIAS
)
5807 else if (is_ptr(type
))
5815 return (type_memsize(type
, &align
) == 16);
5818 static void check_conformance_expr_list(const char *attr_name
, const var_t
*arg
, const type_t
*container_type
, expr_list_t
*expr_list
)
5821 struct expr_loc expr_loc
;
5823 expr_loc
.attr
= attr_name
;
5824 if (expr_list
) LIST_FOR_EACH_ENTRY(dim
, expr_list
, expr_t
, entry
)
5826 if (dim
->type
!= EXPR_VOID
)
5828 const type_t
*expr_type
= expr_resolve_type(&expr_loc
, container_type
, dim
);
5829 if (!is_allowed_conf_type(expr_type
))
5830 error_loc_info(&arg
->loc_info
, "expression must resolve to integral type <= 32bits for attribute %s\n",
5836 static void check_remoting_fields(const var_t
*var
, type_t
*type
);
5838 /* checks that properties common to fields and arguments are consistent */
5839 static void check_field_common(const type_t
*container_type
,
5840 const char *container_name
, const var_t
*arg
)
5842 type_t
*type
= arg
->type
;
5843 int is_wire_marshal
= 0;
5844 int is_context_handle
= 0;
5845 const char *container_type_name
= NULL
;
5847 if (is_struct(container_type
->type
))
5848 container_type_name
= "struct";
5849 else if (is_union(container_type
->type
))
5850 container_type_name
= "union";
5851 else if (container_type
->type
== RPC_FC_FUNCTION
)
5852 container_type_name
= "function";
5854 if (is_attr(arg
->attrs
, ATTR_LENGTHIS
) &&
5855 (is_attr(arg
->attrs
, ATTR_STRING
) || is_aliaschain_attr(arg
->type
, ATTR_STRING
)))
5856 error_loc_info(&arg
->loc_info
,
5857 "string and length_is specified for argument %s are mutually exclusive attributes\n",
5860 if (is_attr(arg
->attrs
, ATTR_SIZEIS
))
5862 expr_list_t
*size_is_exprs
= get_attrp(arg
->attrs
, ATTR_SIZEIS
);
5863 check_conformance_expr_list("size_is", arg
, container_type
, size_is_exprs
);
5865 if (is_attr(arg
->attrs
, ATTR_LENGTHIS
))
5867 expr_list_t
*length_is_exprs
= get_attrp(arg
->attrs
, ATTR_LENGTHIS
);
5868 check_conformance_expr_list("length_is", arg
, container_type
, length_is_exprs
);
5870 if (is_attr(arg
->attrs
, ATTR_IIDIS
))
5872 struct expr_loc expr_loc
;
5873 expr_t
*expr
= get_attrp(arg
->attrs
, ATTR_IIDIS
);
5874 if (expr
->type
!= EXPR_VOID
)
5876 const type_t
*expr_type
;
5878 expr_loc
.attr
= "iid_is";
5879 expr_type
= expr_resolve_type(&expr_loc
, container_type
, expr
);
5880 if (!expr_type
|| !is_ptr_guid_type(expr_type
))
5881 error_loc_info(&arg
->loc_info
, "expression must resolve to pointer to GUID type for attribute iid_is\n");
5884 if (is_attr(arg
->attrs
, ATTR_SWITCHIS
))
5886 struct expr_loc expr_loc
;
5887 expr_t
*expr
= get_attrp(arg
->attrs
, ATTR_SWITCHIS
);
5888 if (expr
->type
!= EXPR_VOID
)
5890 const type_t
*expr_type
;
5892 expr_loc
.attr
= "switch_is";
5893 expr_type
= expr_resolve_type(&expr_loc
, container_type
, expr
);
5894 if (!expr_type
|| !is_allowed_conf_type(expr_type
))
5895 error_loc_info(&arg
->loc_info
, "expression must resolve to integral type <= 32bits for attribute %s\n",
5900 /* get fundamental type for the argument */
5903 if (is_attr(type
->attrs
, ATTR_WIREMARSHAL
))
5905 is_wire_marshal
= 1;
5908 if (is_attr(type
->attrs
, ATTR_CONTEXTHANDLE
))
5910 is_context_handle
= 1;
5913 if (type
->kind
== TKIND_ALIAS
)
5915 else if (is_ptr(type
) || is_array(type
))
5921 if (type
->type
== 0 && !is_attr(arg
->attrs
, ATTR_IIDIS
) && !is_wire_marshal
&& !is_context_handle
)
5922 error_loc_info(&arg
->loc_info
, "parameter \'%s\' of %s \'%s\' cannot derive from void *\n", arg
->name
, container_type_name
, container_name
);
5923 else if (type
->type
== RPC_FC_FUNCTION
)
5924 error_loc_info(&arg
->loc_info
, "parameter \'%s\' of %s \'%s\' cannot be a function pointer\n", arg
->name
, container_type_name
, container_name
);
5925 else if (!is_wire_marshal
&& (is_struct(type
->type
) || is_union(type
->type
)))
5926 check_remoting_fields(arg
, type
);
5929 static void check_remoting_fields(const var_t
*var
, type_t
*type
)
5932 const var_list_t
*fields
= NULL
;
5937 type
->checked
= TRUE
;
5939 if (is_struct(type
->type
))
5942 fields
= type
->fields_or_args
;
5944 error_loc_info(&var
->loc_info
, "undefined type declaration %s\n", type
->name
);
5946 else if (is_union(type
->type
))
5948 if (type
->type
== RPC_FC_ENCAPSULATED_UNION
)
5950 const var_t
*uv
= LIST_ENTRY(list_tail(type
->fields_or_args
), const var_t
, entry
);
5951 fields
= uv
->type
->fields_or_args
;
5954 fields
= type
->fields_or_args
;
5957 if (fields
) LIST_FOR_EACH_ENTRY( field
, fields
, const var_t
, entry
)
5958 if (field
->type
) check_field_common(type
, type
->name
, field
);
5961 /* checks that arguments for a function make sense for marshalling and unmarshalling */
5962 static void check_remoting_args(const func_t
*func
)
5964 const char *funcname
= func
->def
->name
;
5967 if (func
->args
) LIST_FOR_EACH_ENTRY( arg
, func
->args
, const var_t
, entry
)
5970 const type_t
*type
= arg
->type
;
5972 /* get pointer level and fundamental type for the argument */
5975 if (is_attr(type
->attrs
, ATTR_WIREMARSHAL
))
5977 if (is_attr(type
->attrs
, ATTR_CONTEXTHANDLE
))
5979 if (type
->kind
== TKIND_ALIAS
)
5981 else if (is_ptr(type
))
5990 /* check that [out] parameters have enough pointer levels */
5991 if (is_attr(arg
->attrs
, ATTR_OUT
))
5993 if (!is_array(type
))
5996 error_loc_info(&arg
->loc_info
, "out parameter \'%s\' of function \'%s\' is not a pointer\n", arg
->name
, funcname
);
5997 if (type
->type
== RPC_FC_IP
&& ptr_level
== 1)
5998 error_loc_info(&arg
->loc_info
, "out interface pointer \'%s\' of function \'%s\' is not a double pointer\n", arg
->name
, funcname
);
6002 check_field_common(func
->def
->type
, funcname
, arg
);
6006 static void add_explicit_handle_if_necessary(func_t
*func
)
6008 const var_t
* explicit_handle_var
;
6009 const var_t
* explicit_generic_handle_var
= NULL
;
6010 const var_t
* context_handle_var
= NULL
;
6012 /* check for a defined binding handle */
6013 explicit_handle_var
= get_explicit_handle_var(func
);
6014 if (!explicit_handle_var
)
6016 explicit_generic_handle_var
= get_explicit_generic_handle_var(func
);
6017 if (!explicit_generic_handle_var
)
6019 context_handle_var
= get_context_handle_var(func
);
6020 if (!context_handle_var
)
6022 /* no explicit handle specified so add
6023 * "[in] handle_t IDL_handle" as the first parameter to the
6025 var_t
*idl_handle
= make_var(xstrdup("IDL_handle"));
6026 idl_handle
->attrs
= append_attr(NULL
, make_attr(ATTR_IN
));
6027 idl_handle
->type
= find_type("handle_t", 0);
6028 if (!func
->def
->type
->fields_or_args
)
6030 func
->def
->type
->fields_or_args
= xmalloc( sizeof(*func
->def
->type
->fields_or_args
) );
6031 list_init( func
->def
->type
->fields_or_args
);
6033 list_add_head( func
->def
->type
->fields_or_args
, &idl_handle
->entry
);
6034 func
->args
= func
->def
->type
->fields_or_args
;
6040 static void check_functions(const type_t
*iface
)
6042 if (is_attr(iface
->attrs
, ATTR_EXPLICIT_HANDLE
) && iface
->funcs
)
6045 LIST_FOR_EACH_ENTRY( func
, iface
->funcs
, func_t
, entry
)
6046 add_explicit_handle_if_necessary(func
);
6048 if (!is_inside_library
&& !is_attr(iface
->attrs
, ATTR_LOCAL
))
6051 if (iface
->funcs
) LIST_FOR_EACH_ENTRY( func
, iface
->funcs
, const func_t
, entry
)
6053 if (!is_attr(func
->def
->attrs
, ATTR_LOCAL
))
6054 check_remoting_args(func
);
6059 static void check_all_user_types(const statement_list_t
*stmts
)
6061 const statement_t
*stmt
;
6063 if (stmts
) LIST_FOR_EACH_ENTRY(stmt
, stmts
, const statement_t
, entry
)
6065 if (stmt
->type
== STMT_LIBRARY
)
6066 check_all_user_types(stmt
->u
.lib
->stmts
);
6067 else if (stmt
->type
== STMT_TYPE
&& stmt
->u
.type
->type
== RPC_FC_IP
)
6070 const func_list_t
*fs
= stmt
->u
.type
->funcs
;
6071 if (fs
) LIST_FOR_EACH_ENTRY(f
, fs
, const func_t
, entry
)
6072 check_for_additional_prototype_types(f
->args
);
6077 int is_valid_uuid(const char *s
)
6081 for (i
= 0; i
< 36; ++i
)
6082 if (i
== 8 || i
== 13 || i
== 18 || i
== 23)
6088 if (!isxdigit(s
[i
]))
6091 return s
[i
] == '\0';
6094 static statement_t
*make_statement(enum statement_type type
)
6096 statement_t
*stmt
= xmalloc(sizeof(*stmt
));
6101 static statement_t
*make_statement_type_decl(type_t
*type
)
6103 statement_t
*stmt
= make_statement(STMT_TYPE
);
6104 stmt
->u
.type
= type
;
6108 static statement_t
*make_statement_reference(type_t
*type
)
6110 statement_t
*stmt
= make_statement(STMT_TYPEREF
);
6111 stmt
->u
.type
= type
;
6115 static statement_t
*make_statement_declaration(var_t
*var
)
6117 statement_t
*stmt
= make_statement(STMT_DECLARATION
);
6119 if (var
->stgclass
== STG_EXTERN
&& var
->eval
)
6120 warning("'%s' initialised and declared extern\n", var
->name
);
6121 if (is_const_decl(var
))
6126 else if ((var
->stgclass
== STG_NONE
|| var
->stgclass
== STG_REGISTER
) &&
6127 var
->type
->type
!= RPC_FC_FUNCTION
)
6128 error_loc("instantiation of data is illegal\n");
6132 static statement_t
*make_statement_library(typelib_t
*typelib
)
6134 statement_t
*stmt
= make_statement(STMT_LIBRARY
);
6135 stmt
->u
.lib
= typelib
;
6139 static statement_t
*make_statement_cppquote(const char *str
)
6141 statement_t
*stmt
= make_statement(STMT_CPPQUOTE
);
6146 static statement_t
*make_statement_importlib(const char *str
)
6148 statement_t
*stmt
= make_statement(STMT_IMPORTLIB
);
6153 static statement_t
*make_statement_import(const char *str
)
6155 statement_t
*stmt
= make_statement(STMT_IMPORT
);
6160 static statement_t
*make_statement_module(type_t
*type
)
6162 statement_t
*stmt
= make_statement(STMT_MODULE
);
6163 stmt
->u
.type
= type
;
6167 static statement_t
*process_typedefs(declarator_list_t
*decls
)
6169 declarator_t
*decl
, *next
;
6171 type_list_t
**type_list
;
6173 if (!decls
) return NULL
;
6175 stmt
= make_statement(STMT_TYPEDEF
);
6176 stmt
->u
.type_list
= NULL
;
6177 type_list
= &stmt
->u
.type_list
;
6179 LIST_FOR_EACH_ENTRY_SAFE( decl
, next
, decls
, declarator_t
, entry
)
6181 var_t
*var
= decl
->var
;
6182 type_t
*type
= find_type(var
->name
, 0);
6183 *type_list
= xmalloc(sizeof(type_list_t
));
6184 (*type_list
)->type
= type
;
6185 (*type_list
)->next
= NULL
;
6187 if (! parse_only
&& do_header
)
6188 write_typedef(type
);
6189 if (in_typelib
&& is_attr(type
->attrs
, ATTR_PUBLIC
))
6190 add_typelib_entry(type
);
6192 type_list
= &(*type_list
)->next
;
6200 static statement_list_t
*append_statement(statement_list_t
*list
, statement_t
*stmt
)
6202 if (!stmt
) return list
;
6205 list
= xmalloc( sizeof(*list
) );
6208 list_add_tail( list
, &stmt
->entry
);
6212 static func_list_t
*append_func_from_statement(func_list_t
*list
, statement_t
*stmt
)
6214 if (stmt
->type
== STMT_DECLARATION
)
6216 var_t
*var
= stmt
->u
.var
;
6217 if (var
->stgclass
== STG_NONE
&& var
->type
->type
== RPC_FC_FUNCTION
)
6219 check_function_attrs(var
->name
, var
->type
->attrs
);
6220 return append_func(list
, make_func(stmt
->u
.var
));
6226 void init_loc_info(loc_info_t
*i
)
6228 i
->input_name
= input_name
? input_name
: "stdin";
6229 i
->line_number
= line_number
;
6230 i
->near_text
= parser_text
;
6233 static void check_def(const type_t
*t
)
6236 error_loc("%s: redefinition error; original definition was at %s:%d\n",
6237 t
->name
, t
->loc_info
.input_name
, t
->loc_info
.line_number
);