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
);
533 static statement_t
*make_statement(enum statement_type type
);
534 static statement_t
*make_statement_type_decl(type_t
*type
);
535 static statement_t
*make_statement_reference(type_t
*type
);
536 static statement_t
*make_statement_declaration(var_t
*var
);
537 static statement_t
*make_statement_library(typelib_t
*typelib
);
538 static statement_t
*make_statement_cppquote(const char *str
);
539 static statement_t
*make_statement_importlib(const char *str
);
540 static statement_t
*make_statement_module(type_t
*type
);
541 static statement_t
*make_statement_import(const char *str
);
542 static statement_list_t
*append_statement(statement_list_t
*list
, statement_t
*stmt
);
543 static func_list_t
*append_func_from_statement(func_list_t
*list
, statement_t
*stmt
);
551 /* Enabling traces. */
556 /* Enabling verbose error messages. */
557 #ifdef YYERROR_VERBOSE
558 # undef YYERROR_VERBOSE
559 # define YYERROR_VERBOSE 1
561 # define YYERROR_VERBOSE 0
564 /* Enabling the token table. */
565 #ifndef YYTOKEN_TABLE
566 # define YYTOKEN_TABLE 0
569 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
571 typedef union YYSTYPE
{
573 attr_list_t
*attr_list
;
574 str_list_t
*str_list
;
576 expr_list_t
*expr_list
;
577 array_dims_t
*array_dims
;
580 var_list_t
*var_list
;
581 declarator_t
*declarator
;
582 declarator_list_t
*declarator_list
;
584 func_list_t
*func_list
;
585 statement_t
*statement
;
586 statement_list_t
*stmt_list
;
588 ifref_list_t
*ifref_list
;
593 interface_info_t ifinfo
;
595 struct _import_t
*import
;
596 struct _decl_spec_t
*declspec
;
597 enum storage_class stgclass
;
599 /* Line 196 of yacc.c. */
600 #line 601 "parser.tab.c"
601 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
602 # define YYSTYPE_IS_DECLARED 1
603 # define YYSTYPE_IS_TRIVIAL 1
608 /* Copy the second part of user declarations. */
611 /* Line 219 of yacc.c. */
612 #line 613 "parser.tab.c"
614 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
615 # define YYSIZE_T __SIZE_TYPE__
617 #if ! defined (YYSIZE_T) && defined (size_t)
618 # define YYSIZE_T size_t
620 #if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus))
621 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
622 # define YYSIZE_T size_t
624 #if ! defined (YYSIZE_T)
625 # define YYSIZE_T unsigned int
631 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
632 # define YY_(msgid) dgettext ("bison-runtime", msgid)
636 # define YY_(msgid) msgid
640 #if ! defined (yyoverflow) || YYERROR_VERBOSE
642 /* The parser invokes alloca or malloc; define the necessary symbols. */
644 # ifdef YYSTACK_USE_ALLOCA
645 # if YYSTACK_USE_ALLOCA
647 # define YYSTACK_ALLOC __builtin_alloca
649 # define YYSTACK_ALLOC alloca
650 # if defined (__STDC__) || defined (__cplusplus)
651 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
652 # define YYINCLUDED_STDLIB_H
658 # ifdef YYSTACK_ALLOC
659 /* Pacify GCC's `empty if-body' warning. */
660 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
661 # ifndef YYSTACK_ALLOC_MAXIMUM
662 /* The OS might guarantee only one guard page at the bottom of the stack,
663 and a page size can be as small as 4096 bytes. So we cannot safely
664 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
665 to allow for a few compiler-allocated temporary stack slots. */
666 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */
669 # define YYSTACK_ALLOC YYMALLOC
670 # define YYSTACK_FREE YYFREE
671 # ifndef YYSTACK_ALLOC_MAXIMUM
672 # define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1)
678 # define YYMALLOC malloc
679 # if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \
680 && (defined (__STDC__) || defined (__cplusplus)))
681 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
686 # if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \
687 && (defined (__STDC__) || defined (__cplusplus)))
688 void free (void *); /* INFRINGES ON USER NAME SPACE */
695 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
698 #if (! defined (yyoverflow) \
699 && (! defined (__cplusplus) \
700 || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
702 /* A type that is properly aligned for any stack member. */
709 /* The size of the maximum gap between one aligned stack and the next. */
710 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
712 /* The size of an array large to enough to hold all stacks, each with
714 # define YYSTACK_BYTES(N) \
715 ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \
716 + YYSTACK_GAP_MAXIMUM)
718 /* Copy COUNT objects from FROM to TO. The source and destination do
721 # if defined (__GNUC__) && 1 < __GNUC__
722 # define YYCOPY(To, From, Count) \
723 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
725 # define YYCOPY(To, From, Count) \
729 for (yyi = 0; yyi < (Count); yyi++) \
730 (To)[yyi] = (From)[yyi]; \
736 /* Relocate STACK from its old location to the new one. The
737 local variables YYSIZE and YYSTACKSIZE give the old and new number of
738 elements in the stack, and YYPTR gives the new location of the
739 stack. Advance YYPTR to a properly aligned location for the next
741 # define YYSTACK_RELOCATE(Stack) \
744 YYSIZE_T yynewbytes; \
745 YYCOPY (&yyptr->Stack, Stack, yysize); \
746 Stack = &yyptr->Stack; \
747 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
748 yyptr += yynewbytes / sizeof (*yyptr); \
754 #if defined (__STDC__) || defined (__cplusplus)
755 typedef signed char yysigned_char
;
757 typedef short int yysigned_char
;
760 /* YYFINAL -- State number of the termination state. */
762 /* YYLAST -- Last index in YYTABLE. */
765 /* YYNTOKENS -- Number of terminals. */
766 #define YYNTOKENS 176
767 /* YYNNTS -- Number of nonterminals. */
769 /* YYNRULES -- Number of rules. */
771 /* YYNRULES -- Number of states. */
772 #define YYNSTATES 546
774 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
776 #define YYMAXUTOK 406
778 #define YYTRANSLATE(YYX) \
779 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
781 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
782 static const unsigned char yytranslate
[] =
784 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
785 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
786 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
787 2, 2, 2, 160, 2, 2, 2, 159, 152, 2,
788 171, 172, 157, 156, 147, 155, 167, 158, 2, 2,
789 2, 2, 2, 2, 2, 2, 2, 2, 149, 170,
790 153, 175, 154, 148, 2, 2, 2, 2, 2, 2,
791 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
792 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
793 2, 168, 2, 169, 151, 2, 2, 2, 2, 2,
794 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
795 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
796 2, 2, 2, 173, 150, 174, 161, 2, 2, 2,
797 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
798 2, 2, 2, 2, 2, 2, 2, 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, 1, 2, 3, 4,
810 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
811 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
812 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
813 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
814 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
815 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
816 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
817 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
818 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
819 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
820 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
821 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
822 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
823 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
824 145, 146, 162, 163, 164, 165, 166
828 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
830 static const unsigned short int yyprhs
[] =
832 0, 0, 3, 5, 6, 9, 12, 16, 19, 22,
833 25, 28, 29, 32, 35, 39, 42, 45, 48, 51,
834 54, 55, 58, 59, 61, 63, 66, 69, 71, 74,
835 77, 80, 85, 89, 93, 99, 102, 106, 111, 112,
836 114, 116, 118, 122, 124, 128, 131, 135, 139, 140,
837 142, 146, 148, 152, 157, 159, 163, 164, 166, 168,
838 170, 172, 174, 176, 181, 186, 188, 190, 192, 194,
839 196, 198, 203, 205, 207, 212, 214, 219, 224, 226,
840 228, 233, 238, 243, 248, 253, 255, 260, 262, 267,
841 269, 275, 277, 279, 284, 289, 291, 293, 295, 297,
842 299, 301, 303, 305, 307, 312, 314, 316, 318, 320,
843 327, 329, 331, 333, 335, 340, 342, 344, 346, 351,
844 356, 361, 366, 368, 370, 375, 380, 382, 384, 386,
845 388, 390, 392, 394, 395, 398, 403, 407, 408, 411,
846 413, 415, 419, 423, 425, 431, 433, 437, 438, 440,
847 442, 444, 446, 448, 450, 452, 454, 456, 458, 464,
848 468, 472, 476, 480, 484, 488, 492, 496, 500, 504,
849 508, 512, 516, 520, 524, 528, 532, 536, 539, 542,
850 545, 548, 551, 554, 558, 562, 567, 572, 577, 581,
851 583, 587, 589, 591, 592, 595, 600, 604, 607, 610,
852 611, 614, 617, 619, 623, 627, 631, 634, 635, 637,
853 638, 640, 642, 644, 646, 648, 650, 652, 655, 658,
854 660, 662, 664, 666, 668, 670, 672, 673, 675, 677,
855 680, 682, 685, 688, 690, 692, 695, 698, 701, 707,
856 708, 711, 714, 717, 720, 723, 726, 730, 733, 737,
857 743, 749, 750, 753, 756, 759, 762, 769, 778, 781,
858 784, 787, 790, 793, 796, 802, 804, 806, 808, 810,
859 812, 813, 816, 819, 823, 824, 826, 829, 832, 835,
860 839, 842, 844, 846, 850, 853, 858, 860, 864, 866,
861 870, 872, 874, 876, 882, 884, 886, 888, 890, 893,
862 895, 898, 900, 903, 908, 913, 919, 930, 932
865 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
866 static const short int yyrhs
[] =
868 177, 0, -1, 178, -1, -1, 178, 242, -1, 178,
869 241, -1, 178, 228, 170, -1, 178, 230, -1, 178,
870 245, -1, 178, 189, -1, 178, 182, -1, -1, 179,
871 242, -1, 179, 241, -1, 179, 228, 170, -1, 179,
872 230, -1, 179, 245, -1, 179, 182, -1, 179, 186,
873 -1, 179, 189, -1, -1, 180, 182, -1, -1, 170,
874 -1, 183, -1, 207, 170, -1, 221, 170, -1, 185,
875 -1, 258, 170, -1, 260, 170, -1, 261, 170, -1,
876 45, 171, 8, 172, -1, 78, 8, 170, -1, 184,
877 179, 11, -1, 79, 171, 8, 172, 181, -1, 89,
878 3, -1, 196, 187, 173, -1, 188, 179, 174, 181,
879 -1, -1, 192, -1, 144, -1, 193, -1, 192, 147,
880 193, -1, 191, -1, 196, 250, 253, -1, 250, 253,
881 -1, 168, 209, 169, -1, 168, 157, 169, -1, -1,
882 196, -1, 168, 197, 169, -1, 199, -1, 197, 147,
883 199, -1, 197, 169, 168, 199, -1, 8, -1, 198,
884 147, 8, -1, -1, 21, -1, 23, -1, 24, -1,
885 26, -1, 27, -1, 29, -1, 32, 171, 224, 172,
886 -1, 34, 171, 211, 172, -1, 41, -1, 42, -1,
887 43, -1, 44, -1, 46, -1, 47, -1, 48, 171,
888 213, 172, -1, 49, -1, 50, -1, 52, 171, 8,
889 172, -1, 54, -1, 55, 171, 198, 172, -1, 56,
890 171, 213, 172, -1, 59, -1, 64, -1, 66, 171,
891 212, 172, -1, 67, 171, 8, 172, -1, 68, 171,
892 8, 172, -1, 69, 171, 212, 172, -1, 70, 171,
893 8, 172, -1, 71, -1, 73, 171, 212, 172, -1,
894 74, -1, 75, 171, 210, 172, -1, 76, -1, 77,
895 171, 65, 3, 172, -1, 80, -1, 83, -1, 88,
896 171, 208, 172, -1, 87, 171, 212, 172, -1, 90,
897 -1, 94, -1, 95, -1, 96, -1, 98, -1, 99,
898 -1, 100, -1, 101, -1, 102, -1, 104, 171, 257,
899 172, -1, 106, -1, 107, -1, 108, -1, 110, -1,
900 111, 171, 212, 147, 212, 172, -1, 112, -1, 115,
901 -1, 116, -1, 117, -1, 122, 171, 208, 172, -1,
902 125, -1, 128, -1, 129, -1, 132, 171, 210, 172,
903 -1, 133, 171, 259, 172, -1, 134, 171, 259, 172,
904 -1, 140, 171, 200, 172, -1, 141, -1, 142, -1,
905 143, 171, 262, 172, -1, 146, 171, 259, 172, -1,
906 257, -1, 10, -1, 8, -1, 35, -1, 62, -1,
907 103, -1, 127, -1, -1, 202, 203, -1, 34, 212,
908 149, 218, -1, 46, 149, 218, -1, -1, 205, 147,
909 -1, 205, -1, 206, -1, 205, 147, 206, -1, 224,
910 175, 212, -1, 224, -1, 57, 223, 173, 204, 174,
911 -1, 209, -1, 208, 147, 209, -1, -1, 210, -1,
912 5, -1, 6, -1, 7, -1, 61, -1, 97, -1,
913 135, -1, 8, -1, 9, -1, 3, -1, 210, 148,
914 210, 149, 210, -1, 210, 19, 210, -1, 210, 20,
915 210, -1, 210, 150, 210, -1, 210, 151, 210, -1,
916 210, 152, 210, -1, 210, 15, 210, -1, 210, 16,
917 210, -1, 210, 154, 210, -1, 210, 153, 210, -1,
918 210, 17, 210, -1, 210, 18, 210, -1, 210, 12,
919 210, -1, 210, 13, 210, -1, 210, 156, 210, -1,
920 210, 155, 210, -1, 210, 159, 210, -1, 210, 157,
921 210, -1, 210, 158, 210, -1, 160, 210, -1, 161,
922 210, -1, 156, 210, -1, 155, 210, -1, 152, 210,
923 -1, 157, 210, -1, 210, 14, 3, -1, 210, 167,
924 3, -1, 171, 259, 172, 210, -1, 123, 171, 259,
925 172, -1, 210, 168, 210, 169, -1, 171, 210, 172,
926 -1, 212, -1, 211, 147, 212, -1, 210, -1, 210,
927 -1, -1, 214, 215, -1, 195, 250, 255, 170, -1,
928 195, 261, 170, -1, 219, 170, -1, 196, 170, -1,
929 -1, 217, 216, -1, 219, 170, -1, 170, -1, 195,
930 250, 253, -1, 195, 250, 253, -1, 196, 250, 256,
931 -1, 250, 256, -1, -1, 224, -1, -1, 3, -1,
932 4, -1, 3, -1, 4, -1, 30, -1, 145, -1,
933 227, -1, 120, 227, -1, 139, 227, -1, 139, -1,
934 63, -1, 121, -1, 53, -1, 28, -1, 58, -1,
935 65, -1, -1, 84, -1, 84, -1, 119, 226, -1,
936 124, -1, 91, 226, -1, 72, 226, -1, 85, -1,
937 36, -1, 37, 3, -1, 37, 4, -1, 196, 228,
938 -1, 229, 173, 231, 174, 181, -1, -1, 231, 232,
939 -1, 195, 242, -1, 51, 3, -1, 51, 4, -1,
940 196, 233, -1, 105, 149, -1, 235, 219, 170, -1,
941 92, 149, -1, 236, 220, 170, -1, 234, 173, 235,
942 236, 174, -1, 234, 173, 239, 170, 174, -1, -1,
943 149, 4, -1, 86, 3, -1, 86, 4, -1, 196,
944 239, -1, 240, 238, 173, 180, 174, 181, -1, 240,
945 149, 3, 173, 185, 180, 174, 181, -1, 237, 181,
946 -1, 239, 170, -1, 233, 170, -1, 93, 3, -1,
947 93, 4, -1, 196, 243, -1, 244, 173, 180, 174,
948 181, -1, 60, -1, 126, -1, 114, -1, 82, -1,
949 40, -1, -1, 249, 248, -1, 259, 251, -1, 252,
950 259, 251, -1, -1, 252, -1, 248, 251, -1, 247,
951 251, -1, 246, 251, -1, 157, 249, 253, -1, 201,
952 253, -1, 254, -1, 224, -1, 171, 253, 172, -1,
953 254, 194, -1, 254, 171, 190, 172, -1, 253, -1,
954 255, 147, 253, -1, 253, -1, 253, 175, 213, -1,
955 113, -1, 138, -1, 109, -1, 130, 223, 173, 214,
956 174, -1, 144, -1, 4, -1, 225, -1, 207, -1,
957 57, 3, -1, 258, -1, 130, 3, -1, 261, -1,
958 137, 3, -1, 118, 171, 259, 172, -1, 136, 195,
959 250, 255, -1, 137, 223, 173, 217, 174, -1, 137,
960 223, 131, 171, 219, 172, 222, 173, 202, 174, -1,
964 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
965 static const unsigned short int yyrline
[] =
967 0, 349, 349, 358, 359, 360, 361, 365, 370, 373,
968 374, 377, 378, 379, 380, 381, 386, 387, 388, 389,
969 392, 393, 396, 397, 401, 402, 408, 411, 412, 418,
970 419, 427, 429, 437, 444, 448, 450, 457, 465, 466,
971 469, 472, 473, 474, 478, 485, 493, 494, 497, 498,
972 502, 508, 509, 510, 513, 514, 517, 518, 519, 520,
973 521, 522, 523, 524, 525, 526, 527, 528, 529, 530,
974 531, 532, 533, 534, 535, 536, 537, 538, 539, 540,
975 541, 542, 543, 544, 545, 546, 547, 548, 549, 550,
976 551, 552, 553, 554, 555, 556, 557, 558, 559, 560,
977 561, 562, 563, 564, 565, 566, 567, 568, 569, 570,
978 574, 575, 576, 577, 578, 579, 580, 581, 582, 583,
979 584, 585, 586, 587, 588, 589, 590, 594, 595, 600,
980 601, 602, 603, 606, 607, 610, 614, 620, 621, 622,
981 625, 629, 638, 642, 647, 656, 657, 670, 671, 674,
982 675, 676, 677, 678, 679, 680, 681, 682, 683, 684,
983 685, 686, 687, 688, 689, 690, 691, 692, 693, 694,
984 695, 696, 697, 698, 699, 700, 701, 702, 703, 704,
985 705, 706, 707, 708, 709, 710, 711, 712, 713, 716,
986 717, 720, 726, 732, 733, 736, 741, 748, 749, 752,
987 753, 757, 758, 761, 769, 778, 784, 790, 791, 794,
988 795, 796, 799, 801, 804, 805, 806, 807, 808, 824,
989 825, 826, 827, 828, 829, 830, 833, 834, 837, 838,
990 839, 840, 841, 842, 843, 846, 847, 853, 862, 869,
991 870, 874, 877, 878, 881, 895, 896, 899, 900, 903,
992 913, 923, 924, 927, 928, 931, 944, 958, 971, 975,
993 976, 979, 980, 983, 988, 996, 997, 998, 1002, 1006,
994 1009, 1010, 1013, 1014, 1018, 1019, 1023, 1024, 1025, 1029,
995 1031, 1032, 1036, 1037, 1038, 1039, 1046, 1047, 1051, 1052,
996 1056, 1057, 1058, 1061, 1072, 1073, 1074, 1075, 1076, 1077,
997 1078, 1079, 1080, 1081, 1084, 1090, 1096, 1113, 1114
1001 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
1002 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1003 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
1004 static const char *const yytname
[] =
1006 "$end", "error", "$undefined", "aIDENTIFIER", "aKNOWNTYPE", "aNUM",
1007 "aHEXNUM", "aDOUBLE", "aSTRING", "aWSTRING", "aUUID", "aEOF", "SHL",
1008 "SHR", "MEMBERPTR", "EQUALITY", "INEQUALITY", "GREATEREQUAL",
1009 "LESSEQUAL", "LOGICALOR", "LOGICALAND", "tAGGREGATABLE", "tALLOCATE",
1010 "tAPPOBJECT", "tASYNC", "tASYNCUUID", "tAUTOHANDLE", "tBINDABLE",
1011 "tBOOLEAN", "tBROADCAST", "tBYTE", "tBYTECOUNT", "tCALLAS", "tCALLBACK",
1012 "tCASE", "tCDECL", "tCHAR", "tCOCLASS", "tCODE", "tCOMMSTATUS", "tCONST",
1013 "tCONTEXTHANDLE", "tCONTEXTHANDLENOSERIALIZE", "tCONTEXTHANDLESERIALIZE",
1014 "tCONTROL", "tCPPQUOTE", "tDEFAULT", "tDEFAULTCOLLELEM", "tDEFAULTVALUE",
1015 "tDEFAULTVTABLE", "tDISPLAYBIND", "tDISPINTERFACE", "tDLLNAME",
1016 "tDOUBLE", "tDUAL", "tENDPOINT", "tENTRY", "tENUM", "tERRORSTATUST",
1017 "tEXPLICITHANDLE", "tEXTERN", "tFALSE", "tFASTCALL", "tFLOAT", "tHANDLE",
1018 "tHANDLET", "tHELPCONTEXT", "tHELPFILE", "tHELPSTRING",
1019 "tHELPSTRINGCONTEXT", "tHELPSTRINGDLL", "tHIDDEN", "tHYPER", "tID",
1020 "tIDEMPOTENT", "tIIDIS", "tIMMEDIATEBIND", "tIMPLICITHANDLE", "tIMPORT",
1021 "tIMPORTLIB", "tIN", "tIN_LINE", "tINLINE", "tINPUTSYNC", "tINT",
1022 "tINT64", "tINTERFACE", "tLCID", "tLENGTHIS", "tLIBRARY", "tLOCAL",
1023 "tLONG", "tMETHODS", "tMODULE", "tNONBROWSABLE", "tNONCREATABLE",
1024 "tNONEXTENSIBLE", "tNULL", "tOBJECT", "tODL", "tOLEAUTOMATION",
1025 "tOPTIONAL", "tOUT", "tPASCAL", "tPOINTERDEFAULT", "tPROPERTIES",
1026 "tPROPGET", "tPROPPUT", "tPROPPUTREF", "tPTR", "tPUBLIC", "tRANGE",
1027 "tREADONLY", "tREF", "tREGISTER", "tREQUESTEDIT", "tRESTRICTED",
1028 "tRETVAL", "tSAFEARRAY", "tSHORT", "tSIGNED", "tSINGLE", "tSIZEIS",
1029 "tSIZEOF", "tSMALL", "tSOURCE", "tSTATIC", "tSTDCALL",
1030 "tSTRICTCONTEXTHANDLE", "tSTRING", "tSTRUCT", "tSWITCH", "tSWITCHIS",
1031 "tSWITCHTYPE", "tTRANSMITAS", "tTRUE", "tTYPEDEF", "tUNION", "tUNIQUE",
1032 "tUNSIGNED", "tUUID", "tV1ENUM", "tVARARG", "tVERSION", "tVOID",
1033 "tWCHAR", "tWIREMARSHAL", "','", "'?'", "':'", "'|'", "'^'", "'&'",
1034 "'<'", "'>'", "'-'", "'+'", "'*'", "'/'", "'%'", "'!'", "'~'",
1035 "ADDRESSOF", "NEG", "POS", "PPTR", "CAST", "'.'", "'['", "']'", "';'",
1036 "'('", "')'", "'{'", "'}'", "'='", "$accept", "input", "gbl_statements",
1037 "imp_statements", "int_statements", "semicolon_opt", "statement",
1038 "cppquote", "import_start", "import", "importlib", "libraryhdr",
1039 "library_start", "librarydef", "m_args", "no_args", "args", "arg",
1040 "array", "m_attributes", "attributes", "attrib_list", "str_list",
1041 "attribute", "uuid_string", "callconv", "cases", "case", "enums",
1042 "enum_list", "enum", "enumdef", "m_exprs", "m_expr", "expr",
1043 "expr_list_int_const", "expr_int_const", "expr_const", "fields", "field",
1044 "ne_union_field", "ne_union_fields", "union_field", "s_field", "funcdef",
1045 "declaration", "m_ident", "t_ident", "ident", "base_type", "m_int",
1046 "int_std", "coclass", "coclasshdr", "coclassdef", "coclass_ints",
1047 "coclass_int", "dispinterface", "dispinterfacehdr", "dispint_props",
1048 "dispint_meths", "dispinterfacedef", "inherit", "interface",
1049 "interfacehdr", "interfacedef", "interfacedec", "module", "modulehdr",
1050 "moduledef", "storage_cls_spec", "function_specifier", "type_qualifier",
1051 "m_type_qual_list", "decl_spec", "m_decl_spec_no_type",
1052 "decl_spec_no_type", "declarator", "direct_declarator",
1053 "declarator_list", "init_declarator", "pointer_type", "structdef",
1054 "type", "typedef", "uniondef", "version", 0
1059 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
1061 static const unsigned short int yytoknum
[] =
1063 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1064 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1065 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
1066 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
1067 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
1068 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
1069 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
1070 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
1071 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
1072 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
1073 355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
1074 365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
1075 375, 376, 377, 378, 379, 380, 381, 382, 383, 384,
1076 385, 386, 387, 388, 389, 390, 391, 392, 393, 394,
1077 395, 396, 397, 398, 399, 400, 401, 44, 63, 58,
1078 124, 94, 38, 60, 62, 45, 43, 42, 47, 37,
1079 33, 126, 402, 403, 404, 405, 406, 46, 91, 93,
1080 59, 40, 41, 123, 125, 61
1084 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
1085 static const unsigned short int yyr1
[] =
1087 0, 176, 177, 178, 178, 178, 178, 178, 178, 178,
1088 178, 179, 179, 179, 179, 179, 179, 179, 179, 179,
1089 180, 180, 181, 181, 182, 182, 182, 182, 182, 182,
1090 182, 183, 184, 185, 186, 187, 188, 189, 190, 190,
1091 191, 192, 192, 192, 193, 193, 194, 194, 195, 195,
1092 196, 197, 197, 197, 198, 198, 199, 199, 199, 199,
1093 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
1094 199, 199, 199, 199, 199, 199, 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, 200, 200, 201,
1100 201, 201, 201, 202, 202, 203, 203, 204, 204, 204,
1101 205, 205, 206, 206, 207, 208, 208, 209, 209, 210,
1102 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
1103 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
1104 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
1105 210, 210, 210, 210, 210, 210, 210, 210, 210, 211,
1106 211, 212, 213, 214, 214, 215, 215, 216, 216, 217,
1107 217, 218, 218, 219, 220, 221, 221, 222, 222, 223,
1108 223, 223, 224, 224, 225, 225, 225, 225, 225, 225,
1109 225, 225, 225, 225, 225, 225, 226, 226, 227, 227,
1110 227, 227, 227, 227, 227, 228, 228, 229, 230, 231,
1111 231, 232, 233, 233, 234, 235, 235, 236, 236, 237,
1112 237, 238, 238, 239, 239, 240, 241, 241, 241, 242,
1113 242, 243, 243, 244, 245, 246, 246, 246, 247, 248,
1114 249, 249, 250, 250, 251, 251, 252, 252, 252, 253,
1115 253, 253, 254, 254, 254, 254, 255, 255, 256, 256,
1116 257, 257, 257, 258, 259, 259, 259, 259, 259, 259,
1117 259, 259, 259, 259, 260, 261, 261, 262, 262
1120 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
1121 static const unsigned char yyr2
[] =
1123 0, 2, 1, 0, 2, 2, 3, 2, 2, 2,
1124 2, 0, 2, 2, 3, 2, 2, 2, 2, 2,
1125 0, 2, 0, 1, 1, 2, 2, 1, 2, 2,
1126 2, 4, 3, 3, 5, 2, 3, 4, 0, 1,
1127 1, 1, 3, 1, 3, 2, 3, 3, 0, 1,
1128 3, 1, 3, 4, 1, 3, 0, 1, 1, 1,
1129 1, 1, 1, 4, 4, 1, 1, 1, 1, 1,
1130 1, 4, 1, 1, 4, 1, 4, 4, 1, 1,
1131 4, 4, 4, 4, 4, 1, 4, 1, 4, 1,
1132 5, 1, 1, 4, 4, 1, 1, 1, 1, 1,
1133 1, 1, 1, 1, 4, 1, 1, 1, 1, 6,
1134 1, 1, 1, 1, 4, 1, 1, 1, 4, 4,
1135 4, 4, 1, 1, 4, 4, 1, 1, 1, 1,
1136 1, 1, 1, 0, 2, 4, 3, 0, 2, 1,
1137 1, 3, 3, 1, 5, 1, 3, 0, 1, 1,
1138 1, 1, 1, 1, 1, 1, 1, 1, 5, 3,
1139 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
1140 3, 3, 3, 3, 3, 3, 3, 2, 2, 2,
1141 2, 2, 2, 3, 3, 4, 4, 4, 3, 1,
1142 3, 1, 1, 0, 2, 4, 3, 2, 2, 0,
1143 2, 2, 1, 3, 3, 3, 2, 0, 1, 0,
1144 1, 1, 1, 1, 1, 1, 1, 2, 2, 1,
1145 1, 1, 1, 1, 1, 1, 0, 1, 1, 2,
1146 1, 2, 2, 1, 1, 2, 2, 2, 5, 0,
1147 2, 2, 2, 2, 2, 2, 3, 2, 3, 5,
1148 5, 0, 2, 2, 2, 2, 6, 8, 2, 2,
1149 2, 2, 2, 2, 5, 1, 1, 1, 1, 1,
1150 0, 2, 2, 3, 0, 1, 2, 2, 2, 3,
1151 2, 1, 1, 3, 2, 4, 1, 3, 1, 3,
1152 1, 1, 1, 5, 1, 1, 1, 1, 2, 1,
1153 2, 1, 2, 4, 4, 5, 10, 1, 3
1156 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
1157 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
1158 means the default is an error. */
1159 static const unsigned short int yydefact
[] =
1161 3, 0, 2, 1, 295, 223, 214, 234, 0, 269,
1162 0, 0, 222, 209, 224, 265, 220, 225, 226, 0,
1163 268, 228, 233, 0, 226, 267, 0, 226, 0, 221,
1164 230, 266, 209, 48, 209, 219, 294, 215, 56, 10,
1165 24, 11, 27, 11, 9, 0, 297, 0, 296, 216,
1166 0, 0, 7, 0, 0, 22, 0, 251, 5, 4,
1167 0, 8, 274, 274, 274, 0, 0, 299, 274, 0,
1168 301, 235, 236, 0, 242, 243, 298, 211, 0, 227,
1169 232, 0, 253, 254, 231, 0, 229, 217, 300, 0,
1170 0, 49, 302, 0, 218, 57, 58, 59, 60, 61,
1171 62, 0, 0, 65, 66, 67, 68, 69, 70, 0,
1172 72, 73, 0, 75, 0, 0, 78, 79, 0, 0,
1173 0, 0, 0, 85, 0, 87, 0, 89, 0, 91,
1174 92, 0, 0, 95, 96, 97, 98, 99, 100, 101,
1175 102, 103, 0, 105, 106, 107, 292, 108, 0, 110,
1176 290, 111, 112, 113, 0, 115, 116, 117, 0, 0,
1177 0, 291, 0, 122, 123, 0, 0, 0, 51, 126,
1178 0, 0, 0, 0, 0, 297, 237, 244, 255, 263,
1179 0, 299, 301, 25, 26, 6, 239, 260, 0, 23,
1180 258, 259, 0, 0, 20, 278, 275, 277, 276, 212,
1181 213, 129, 130, 131, 132, 270, 0, 0, 282, 288,
1182 281, 206, 274, 28, 272, 29, 30, 0, 137, 32,
1183 0, 193, 0, 0, 199, 0, 0, 0, 0, 0,
1184 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1185 147, 0, 0, 147, 0, 0, 0, 0, 0, 0,
1186 56, 50, 33, 0, 17, 18, 19, 0, 15, 13,
1187 12, 16, 22, 35, 261, 262, 36, 205, 48, 0,
1188 48, 0, 0, 252, 20, 0, 0, 0, 280, 0,
1189 147, 38, 284, 273, 31, 0, 139, 140, 143, 303,
1190 48, 286, 304, 48, 48, 0, 157, 149, 150, 151,
1191 155, 156, 152, 153, 0, 154, 0, 0, 0, 0,
1192 0, 0, 0, 191, 0, 189, 192, 0, 0, 54,
1193 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1194 0, 0, 145, 148, 0, 0, 0, 0, 0, 0,
1195 128, 127, 0, 307, 0, 0, 52, 56, 0, 14,
1196 37, 22, 0, 240, 245, 0, 0, 0, 48, 0,
1197 0, 0, 22, 21, 0, 271, 279, 283, 289, 0,
1198 0, 294, 0, 43, 39, 41, 0, 0, 144, 138,
1199 0, 293, 0, 194, 0, 0, 305, 49, 200, 0,
1200 63, 0, 181, 180, 179, 182, 177, 178, 0, 0,
1201 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1202 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1203 0, 0, 0, 64, 71, 74, 0, 76, 77, 80,
1204 81, 82, 83, 84, 86, 88, 0, 94, 147, 93,
1205 104, 0, 114, 118, 119, 120, 121, 0, 124, 125,
1206 53, 0, 238, 241, 247, 0, 246, 249, 0, 0,
1207 250, 20, 22, 264, 47, 46, 285, 0, 0, 45,
1208 141, 142, 0, 301, 287, 207, 198, 197, 0, 188,
1209 0, 170, 171, 183, 164, 165, 168, 169, 159, 160,
1210 0, 161, 162, 163, 167, 166, 173, 172, 175, 176,
1211 174, 184, 0, 190, 55, 90, 146, 0, 308, 22,
1212 203, 0, 248, 0, 256, 42, 44, 0, 196, 0,
1213 208, 186, 185, 0, 187, 109, 34, 204, 22, 195,
1214 133, 158, 257, 0, 0, 0, 306, 134, 0, 48,
1215 48, 202, 136, 0, 135, 201
1218 /* YYDEFGOTO[NTERM-NUM]. */
1219 static const short int yydefgoto
[] =
1221 -1, 1, 2, 170, 275, 190, 363, 40, 41, 42,
1222 255, 174, 43, 256, 372, 373, 374, 375, 282, 356,
1223 91, 167, 320, 168, 342, 207, 533, 537, 285, 286,
1224 287, 175, 331, 332, 313, 314, 315, 317, 290, 383,
1225 388, 294, 542, 543, 459, 47, 519, 78, 208, 48,
1226 80, 49, 257, 51, 258, 268, 353, 53, 54, 270,
1227 358, 55, 193, 56, 57, 259, 260, 179, 60, 261,
1228 62, 63, 64, 276, 65, 195, 66, 209, 210, 292,
1229 211, 169, 181, 68, 69, 182, 344
1232 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1234 #define YYPACT_NINF -267
1235 static const short int yypact
[] =
1237 -267, 42, 1020, -267, -267, -267, -267, -267, 47, -267,
1238 -94, 86, -267, 144, -267, -267, -267, -267, 40, 137,
1239 -267, -267, -267, 150, 40, -267, -20, 40, 199, -267,
1240 -267, -267, 161, -7, 194, 199, -267, -267, 1869, -267,
1241 -267, -267, -267, -267, -267, 1631, -14, 4, -267, -267,
1242 10, -6, -267, 12, 21, 38, 43, 73, -267, -267,
1243 59, -267, -3, -3, -3, 52, 1744, 55, -3, 56,
1244 63, -267, -267, 226, -267, -267, 65, -267, 66, -267,
1245 -267, 70, -267, -267, -267, 1744, -267, -267, 65, 69,
1246 1674, -267, -110, -108, -267, -267, -267, -267, -267, -267,
1247 -267, 77, 78, -267, -267, -267, -267, -267, -267, 79,
1248 -267, -267, 81, -267, 82, 83, -267, -267, 87, 89,
1249 91, 93, 98, -267, 99, -267, 101, -267, 110, -267,
1250 -267, 115, 116, -267, -267, -267, -267, -267, -267, -267,
1251 -267, -267, 117, -267, -267, -267, -267, -267, 118, -267,
1252 -267, -267, -267, -267, 120, -267, -267, -267, 129, 130,
1253 131, -267, 138, -267, -267, 139, 140, -107, -267, -267,
1254 925, 403, 233, 203, 95, -267, -267, -267, -267, -267,
1255 52, -267, -267, -267, -267, -267, -267, -267, -12, -267,
1256 -267, -267, 208, 135, -267, -267, -267, -267, -267, -267,
1257 -267, -267, -267, -267, -267, -267, 52, 52, -267, 84,
1258 -42, -267, -3, -267, -267, -267, -267, 113, 212, -267,
1259 141, -267, 52, 151, -267, 212, 749, 749, 311, 313,
1260 749, 749, 316, 317, 749, 318, 749, 749, 262, 749,
1261 749, -79, 749, 749, 749, 1744, 1744, 97, 323, 1744,
1262 1869, 165, -267, 158, -267, -267, -267, 164, -267, -267,
1263 -267, -267, 38, -267, -267, -267, -267, -267, -114, 186,
1264 -65, 166, 174, -267, -267, 13, 32, 167, -267, 749,
1265 789, 1095, -267, -267, -267, 163, 201, -267, 175, -267,
1266 -82, -267, 202, -7, -46, 179, -267, -267, -267, -267,
1267 -267, -267, -267, -267, 181, -267, 749, 749, 749, 749,
1268 749, 749, 688, 1390, -103, -267, 1390, 185, 188, -267,
1269 -66, 190, 192, 193, 195, 196, 197, 198, 1229, 355,
1270 200, -64, -267, 1390, 204, 224, -63, 1272, 205, 206,
1271 -267, -267, 207, 213, 209, 211, -267, 1869, 365, -267,
1272 -267, 38, -22, -267, -267, 225, 1674, 214, -38, 215,
1273 297, 498, 38, -267, 1674, -267, -267, -267, -267, 444,
1274 216, -59, 237, -267, 239, -267, 1674, 52, -267, 212,
1275 749, -267, 1674, -267, 52, 238, -267, 241, -267, 242,
1276 -267, 1744, 25, 25, 25, 25, 25, 25, 1295, 243,
1277 749, 749, 410, 749, 749, 749, 749, 749, 749, 749,
1278 749, 749, 749, 749, 749, 749, 749, 749, 749, 749,
1279 413, 749, 749, -267, -267, -267, 409, -267, -267, -267,
1280 -267, -267, -267, -267, -267, -267, 246, -267, 749, -267,
1281 -267, 749, -267, -267, -267, -267, -267, 414, -267, -267,
1282 -267, 248, -267, -267, -267, 52, -267, -267, 1674, 251,
1283 -267, -267, 38, -267, -267, -267, -267, 1138, 52, -267,
1284 -267, -267, 52, 252, -267, 212, -267, -267, 254, -267,
1285 749, 148, 148, -267, 187, 187, 88, 88, 1497, 1420,
1286 1340, 1443, 1466, 864, 88, 88, 61, 61, 25, 25,
1287 25, -267, 1318, -267, -267, -267, -267, 255, -267, 38,
1288 -267, 52, -267, 593, -267, -267, -267, -102, -267, 256,
1289 -267, -267, 25, 749, -267, -267, -267, -267, 38, -267,
1290 -267, 1390, -267, -8, 749, 275, -267, -267, 279, -28,
1291 -28, -267, -267, 260, -267, -267
1294 /* YYPGOTO[NTERM-NUM]. */
1295 static const short int yypgoto
[] =
1297 -267, -267, -267, 389, -266, -252, 7, -267, -267, 74,
1298 -267, -267, -267, 433, -267, -267, -267, -31, -267, -27,
1299 -2, -267, -267, -235, -267, -267, -267, -267, -267, -267,
1300 58, 2, 219, -247, -13, -267, -220, -199, -267, -267,
1301 -267, -267, -99, -174, -267, -267, -267, 112, -193, -267,
1302 114, 90, 16, -267, 436, -267, -267, 397, -267, -267,
1303 -267, -267, -267, -25, -267, 442, 1, -267, -267, 443,
1304 -267, -267, 170, -267, -44, -16, 53, -194, -267, -17,
1305 277, 217, 5, -61, -267, 0, -267
1308 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
1309 positive, shift that token. If negative, reduce the rule which
1310 number is the opposite. If zero, do what YYDEFACT says.
1311 If YYTABLE_NINF, syntax error. */
1312 #define YYTABLE_NINF -211
1313 static const short int yytable
[] =
1315 45, 180, 70, 59, 46, 212, 90, 67, 361, 39,
1316 350, 322, 277, 278, 325, 346, 327, 4, 50, 330,
1317 178, -210, 335, 223, 220, 288, 534, 355, 291, 11,
1318 146, 321, 295, 370, 150, 199, 200, 9, 535, 402,
1319 250, 5, 3, 6, 422, 384, 222, 197, 198, 7,
1320 71, 72, 214, 9, 38, 199, 200, 15, 10, 161,
1321 351, 176, 251, -210, 23, 224, 12, 201, 529, 423,
1322 13, 14, 9, 15, 23, 402, 16, 73, 17, 20,
1323 368, 426, 366, 438, 438, 18, 38, 201, -40, 74,
1324 75, 19, 381, 269, 202, 20, 357, 21, 22, 452,
1325 400, 401, 402, 38, 24, 340, 427, 341, 439, 442,
1326 463, 25, 450, -40, 202, 196, 196, 196, 87, 385,
1327 389, 196, 38, 31, 79, 94, 280, 25, 386, 281,
1328 38, 26, 27, 28, 29, 203, 457, 30, 84, 31,
1329 38, 86, 541, 32, 89, 81, 93, 76, 77, 33,
1330 34, 85, 35, 82, 83, 203, 183, 36, 37, 204,
1331 471, 38, 402, 271, 88, 77, 536, 186, 45, 45,
1332 70, 70, 46, 46, 184, 67, 67, 254, 254, 204,
1333 185, 38, 187, 469, 338, 339, 288, 362, 345, 205,
1334 474, 506, 420, 421, 188, 513, 283, 92, 77, 400,
1335 401, 402, 503, 206, 405, 406, 264, 265, 189, 205,
1336 514, 272, 273, 191, 316, 199, 200, 316, 417, 418,
1337 419, 507, 192, 206, 328, 213, 215, 333, 420, 421,
1338 333, 337, 194, 216, 217, 7, 263, 377, -210, 218,
1339 219, 352, 221, 415, 416, 417, 418, 419, 225, 226,
1340 227, 399, 228, 229, 230, 420, 421, 526, 231, 279,
1341 232, 510, 233, 382, 234, 196, 316, 333, 266, 235,
1342 236, 18, 237, 364, 516, 70, 532, 46, 291, 376,
1343 67, 238, 520, 21, 22, 284, 239, 240, 241, 242,
1344 24, 243, 387, 392, 393, 394, 395, 396, 397, 398,
1345 244, 245, 246, 415, 416, 417, 418, 419, 274, 247,
1346 248, 249, 455, 289, 538, 420, 421, 527, 27, 318,
1347 180, 319, 293, 30, 323, 324, 326, 329, 343, 348,
1348 478, 458, 468, 347, 349, 354, 359, 378, 472, 367,
1349 413, 414, 415, 416, 417, 418, 419, 360, 379, 384,
1350 380, 390, 391, 453, 420, 421, 395, 424, 436, 364,
1351 425, 70, 428, 46, 429, 430, 67, 431, 432, 433,
1352 434, 441, 437, 451, 454, 19, 440, 444, 445, 446,
1353 447, 448, 473, 449, 456, 465, 467, 481, 482, 460,
1354 484, 485, 486, 487, 488, 489, 490, 491, 492, 493,
1355 494, 495, 496, 497, 498, 499, 500, 4, 502, 466,
1356 475, 476, 477, 483, 511, 480, 501, 504, 505, 508,
1357 509, 512, 518, 377, 539, 333, 521, 525, 540, 530,
1358 545, 5, 171, 6, 461, 44, 515, 470, 52, 7,
1359 8, 544, 177, 9, 58, 61, 365, 296, 10, 297,
1360 298, 299, 300, 301, 11, 517, 12, 267, 334, 0,
1361 13, 14, 336, 15, 0, 376, 16, 522, 17, 0,
1362 0, 0, 0, 0, 0, 18, 0, 0, 0, 0,
1363 0, 19, 253, 0, 0, 20, 0, 21, 22, 23,
1364 0, 0, 0, 0, 24, 0, 0, 0, 0, 0,
1365 0, 0, 4, 0, 0, 302, 0, 0, 0, 0,
1366 531, 364, 0, 70, 0, 46, 0, 25, 67, 0,
1367 0, 26, 27, 28, 29, 0, 5, 30, 6, 31,
1368 0, 0, 0, 32, 7, 0, 0, 0, 9, 33,
1369 34, 303, 35, 10, 0, 0, 0, 36, 37, 0,
1370 0, 12, 0, 0, 0, 13, 14, 0, 15, 0,
1371 0, 16, 0, 17, 0, 0, 0, 304, 0, 0,
1372 18, 38, 0, 0, 0, 0, 19, 262, 0, 305,
1373 20, 0, 21, 22, 0, 0, 0, 0, 0, 24,
1374 0, 0, 0, 0, 0, 0, 306, 4, 0, 307,
1375 308, 309, 0, 0, 310, 311, 0, 0, 0, 0,
1376 0, 0, 25, 464, 0, 312, 26, 27, 28, 29,
1377 0, 5, 30, 6, 31, 0, 0, 0, 32, 7,
1378 0, 0, 0, 9, 33, 34, 0, 35, 10, 0,
1379 0, 0, 36, 37, 0, 0, 12, 0, 0, 0,
1380 13, 14, 0, 15, 0, 0, 16, 0, 17, 0,
1381 0, 0, 0, 0, 0, 18, 38, 0, 0, 0,
1382 0, 19, 462, 0, 0, 20, 0, 21, 22, 0,
1383 0, 0, 0, 0, 24, 0, 0, 0, 0, 0,
1384 0, 296, 4, 297, 298, 299, 300, 301, 0, 0,
1385 0, 0, 0, 0, 0, 0, 0, 25, 0, 0,
1386 0, 26, 27, 28, 29, 0, 5, 30, 6, 31,
1387 0, 0, 0, 32, 7, 0, 0, 0, 0, 33,
1388 34, 0, 35, 0, 0, 0, 0, 36, 37, 0,
1389 0, 12, 0, 0, 0, 13, 14, 0, 0, 302,
1390 0, 16, 296, 17, 297, 298, 299, 300, 301, 0,
1391 18, 38, 0, 0, 0, 0, 0, 528, 0, 0,
1392 0, 0, 21, 22, 0, 0, 0, 0, 0, 24,
1393 0, 0, 0, 0, 0, 303, 0, 0, 0, 0,
1394 0, 0, 296, 0, 297, 298, 299, 300, 301, 0,
1395 0, 0, 0, 0, 0, 0, 26, 27, 28, 29,
1396 302, 304, 30, 0, 0, 0, 0, 0, 32, 0,
1397 0, 0, 0, 305, 0, 34, 0, 35, 0, 0,
1398 0, 0, 36, 37, 0, 0, 0, 0, 0, 0,
1399 306, 0, 0, 307, 308, 309, 303, 0, 310, 311,
1400 302, 0, 0, 0, 0, 0, 0, 0, 0, 312,
1401 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1402 0, 0, 304, 0, 0, 0, 400, 401, 402, 403,
1403 404, 405, 406, 0, 305, 0, 303, 0, 0, 0,
1404 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1405 0, 306, 0, 0, 307, 308, 309, 0, 0, 310,
1406 311, 0, 304, 0, 0, 0, 0, 0, 0, 0,
1407 312, 0, 0, 0, 305, 0, 0, 0, 0, 4,
1408 0, 0, 0, 0, 0, 0, 252, 0, 0, 0,
1409 0, 306, 0, 0, 307, 308, 369, 0, 0, 310,
1410 311, 0, 0, 5, 0, 6, 0, 0, 0, 0,
1411 312, 7, 8, 0, 0, 9, 0, 0, 0, 0,
1412 10, 0, 0, 0, 0, 0, 11, 0, 12, 0,
1413 0, 0, 13, 14, 0, 15, 0, 0, 16, 0,
1414 17, 0, 0, 0, 0, 0, 0, 18, 0, 0,
1415 0, 0, 0, 19, 253, 0, 0, 20, 0, 21,
1416 22, 23, 0, 0, 0, 0, 24, 413, 414, 415,
1417 416, 417, 418, 419, 4, 0, 0, 0, 0, 0,
1418 0, 420, 421, 0, 0, 0, 0, 0, 0, 25,
1419 0, 0, 0, 26, 27, 28, 29, 0, 5, 30,
1420 6, 31, 0, 0, 0, 32, 7, 8, 0, 0,
1421 9, 33, 34, 0, 35, 10, 0, 0, 0, 36,
1422 37, 11, 0, 12, 0, 0, 0, 13, 14, 0,
1423 15, 0, 0, 16, 0, 17, 0, 0, 0, 0,
1424 0, 0, 18, 38, 0, 0, 0, 0, 19, 4,
1425 0, 0, 20, 0, 21, 22, 23, 0, 0, 0,
1426 0, 24, 0, 0, 0, 0, 0, 0, 0, 0,
1427 0, 0, 0, 5, 0, 6, 0, 0, 0, 0,
1428 0, 7, 0, 0, 25, 9, 0, 0, 26, 27,
1429 28, 29, 4, 0, 30, 0, 31, 0, 12, 0,
1430 32, 0, 13, 14, 0, 15, 33, 34, 16, 35,
1431 17, 0, 0, 0, 36, 37, 5, 18, 6, 0,
1432 0, 0, 0, 0, 7, 0, 0, 20, 9, 21,
1433 22, 0, 0, 0, 0, 0, 24, 0, 38, 0,
1434 0, 12, 0, 0, 0, 13, 14, 0, 15, 0,
1435 0, 16, 0, 17, 0, 0, 0, 0, 0, 25,
1436 18, 0, 0, 26, 27, 28, 29, 0, 0, 30,
1437 20, 31, 21, 22, 0, 32, 0, 0, 0, 24,
1438 0, 0, 34, 0, 35, 0, 0, 0, 0, 371,
1439 37, 400, 401, 402, 403, 404, 405, 406, 407, 408,
1440 0, 0, 25, 0, 0, 0, 26, 27, 28, 29,
1441 0, 0, 30, 38, 31, 0, 0, 0, 32, 0,
1442 0, 0, 0, 0, 0, 34, 0, 35, 0, 0,
1443 0, 0, 36, 37, 400, 401, 402, 403, 404, 405,
1444 406, 407, 408, 0, 0, 0, 0, 0, 0, 0,
1445 0, 0, 0, 0, 0, 0, 38, 400, 401, 402,
1446 403, 404, 405, 406, 407, 408, 0, 0, 0, 0,
1447 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1448 400, 401, 402, 403, 404, 405, 406, 407, 408, 0,
1449 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1450 0, 0, 400, 401, 402, 403, 404, 405, 406, 407,
1451 408, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1452 0, 0, 0, 0, 0, 0, 0, 409, 0, 410,
1453 411, 412, 413, 414, 415, 416, 417, 418, 419, 0,
1454 0, 0, 0, 0, 0, 0, 420, 421, 0, 0,
1455 0, 435, 400, 401, 402, 403, 404, 405, 406, 407,
1456 408, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1457 409, 0, 410, 411, 412, 413, 414, 415, 416, 417,
1458 418, 419, 400, 401, 402, 403, 404, 405, 406, 420,
1459 421, 0, 0, 409, 443, 410, 411, 412, 413, 414,
1460 415, 416, 417, 418, 419, 400, 401, 402, 403, 404,
1461 405, 406, 420, 421, 0, 0, 409, 479, 410, 411,
1462 412, 413, 414, 415, 416, 417, 418, 419, 400, 401,
1463 402, 403, 404, 405, 406, 420, 421, 524, 409, 523,
1464 410, 411, 412, 413, 414, 415, 416, 417, 418, 419,
1465 0, 0, 0, 0, 0, 0, 0, 420, 421, 400,
1466 401, 402, 403, 404, 405, 406, 0, 408, 0, 0,
1467 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1468 0, 0, 0, 0, 0, 0, 0, 0, 409, 0,
1469 410, 411, 412, 413, 414, 415, 416, 417, 418, 419,
1470 0, 0, 0, 0, 0, 0, 0, 420, 421, 0,
1471 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1472 410, 411, 412, 413, 414, 415, 416, 417, 418, 419,
1473 0, 0, 0, 0, 0, 0, 0, 420, 421, 0,
1474 0, 0, 0, 0, 411, 412, 413, 414, 415, 416,
1475 417, 418, 419, 0, 0, 0, 0, 0, 0, 0,
1476 420, 421, 0, 0, 0, 0, 0, 0, 412, 413,
1477 414, 415, 416, 417, 418, 419, 0, 0, 0, 0,
1478 0, 0, 0, 420, 421, 4, 0, 0, 0, 0,
1479 0, 0, 0, 0, 0, 0, 0, 410, 411, 412,
1480 413, 414, 415, 416, 417, 418, 419, 0, 0, 5,
1481 0, 6, 0, 0, 420, 421, 0, 7, 8, 0,
1482 0, 9, 0, 0, 0, 0, 0, 0, 4, 0,
1483 0, 0, 11, 0, 12, 0, 0, 0, 13, 14,
1484 0, 15, 0, 0, 16, 0, 17, 0, 0, 0,
1485 0, 0, 5, 18, 6, 0, 0, 0, 0, 0,
1486 7, 0, 0, 20, 9, 21, 22, 23, 0, 0,
1487 172, 0, 24, 0, 173, 0, 0, 12, 0, 0,
1488 0, 13, 14, 0, 15, 0, 0, 16, 0, 17,
1489 0, 0, 0, 0, 0, 25, 18, 0, 4, 26,
1490 27, 28, 29, 0, 0, 30, 20, 31, 21, 22,
1491 0, 32, 0, 0, 0, 24, 0, 0, 34, 0,
1492 35, 0, 5, 0, 6, 36, 37, 0, 0, 0,
1493 7, 0, 0, 0, 0, 0, 0, 0, 25, 0,
1494 0, 0, 26, 27, 28, 29, 0, 12, 30, 0,
1495 31, 13, 14, 0, 32, 0, 0, 16, 0, 17,
1496 0, 34, 0, 35, 0, 0, 18, 0, 36, 37,
1497 0, 0, 0, 0, 0, 0, 0, 0, 21, 22,
1498 0, 0, 0, 0, 0, 24, 0, 0, 0, 0,
1499 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1500 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1501 0, 0, 26, 27, 28, 29, 0, 0, 30, 0,
1502 0, 0, 0, 0, 32, 0, 0, 0, 0, 0,
1503 0, 34, 0, 35, 0, 0, 0, 0, 36, 37,
1504 95, 0, 96, 97, 0, 98, 99, 0, 100, 0,
1505 0, 101, 0, 102, 0, 0, 0, 0, 0, 0,
1506 103, 104, 105, 106, 0, 107, 108, 109, 110, 111,
1507 0, 112, 0, 113, 114, 115, 0, 0, 116, 0,
1508 0, 0, 0, 117, 0, 118, 119, 120, 121, 122,
1509 123, 0, 124, 125, 126, 127, 128, 0, 0, 129,
1510 0, 0, 130, 0, 0, 0, 131, 132, 0, 133,
1511 0, 0, 0, 134, 135, 136, 0, 137, 138, 139,
1512 140, 141, 0, 142, 0, 143, 144, 145, 146, 147,
1513 148, 149, 150, 0, 151, 152, 153, 0, 0, 0,
1514 0, 154, 0, 0, 155, 0, 0, 156, 157, 0,
1515 0, 158, 159, 160, 0, 0, 0, 161, 0, 162,
1516 163, 164, 165, 0, 0, 166
1519 static const short int yycheck
[] =
1521 2, 45, 2, 2, 2, 66, 33, 2, 274, 2,
1522 262, 231, 206, 207, 234, 250, 236, 4, 2, 239,
1523 45, 131, 242, 131, 85, 218, 34, 92, 222, 51,
1524 109, 230, 225, 280, 113, 3, 4, 40, 46, 14,
1525 147, 28, 0, 30, 147, 147, 90, 63, 64, 36,
1526 3, 4, 68, 40, 168, 3, 4, 60, 45, 138,
1527 174, 45, 169, 173, 86, 173, 53, 35, 170, 172,
1528 57, 58, 40, 60, 86, 14, 63, 171, 65, 82,
1529 279, 147, 276, 147, 147, 72, 168, 35, 147, 3,
1530 4, 78, 174, 105, 62, 82, 270, 84, 85, 351,
1531 12, 13, 14, 168, 91, 8, 172, 10, 172, 172,
1532 362, 114, 347, 172, 62, 62, 63, 64, 28, 293,
1533 294, 68, 168, 126, 84, 35, 168, 114, 174, 171,
1534 168, 118, 119, 120, 121, 103, 174, 124, 24, 126,
1535 168, 27, 170, 130, 32, 8, 34, 3, 4, 136,
1536 137, 171, 139, 3, 4, 103, 170, 144, 145, 127,
1537 380, 168, 14, 188, 3, 4, 174, 173, 170, 171,
1538 170, 171, 170, 171, 170, 170, 171, 170, 171, 127,
1539 170, 168, 170, 377, 245, 246, 379, 174, 249, 157,
1540 384, 438, 167, 168, 173, 461, 212, 3, 4, 12,
1541 13, 14, 422, 171, 17, 18, 3, 4, 170, 157,
1542 462, 3, 4, 170, 227, 3, 4, 230, 157, 158,
1543 159, 441, 149, 171, 237, 170, 170, 240, 167, 168,
1544 243, 244, 173, 170, 8, 36, 3, 281, 173, 173,
1545 170, 268, 173, 155, 156, 157, 158, 159, 171, 171,
1546 171, 312, 171, 171, 171, 167, 168, 509, 171, 175,
1547 171, 455, 171, 290, 171, 212, 279, 280, 173, 171,
1548 171, 72, 171, 275, 468, 275, 528, 275, 472, 281,
1549 275, 171, 475, 84, 85, 172, 171, 171, 171, 171,
1550 91, 171, 294, 306, 307, 308, 309, 310, 311, 312,
1551 171, 171, 171, 155, 156, 157, 158, 159, 173, 171,
1552 171, 171, 356, 172, 534, 167, 168, 511, 119, 8,
1553 364, 8, 171, 124, 8, 8, 8, 65, 5, 171,
1554 391, 358, 376, 168, 170, 149, 170, 174, 382, 172,
1555 153, 154, 155, 156, 157, 158, 159, 173, 147, 147,
1556 175, 172, 171, 352, 167, 168, 369, 172, 3, 361,
1557 172, 361, 172, 361, 172, 172, 361, 172, 172, 172,
1558 172, 147, 172, 8, 149, 78, 172, 172, 172, 172,
1559 167, 172, 382, 172, 170, 169, 147, 400, 401, 174,
1560 403, 404, 405, 406, 407, 408, 409, 410, 411, 412,
1561 413, 414, 415, 416, 417, 418, 419, 4, 421, 172,
1562 172, 170, 170, 3, 458, 172, 3, 8, 172, 5,
1563 172, 170, 170, 467, 149, 438, 172, 172, 149, 173,
1564 170, 28, 43, 30, 360, 2, 467, 379, 2, 36,
1565 37, 540, 45, 40, 2, 2, 276, 3, 45, 5,
1566 6, 7, 8, 9, 51, 472, 53, 180, 241, -1,
1567 57, 58, 243, 60, -1, 467, 63, 480, 65, -1,
1568 -1, -1, -1, -1, -1, 72, -1, -1, -1, -1,
1569 -1, 78, 79, -1, -1, 82, -1, 84, 85, 86,
1570 -1, -1, -1, -1, 91, -1, -1, -1, -1, -1,
1571 -1, -1, 4, -1, -1, 61, -1, -1, -1, -1,
1572 523, 513, -1, 513, -1, 513, -1, 114, 513, -1,
1573 -1, 118, 119, 120, 121, -1, 28, 124, 30, 126,
1574 -1, -1, -1, 130, 36, -1, -1, -1, 40, 136,
1575 137, 97, 139, 45, -1, -1, -1, 144, 145, -1,
1576 -1, 53, -1, -1, -1, 57, 58, -1, 60, -1,
1577 -1, 63, -1, 65, -1, -1, -1, 123, -1, -1,
1578 72, 168, -1, -1, -1, -1, 78, 174, -1, 135,
1579 82, -1, 84, 85, -1, -1, -1, -1, -1, 91,
1580 -1, -1, -1, -1, -1, -1, 152, 4, -1, 155,
1581 156, 157, -1, -1, 160, 161, -1, -1, -1, -1,
1582 -1, -1, 114, 169, -1, 171, 118, 119, 120, 121,
1583 -1, 28, 124, 30, 126, -1, -1, -1, 130, 36,
1584 -1, -1, -1, 40, 136, 137, -1, 139, 45, -1,
1585 -1, -1, 144, 145, -1, -1, 53, -1, -1, -1,
1586 57, 58, -1, 60, -1, -1, 63, -1, 65, -1,
1587 -1, -1, -1, -1, -1, 72, 168, -1, -1, -1,
1588 -1, 78, 174, -1, -1, 82, -1, 84, 85, -1,
1589 -1, -1, -1, -1, 91, -1, -1, -1, -1, -1,
1590 -1, 3, 4, 5, 6, 7, 8, 9, -1, -1,
1591 -1, -1, -1, -1, -1, -1, -1, 114, -1, -1,
1592 -1, 118, 119, 120, 121, -1, 28, 124, 30, 126,
1593 -1, -1, -1, 130, 36, -1, -1, -1, -1, 136,
1594 137, -1, 139, -1, -1, -1, -1, 144, 145, -1,
1595 -1, 53, -1, -1, -1, 57, 58, -1, -1, 61,
1596 -1, 63, 3, 65, 5, 6, 7, 8, 9, -1,
1597 72, 168, -1, -1, -1, -1, -1, 174, -1, -1,
1598 -1, -1, 84, 85, -1, -1, -1, -1, -1, 91,
1599 -1, -1, -1, -1, -1, 97, -1, -1, -1, -1,
1600 -1, -1, 3, -1, 5, 6, 7, 8, 9, -1,
1601 -1, -1, -1, -1, -1, -1, 118, 119, 120, 121,
1602 61, 123, 124, -1, -1, -1, -1, -1, 130, -1,
1603 -1, -1, -1, 135, -1, 137, -1, 139, -1, -1,
1604 -1, -1, 144, 145, -1, -1, -1, -1, -1, -1,
1605 152, -1, -1, 155, 156, 157, 97, -1, 160, 161,
1606 61, -1, -1, -1, -1, -1, -1, -1, -1, 171,
1607 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1608 -1, -1, 123, -1, -1, -1, 12, 13, 14, 15,
1609 16, 17, 18, -1, 135, -1, 97, -1, -1, -1,
1610 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1611 -1, 152, -1, -1, 155, 156, 157, -1, -1, 160,
1612 161, -1, 123, -1, -1, -1, -1, -1, -1, -1,
1613 171, -1, -1, -1, 135, -1, -1, -1, -1, 4,
1614 -1, -1, -1, -1, -1, -1, 11, -1, -1, -1,
1615 -1, 152, -1, -1, 155, 156, 157, -1, -1, 160,
1616 161, -1, -1, 28, -1, 30, -1, -1, -1, -1,
1617 171, 36, 37, -1, -1, 40, -1, -1, -1, -1,
1618 45, -1, -1, -1, -1, -1, 51, -1, 53, -1,
1619 -1, -1, 57, 58, -1, 60, -1, -1, 63, -1,
1620 65, -1, -1, -1, -1, -1, -1, 72, -1, -1,
1621 -1, -1, -1, 78, 79, -1, -1, 82, -1, 84,
1622 85, 86, -1, -1, -1, -1, 91, 153, 154, 155,
1623 156, 157, 158, 159, 4, -1, -1, -1, -1, -1,
1624 -1, 167, 168, -1, -1, -1, -1, -1, -1, 114,
1625 -1, -1, -1, 118, 119, 120, 121, -1, 28, 124,
1626 30, 126, -1, -1, -1, 130, 36, 37, -1, -1,
1627 40, 136, 137, -1, 139, 45, -1, -1, -1, 144,
1628 145, 51, -1, 53, -1, -1, -1, 57, 58, -1,
1629 60, -1, -1, 63, -1, 65, -1, -1, -1, -1,
1630 -1, -1, 72, 168, -1, -1, -1, -1, 78, 4,
1631 -1, -1, 82, -1, 84, 85, 86, -1, -1, -1,
1632 -1, 91, -1, -1, -1, -1, -1, -1, -1, -1,
1633 -1, -1, -1, 28, -1, 30, -1, -1, -1, -1,
1634 -1, 36, -1, -1, 114, 40, -1, -1, 118, 119,
1635 120, 121, 4, -1, 124, -1, 126, -1, 53, -1,
1636 130, -1, 57, 58, -1, 60, 136, 137, 63, 139,
1637 65, -1, -1, -1, 144, 145, 28, 72, 30, -1,
1638 -1, -1, -1, -1, 36, -1, -1, 82, 40, 84,
1639 85, -1, -1, -1, -1, -1, 91, -1, 168, -1,
1640 -1, 53, -1, -1, -1, 57, 58, -1, 60, -1,
1641 -1, 63, -1, 65, -1, -1, -1, -1, -1, 114,
1642 72, -1, -1, 118, 119, 120, 121, -1, -1, 124,
1643 82, 126, 84, 85, -1, 130, -1, -1, -1, 91,
1644 -1, -1, 137, -1, 139, -1, -1, -1, -1, 144,
1645 145, 12, 13, 14, 15, 16, 17, 18, 19, 20,
1646 -1, -1, 114, -1, -1, -1, 118, 119, 120, 121,
1647 -1, -1, 124, 168, 126, -1, -1, -1, 130, -1,
1648 -1, -1, -1, -1, -1, 137, -1, 139, -1, -1,
1649 -1, -1, 144, 145, 12, 13, 14, 15, 16, 17,
1650 18, 19, 20, -1, -1, -1, -1, -1, -1, -1,
1651 -1, -1, -1, -1, -1, -1, 168, 12, 13, 14,
1652 15, 16, 17, 18, 19, 20, -1, -1, -1, -1,
1653 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1654 12, 13, 14, 15, 16, 17, 18, 19, 20, -1,
1655 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1656 -1, -1, 12, 13, 14, 15, 16, 17, 18, 19,
1657 20, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1658 -1, -1, -1, -1, -1, -1, -1, 148, -1, 150,
1659 151, 152, 153, 154, 155, 156, 157, 158, 159, -1,
1660 -1, -1, -1, -1, -1, -1, 167, 168, -1, -1,
1661 -1, 172, 12, 13, 14, 15, 16, 17, 18, 19,
1662 20, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1663 148, -1, 150, 151, 152, 153, 154, 155, 156, 157,
1664 158, 159, 12, 13, 14, 15, 16, 17, 18, 167,
1665 168, -1, -1, 148, 172, 150, 151, 152, 153, 154,
1666 155, 156, 157, 158, 159, 12, 13, 14, 15, 16,
1667 17, 18, 167, 168, -1, -1, 148, 172, 150, 151,
1668 152, 153, 154, 155, 156, 157, 158, 159, 12, 13,
1669 14, 15, 16, 17, 18, 167, 168, 169, 148, 149,
1670 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
1671 -1, -1, -1, -1, -1, -1, -1, 167, 168, 12,
1672 13, 14, 15, 16, 17, 18, -1, 20, -1, -1,
1673 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1674 -1, -1, -1, -1, -1, -1, -1, -1, 148, -1,
1675 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
1676 -1, -1, -1, -1, -1, -1, -1, 167, 168, -1,
1677 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1678 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
1679 -1, -1, -1, -1, -1, -1, -1, 167, 168, -1,
1680 -1, -1, -1, -1, 151, 152, 153, 154, 155, 156,
1681 157, 158, 159, -1, -1, -1, -1, -1, -1, -1,
1682 167, 168, -1, -1, -1, -1, -1, -1, 152, 153,
1683 154, 155, 156, 157, 158, 159, -1, -1, -1, -1,
1684 -1, -1, -1, 167, 168, 4, -1, -1, -1, -1,
1685 -1, -1, -1, -1, -1, -1, -1, 150, 151, 152,
1686 153, 154, 155, 156, 157, 158, 159, -1, -1, 28,
1687 -1, 30, -1, -1, 167, 168, -1, 36, 37, -1,
1688 -1, 40, -1, -1, -1, -1, -1, -1, 4, -1,
1689 -1, -1, 51, -1, 53, -1, -1, -1, 57, 58,
1690 -1, 60, -1, -1, 63, -1, 65, -1, -1, -1,
1691 -1, -1, 28, 72, 30, -1, -1, -1, -1, -1,
1692 36, -1, -1, 82, 40, 84, 85, 86, -1, -1,
1693 89, -1, 91, -1, 93, -1, -1, 53, -1, -1,
1694 -1, 57, 58, -1, 60, -1, -1, 63, -1, 65,
1695 -1, -1, -1, -1, -1, 114, 72, -1, 4, 118,
1696 119, 120, 121, -1, -1, 124, 82, 126, 84, 85,
1697 -1, 130, -1, -1, -1, 91, -1, -1, 137, -1,
1698 139, -1, 28, -1, 30, 144, 145, -1, -1, -1,
1699 36, -1, -1, -1, -1, -1, -1, -1, 114, -1,
1700 -1, -1, 118, 119, 120, 121, -1, 53, 124, -1,
1701 126, 57, 58, -1, 130, -1, -1, 63, -1, 65,
1702 -1, 137, -1, 139, -1, -1, 72, -1, 144, 145,
1703 -1, -1, -1, -1, -1, -1, -1, -1, 84, 85,
1704 -1, -1, -1, -1, -1, 91, -1, -1, -1, -1,
1705 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1706 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1707 -1, -1, 118, 119, 120, 121, -1, -1, 124, -1,
1708 -1, -1, -1, -1, 130, -1, -1, -1, -1, -1,
1709 -1, 137, -1, 139, -1, -1, -1, -1, 144, 145,
1710 21, -1, 23, 24, -1, 26, 27, -1, 29, -1,
1711 -1, 32, -1, 34, -1, -1, -1, -1, -1, -1,
1712 41, 42, 43, 44, -1, 46, 47, 48, 49, 50,
1713 -1, 52, -1, 54, 55, 56, -1, -1, 59, -1,
1714 -1, -1, -1, 64, -1, 66, 67, 68, 69, 70,
1715 71, -1, 73, 74, 75, 76, 77, -1, -1, 80,
1716 -1, -1, 83, -1, -1, -1, 87, 88, -1, 90,
1717 -1, -1, -1, 94, 95, 96, -1, 98, 99, 100,
1718 101, 102, -1, 104, -1, 106, 107, 108, 109, 110,
1719 111, 112, 113, -1, 115, 116, 117, -1, -1, -1,
1720 -1, 122, -1, -1, 125, -1, -1, 128, 129, -1,
1721 -1, 132, 133, 134, -1, -1, -1, 138, -1, 140,
1722 141, 142, 143, -1, -1, 146
1725 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1726 symbol of state STATE-NUM. */
1727 static const unsigned short int yystos
[] =
1729 0, 177, 178, 0, 4, 28, 30, 36, 37, 40,
1730 45, 51, 53, 57, 58, 60, 63, 65, 72, 78,
1731 82, 84, 85, 86, 91, 114, 118, 119, 120, 121,
1732 124, 126, 130, 136, 137, 139, 144, 145, 168, 182,
1733 183, 184, 185, 188, 189, 196, 207, 221, 225, 227,
1734 228, 229, 230, 233, 234, 237, 239, 240, 241, 242,
1735 244, 245, 246, 247, 248, 250, 252, 258, 259, 260,
1736 261, 3, 4, 171, 3, 4, 3, 4, 223, 84,
1737 226, 8, 3, 4, 226, 171, 226, 227, 3, 223,
1738 195, 196, 3, 223, 227, 21, 23, 24, 26, 27,
1739 29, 32, 34, 41, 42, 43, 44, 46, 47, 48,
1740 49, 50, 52, 54, 55, 56, 59, 64, 66, 67,
1741 68, 69, 70, 71, 73, 74, 75, 76, 77, 80,
1742 83, 87, 88, 90, 94, 95, 96, 98, 99, 100,
1743 101, 102, 104, 106, 107, 108, 109, 110, 111, 112,
1744 113, 115, 116, 117, 122, 125, 128, 129, 132, 133,
1745 134, 138, 140, 141, 142, 143, 146, 197, 199, 257,
1746 179, 179, 89, 93, 187, 207, 228, 233, 239, 243,
1747 250, 258, 261, 170, 170, 170, 173, 170, 173, 170,
1748 181, 170, 149, 238, 173, 251, 252, 251, 251, 3,
1749 4, 35, 62, 103, 127, 157, 171, 201, 224, 253,
1750 254, 256, 259, 170, 251, 170, 170, 8, 173, 170,
1751 259, 173, 250, 131, 173, 171, 171, 171, 171, 171,
1752 171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
1753 171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
1754 147, 169, 11, 79, 182, 186, 189, 228, 230, 241,
1755 242, 245, 174, 3, 3, 4, 173, 256, 231, 105,
1756 235, 239, 3, 4, 173, 180, 249, 253, 253, 175,
1757 168, 171, 194, 251, 172, 204, 205, 206, 224, 172,
1758 214, 253, 255, 171, 217, 224, 3, 5, 6, 7,
1759 8, 9, 61, 97, 123, 135, 152, 155, 156, 157,
1760 160, 161, 171, 210, 211, 212, 210, 213, 8, 8,
1761 198, 213, 212, 8, 8, 212, 8, 212, 210, 65,
1762 212, 208, 209, 210, 257, 212, 208, 210, 259, 259,
1763 8, 10, 200, 5, 262, 259, 199, 168, 171, 170,
1764 181, 174, 195, 232, 149, 92, 195, 219, 236, 170,
1765 173, 180, 174, 182, 196, 248, 253, 172, 213, 157,
1766 209, 144, 190, 191, 192, 193, 196, 250, 174, 147,
1767 175, 174, 195, 215, 147, 219, 174, 196, 216, 219,
1768 172, 171, 210, 210, 210, 210, 210, 210, 210, 259,
1769 12, 13, 14, 15, 16, 17, 18, 19, 20, 148,
1770 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
1771 167, 168, 147, 172, 172, 172, 147, 172, 172, 172,
1772 172, 172, 172, 172, 172, 172, 3, 172, 147, 172,
1773 172, 147, 172, 172, 172, 172, 172, 167, 172, 172,
1774 199, 8, 181, 242, 149, 250, 170, 174, 195, 220,
1775 174, 185, 174, 181, 169, 169, 172, 147, 250, 253,
1776 206, 212, 250, 261, 253, 172, 170, 170, 259, 172,
1777 172, 210, 210, 3, 210, 210, 210, 210, 210, 210,
1778 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
1779 210, 3, 210, 212, 8, 172, 209, 212, 5, 172,
1780 253, 250, 170, 180, 181, 193, 253, 255, 170, 222,
1781 224, 172, 210, 149, 169, 172, 181, 253, 174, 170,
1782 173, 210, 181, 202, 34, 46, 174, 203, 212, 149,
1783 149, 170, 218, 219, 218, 170
1786 #define yyerrok (yyerrstatus = 0)
1787 #define yyclearin (yychar = YYEMPTY)
1788 #define YYEMPTY (-2)
1791 #define YYACCEPT goto yyacceptlab
1792 #define YYABORT goto yyabortlab
1793 #define YYERROR goto yyerrorlab
1796 /* Like YYERROR except do call yyerror. This remains here temporarily
1797 to ease the transition to the new meaning of YYERROR, for GCC.
1798 Once GCC version 2 has supplanted version 1, this can go. */
1800 #define YYFAIL goto yyerrlab
1802 #define YYRECOVERING() (!!yyerrstatus)
1804 #define YYBACKUP(Token, Value) \
1806 if (yychar == YYEMPTY && yylen == 1) \
1810 yytoken = YYTRANSLATE (yychar); \
1816 yyerror (YY_("syntax error: cannot back up")); \
1823 #define YYERRCODE 256
1826 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1827 If N is 0, then set CURRENT to the empty location which ends
1828 the previous symbol: RHS[0] (always defined). */
1830 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
1831 #ifndef YYLLOC_DEFAULT
1832 # define YYLLOC_DEFAULT(Current, Rhs, N) \
1836 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1837 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1838 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1839 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1843 (Current).first_line = (Current).last_line = \
1844 YYRHSLOC (Rhs, 0).last_line; \
1845 (Current).first_column = (Current).last_column = \
1846 YYRHSLOC (Rhs, 0).last_column; \
1852 /* YY_LOCATION_PRINT -- Print the location on the stream.
1853 This macro was not mandated originally: define only if we know
1854 we won't break user code: when these are the locations we know. */
1856 #ifndef YY_LOCATION_PRINT
1857 # if YYLTYPE_IS_TRIVIAL
1858 # define YY_LOCATION_PRINT(File, Loc) \
1859 fprintf (File, "%d.%d-%d.%d", \
1860 (Loc).first_line, (Loc).first_column, \
1861 (Loc).last_line, (Loc).last_column)
1863 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1868 /* YYLEX -- calling `yylex' with the right arguments. */
1871 # define YYLEX yylex (YYLEX_PARAM)
1873 # define YYLEX yylex ()
1876 /* Enable debugging if requested. */
1880 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1881 # define YYFPRINTF fprintf
1884 # define YYDPRINTF(Args) \
1890 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1894 YYFPRINTF (stderr, "%s ", Title); \
1895 yysymprint (stderr, \
1897 YYFPRINTF (stderr, "\n"); \
1901 /*------------------------------------------------------------------.
1902 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1904 `------------------------------------------------------------------*/
1906 #if defined (__STDC__) || defined (__cplusplus)
1908 yy_stack_print (short int *bottom
, short int *top
)
1911 yy_stack_print (bottom
, top
)
1916 YYFPRINTF (stderr
, "Stack now");
1917 for (/* Nothing. */; bottom
<= top
; ++bottom
)
1918 YYFPRINTF (stderr
, " %d", *bottom
);
1919 YYFPRINTF (stderr
, "\n");
1922 # define YY_STACK_PRINT(Bottom, Top) \
1925 yy_stack_print ((Bottom), (Top)); \
1929 /*------------------------------------------------.
1930 | Report that the YYRULE is going to be reduced. |
1931 `------------------------------------------------*/
1933 #if defined (__STDC__) || defined (__cplusplus)
1935 yy_reduce_print (int yyrule
)
1938 yy_reduce_print (yyrule
)
1943 unsigned long int yylno
= yyrline
[yyrule
];
1944 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu), ",
1946 /* Print the symbols being reduced, and their result. */
1947 for (yyi
= yyprhs
[yyrule
]; 0 <= yyrhs
[yyi
]; yyi
++)
1948 YYFPRINTF (stderr
, "%s ", yytname
[yyrhs
[yyi
]]);
1949 YYFPRINTF (stderr
, "-> %s\n", yytname
[yyr1
[yyrule
]]);
1952 # define YY_REDUCE_PRINT(Rule) \
1955 yy_reduce_print (Rule); \
1958 /* Nonzero means print parse trace. It is left uninitialized so that
1959 multiple parsers can coexist. */
1961 #else /* !YYDEBUG */
1962 # define YYDPRINTF(Args)
1963 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1964 # define YY_STACK_PRINT(Bottom, Top)
1965 # define YY_REDUCE_PRINT(Rule)
1966 #endif /* !YYDEBUG */
1969 /* YYINITDEPTH -- initial size of the parser's stacks. */
1971 # define YYINITDEPTH 200
1974 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1975 if the built-in stack extension method is used).
1977 Do not make this value too large; the results are undefined if
1978 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1979 evaluated with infinite-precision integer arithmetic. */
1982 # define YYMAXDEPTH 10000
1990 # if defined (__GLIBC__) && defined (_STRING_H)
1991 # define yystrlen strlen
1993 /* Return the length of YYSTR. */
1995 # if defined (__STDC__) || defined (__cplusplus)
1996 yystrlen (const char *yystr
)
2002 const char *yys
= yystr
;
2004 while (*yys
++ != '\0')
2007 return yys
- yystr
- 1;
2013 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
2014 # define yystpcpy stpcpy
2016 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
2019 # if defined (__STDC__) || defined (__cplusplus)
2020 yystpcpy (char *yydest
, const char *yysrc
)
2022 yystpcpy (yydest
, yysrc
)
2028 const char *yys
= yysrc
;
2030 while ((*yyd
++ = *yys
++) != '\0')
2039 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
2040 quotes and backslashes, so that it's suitable for yyerror. The
2041 heuristic is that double-quoting is unnecessary unless the string
2042 contains an apostrophe, a comma, or backslash (other than
2043 backslash-backslash). YYSTR is taken from yytname. If YYRES is
2044 null, do not copy; instead, return the length of what the result
2047 yytnamerr (char *yyres
, const char *yystr
)
2052 char const *yyp
= yystr
;
2059 goto do_not_strip_quotes
;
2063 goto do_not_strip_quotes
;
2076 do_not_strip_quotes
: ;
2080 return yystrlen (yystr
);
2082 return yystpcpy (yyres
, yystr
) - yyres
;
2086 #endif /* YYERROR_VERBOSE */
2091 /*--------------------------------.
2092 | Print this symbol on YYOUTPUT. |
2093 `--------------------------------*/
2095 #if defined (__STDC__) || defined (__cplusplus)
2097 yysymprint (FILE *yyoutput
, int yytype
, YYSTYPE
*yyvaluep
)
2100 yysymprint (yyoutput
, yytype
, yyvaluep
)
2106 /* Pacify ``unused variable'' warnings. */
2109 if (yytype
< YYNTOKENS
)
2110 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
2112 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
2116 if (yytype
< YYNTOKENS
)
2117 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
2124 YYFPRINTF (yyoutput
, ")");
2127 #endif /* ! YYDEBUG */
2128 /*-----------------------------------------------.
2129 | Release the memory associated to this symbol. |
2130 `-----------------------------------------------*/
2132 #if defined (__STDC__) || defined (__cplusplus)
2134 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
)
2137 yydestruct (yymsg
, yytype
, yyvaluep
)
2143 /* Pacify ``unused variable'' warnings. */
2148 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
2159 /* Prevent warnings from -Wmissing-prototypes. */
2161 #ifdef YYPARSE_PARAM
2162 # if defined (__STDC__) || defined (__cplusplus)
2163 int yyparse (void *YYPARSE_PARAM
);
2167 #else /* ! YYPARSE_PARAM */
2168 #if defined (__STDC__) || defined (__cplusplus)
2173 #endif /* ! YYPARSE_PARAM */
2177 /* The look-ahead symbol. */
2180 /* The semantic value of the look-ahead symbol. */
2183 /* Number of syntax errors so far. */
2192 #ifdef YYPARSE_PARAM
2193 # if defined (__STDC__) || defined (__cplusplus)
2194 int yyparse (void *YYPARSE_PARAM
)
2196 int yyparse (YYPARSE_PARAM
)
2197 void *YYPARSE_PARAM
;
2199 #else /* ! YYPARSE_PARAM */
2200 #if defined (__STDC__) || defined (__cplusplus)
2214 /* Number of tokens to shift before error messages enabled. */
2216 /* Look-ahead token as an internal (translated) token number. */
2219 /* Three stacks and their tools:
2220 `yyss': related to states,
2221 `yyvs': related to semantic values,
2222 `yyls': related to locations.
2224 Refer to the stacks thru separate pointers, to allow yyoverflow
2225 to reallocate them elsewhere. */
2227 /* The state stack. */
2228 short int yyssa
[YYINITDEPTH
];
2229 short int *yyss
= yyssa
;
2232 /* The semantic value stack. */
2233 YYSTYPE yyvsa
[YYINITDEPTH
];
2234 YYSTYPE
*yyvs
= yyvsa
;
2239 #define YYPOPSTACK (yyvsp--, yyssp--)
2241 YYSIZE_T yystacksize
= YYINITDEPTH
;
2243 /* The variables used to return semantic value and location from the
2248 /* When reducing, the number of symbols on the RHS of the reduced
2252 YYDPRINTF ((stderr
, "Starting parse\n"));
2257 yychar
= YYEMPTY
; /* Cause a token to be read. */
2259 /* Initialize stack pointers.
2260 Waste one element of value and location stack
2261 so that they stay on the same level as the state stack.
2262 The wasted elements are never initialized. */
2269 /*------------------------------------------------------------.
2270 | yynewstate -- Push a new state, which is found in yystate. |
2271 `------------------------------------------------------------*/
2273 /* In all cases, when you get here, the value and location stacks
2274 have just been pushed. so pushing a state here evens the stacks.
2281 if (yyss
+ yystacksize
- 1 <= yyssp
)
2283 /* Get the current used size of the three stacks, in elements. */
2284 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
2288 /* Give user a chance to reallocate the stack. Use copies of
2289 these so that the &'s don't force the real ones into
2291 YYSTYPE
*yyvs1
= yyvs
;
2292 short int *yyss1
= yyss
;
2295 /* Each stack pointer address is followed by the size of the
2296 data in use in that stack, in bytes. This used to be a
2297 conditional around just the two extra args, but that might
2298 be undefined if yyoverflow is a macro. */
2299 yyoverflow (YY_("memory exhausted"),
2300 &yyss1
, yysize
* sizeof (*yyssp
),
2301 &yyvs1
, yysize
* sizeof (*yyvsp
),
2308 #else /* no yyoverflow */
2309 # ifndef YYSTACK_RELOCATE
2310 goto yyexhaustedlab
;
2312 /* Extend the stack our own way. */
2313 if (YYMAXDEPTH
<= yystacksize
)
2314 goto yyexhaustedlab
;
2316 if (YYMAXDEPTH
< yystacksize
)
2317 yystacksize
= YYMAXDEPTH
;
2320 short int *yyss1
= yyss
;
2321 union yyalloc
*yyptr
=
2322 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
2324 goto yyexhaustedlab
;
2325 YYSTACK_RELOCATE (yyss
);
2326 YYSTACK_RELOCATE (yyvs
);
2328 # undef YYSTACK_RELOCATE
2330 YYSTACK_FREE (yyss1
);
2333 #endif /* no yyoverflow */
2335 yyssp
= yyss
+ yysize
- 1;
2336 yyvsp
= yyvs
+ yysize
- 1;
2339 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
2340 (unsigned long int) yystacksize
));
2342 if (yyss
+ yystacksize
- 1 <= yyssp
)
2346 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
2355 /* Do appropriate processing given the current state. */
2356 /* Read a look-ahead token if we need one and don't already have one. */
2359 /* First try to decide what to do without reference to look-ahead token. */
2361 yyn
= yypact
[yystate
];
2362 if (yyn
== YYPACT_NINF
)
2365 /* Not known => get a look-ahead token if don't already have one. */
2367 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
2368 if (yychar
== YYEMPTY
)
2370 YYDPRINTF ((stderr
, "Reading a token: "));
2374 if (yychar
<= YYEOF
)
2376 yychar
= yytoken
= YYEOF
;
2377 YYDPRINTF ((stderr
, "Now at end of input.\n"));
2381 yytoken
= YYTRANSLATE (yychar
);
2382 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
2385 /* If the proper action on seeing token YYTOKEN is to reduce or to
2386 detect an error, take that action. */
2388 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
2393 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
2402 /* Shift the look-ahead token. */
2403 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
2405 /* Discard the token being shifted unless it is eof. */
2406 if (yychar
!= YYEOF
)
2412 /* Count tokens shifted since error; after three, turn off error
2421 /*-----------------------------------------------------------.
2422 | yydefault -- do the default action for the current state. |
2423 `-----------------------------------------------------------*/
2425 yyn
= yydefact
[yystate
];
2431 /*-----------------------------.
2432 | yyreduce -- Do a reduction. |
2433 `-----------------------------*/
2435 /* yyn is the number of a rule to reduce with. */
2438 /* If YYLEN is nonzero, implement the default value of the action:
2441 Otherwise, the following line sets YYVAL to garbage.
2442 This behavior is undocumented and Bison
2443 users should not rely upon it. Assigning to YYVAL
2444 unconditionally makes the parser a bit smaller, and it avoids a
2445 GCC warning that YYVAL may be used uninitialized. */
2446 yyval
= yyvsp
[1-yylen
];
2449 YY_REDUCE_PRINT (yyn
);
2453 #line 349 "parser.y"
2455 check_all_user_types((yyvsp
[0].stmt_list
));
2456 write_proxies((yyvsp
[0].stmt_list
));
2457 write_client((yyvsp
[0].stmt_list
));
2458 write_server((yyvsp
[0].stmt_list
));
2459 write_dlldata((yyvsp
[0].stmt_list
));
2464 #line 358 "parser.y"
2465 { (yyval
.stmt_list
) = NULL
; ;}
2469 #line 359 "parser.y"
2470 { (yyval
.stmt_list
) = (yyvsp
[-1].stmt_list
); ;}
2474 #line 360 "parser.y"
2475 { (yyval
.stmt_list
) = append_statement((yyvsp
[-1].stmt_list
), make_statement_type_decl((yyvsp
[0].type
))); ;}
2479 #line 361 "parser.y"
2480 { (yyval
.stmt_list
) = (yyvsp
[-2].stmt_list
);
2481 reg_type((yyvsp
[-1].type
), (yyvsp
[-1].type
)->name
, 0);
2482 if (!parse_only
&& do_header
) write_coclass_forward((yyvsp
[-1].type
));
2487 #line 365 "parser.y"
2488 { (yyval
.stmt_list
) = append_statement((yyvsp
[-1].stmt_list
), make_statement_type_decl((yyvsp
[0].type
)));
2489 add_typelib_entry((yyvsp
[0].type
));
2490 reg_type((yyvsp
[0].type
), (yyvsp
[0].type
)->name
, 0);
2491 if (!parse_only
&& do_header
) write_coclass_forward((yyvsp
[0].type
));
2496 #line 370 "parser.y"
2497 { (yyval
.stmt_list
) = append_statement((yyvsp
[-1].stmt_list
), make_statement_module((yyvsp
[0].type
)));
2498 add_typelib_entry((yyvsp
[0].type
));
2503 #line 373 "parser.y"
2504 { (yyval
.stmt_list
) = append_statement((yyvsp
[-1].stmt_list
), make_statement_library((yyvsp
[0].typelib
))); ;}
2508 #line 374 "parser.y"
2509 { (yyval
.stmt_list
) = append_statement((yyvsp
[-1].stmt_list
), (yyvsp
[0].statement
)); ;}
2513 #line 377 "parser.y"
2514 { (yyval
.stmt_list
) = NULL
; ;}
2518 #line 378 "parser.y"
2519 { (yyval
.stmt_list
) = append_statement((yyvsp
[-1].stmt_list
), make_statement_reference((yyvsp
[0].type
))); if (!parse_only
) add_typelib_entry((yyvsp
[0].type
)); ;}
2523 #line 379 "parser.y"
2524 { (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
)); ;}
2528 #line 380 "parser.y"
2529 { (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
)); ;}
2533 #line 381 "parser.y"
2534 { (yyval
.stmt_list
) = append_statement((yyvsp
[-1].stmt_list
), make_statement_type_decl((yyvsp
[0].type
)));
2535 if (!parse_only
) add_typelib_entry((yyvsp
[0].type
));
2536 reg_type((yyvsp
[0].type
), (yyvsp
[0].type
)->name
, 0);
2537 if (!parse_only
&& do_header
) write_coclass_forward((yyvsp
[0].type
));
2542 #line 386 "parser.y"
2543 { (yyval
.stmt_list
) = append_statement((yyvsp
[-1].stmt_list
), make_statement_module((yyvsp
[0].type
))); if (!parse_only
) add_typelib_entry((yyvsp
[0].type
)); ;}
2547 #line 387 "parser.y"
2548 { (yyval
.stmt_list
) = append_statement((yyvsp
[-1].stmt_list
), (yyvsp
[0].statement
)); ;}
2552 #line 388 "parser.y"
2553 { (yyval
.stmt_list
) = append_statement((yyvsp
[-1].stmt_list
), make_statement_importlib((yyvsp
[0].str
))); ;}
2557 #line 389 "parser.y"
2558 { (yyval
.stmt_list
) = append_statement((yyvsp
[-1].stmt_list
), make_statement_library((yyvsp
[0].typelib
))); ;}
2562 #line 392 "parser.y"
2563 { (yyval
.func_list
) = NULL
; ;}
2567 #line 393 "parser.y"
2568 { (yyval
.func_list
) = append_func_from_statement( (yyvsp
[-1].func_list
), (yyvsp
[0].statement
) ); ;}
2572 #line 401 "parser.y"
2573 { (yyval
.statement
) = make_statement_cppquote((yyvsp
[0].str
)); ;}
2577 #line 402 "parser.y"
2578 { (yyval
.statement
) = make_statement_type_decl((yyvsp
[-1].type
));
2579 if (!parse_only
&& do_header
) {
2580 write_type_def_or_decl(header
, (yyvsp
[-1].type
), FALSE
, NULL
);
2581 fprintf(header
, ";\n\n");
2587 #line 408 "parser.y"
2588 { (yyval
.statement
) = make_statement_declaration((yyvsp
[-1].var
));
2589 if (!parse_only
&& do_header
) write_declaration((yyvsp
[-1].var
), is_in_interface
);
2594 #line 411 "parser.y"
2595 { (yyval
.statement
) = make_statement_import((yyvsp
[0].str
)); ;}
2599 #line 412 "parser.y"
2600 { (yyval
.statement
) = make_statement_type_decl((yyvsp
[-1].type
));
2601 if (!parse_only
&& do_header
) {
2602 write_type_def_or_decl(header
, (yyvsp
[-1].type
), FALSE
, NULL
);
2603 fprintf(header
, ";\n\n");
2609 #line 418 "parser.y"
2610 { (yyval
.statement
) = (yyvsp
[-1].statement
); ;}
2614 #line 419 "parser.y"
2615 { (yyval
.statement
) = make_statement_type_decl((yyvsp
[-1].type
));
2616 if (!parse_only
&& do_header
) {
2617 write_type_def_or_decl(header
, (yyvsp
[-1].type
), FALSE
, NULL
);
2618 fprintf(header
, ";\n\n");
2624 #line 427 "parser.y"
2625 { (yyval
.str
) = (yyvsp
[-1].str
); if (!parse_only
&& do_header
) fprintf(header
, "%s\n", (yyvsp
[-1].str
)); ;}
2629 #line 429 "parser.y"
2630 { assert(yychar
== YYEMPTY
);
2631 (yyval
.import
) = xmalloc(sizeof(struct _import_t
));
2632 (yyval
.import
)->name
= (yyvsp
[-1].str
);
2633 (yyval
.import
)->import_performed
= do_import((yyvsp
[-1].str
));
2634 if (!(yyval
.import
)->import_performed
) yychar
= aEOF
;
2639 #line 437 "parser.y"
2640 { (yyval
.str
) = (yyvsp
[-2].import
)->name
;
2641 if ((yyvsp
[-2].import
)->import_performed
) pop_import();
2642 free((yyvsp
[-2].import
));
2643 if (!parse_only
&& do_header
) write_import((yyval
.str
));
2648 #line 445 "parser.y"
2649 { (yyval
.str
) = (yyvsp
[-2].str
); if(!parse_only
) add_importlib((yyvsp
[-2].str
)); ;}
2653 #line 448 "parser.y"
2654 { (yyval
.str
) = (yyvsp
[0].str
); ;}
2658 #line 450 "parser.y"
2659 { (yyval
.typelib
) = make_library((yyvsp
[-1].str
), check_library_attrs((yyvsp
[-1].str
), (yyvsp
[-2].attr_list
)));
2660 if (!parse_only
) start_typelib((yyval
.typelib
));
2661 if (!parse_only
&& do_header
) write_library((yyval
.typelib
));
2662 if (!parse_only
&& do_idfile
) write_libid((yyval
.typelib
));
2663 is_inside_library
= TRUE
;
2668 #line 458 "parser.y"
2669 { (yyval
.typelib
) = (yyvsp
[-3].typelib
);
2670 (yyval
.typelib
)->stmts
= (yyvsp
[-2].stmt_list
);
2671 if (!parse_only
) end_typelib();
2672 is_inside_library
= FALSE
;
2677 #line 465 "parser.y"
2678 { (yyval
.var_list
) = NULL
; ;}
2682 #line 469 "parser.y"
2683 { (yyval
.var_list
) = NULL
; ;}
2687 #line 472 "parser.y"
2688 { check_arg((yyvsp
[0].var
)); (yyval
.var_list
) = append_var( NULL
, (yyvsp
[0].var
) ); ;}
2692 #line 473 "parser.y"
2693 { check_arg((yyvsp
[0].var
)); (yyval
.var_list
) = append_var( (yyvsp
[-2].var_list
), (yyvsp
[0].var
)); ;}
2697 #line 478 "parser.y"
2698 { (yyval
.var
) = (yyvsp
[0].declarator
)->var
;
2699 (yyval
.var
)->attrs
= (yyvsp
[-2].attr_list
);
2700 if ((yyvsp
[-1].declspec
)->stgclass
!= STG_NONE
&& (yyvsp
[-1].declspec
)->stgclass
!= STG_REGISTER
)
2701 error_loc("invalid storage class for function parameter\n");
2702 set_type((yyval
.var
), (yyvsp
[-1].declspec
), (yyvsp
[0].declarator
), TRUE
);
2703 free((yyvsp
[0].declarator
));
2708 #line 485 "parser.y"
2709 { (yyval
.var
) = (yyvsp
[0].declarator
)->var
;
2710 if ((yyvsp
[-1].declspec
)->stgclass
!= STG_NONE
&& (yyvsp
[-1].declspec
)->stgclass
!= STG_REGISTER
)
2711 error_loc("invalid storage class for function parameter\n");
2712 set_type((yyval
.var
), (yyvsp
[-1].declspec
), (yyvsp
[0].declarator
), TRUE
);
2713 free((yyvsp
[0].declarator
));
2718 #line 493 "parser.y"
2719 { (yyval
.expr
) = (yyvsp
[-1].expr
); ;}
2723 #line 494 "parser.y"
2724 { (yyval
.expr
) = make_expr(EXPR_VOID
); ;}
2728 #line 497 "parser.y"
2729 { (yyval
.attr_list
) = NULL
; ;}
2733 #line 502 "parser.y"
2734 { (yyval
.attr_list
) = (yyvsp
[-1].attr_list
);
2735 if (!(yyval
.attr_list
))
2736 error_loc("empty attribute lists unsupported\n");
2741 #line 508 "parser.y"
2742 { (yyval
.attr_list
) = append_attr( NULL
, (yyvsp
[0].attr
) ); ;}
2746 #line 509 "parser.y"
2747 { (yyval
.attr_list
) = append_attr( (yyvsp
[-2].attr_list
), (yyvsp
[0].attr
) ); ;}
2751 #line 510 "parser.y"
2752 { (yyval
.attr_list
) = append_attr( (yyvsp
[-3].attr_list
), (yyvsp
[0].attr
) ); ;}
2756 #line 513 "parser.y"
2757 { (yyval
.str_list
) = append_str( NULL
, (yyvsp
[0].str
) ); ;}
2761 #line 514 "parser.y"
2762 { (yyval
.str_list
) = append_str( (yyvsp
[-2].str_list
), (yyvsp
[0].str
) ); ;}
2766 #line 517 "parser.y"
2767 { (yyval
.attr
) = NULL
; ;}
2771 #line 518 "parser.y"
2772 { (yyval
.attr
) = make_attr(ATTR_AGGREGATABLE
); ;}
2776 #line 519 "parser.y"
2777 { (yyval
.attr
) = make_attr(ATTR_APPOBJECT
); ;}
2781 #line 520 "parser.y"
2782 { (yyval
.attr
) = make_attr(ATTR_ASYNC
); ;}
2786 #line 521 "parser.y"
2787 { (yyval
.attr
) = make_attr(ATTR_AUTO_HANDLE
); ;}
2791 #line 522 "parser.y"
2792 { (yyval
.attr
) = make_attr(ATTR_BINDABLE
); ;}
2796 #line 523 "parser.y"
2797 { (yyval
.attr
) = make_attr(ATTR_BROADCAST
); ;}
2801 #line 524 "parser.y"
2802 { (yyval
.attr
) = make_attrp(ATTR_CALLAS
, (yyvsp
[-1].var
)); ;}
2806 #line 525 "parser.y"
2807 { (yyval
.attr
) = make_attrp(ATTR_CASE
, (yyvsp
[-1].expr_list
)); ;}
2811 #line 526 "parser.y"
2812 { (yyval
.attr
) = make_attrv(ATTR_CONTEXTHANDLE
, 0); ;}
2816 #line 527 "parser.y"
2817 { (yyval
.attr
) = make_attrv(ATTR_CONTEXTHANDLE
, 0); /* RPC_CONTEXT_HANDLE_DONT_SERIALIZE */ ;}
2821 #line 528 "parser.y"
2822 { (yyval
.attr
) = make_attrv(ATTR_CONTEXTHANDLE
, 0); /* RPC_CONTEXT_HANDLE_SERIALIZE */ ;}
2826 #line 529 "parser.y"
2827 { (yyval
.attr
) = make_attr(ATTR_CONTROL
); ;}
2831 #line 530 "parser.y"
2832 { (yyval
.attr
) = make_attr(ATTR_DEFAULT
); ;}
2836 #line 531 "parser.y"
2837 { (yyval
.attr
) = make_attr(ATTR_DEFAULTCOLLELEM
); ;}
2841 #line 532 "parser.y"
2842 { (yyval
.attr
) = make_attrp(ATTR_DEFAULTVALUE
, (yyvsp
[-1].expr
)); ;}
2846 #line 533 "parser.y"
2847 { (yyval
.attr
) = make_attr(ATTR_DEFAULTVTABLE
); ;}
2851 #line 534 "parser.y"
2852 { (yyval
.attr
) = make_attr(ATTR_DISPLAYBIND
); ;}
2856 #line 535 "parser.y"
2857 { (yyval
.attr
) = make_attrp(ATTR_DLLNAME
, (yyvsp
[-1].str
)); ;}
2861 #line 536 "parser.y"
2862 { (yyval
.attr
) = make_attr(ATTR_DUAL
); ;}
2866 #line 537 "parser.y"
2867 { (yyval
.attr
) = make_attrp(ATTR_ENDPOINT
, (yyvsp
[-1].str_list
)); ;}
2871 #line 538 "parser.y"
2872 { (yyval
.attr
) = make_attrp(ATTR_ENTRY
, (yyvsp
[-1].expr
)); ;}
2876 #line 539 "parser.y"
2877 { (yyval
.attr
) = make_attr(ATTR_EXPLICIT_HANDLE
); ;}
2881 #line 540 "parser.y"
2882 { (yyval
.attr
) = make_attr(ATTR_HANDLE
); ;}
2886 #line 541 "parser.y"
2887 { (yyval
.attr
) = make_attrp(ATTR_HELPCONTEXT
, (yyvsp
[-1].expr
)); ;}
2891 #line 542 "parser.y"
2892 { (yyval
.attr
) = make_attrp(ATTR_HELPFILE
, (yyvsp
[-1].str
)); ;}
2896 #line 543 "parser.y"
2897 { (yyval
.attr
) = make_attrp(ATTR_HELPSTRING
, (yyvsp
[-1].str
)); ;}
2901 #line 544 "parser.y"
2902 { (yyval
.attr
) = make_attrp(ATTR_HELPSTRINGCONTEXT
, (yyvsp
[-1].expr
)); ;}
2906 #line 545 "parser.y"
2907 { (yyval
.attr
) = make_attrp(ATTR_HELPSTRINGDLL
, (yyvsp
[-1].str
)); ;}
2911 #line 546 "parser.y"
2912 { (yyval
.attr
) = make_attr(ATTR_HIDDEN
); ;}
2916 #line 547 "parser.y"
2917 { (yyval
.attr
) = make_attrp(ATTR_ID
, (yyvsp
[-1].expr
)); ;}
2921 #line 548 "parser.y"
2922 { (yyval
.attr
) = make_attr(ATTR_IDEMPOTENT
); ;}
2926 #line 549 "parser.y"
2927 { (yyval
.attr
) = make_attrp(ATTR_IIDIS
, (yyvsp
[-1].expr
)); ;}
2931 #line 550 "parser.y"
2932 { (yyval
.attr
) = make_attr(ATTR_IMMEDIATEBIND
); ;}
2936 #line 551 "parser.y"
2937 { (yyval
.attr
) = make_attrp(ATTR_IMPLICIT_HANDLE
, (yyvsp
[-1].str
)); ;}
2941 #line 552 "parser.y"
2942 { (yyval
.attr
) = make_attr(ATTR_IN
); ;}
2946 #line 553 "parser.y"
2947 { (yyval
.attr
) = make_attr(ATTR_INPUTSYNC
); ;}
2951 #line 554 "parser.y"
2952 { (yyval
.attr
) = make_attrp(ATTR_LENGTHIS
, (yyvsp
[-1].expr_list
)); ;}
2956 #line 555 "parser.y"
2957 { (yyval
.attr
) = make_attrp(ATTR_LIBLCID
, (yyvsp
[-1].expr
)); ;}
2961 #line 556 "parser.y"
2962 { (yyval
.attr
) = make_attr(ATTR_LOCAL
); ;}
2966 #line 557 "parser.y"
2967 { (yyval
.attr
) = make_attr(ATTR_NONBROWSABLE
); ;}
2971 #line 558 "parser.y"
2972 { (yyval
.attr
) = make_attr(ATTR_NONCREATABLE
); ;}
2976 #line 559 "parser.y"
2977 { (yyval
.attr
) = make_attr(ATTR_NONEXTENSIBLE
); ;}
2981 #line 560 "parser.y"
2982 { (yyval
.attr
) = make_attr(ATTR_OBJECT
); ;}
2986 #line 561 "parser.y"
2987 { (yyval
.attr
) = make_attr(ATTR_ODL
); ;}
2991 #line 562 "parser.y"
2992 { (yyval
.attr
) = make_attr(ATTR_OLEAUTOMATION
); ;}
2996 #line 563 "parser.y"
2997 { (yyval
.attr
) = make_attr(ATTR_OPTIONAL
); ;}
3001 #line 564 "parser.y"
3002 { (yyval
.attr
) = make_attr(ATTR_OUT
); ;}
3006 #line 565 "parser.y"
3007 { (yyval
.attr
) = make_attrv(ATTR_POINTERDEFAULT
, (yyvsp
[-1].num
)); ;}
3011 #line 566 "parser.y"
3012 { (yyval
.attr
) = make_attr(ATTR_PROPGET
); ;}
3016 #line 567 "parser.y"
3017 { (yyval
.attr
) = make_attr(ATTR_PROPPUT
); ;}
3021 #line 568 "parser.y"
3022 { (yyval
.attr
) = make_attr(ATTR_PROPPUTREF
); ;}
3026 #line 569 "parser.y"
3027 { (yyval
.attr
) = make_attr(ATTR_PUBLIC
); ;}
3031 #line 571 "parser.y"
3032 { expr_list_t
*list
= append_expr( NULL
, (yyvsp
[-3].expr
) );
3033 list
= append_expr( list
, (yyvsp
[-1].expr
) );
3034 (yyval
.attr
) = make_attrp(ATTR_RANGE
, list
); ;}
3038 #line 574 "parser.y"
3039 { (yyval
.attr
) = make_attr(ATTR_READONLY
); ;}
3043 #line 575 "parser.y"
3044 { (yyval
.attr
) = make_attr(ATTR_REQUESTEDIT
); ;}
3048 #line 576 "parser.y"
3049 { (yyval
.attr
) = make_attr(ATTR_RESTRICTED
); ;}
3053 #line 577 "parser.y"
3054 { (yyval
.attr
) = make_attr(ATTR_RETVAL
); ;}
3058 #line 578 "parser.y"
3059 { (yyval
.attr
) = make_attrp(ATTR_SIZEIS
, (yyvsp
[-1].expr_list
)); ;}
3063 #line 579 "parser.y"
3064 { (yyval
.attr
) = make_attr(ATTR_SOURCE
); ;}
3068 #line 580 "parser.y"
3069 { (yyval
.attr
) = make_attr(ATTR_STRICTCONTEXTHANDLE
); ;}
3073 #line 581 "parser.y"
3074 { (yyval
.attr
) = make_attr(ATTR_STRING
); ;}
3078 #line 582 "parser.y"
3079 { (yyval
.attr
) = make_attrp(ATTR_SWITCHIS
, (yyvsp
[-1].expr
)); ;}
3083 #line 583 "parser.y"
3084 { (yyval
.attr
) = make_attrp(ATTR_SWITCHTYPE
, (yyvsp
[-1].type
)); ;}
3088 #line 584 "parser.y"
3089 { (yyval
.attr
) = make_attrp(ATTR_TRANSMITAS
, (yyvsp
[-1].type
)); ;}
3093 #line 585 "parser.y"
3094 { (yyval
.attr
) = make_attrp(ATTR_UUID
, (yyvsp
[-1].uuid
)); ;}
3098 #line 586 "parser.y"
3099 { (yyval
.attr
) = make_attr(ATTR_V1ENUM
); ;}
3103 #line 587 "parser.y"
3104 { (yyval
.attr
) = make_attr(ATTR_VARARG
); ;}
3108 #line 588 "parser.y"
3109 { (yyval
.attr
) = make_attrv(ATTR_VERSION
, (yyvsp
[-1].num
)); ;}
3113 #line 589 "parser.y"
3114 { (yyval
.attr
) = make_attrp(ATTR_WIREMARSHAL
, (yyvsp
[-1].type
)); ;}
3118 #line 590 "parser.y"
3119 { (yyval
.attr
) = make_attrv(ATTR_POINTERTYPE
, (yyvsp
[0].num
)); ;}
3123 #line 595 "parser.y"
3124 { if (!is_valid_uuid((yyvsp
[0].str
)))
3125 error_loc("invalid UUID: %s\n", (yyvsp
[0].str
));
3126 (yyval
.uuid
) = parse_uuid((yyvsp
[0].str
)); ;}
3130 #line 600 "parser.y"
3131 { (yyval
.str
) = (yyvsp
[0].str
); ;}
3135 #line 601 "parser.y"
3136 { (yyval
.str
) = (yyvsp
[0].str
); ;}
3140 #line 602 "parser.y"
3141 { (yyval
.str
) = (yyvsp
[0].str
); ;}
3145 #line 603 "parser.y"
3146 { (yyval
.str
) = (yyvsp
[0].str
); ;}
3150 #line 606 "parser.y"
3151 { (yyval
.var_list
) = NULL
; ;}
3155 #line 607 "parser.y"
3156 { (yyval
.var_list
) = append_var( (yyvsp
[-1].var_list
), (yyvsp
[0].var
) ); ;}
3160 #line 610 "parser.y"
3161 { attr_t
*a
= make_attrp(ATTR_CASE
, append_expr( NULL
, (yyvsp
[-2].expr
) ));
3162 (yyval
.var
) = (yyvsp
[0].var
); if (!(yyval
.var
)) (yyval
.var
) = make_var(NULL
);
3163 (yyval
.var
)->attrs
= append_attr( (yyval
.var
)->attrs
, a
);
3168 #line 614 "parser.y"
3169 { attr_t
*a
= make_attr(ATTR_DEFAULT
);
3170 (yyval
.var
) = (yyvsp
[0].var
); if (!(yyval
.var
)) (yyval
.var
) = make_var(NULL
);
3171 (yyval
.var
)->attrs
= append_attr( (yyval
.var
)->attrs
, a
);
3176 #line 620 "parser.y"
3177 { (yyval
.var_list
) = NULL
; ;}
3181 #line 621 "parser.y"
3182 { (yyval
.var_list
) = (yyvsp
[-1].var_list
); ;}
3186 #line 625 "parser.y"
3187 { if (!(yyvsp
[0].var
)->eval
)
3188 (yyvsp
[0].var
)->eval
= make_exprl(EXPR_NUM
, 0 /* default for first enum entry */);
3189 (yyval
.var_list
) = append_var( NULL
, (yyvsp
[0].var
) );
3194 #line 629 "parser.y"
3195 { if (!(yyvsp
[0].var
)->eval
)
3197 var_t
*last
= LIST_ENTRY( list_tail((yyval
.var_list
)), var_t
, entry
);
3198 (yyvsp
[0].var
)->eval
= make_exprl(EXPR_NUM
, last
->eval
->cval
+ 1);
3200 (yyval
.var_list
) = append_var( (yyvsp
[-2].var_list
), (yyvsp
[0].var
) );
3205 #line 638 "parser.y"
3206 { (yyval
.var
) = reg_const((yyvsp
[-2].var
));
3207 (yyval
.var
)->eval
= (yyvsp
[0].expr
);
3208 (yyval
.var
)->type
= make_int(0);
3213 #line 642 "parser.y"
3214 { (yyval
.var
) = reg_const((yyvsp
[0].var
));
3215 (yyval
.var
)->type
= make_int(0);
3220 #line 647 "parser.y"
3221 { (yyval
.type
) = get_typev(RPC_FC_ENUM16
, (yyvsp
[-3].var
), tsENUM
);
3222 (yyval
.type
)->kind
= TKIND_ENUM
;
3223 (yyval
.type
)->fields_or_args
= (yyvsp
[-1].var_list
);
3224 (yyval
.type
)->defined
= TRUE
;
3226 add_typelib_entry((yyval
.type
));
3231 #line 656 "parser.y"
3232 { (yyval
.expr_list
) = append_expr( NULL
, (yyvsp
[0].expr
) ); ;}
3236 #line 657 "parser.y"
3237 { (yyval
.expr_list
) = append_expr( (yyvsp
[-2].expr_list
), (yyvsp
[0].expr
) ); ;}
3241 #line 670 "parser.y"
3242 { (yyval
.expr
) = make_expr(EXPR_VOID
); ;}
3246 #line 674 "parser.y"
3247 { (yyval
.expr
) = make_exprl(EXPR_NUM
, (yyvsp
[0].num
)); ;}
3251 #line 675 "parser.y"
3252 { (yyval
.expr
) = make_exprl(EXPR_HEXNUM
, (yyvsp
[0].num
)); ;}
3256 #line 676 "parser.y"
3257 { (yyval
.expr
) = make_exprd(EXPR_DOUBLE
, (yyvsp
[0].dbl
)); ;}
3261 #line 677 "parser.y"
3262 { (yyval
.expr
) = make_exprl(EXPR_TRUEFALSE
, 0); ;}
3266 #line 678 "parser.y"
3267 { (yyval
.expr
) = make_exprl(EXPR_NUM
, 0); ;}
3271 #line 679 "parser.y"
3272 { (yyval
.expr
) = make_exprl(EXPR_TRUEFALSE
, 1); ;}
3276 #line 680 "parser.y"
3277 { (yyval
.expr
) = make_exprs(EXPR_STRLIT
, (yyvsp
[0].str
)); ;}
3281 #line 681 "parser.y"
3282 { (yyval
.expr
) = make_exprs(EXPR_WSTRLIT
, (yyvsp
[0].str
)); ;}
3286 #line 682 "parser.y"
3287 { (yyval
.expr
) = make_exprs(EXPR_IDENTIFIER
, (yyvsp
[0].str
)); ;}
3291 #line 683 "parser.y"
3292 { (yyval
.expr
) = make_expr3(EXPR_COND
, (yyvsp
[-4].expr
), (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3296 #line 684 "parser.y"
3297 { (yyval
.expr
) = make_expr2(EXPR_LOGOR
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3301 #line 685 "parser.y"
3302 { (yyval
.expr
) = make_expr2(EXPR_LOGAND
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3306 #line 686 "parser.y"
3307 { (yyval
.expr
) = make_expr2(EXPR_OR
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3311 #line 687 "parser.y"
3312 { (yyval
.expr
) = make_expr2(EXPR_XOR
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3316 #line 688 "parser.y"
3317 { (yyval
.expr
) = make_expr2(EXPR_AND
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3321 #line 689 "parser.y"
3322 { (yyval
.expr
) = make_expr2(EXPR_EQUALITY
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3326 #line 690 "parser.y"
3327 { (yyval
.expr
) = make_expr2(EXPR_INEQUALITY
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3331 #line 691 "parser.y"
3332 { (yyval
.expr
) = make_expr2(EXPR_GTR
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3336 #line 692 "parser.y"
3337 { (yyval
.expr
) = make_expr2(EXPR_LESS
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3341 #line 693 "parser.y"
3342 { (yyval
.expr
) = make_expr2(EXPR_GTREQL
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3346 #line 694 "parser.y"
3347 { (yyval
.expr
) = make_expr2(EXPR_LESSEQL
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3351 #line 695 "parser.y"
3352 { (yyval
.expr
) = make_expr2(EXPR_SHL
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3356 #line 696 "parser.y"
3357 { (yyval
.expr
) = make_expr2(EXPR_SHR
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3361 #line 697 "parser.y"
3362 { (yyval
.expr
) = make_expr2(EXPR_ADD
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3366 #line 698 "parser.y"
3367 { (yyval
.expr
) = make_expr2(EXPR_SUB
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3371 #line 699 "parser.y"
3372 { (yyval
.expr
) = make_expr2(EXPR_MOD
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3376 #line 700 "parser.y"
3377 { (yyval
.expr
) = make_expr2(EXPR_MUL
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3381 #line 701 "parser.y"
3382 { (yyval
.expr
) = make_expr2(EXPR_DIV
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); ;}
3386 #line 702 "parser.y"
3387 { (yyval
.expr
) = make_expr1(EXPR_LOGNOT
, (yyvsp
[0].expr
)); ;}
3391 #line 703 "parser.y"
3392 { (yyval
.expr
) = make_expr1(EXPR_NOT
, (yyvsp
[0].expr
)); ;}
3396 #line 704 "parser.y"
3397 { (yyval
.expr
) = make_expr1(EXPR_POS
, (yyvsp
[0].expr
)); ;}
3401 #line 705 "parser.y"
3402 { (yyval
.expr
) = make_expr1(EXPR_NEG
, (yyvsp
[0].expr
)); ;}
3406 #line 706 "parser.y"
3407 { (yyval
.expr
) = make_expr1(EXPR_ADDRESSOF
, (yyvsp
[0].expr
)); ;}
3411 #line 707 "parser.y"
3412 { (yyval
.expr
) = make_expr1(EXPR_PPTR
, (yyvsp
[0].expr
)); ;}
3416 #line 708 "parser.y"
3417 { (yyval
.expr
) = make_expr2(EXPR_MEMBER
, make_expr1(EXPR_PPTR
, (yyvsp
[-2].expr
)), make_exprs(EXPR_IDENTIFIER
, (yyvsp
[0].str
))); ;}
3421 #line 709 "parser.y"
3422 { (yyval
.expr
) = make_expr2(EXPR_MEMBER
, (yyvsp
[-2].expr
), make_exprs(EXPR_IDENTIFIER
, (yyvsp
[0].str
))); ;}
3426 #line 710 "parser.y"
3427 { (yyval
.expr
) = make_exprt(EXPR_CAST
, (yyvsp
[-2].type
), (yyvsp
[0].expr
)); ;}
3431 #line 711 "parser.y"
3432 { (yyval
.expr
) = make_exprt(EXPR_SIZEOF
, (yyvsp
[-1].type
), NULL
); ;}
3436 #line 712 "parser.y"
3437 { (yyval
.expr
) = make_expr2(EXPR_ARRAY
, (yyvsp
[-3].expr
), (yyvsp
[-1].expr
)); ;}
3441 #line 713 "parser.y"
3442 { (yyval
.expr
) = (yyvsp
[-1].expr
); ;}
3446 #line 716 "parser.y"
3447 { (yyval
.expr_list
) = append_expr( NULL
, (yyvsp
[0].expr
) ); ;}
3451 #line 717 "parser.y"
3452 { (yyval
.expr_list
) = append_expr( (yyvsp
[-2].expr_list
), (yyvsp
[0].expr
) ); ;}
3456 #line 720 "parser.y"
3457 { (yyval
.expr
) = (yyvsp
[0].expr
);
3458 if (!(yyval
.expr
)->is_const
)
3459 error_loc("expression is not an integer constant\n");
3464 #line 726 "parser.y"
3465 { (yyval
.expr
) = (yyvsp
[0].expr
);
3466 if (!(yyval
.expr
)->is_const
&& (yyval
.expr
)->type
!= EXPR_STRLIT
&& (yyval
.expr
)->type
!= EXPR_WSTRLIT
)
3467 error_loc("expression is not constant\n");
3472 #line 732 "parser.y"
3473 { (yyval
.var_list
) = NULL
; ;}
3477 #line 733 "parser.y"
3478 { (yyval
.var_list
) = append_var_list((yyvsp
[-1].var_list
), (yyvsp
[0].var_list
)); ;}
3482 #line 737 "parser.y"
3483 { const char *first
= LIST_ENTRY(list_head((yyvsp
[-1].declarator_list
)), declarator_t
, entry
)->var
->name
;
3484 check_field_attrs(first
, (yyvsp
[-3].attr_list
));
3485 (yyval
.var_list
) = set_var_types((yyvsp
[-3].attr_list
), (yyvsp
[-2].declspec
), (yyvsp
[-1].declarator_list
));
3490 #line 741 "parser.y"
3491 { var_t
*v
= make_var(NULL
);
3492 v
->type
= (yyvsp
[-1].type
); v
->attrs
= (yyvsp
[-2].attr_list
);
3493 (yyval
.var_list
) = append_var(NULL
, v
);
3498 #line 748 "parser.y"
3499 { (yyval
.var
) = (yyvsp
[-1].var
); ;}
3503 #line 749 "parser.y"
3504 { (yyval
.var
) = make_var(NULL
); (yyval
.var
)->attrs
= (yyvsp
[-1].attr_list
); ;}
3508 #line 752 "parser.y"
3509 { (yyval
.var_list
) = NULL
; ;}
3513 #line 753 "parser.y"
3514 { (yyval
.var_list
) = append_var( (yyvsp
[-1].var_list
), (yyvsp
[0].var
) ); ;}
3518 #line 757 "parser.y"
3519 { (yyval
.var
) = (yyvsp
[-1].var
); ;}
3523 #line 758 "parser.y"
3524 { (yyval
.var
) = NULL
; ;}
3528 #line 761 "parser.y"
3529 { (yyval
.var
) = (yyvsp
[0].declarator
)->var
;
3530 (yyval
.var
)->attrs
= check_field_attrs((yyval
.var
)->name
, (yyvsp
[-2].attr_list
));
3531 set_type((yyval
.var
), (yyvsp
[-1].declspec
), (yyvsp
[0].declarator
), FALSE
);
3532 free((yyvsp
[0].declarator
));
3537 #line 769 "parser.y"
3538 { var_t
*v
= (yyvsp
[0].declarator
)->var
;
3539 v
->attrs
= check_function_attrs(v
->name
, (yyvsp
[-2].attr_list
));
3540 set_type(v
, (yyvsp
[-1].declspec
), (yyvsp
[0].declarator
), FALSE
);
3541 free((yyvsp
[0].declarator
));
3542 (yyval
.func
) = make_func(v
);
3547 #line 779 "parser.y"
3548 { (yyval
.var
) = (yyvsp
[0].declarator
)->var
;
3549 (yyval
.var
)->attrs
= (yyvsp
[-2].attr_list
);
3550 set_type((yyval
.var
), (yyvsp
[-1].declspec
), (yyvsp
[0].declarator
), FALSE
);
3551 free((yyvsp
[0].declarator
));
3556 #line 784 "parser.y"
3557 { (yyval
.var
) = (yyvsp
[0].declarator
)->var
;
3558 set_type((yyval
.var
), (yyvsp
[-1].declspec
), (yyvsp
[0].declarator
), FALSE
);
3559 free((yyvsp
[0].declarator
));
3564 #line 790 "parser.y"
3565 { (yyval
.var
) = NULL
; ;}
3569 #line 794 "parser.y"
3570 { (yyval
.var
) = NULL
; ;}
3574 #line 795 "parser.y"
3575 { (yyval
.var
) = make_var((yyvsp
[0].str
)); ;}
3579 #line 796 "parser.y"
3580 { (yyval
.var
) = make_var((yyvsp
[0].str
)); ;}
3584 #line 799 "parser.y"
3585 { (yyval
.var
) = make_var((yyvsp
[0].str
)); ;}
3589 #line 801 "parser.y"
3590 { (yyval
.var
) = make_var((yyvsp
[0].str
)); ;}
3594 #line 804 "parser.y"
3595 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3599 #line 805 "parser.y"
3600 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3604 #line 807 "parser.y"
3605 { (yyval
.type
) = (yyvsp
[0].type
); (yyval
.type
)->sign
= 1; ;}
3609 #line 808 "parser.y"
3610 { (yyval
.type
) = (yyvsp
[0].type
); (yyval
.type
)->sign
= -1;
3611 switch ((yyval
.type
)->type
) {
3612 case RPC_FC_CHAR
: break;
3613 case RPC_FC_SMALL
: (yyval
.type
)->type
= RPC_FC_USMALL
; break;
3614 case RPC_FC_SHORT
: (yyval
.type
)->type
= RPC_FC_USHORT
; break;
3615 case RPC_FC_LONG
: (yyval
.type
)->type
= RPC_FC_ULONG
; break;
3617 if ((yyval
.type
)->name
[0] == 'h') /* hyper, as opposed to __int64 */
3619 (yyval
.type
) = alias((yyval
.type
), "MIDL_uhyper");
3620 (yyval
.type
)->sign
= 0;
3629 #line 824 "parser.y"
3630 { (yyval
.type
) = make_int(-1); ;}
3634 #line 825 "parser.y"
3635 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3639 #line 826 "parser.y"
3640 { (yyval
.type
) = duptype(find_type("float", 0), 1); ;}
3644 #line 827 "parser.y"
3645 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3649 #line 828 "parser.y"
3650 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3654 #line 829 "parser.y"
3655 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3659 #line 830 "parser.y"
3660 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3664 #line 837 "parser.y"
3665 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3669 #line 838 "parser.y"
3670 { (yyval
.type
) = make_builtin((yyvsp
[-1].str
)); ;}
3674 #line 839 "parser.y"
3675 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3679 #line 840 "parser.y"
3680 { (yyval
.type
) = make_builtin((yyvsp
[-1].str
)); ;}
3684 #line 841 "parser.y"
3685 { (yyval
.type
) = make_builtin((yyvsp
[-1].str
)); ;}
3689 #line 842 "parser.y"
3690 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3694 #line 843 "parser.y"
3695 { (yyval
.type
) = make_builtin((yyvsp
[0].str
)); ;}
3699 #line 846 "parser.y"
3700 { (yyval
.type
) = make_class((yyvsp
[0].str
)); ;}
3704 #line 847 "parser.y"
3705 { (yyval
.type
) = find_type((yyvsp
[0].str
), 0);
3706 if ((yyval
.type
)->defined
) error_loc("multiple definition error\n");
3707 if ((yyval
.type
)->kind
!= TKIND_COCLASS
) error_loc("%s was not declared a coclass\n", (yyvsp
[0].str
));
3712 #line 853 "parser.y"
3713 { (yyval
.type
) = (yyvsp
[0].type
);
3714 (yyval
.type
)->attrs
= check_coclass_attrs((yyvsp
[0].type
)->name
, (yyvsp
[-1].attr_list
));
3715 if (!parse_only
&& do_header
)
3716 write_coclass((yyval
.type
));
3717 if (!parse_only
&& do_idfile
)
3718 write_clsid((yyval
.type
));
3723 #line 863 "parser.y"
3724 { (yyval
.type
) = (yyvsp
[-4].type
);
3725 (yyval
.type
)->ifaces
= (yyvsp
[-2].ifref_list
);
3726 (yyval
.type
)->defined
= TRUE
;
3731 #line 869 "parser.y"
3732 { (yyval
.ifref_list
) = NULL
; ;}
3736 #line 870 "parser.y"
3737 { (yyval
.ifref_list
) = append_ifref( (yyvsp
[-1].ifref_list
), (yyvsp
[0].ifref
) ); ;}
3741 #line 874 "parser.y"
3742 { (yyval
.ifref
) = make_ifref((yyvsp
[0].type
)); (yyval
.ifref
)->attrs
= (yyvsp
[-1].attr_list
); ;}
3746 #line 877 "parser.y"
3747 { (yyval
.type
) = get_type(0, (yyvsp
[0].str
), 0); (yyval
.type
)->kind
= TKIND_DISPATCH
; ;}
3751 #line 878 "parser.y"
3752 { (yyval
.type
) = get_type(0, (yyvsp
[0].str
), 0); (yyval
.type
)->kind
= TKIND_DISPATCH
; ;}
3756 #line 881 "parser.y"
3758 is_in_interface
= TRUE
;
3759 is_object_interface
= TRUE
;
3760 (yyval
.type
) = (yyvsp
[0].type
);
3761 if ((yyval
.type
)->defined
) error_loc("multiple definition error\n");
3762 attrs
= make_attr(ATTR_DISPINTERFACE
);
3763 (yyval
.type
)->attrs
= append_attr( check_dispiface_attrs((yyvsp
[0].type
)->name
, (yyvsp
[-1].attr_list
)), attrs
);
3764 (yyval
.type
)->ref
= find_type("IDispatch", 0);
3765 if (!(yyval
.type
)->ref
) error_loc("IDispatch is undefined\n");
3766 (yyval
.type
)->defined
= TRUE
;
3767 if (!parse_only
&& do_header
) write_forward((yyval
.type
));
3772 #line 895 "parser.y"
3773 { (yyval
.var_list
) = NULL
; ;}
3777 #line 896 "parser.y"
3778 { (yyval
.var_list
) = append_var( (yyvsp
[-2].var_list
), (yyvsp
[-1].var
) ); ;}
3782 #line 899 "parser.y"
3783 { (yyval
.func_list
) = NULL
; ;}
3787 #line 900 "parser.y"
3788 { (yyval
.func_list
) = append_func( (yyvsp
[-2].func_list
), (yyvsp
[-1].func
) ); ;}
3792 #line 906 "parser.y"
3793 { (yyval
.type
) = (yyvsp
[-4].type
);
3794 (yyval
.type
)->fields_or_args
= (yyvsp
[-2].var_list
);
3795 (yyval
.type
)->funcs
= (yyvsp
[-1].func_list
);
3796 if (!parse_only
&& do_header
) write_interface((yyval
.type
));
3797 if (!parse_only
&& do_idfile
) write_diid((yyval
.type
));
3798 is_in_interface
= FALSE
;
3803 #line 914 "parser.y"
3804 { (yyval
.type
) = (yyvsp
[-4].type
);
3805 (yyval
.type
)->fields_or_args
= (yyvsp
[-2].type
)->fields_or_args
;
3806 (yyval
.type
)->funcs
= (yyvsp
[-2].type
)->funcs
;
3807 if (!parse_only
&& do_header
) write_interface((yyval
.type
));
3808 if (!parse_only
&& do_idfile
) write_diid((yyval
.type
));
3809 is_in_interface
= FALSE
;
3814 #line 923 "parser.y"
3815 { (yyval
.type
) = NULL
; ;}
3819 #line 924 "parser.y"
3820 { (yyval
.type
) = find_type2((yyvsp
[0].str
), 0); ;}
3824 #line 927 "parser.y"
3825 { (yyval
.type
) = get_type(RPC_FC_IP
, (yyvsp
[0].str
), 0); (yyval
.type
)->kind
= TKIND_INTERFACE
; ;}
3829 #line 928 "parser.y"
3830 { (yyval
.type
) = get_type(RPC_FC_IP
, (yyvsp
[0].str
), 0); (yyval
.type
)->kind
= TKIND_INTERFACE
; ;}
3834 #line 931 "parser.y"
3835 { (yyval
.ifinfo
).interface
= (yyvsp
[0].type
);
3836 (yyval
.ifinfo
).old_pointer_default
= pointer_default
;
3837 if (is_attr((yyvsp
[-1].attr_list
), ATTR_POINTERDEFAULT
))
3838 pointer_default
= get_attrv((yyvsp
[-1].attr_list
), ATTR_POINTERDEFAULT
);
3839 is_object_interface
= is_object((yyvsp
[-1].attr_list
));
3840 is_in_interface
= TRUE
;
3841 if ((yyvsp
[0].type
)->defined
) error_loc("multiple definition error\n");
3842 (yyvsp
[0].type
)->attrs
= check_iface_attrs((yyvsp
[0].type
)->name
, (yyvsp
[-1].attr_list
));
3843 (yyvsp
[0].type
)->defined
= TRUE
;
3844 if (!parse_only
&& do_header
) write_forward((yyvsp
[0].type
));
3849 #line 945 "parser.y"
3850 { (yyval
.type
) = (yyvsp
[-5].ifinfo
).interface
;
3851 (yyval
.type
)->ref
= (yyvsp
[-4].type
);
3852 (yyval
.type
)->funcs
= (yyvsp
[-2].func_list
);
3853 check_functions((yyval
.type
));
3854 compute_method_indexes((yyval
.type
));
3855 if (!parse_only
&& do_header
) write_interface((yyval
.type
));
3856 if (!parse_only
&& local_stubs
) write_locals(local_stubs
, (yyval
.type
), TRUE
);
3857 if (!parse_only
&& do_idfile
) write_iid((yyval
.type
));
3858 pointer_default
= (yyvsp
[-5].ifinfo
).old_pointer_default
;
3859 is_in_interface
= FALSE
;
3864 #line 960 "parser.y"
3865 { (yyval
.type
) = (yyvsp
[-7].ifinfo
).interface
;
3866 (yyval
.type
)->ref
= find_type2((yyvsp
[-5].str
), 0);
3867 if (!(yyval
.type
)->ref
) error_loc("base class '%s' not found in import\n", (yyvsp
[-5].str
));
3868 (yyval
.type
)->funcs
= (yyvsp
[-2].func_list
);
3869 compute_method_indexes((yyval
.type
));
3870 if (!parse_only
&& do_header
) write_interface((yyval
.type
));
3871 if (!parse_only
&& local_stubs
) write_locals(local_stubs
, (yyval
.type
), TRUE
);
3872 if (!parse_only
&& do_idfile
) write_iid((yyval
.type
));
3873 pointer_default
= (yyvsp
[-7].ifinfo
).old_pointer_default
;
3874 is_in_interface
= FALSE
;
3879 #line 971 "parser.y"
3880 { (yyval
.type
) = (yyvsp
[-1].type
); ;}
3884 #line 975 "parser.y"
3885 { (yyval
.type
) = (yyvsp
[-1].type
); if (!parse_only
&& do_header
) write_forward((yyval
.type
)); ;}
3889 #line 976 "parser.y"
3890 { (yyval
.type
) = (yyvsp
[-1].type
); if (!parse_only
&& do_header
) write_forward((yyval
.type
)); ;}
3894 #line 979 "parser.y"
3895 { (yyval
.type
) = make_type(0, NULL
); (yyval
.type
)->name
= (yyvsp
[0].str
); (yyval
.type
)->kind
= TKIND_MODULE
; ;}
3899 #line 980 "parser.y"
3900 { (yyval
.type
) = make_type(0, NULL
); (yyval
.type
)->name
= (yyvsp
[0].str
); (yyval
.type
)->kind
= TKIND_MODULE
; ;}
3904 #line 983 "parser.y"
3905 { (yyval
.type
) = (yyvsp
[0].type
);
3906 (yyval
.type
)->attrs
= check_module_attrs((yyvsp
[0].type
)->name
, (yyvsp
[-1].attr_list
));
3911 #line 989 "parser.y"
3912 { (yyval
.type
) = (yyvsp
[-4].type
);
3913 (yyval
.type
)->funcs
= (yyvsp
[-2].func_list
);
3914 /* FIXME: if (!parse_only && do_header) write_module($$); */
3919 #line 996 "parser.y"
3920 { (yyval
.stgclass
) = STG_EXTERN
; ;}
3924 #line 997 "parser.y"
3925 { (yyval
.stgclass
) = STG_STATIC
; ;}
3929 #line 998 "parser.y"
3930 { (yyval
.stgclass
) = STG_REGISTER
; ;}
3934 #line 1002 "parser.y"
3935 { (yyval
.attr
) = make_attr(ATTR_INLINE
); ;}
3939 #line 1006 "parser.y"
3940 { (yyval
.attr
) = make_attr(ATTR_CONST
); ;}
3944 #line 1009 "parser.y"
3945 { (yyval
.attr_list
) = NULL
; ;}
3949 #line 1010 "parser.y"
3950 { (yyval
.attr_list
) = append_attr((yyvsp
[-1].attr_list
), (yyvsp
[0].attr
)); ;}
3954 #line 1013 "parser.y"
3955 { (yyval
.declspec
) = make_decl_spec((yyvsp
[-1].type
), (yyvsp
[0].declspec
), NULL
, NULL
, STG_NONE
); ;}
3959 #line 1015 "parser.y"
3960 { (yyval
.declspec
) = make_decl_spec((yyvsp
[-1].type
), (yyvsp
[-2].declspec
), (yyvsp
[0].declspec
), NULL
, STG_NONE
); ;}
3964 #line 1018 "parser.y"
3965 { (yyval
.declspec
) = NULL
; ;}
3969 #line 1023 "parser.y"
3970 { (yyval
.declspec
) = make_decl_spec(NULL
, (yyvsp
[0].declspec
), NULL
, (yyvsp
[-1].attr
), STG_NONE
); ;}
3974 #line 1024 "parser.y"
3975 { (yyval
.declspec
) = make_decl_spec(NULL
, (yyvsp
[0].declspec
), NULL
, (yyvsp
[-1].attr
), STG_NONE
); ;}
3979 #line 1025 "parser.y"
3980 { (yyval
.declspec
) = make_decl_spec(NULL
, (yyvsp
[0].declspec
), NULL
, NULL
, (yyvsp
[-1].stgclass
)); ;}
3984 #line 1030 "parser.y"
3985 { (yyval
.declarator
) = (yyvsp
[0].declarator
); (yyval
.declarator
)->type
= append_ptrchain_type((yyval
.declarator
)->type
, make_pointer_type(NULL
, (yyvsp
[-1].attr_list
))); ;}
3989 #line 1031 "parser.y"
3990 { (yyval
.declarator
) = (yyvsp
[0].declarator
); (yyval
.declarator
)->type
->attrs
= append_attr((yyval
.declarator
)->type
->attrs
, make_attrp(ATTR_CALLCONV
, (yyvsp
[-1].str
))); ;}
3994 #line 1036 "parser.y"
3995 { (yyval
.declarator
) = make_declarator((yyvsp
[0].var
)); ;}
3999 #line 1037 "parser.y"
4000 { (yyval
.declarator
) = (yyvsp
[-1].declarator
); ;}
4004 #line 1038 "parser.y"
4005 { (yyval
.declarator
) = (yyvsp
[-1].declarator
); (yyval
.declarator
)->array
= append_array((yyval
.declarator
)->array
, (yyvsp
[0].expr
)); ;}
4009 #line 1039 "parser.y"
4010 { (yyval
.declarator
) = (yyvsp
[-3].declarator
);
4011 (yyval
.declarator
)->func_type
= append_ptrchain_type((yyval
.declarator
)->type
, make_func_type((yyvsp
[-1].var_list
)));
4012 (yyval
.declarator
)->type
= NULL
;
4017 #line 1046 "parser.y"
4018 { (yyval
.declarator_list
) = append_declarator( NULL
, (yyvsp
[0].declarator
) ); ;}
4022 #line 1047 "parser.y"
4023 { (yyval
.declarator_list
) = append_declarator( (yyvsp
[-2].declarator_list
), (yyvsp
[0].declarator
) ); ;}
4027 #line 1051 "parser.y"
4028 { (yyval
.declarator
) = (yyvsp
[0].declarator
); ;}
4032 #line 1052 "parser.y"
4033 { (yyval
.declarator
) = (yyvsp
[-2].declarator
); (yyvsp
[-2].declarator
)->var
->eval
= (yyvsp
[0].expr
); ;}
4037 #line 1056 "parser.y"
4038 { (yyval
.num
) = RPC_FC_RP
; ;}
4042 #line 1057 "parser.y"
4043 { (yyval
.num
) = RPC_FC_UP
; ;}
4047 #line 1058 "parser.y"
4048 { (yyval
.num
) = RPC_FC_FP
; ;}
4052 #line 1061 "parser.y"
4053 { (yyval
.type
) = get_typev(RPC_FC_STRUCT
, (yyvsp
[-3].var
), tsSTRUCT
);
4054 /* overwrite RPC_FC_STRUCT with a more exact type */
4055 (yyval
.type
)->type
= get_struct_type( (yyvsp
[-1].var_list
) );
4056 (yyval
.type
)->kind
= TKIND_RECORD
;
4057 (yyval
.type
)->fields_or_args
= (yyvsp
[-1].var_list
);
4058 (yyval
.type
)->defined
= TRUE
;
4060 add_typelib_entry((yyval
.type
));
4065 #line 1072 "parser.y"
4066 { (yyval
.type
) = duptype(find_type("void", 0), 1); ;}
4070 #line 1073 "parser.y"
4071 { (yyval
.type
) = find_type((yyvsp
[0].str
), 0); ;}
4075 #line 1074 "parser.y"
4076 { (yyval
.type
) = (yyvsp
[0].type
); ;}
4080 #line 1075 "parser.y"
4081 { (yyval
.type
) = (yyvsp
[0].type
); ;}
4085 #line 1076 "parser.y"
4086 { (yyval
.type
) = find_type2((yyvsp
[0].str
), tsENUM
); ;}
4090 #line 1077 "parser.y"
4091 { (yyval
.type
) = (yyvsp
[0].type
); ;}
4095 #line 1078 "parser.y"
4096 { (yyval
.type
) = get_type(RPC_FC_STRUCT
, (yyvsp
[0].str
), tsSTRUCT
); ;}
4100 #line 1079 "parser.y"
4101 { (yyval
.type
) = (yyvsp
[0].type
); ;}
4105 #line 1080 "parser.y"
4106 { (yyval
.type
) = find_type2((yyvsp
[0].str
), tsUNION
); ;}
4110 #line 1081 "parser.y"
4111 { (yyval
.type
) = make_safearray((yyvsp
[-1].type
)); ;}
4115 #line 1085 "parser.y"
4116 { reg_typedefs((yyvsp
[-1].declspec
), (yyvsp
[0].declarator_list
), check_typedef_attrs((yyvsp
[-2].attr_list
)));
4117 (yyval
.statement
) = process_typedefs((yyvsp
[0].declarator_list
));
4122 #line 1091 "parser.y"
4123 { (yyval
.type
) = get_typev(RPC_FC_NON_ENCAPSULATED_UNION
, (yyvsp
[-3].var
), tsUNION
);
4124 (yyval
.type
)->kind
= TKIND_UNION
;
4125 (yyval
.type
)->fields_or_args
= (yyvsp
[-1].var_list
);
4126 (yyval
.type
)->defined
= TRUE
;
4131 #line 1098 "parser.y"
4132 { var_t
*u
= (yyvsp
[-3].var
);
4133 (yyval
.type
) = get_typev(RPC_FC_ENCAPSULATED_UNION
, (yyvsp
[-8].var
), tsUNION
);
4134 (yyval
.type
)->kind
= TKIND_UNION
;
4135 if (!u
) u
= make_var( xstrdup("tagged_union") );
4136 u
->type
= make_type(RPC_FC_NON_ENCAPSULATED_UNION
, NULL
);
4137 u
->type
->kind
= TKIND_UNION
;
4138 u
->type
->fields_or_args
= (yyvsp
[-1].var_list
);
4139 u
->type
->defined
= TRUE
;
4140 (yyval
.type
)->fields_or_args
= append_var( (yyval
.type
)->fields_or_args
, (yyvsp
[-5].var
) );
4141 (yyval
.type
)->fields_or_args
= append_var( (yyval
.type
)->fields_or_args
, u
);
4142 (yyval
.type
)->defined
= TRUE
;
4147 #line 1113 "parser.y"
4148 { (yyval
.num
) = MAKEVERSION((yyvsp
[0].num
), 0); ;}
4152 #line 1114 "parser.y"
4153 { (yyval
.num
) = MAKEVERSION((yyvsp
[-2].num
), (yyvsp
[0].num
)); ;}
4160 /* Line 1126 of yacc.c. */
4161 #line 4162 "parser.tab.c"
4167 YY_STACK_PRINT (yyss
, yyssp
);
4172 /* Now `shift' the result of the reduction. Determine what state
4173 that goes to, based on the state we popped back to and the rule
4174 number reduced by. */
4178 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
4179 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
4180 yystate
= yytable
[yystate
];
4182 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
4187 /*------------------------------------.
4188 | yyerrlab -- here on detecting error |
4189 `------------------------------------*/
4191 /* If not already recovering from an error, report this error. */
4196 yyn
= yypact
[yystate
];
4198 if (YYPACT_NINF
< yyn
&& yyn
< YYLAST
)
4200 int yytype
= YYTRANSLATE (yychar
);
4201 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytype
]);
4202 YYSIZE_T yysize
= yysize0
;
4204 int yysize_overflow
= 0;
4206 # define YYERROR_VERBOSE_ARGS_MAXIMUM 5
4207 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
4211 /* This is so xgettext sees the translatable formats that are
4212 constructed on the fly. */
4213 YY_("syntax error, unexpected %s");
4214 YY_("syntax error, unexpected %s, expecting %s");
4215 YY_("syntax error, unexpected %s, expecting %s or %s");
4216 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
4217 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
4221 static char const yyunexpected
[] = "syntax error, unexpected %s";
4222 static char const yyexpecting
[] = ", expecting %s";
4223 static char const yyor
[] = " or %s";
4224 char yyformat
[sizeof yyunexpected
4225 + sizeof yyexpecting
- 1
4226 + ((YYERROR_VERBOSE_ARGS_MAXIMUM
- 2)
4227 * (sizeof yyor
- 1))];
4228 char const *yyprefix
= yyexpecting
;
4230 /* Start YYX at -YYN if negative to avoid negative indexes in
4232 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
4234 /* Stay within bounds of both yycheck and yytname. */
4235 int yychecklim
= YYLAST
- yyn
;
4236 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
4239 yyarg
[0] = yytname
[yytype
];
4240 yyfmt
= yystpcpy (yyformat
, yyunexpected
);
4242 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
4243 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
4245 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
4249 yyformat
[sizeof yyunexpected
- 1] = '\0';
4252 yyarg
[yycount
++] = yytname
[yyx
];
4253 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
4254 yysize_overflow
|= yysize1
< yysize
;
4256 yyfmt
= yystpcpy (yyfmt
, yyprefix
);
4260 yyf
= YY_(yyformat
);
4261 yysize1
= yysize
+ yystrlen (yyf
);
4262 yysize_overflow
|= yysize1
< yysize
;
4265 if (!yysize_overflow
&& yysize
<= YYSTACK_ALLOC_MAXIMUM
)
4266 yymsg
= (char *) YYSTACK_ALLOC (yysize
);
4269 /* Avoid sprintf, as that infringes on the user's name space.
4270 Don't have undefined behavior even if the translation
4271 produced a string with the wrong number of "%s"s. */
4274 while ((*yyp
= *yyf
))
4276 if (*yyp
== '%' && yyf
[1] == 's' && yyi
< yycount
)
4278 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
4288 YYSTACK_FREE (yymsg
);
4292 yyerror (YY_("syntax error"));
4293 goto yyexhaustedlab
;
4297 #endif /* YYERROR_VERBOSE */
4298 yyerror (YY_("syntax error"));
4303 if (yyerrstatus
== 3)
4305 /* If just tried and failed to reuse look-ahead token after an
4306 error, discard it. */
4308 if (yychar
<= YYEOF
)
4310 /* Return failure if at end of input. */
4311 if (yychar
== YYEOF
)
4316 yydestruct ("Error: discarding", yytoken
, &yylval
);
4321 /* Else will try to reuse look-ahead token after shifting the error
4326 /*---------------------------------------------------.
4327 | yyerrorlab -- error raised explicitly by YYERROR. |
4328 `---------------------------------------------------*/
4331 /* Pacify compilers like GCC when the user code never invokes
4332 YYERROR and the label yyerrorlab therefore never appears in user
4343 /*-------------------------------------------------------------.
4344 | yyerrlab1 -- common code for both syntax error and YYERROR. |
4345 `-------------------------------------------------------------*/
4347 yyerrstatus
= 3; /* Each real token shifted decrements this. */
4351 yyn
= yypact
[yystate
];
4352 if (yyn
!= YYPACT_NINF
)
4355 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
4363 /* Pop the current state because it cannot handle the error token. */
4368 yydestruct ("Error: popping", yystos
[yystate
], yyvsp
);
4371 YY_STACK_PRINT (yyss
, yyssp
);
4380 /* Shift the error token. */
4381 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
4387 /*-------------------------------------.
4388 | yyacceptlab -- YYACCEPT comes here. |
4389 `-------------------------------------*/
4394 /*-----------------------------------.
4395 | yyabortlab -- YYABORT comes here. |
4396 `-----------------------------------*/
4402 /*-------------------------------------------------.
4403 | yyexhaustedlab -- memory exhaustion comes here. |
4404 `-------------------------------------------------*/
4406 yyerror (YY_("memory exhausted"));
4412 if (yychar
!= YYEOF
&& yychar
!= YYEMPTY
)
4413 yydestruct ("Cleanup: discarding lookahead",
4415 while (yyssp
!= yyss
)
4417 yydestruct ("Cleanup: popping",
4418 yystos
[*yyssp
], yyvsp
);
4423 YYSTACK_FREE (yyss
);
4429 #line 1117 "parser.y"
4432 static void decl_builtin(const char *name
, unsigned char type
)
4434 type_t
*t
= make_type(type
, NULL
);
4435 t
->name
= xstrdup(name
);
4436 reg_type(t
, name
, 0);
4439 static type_t
*make_builtin(char *name
)
4441 /* NAME is strdup'd in the lexer */
4442 type_t
*t
= duptype(find_type(name
, 0), 0);
4447 static type_t
*make_int(int sign
)
4449 type_t
*t
= duptype(find_type("int", 0), 1);
4453 t
->type
= t
->type
== RPC_FC_LONG
? RPC_FC_ULONG
: RPC_FC_USHORT
;
4458 void init_types(void)
4460 decl_builtin("void", 0);
4461 decl_builtin("byte", RPC_FC_BYTE
);
4462 decl_builtin("wchar_t", RPC_FC_WCHAR
);
4463 decl_builtin("int", RPC_FC_LONG
); /* win32 */
4464 decl_builtin("short", RPC_FC_SHORT
);
4465 decl_builtin("small", RPC_FC_SMALL
);
4466 decl_builtin("long", RPC_FC_LONG
);
4467 decl_builtin("hyper", RPC_FC_HYPER
);
4468 decl_builtin("__int64", RPC_FC_HYPER
);
4469 decl_builtin("char", RPC_FC_CHAR
);
4470 decl_builtin("float", RPC_FC_FLOAT
);
4471 decl_builtin("double", RPC_FC_DOUBLE
);
4472 decl_builtin("boolean", RPC_FC_BYTE
);
4473 decl_builtin("error_status_t", RPC_FC_ERROR_STATUS_T
);
4474 decl_builtin("handle_t", RPC_FC_BIND_PRIMITIVE
);
4477 static str_list_t
*append_str(str_list_t
*list
, char *str
)
4479 struct str_list_entry_t
*entry
;
4481 if (!str
) return list
;
4484 list
= xmalloc( sizeof(*list
) );
4487 entry
= xmalloc( sizeof(*entry
) );
4489 list_add_tail( list
, &entry
->entry
);
4493 static attr_list_t
*append_attr(attr_list_t
*list
, attr_t
*attr
)
4495 attr_t
*attr_existing
;
4496 if (!attr
) return list
;
4499 list
= xmalloc( sizeof(*list
) );
4502 LIST_FOR_EACH_ENTRY(attr_existing
, list
, attr_t
, entry
)
4503 if (attr_existing
->type
== attr
->type
)
4505 parser_warning("duplicate attribute %s\n", get_attr_display_name(attr
->type
));
4506 /* use the last attribute, like MIDL does */
4507 list_remove(&attr_existing
->entry
);
4510 list_add_tail( list
, &attr
->entry
);
4514 static attr_list_t
*move_attr(attr_list_t
*dst
, attr_list_t
*src
, enum attr_type type
)
4517 if (!src
) return dst
;
4518 LIST_FOR_EACH_ENTRY(attr
, src
, attr_t
, entry
)
4519 if (attr
->type
== type
)
4521 list_remove(&attr
->entry
);
4522 return append_attr(dst
, attr
);
4527 static attr_list_t
*append_attr_list(attr_list_t
*new_list
, attr_list_t
*old_list
)
4531 if (!old_list
) return new_list
;
4533 while ((entry
= list_head(old_list
)))
4535 attr_t
*attr
= LIST_ENTRY(entry
, attr_t
, entry
);
4537 new_list
= append_attr(new_list
, attr
);
4542 static attr_list_t
*dupattrs(const attr_list_t
*list
)
4544 attr_list_t
*new_list
;
4547 if (!list
) return NULL
;
4549 new_list
= xmalloc( sizeof(*list
) );
4550 list_init( new_list
);
4551 LIST_FOR_EACH_ENTRY(attr
, list
, const attr_t
, entry
)
4553 attr_t
*new_attr
= xmalloc(sizeof(*new_attr
));
4555 list_add_tail(new_list
, &new_attr
->entry
);
4560 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
)
4562 decl_spec_t
*declspec
= left
? left
: right
;
4565 declspec
= xmalloc(sizeof(*declspec
));
4566 declspec
->type
= NULL
;
4567 declspec
->attrs
= NULL
;
4568 declspec
->stgclass
= STG_NONE
;
4570 declspec
->type
= type
;
4571 if (left
&& declspec
!= left
)
4573 declspec
->attrs
= append_attr_list(declspec
->attrs
, left
->attrs
);
4574 if (declspec
->stgclass
== STG_NONE
)
4575 declspec
->stgclass
= left
->stgclass
;
4576 else if (left
->stgclass
!= STG_NONE
)
4577 error_loc("only one storage class can be specified\n");
4578 assert(!left
->type
);
4581 if (right
&& declspec
!= right
)
4583 declspec
->attrs
= append_attr_list(declspec
->attrs
, right
->attrs
);
4584 if (declspec
->stgclass
== STG_NONE
)
4585 declspec
->stgclass
= right
->stgclass
;
4586 else if (right
->stgclass
!= STG_NONE
)
4587 error_loc("only one storage class can be specified\n");
4588 assert(!right
->type
);
4592 declspec
->attrs
= append_attr(declspec
->attrs
, attr
);
4593 if (declspec
->stgclass
== STG_NONE
)
4594 declspec
->stgclass
= stgclass
;
4595 else if (stgclass
!= STG_NONE
)
4596 error_loc("only one storage class can be specified\n");
4598 /* apply attributes to type */
4599 if (type
&& declspec
->attrs
)
4602 declspec
->type
= duptype(type
, 1);
4603 attrs
= dupattrs(type
->attrs
);
4604 declspec
->type
->attrs
= append_attr_list(attrs
, declspec
->attrs
);
4605 declspec
->attrs
= NULL
;
4611 static attr_t
*make_attr(enum attr_type type
)
4613 attr_t
*a
= xmalloc(sizeof(attr_t
));
4619 static attr_t
*make_attrv(enum attr_type type
, unsigned long val
)
4621 attr_t
*a
= xmalloc(sizeof(attr_t
));
4627 static attr_t
*make_attrp(enum attr_type type
, void *val
)
4629 attr_t
*a
= xmalloc(sizeof(attr_t
));
4635 static expr_list_t
*append_expr(expr_list_t
*list
, expr_t
*expr
)
4637 if (!expr
) return list
;
4640 list
= xmalloc( sizeof(*list
) );
4643 list_add_tail( list
, &expr
->entry
);
4647 static array_dims_t
*append_array(array_dims_t
*list
, expr_t
*expr
)
4649 if (!expr
) return list
;
4652 list
= xmalloc( sizeof(*list
) );
4655 list_add_tail( list
, &expr
->entry
);
4659 static struct list type_pool
= LIST_INIT(type_pool
);
4666 type_t
*alloc_type(void)
4668 type_pool_node_t
*node
= xmalloc(sizeof *node
);
4669 list_add_tail(&type_pool
, &node
->link
);
4673 void set_all_tfswrite(int val
)
4675 type_pool_node_t
*node
;
4676 LIST_FOR_EACH_ENTRY(node
, &type_pool
, type_pool_node_t
, link
)
4677 node
->data
.tfswrite
= val
;
4680 type_t
*make_type(unsigned char type
, type_t
*ref
)
4682 type_t
*t
= alloc_type();
4684 t
->kind
= TKIND_PRIMITIVE
;
4690 t
->fields_or_args
= NULL
;
4694 t
->length_is
= NULL
;
4695 t
->typestring_offset
= 0;
4697 t
->declarray
= FALSE
;
4698 t
->ignore
= (parse_only
!= 0);
4702 t
->user_types_registered
= FALSE
;
4703 t
->tfswrite
= FALSE
;
4705 t
->typelib_idx
= -1;
4709 static type_t
*make_func_type(var_list_t
*args
)
4711 type_t
*t
= make_type(RPC_FC_FUNCTION
, NULL
);
4712 t
->fields_or_args
= args
;
4716 static type_t
*make_pointer_type(type_t
*ref
, attr_list_t
*attrs
)
4718 type_t
*t
= make_type(pointer_default
, ref
);
4723 static type_t
*append_ptrchain_type(type_t
*ptrchain
, type_t
*type
)
4725 type_t
*ptrchain_type
;
4728 for (ptrchain_type
= ptrchain
; ptrchain_type
->ref
; ptrchain_type
= ptrchain_type
->ref
)
4730 ptrchain_type
->ref
= type
;
4734 static void set_type(var_t
*v
, decl_spec_t
*decl_spec
, const declarator_t
*decl
,
4737 expr_list_t
*sizes
= get_attrp(v
->attrs
, ATTR_SIZEIS
);
4738 expr_list_t
*lengs
= get_attrp(v
->attrs
, ATTR_LENGTHIS
);
4739 int ptr_attr
= get_attrv(v
->attrs
, ATTR_POINTERTYPE
);
4740 int sizeless
, has_varconf
;
4742 type_t
*atype
, **ptype
;
4743 array_dims_t
*arr
= decl
? decl
->array
: NULL
;
4744 type_t
*func_type
= decl
? decl
->func_type
: NULL
;
4745 type_t
*type
= decl_spec
->type
;
4747 if (is_attr(type
->attrs
, ATTR_INLINE
))
4750 error_loc("inline attribute applied to non-function type\n");
4754 /* move inline attribute from return type node to function node */
4755 for (t
= func_type
; is_ptr(t
); t
= t
->ref
)
4757 t
->attrs
= move_attr(t
->attrs
, type
->attrs
, ATTR_INLINE
);
4761 /* add type onto the end of the pointers in pident->type */
4762 v
->type
= append_ptrchain_type(decl
? decl
->type
: NULL
, type
);
4763 v
->stgclass
= decl_spec
->stgclass
;
4765 /* the highest level of pointer specified should default to the var's ptr attr
4766 * or (RPC_FC_RP if not specified and it's a top level ptr), not
4767 * pointer_default so we need to fix that up here */
4770 const type_t
*ptr
= NULL
;
4771 /* pointer attributes on the left side of the type belong to the function
4772 * pointer, if one is being declared */
4773 type_t
**pt
= func_type
? &func_type
: &v
->type
;
4774 for (ptr
= *pt
; ptr
; )
4776 if (ptr
->kind
== TKIND_ALIAS
)
4781 if (ptr
&& is_ptr(ptr
) && (ptr_attr
|| top
))
4783 /* duplicate type to avoid changing original type */
4784 *pt
= duptype(*pt
, 1);
4785 (*pt
)->type
= ptr_attr
? ptr_attr
: RPC_FC_RP
;
4788 error_loc("%s: pointer attribute applied to non-pointer type\n", v
->name
);
4791 if (is_attr(v
->attrs
, ATTR_STRING
) && !is_ptr(v
->type
) && !arr
)
4792 error_loc("'%s': [string] attribute applied to non-pointer, non-array type\n",
4796 if (arr
) LIST_FOR_EACH_ENTRY_REV(dim
, arr
, expr_t
, entry
)
4799 error_loc("%s: only the first array dimension can be unspecified\n", v
->name
);
4803 unsigned int align
= 0;
4804 size_t size
= type_memsize(v
->type
, &align
);
4807 error_loc("%s: array dimension must be positive\n", v
->name
);
4809 if (0xffffffffuL
/ size
< (unsigned long) dim
->cval
)
4810 error_loc("%s: total array size is too large\n", v
->name
);
4811 else if (0xffffuL
< size
* dim
->cval
)
4812 v
->type
= make_type(RPC_FC_LGFARRAY
, v
->type
);
4814 v
->type
= make_type(RPC_FC_SMFARRAY
, v
->type
);
4819 v
->type
= make_type(RPC_FC_CARRAY
, v
->type
);
4822 v
->type
->declarray
= TRUE
;
4823 v
->type
->dim
= dim
->cval
;
4827 has_varconf
= FALSE
;
4828 if (sizes
) LIST_FOR_EACH_ENTRY(dim
, sizes
, expr_t
, entry
)
4830 if (dim
->type
!= EXPR_VOID
)
4833 atype
= *ptype
= duptype(*ptype
, 0);
4835 if (atype
->type
== RPC_FC_SMFARRAY
|| atype
->type
== RPC_FC_LGFARRAY
)
4836 error_loc("%s: cannot specify size_is for a fixed sized array\n", v
->name
);
4838 if (atype
->type
!= RPC_FC_CARRAY
&& !is_ptr(atype
))
4839 error_loc("%s: size_is attribute applied to illegal type\n", v
->name
);
4841 atype
->type
= RPC_FC_CARRAY
;
4842 atype
->size_is
= dim
;
4845 ptype
= &(*ptype
)->ref
;
4847 error_loc("%s: too many expressions in size_is attribute\n", v
->name
);
4851 if (lengs
) LIST_FOR_EACH_ENTRY(dim
, lengs
, expr_t
, entry
)
4853 if (dim
->type
!= EXPR_VOID
)
4856 atype
= *ptype
= duptype(*ptype
, 0);
4858 if (atype
->type
== RPC_FC_SMFARRAY
)
4859 atype
->type
= RPC_FC_SMVARRAY
;
4860 else if (atype
->type
== RPC_FC_LGFARRAY
)
4861 atype
->type
= RPC_FC_LGVARRAY
;
4862 else if (atype
->type
== RPC_FC_CARRAY
)
4863 atype
->type
= RPC_FC_CVARRAY
;
4865 error_loc("%s: length_is attribute applied to illegal type\n", v
->name
);
4867 atype
->length_is
= dim
;
4870 ptype
= &(*ptype
)->ref
;
4872 error_loc("%s: too many expressions in length_is attribute\n", v
->name
);
4875 if (has_varconf
&& !last_array(v
->type
))
4878 for (ptype
= &v
->type
; is_array(*ptype
); ptype
= &(*ptype
)->ref
)
4880 *ptype
= duptype(*ptype
, 0);
4881 (*ptype
)->type
= RPC_FC_BOGUS_ARRAY
;
4885 if (is_array(v
->type
))
4887 const type_t
*rt
= v
->type
->ref
;
4888 if (is_user_type(rt
))
4889 v
->type
->type
= RPC_FC_BOGUS_ARRAY
;
4893 case RPC_FC_BOGUS_STRUCT
:
4894 case RPC_FC_NON_ENCAPSULATED_UNION
:
4895 case RPC_FC_ENCAPSULATED_UNION
:
4897 v
->type
->type
= RPC_FC_BOGUS_ARRAY
;
4899 /* FC_RP should be above, but widl overuses these, and will break things. */
4902 if (rt
->ref
->type
== RPC_FC_IP
)
4903 v
->type
->type
= RPC_FC_BOGUS_ARRAY
;
4908 /* v->type is currently pointing the the type on the left-side of the
4909 * declaration, so we need to fix this up so that it is the return type of the
4910 * function and make v->type point to the function side of the declaration */
4914 type_t
*return_type
= v
->type
;
4915 v
->type
= func_type
;
4916 for (ft
= v
->type
; is_ptr(ft
); ft
= ft
->ref
)
4918 assert(ft
->type
== RPC_FC_FUNCTION
);
4919 ft
->ref
= return_type
;
4920 /* move calling convention attribute, if present, from pointer nodes to
4922 for (t
= v
->type
; is_ptr(t
); t
= t
->ref
)
4923 ft
->attrs
= move_attr(ft
->attrs
, t
->attrs
, ATTR_CALLCONV
);
4924 if (is_object_interface
&& !is_attr(ft
->attrs
, ATTR_CALLCONV
))
4926 static char *stdmethodcalltype
;
4927 if (!stdmethodcalltype
) stdmethodcalltype
= strdup("STDMETHODCALLTYPE");
4928 ft
->attrs
= append_attr(NULL
, make_attrp(ATTR_CALLCONV
, stdmethodcalltype
));
4934 for (t
= v
->type
; is_ptr(t
); t
= t
->ref
)
4935 if (is_attr(t
->attrs
, ATTR_CALLCONV
))
4936 error_loc("calling convention applied to non-function-pointer type\n");
4940 static var_list_t
*set_var_types(attr_list_t
*attrs
, decl_spec_t
*decl_spec
, declarator_list_t
*decls
)
4942 declarator_t
*decl
, *next
;
4943 var_list_t
*var_list
= NULL
;
4945 LIST_FOR_EACH_ENTRY_SAFE( decl
, next
, decls
, declarator_t
, entry
)
4947 var_t
*var
= decl
->var
;
4950 set_type(var
, decl_spec
, decl
, 0);
4951 var_list
= append_var(var_list
, var
);
4957 static ifref_list_t
*append_ifref(ifref_list_t
*list
, ifref_t
*iface
)
4959 if (!iface
) return list
;
4962 list
= xmalloc( sizeof(*list
) );
4965 list_add_tail( list
, &iface
->entry
);
4969 static ifref_t
*make_ifref(type_t
*iface
)
4971 ifref_t
*l
= xmalloc(sizeof(ifref_t
));
4977 static var_list_t
*append_var(var_list_t
*list
, var_t
*var
)
4979 if (!var
) return list
;
4982 list
= xmalloc( sizeof(*list
) );
4985 list_add_tail( list
, &var
->entry
);
4989 static var_list_t
*append_var_list(var_list_t
*list
, var_list_t
*vars
)
4991 if (!vars
) return list
;
4994 list
= xmalloc( sizeof(*list
) );
4997 list_move_tail( list
, vars
);
5001 static var_t
*make_var(char *name
)
5003 var_t
*v
= xmalloc(sizeof(var_t
));
5008 v
->stgclass
= STG_NONE
;
5009 v
->loc_info
.input_name
= input_name
? input_name
: "stdin";
5010 v
->loc_info
.line_number
= line_number
;
5011 v
->loc_info
.near_text
= parser_text
;
5015 static declarator_list_t
*append_declarator(declarator_list_t
*list
, declarator_t
*d
)
5017 if (!d
) return list
;
5019 list
= xmalloc(sizeof(*list
));
5022 list_add_tail(list
, &d
->entry
);
5026 static declarator_t
*make_declarator(var_t
*var
)
5028 declarator_t
*d
= xmalloc(sizeof(*d
));
5031 d
->func_type
= NULL
;
5036 static func_list_t
*append_func(func_list_t
*list
, func_t
*func
)
5038 if (!func
) return list
;
5041 list
= xmalloc( sizeof(*list
) );
5044 list_add_tail( list
, &func
->entry
);
5048 static func_t
*make_func(var_t
*def
)
5050 func_t
*f
= xmalloc(sizeof(func_t
));
5052 f
->args
= def
->type
->fields_or_args
;
5053 f
->ignore
= parse_only
;
5058 static type_t
*make_class(char *name
)
5060 type_t
*c
= make_type(RPC_FC_COCLASS
, NULL
);
5062 c
->kind
= TKIND_COCLASS
;
5066 static type_t
*make_safearray(type_t
*type
)
5068 type_t
*sa
= duptype(find_type("SAFEARRAY", 0), 1);
5070 return make_type(pointer_default
, sa
);
5073 static typelib_t
*make_library(const char *name
, const attr_list_t
*attrs
)
5075 typelib_t
*typelib
= xmalloc(sizeof(*typelib
));
5076 typelib
->name
= xstrdup(name
);
5077 typelib
->filename
= NULL
;
5078 typelib
->attrs
= attrs
;
5079 list_init( &typelib
->entries
);
5080 list_init( &typelib
->importlibs
);
5086 static int hash_ident(const char *name
)
5088 const char *p
= name
;
5090 /* a simple sum hash is probably good enough */
5095 return sum
& (HASHMAX
-1);
5098 /***** type repository *****/
5107 struct rtype
*type_hash
[HASHMAX
];
5109 static type_t
*reg_type(type_t
*type
, const char *name
, int t
)
5114 error_loc("registering named type without name\n");
5117 hash
= hash_ident(name
);
5118 nt
= xmalloc(sizeof(struct rtype
));
5122 nt
->next
= type_hash
[hash
];
5123 type_hash
[hash
] = nt
;
5127 static int is_incomplete(const type_t
*t
)
5129 return !t
->defined
&& (is_struct(t
->type
) || is_union(t
->type
));
5132 static void add_incomplete(type_t
*t
)
5134 struct typenode
*tn
= xmalloc(sizeof *tn
);
5136 list_add_tail(&incomplete_types
, &tn
->entry
);
5139 static void fix_type(type_t
*t
)
5141 if (t
->kind
== TKIND_ALIAS
&& is_incomplete(t
)) {
5142 type_t
*ot
= t
->orig
;
5144 t
->fields_or_args
= ot
->fields_or_args
;
5145 t
->defined
= ot
->defined
;
5149 static void fix_incomplete(void)
5151 struct typenode
*tn
, *next
;
5153 LIST_FOR_EACH_ENTRY_SAFE(tn
, next
, &incomplete_types
, struct typenode
, entry
) {
5159 static type_t
*reg_typedefs(decl_spec_t
*decl_spec
, declarator_list_t
*decls
, attr_list_t
*attrs
)
5161 const declarator_t
*decl
;
5162 int is_str
= is_attr(attrs
, ATTR_STRING
);
5163 type_t
*type
= decl_spec
->type
;
5167 type_t
*t
= decl_spec
->type
;
5174 if (c
!= RPC_FC_CHAR
&& c
!= RPC_FC_BYTE
&& c
!= RPC_FC_WCHAR
)
5176 decl
= LIST_ENTRY( list_head( decls
), const declarator_t
, entry
);
5177 error_loc("'%s': [string] attribute is only valid on 'char', 'byte', or 'wchar_t' pointers and arrays\n",
5182 /* We must generate names for tagless enum, struct or union.
5183 Typedef-ing a tagless enum, struct or union means we want the typedef
5184 to be included in a library hence the public attribute. */
5185 if ((type
->kind
== TKIND_ENUM
|| type
->kind
== TKIND_RECORD
5186 || type
->kind
== TKIND_UNION
) && ! type
->name
&& ! parse_only
)
5188 if (! is_attr(attrs
, ATTR_PUBLIC
))
5189 attrs
= append_attr( attrs
, make_attr(ATTR_PUBLIC
) );
5190 type
->name
= gen_name();
5192 else if (is_attr(attrs
, ATTR_UUID
) && !is_attr(attrs
, ATTR_PUBLIC
))
5193 attrs
= append_attr( attrs
, make_attr(ATTR_PUBLIC
) );
5195 LIST_FOR_EACH_ENTRY( decl
, decls
, const declarator_t
, entry
)
5197 var_t
*name
= decl
->var
;
5202 /* set the attributes to allow set_type to do some checks on them */
5203 name
->attrs
= attrs
;
5204 set_type(name
, decl_spec
, decl
, 0);
5205 cur
= alias(name
->type
, name
->name
);
5208 if (is_incomplete(cur
))
5209 add_incomplete(cur
);
5210 reg_type(cur
, cur
->name
, 0);
5216 type_t
*find_type(const char *name
, int t
)
5218 struct rtype
*cur
= type_hash
[hash_ident(name
)];
5219 while (cur
&& (cur
->t
!= t
|| strcmp(cur
->name
, name
)))
5222 error_loc("type '%s' not found\n", name
);
5228 static type_t
*find_type2(char *name
, int t
)
5230 type_t
*tp
= find_type(name
, t
);
5235 int is_type(const char *name
)
5237 struct rtype
*cur
= type_hash
[hash_ident(name
)];
5238 while (cur
&& (cur
->t
|| strcmp(cur
->name
, name
)))
5240 if (cur
) return TRUE
;
5244 static type_t
*get_type(unsigned char type
, char *name
, int t
)
5246 struct rtype
*cur
= NULL
;
5249 cur
= type_hash
[hash_ident(name
)];
5250 while (cur
&& (cur
->t
!= t
|| strcmp(cur
->name
, name
)))
5257 tp
= make_type(type
, NULL
);
5259 if (!name
) return tp
;
5260 return reg_type(tp
, name
, t
);
5263 static type_t
*get_typev(unsigned char type
, var_t
*name
, int t
)
5270 return get_type(type
, sname
, t
);
5273 static int get_struct_type(var_list_t
*fields
)
5275 int has_pointer
= 0;
5276 int has_conformance
= 0;
5277 int has_variance
= 0;
5280 if (get_padding(fields
))
5281 return RPC_FC_BOGUS_STRUCT
;
5283 if (fields
) LIST_FOR_EACH_ENTRY( field
, fields
, var_t
, entry
)
5285 type_t
*t
= field
->type
;
5287 if (is_user_type(t
))
5288 return RPC_FC_BOGUS_STRUCT
;
5299 case RPC_FC_ENCAPSULATED_UNION
:
5300 case RPC_FC_NON_ENCAPSULATED_UNION
:
5301 case RPC_FC_BOGUS_STRUCT
:
5302 return RPC_FC_BOGUS_STRUCT
;
5309 if (field
->type
->declarray
)
5311 if (is_string_type(field
->attrs
, field
->type
))
5313 if (is_conformant_array(field
->type
))
5314 has_conformance
= 1;
5319 if (is_array(field
->type
->ref
))
5320 return RPC_FC_BOGUS_STRUCT
;
5322 if (is_conformant_array(field
->type
))
5324 has_conformance
= 1;
5325 if (field
->type
->declarray
&& list_next(fields
, &field
->entry
))
5326 error_loc("field '%s' deriving from a conformant array must be the last field in the structure\n",
5329 if (field
->type
->length_is
)
5332 t
= field
->type
->ref
;
5338 * RPC_FC_BYTE, RPC_FC_STRUCT, etc
5339 * Simple types don't effect the type of struct.
5340 * A struct containing a simple struct is still a simple struct.
5341 * So long as we can block copy the data, we return RPC_FC_STRUCT.
5343 case 0: /* void pointer */
5353 case RPC_FC_INT3264
:
5354 case RPC_FC_UINT3264
:
5367 case RPC_FC_CVARRAY
:
5368 case RPC_FC_BOGUS_ARRAY
:
5373 * Propagate member attributes
5374 * a struct should be at least as complex as its member
5376 case RPC_FC_CVSTRUCT
:
5377 has_conformance
= 1;
5382 case RPC_FC_CPSTRUCT
:
5383 has_conformance
= 1;
5384 if (list_next( fields
, &field
->entry
))
5385 error_loc("field '%s' deriving from a conformant array must be the last field in the structure\n",
5390 case RPC_FC_CSTRUCT
:
5391 has_conformance
= 1;
5392 if (list_next( fields
, &field
->entry
))
5393 error_loc("field '%s' deriving from a conformant array must be the last field in the structure\n",
5397 case RPC_FC_PSTRUCT
:
5402 error_loc("Unknown struct member %s with type (0x%02x)\n", field
->name
, t
->type
);
5403 /* fallthru - treat it as complex */
5405 /* as soon as we see one of these these members, it's bogus... */
5406 case RPC_FC_ENCAPSULATED_UNION
:
5407 case RPC_FC_NON_ENCAPSULATED_UNION
:
5408 case RPC_FC_BOGUS_STRUCT
:
5410 return RPC_FC_BOGUS_STRUCT
;
5416 if ( has_conformance
)
5417 return RPC_FC_CVSTRUCT
;
5419 return RPC_FC_BOGUS_STRUCT
;
5421 if( has_conformance
&& has_pointer
)
5422 return RPC_FC_CPSTRUCT
;
5423 if( has_conformance
)
5424 return RPC_FC_CSTRUCT
;
5426 return RPC_FC_PSTRUCT
;
5427 return RPC_FC_STRUCT
;
5430 /***** constant repository *****/
5435 struct rconst
*next
;
5438 struct rconst
*const_hash
[HASHMAX
];
5440 static var_t
*reg_const(var_t
*var
)
5445 error_loc("registering constant without name\n");
5448 hash
= hash_ident(var
->name
);
5449 nc
= xmalloc(sizeof(struct rconst
));
5450 nc
->name
= var
->name
;
5452 nc
->next
= const_hash
[hash
];
5453 const_hash
[hash
] = nc
;
5457 var_t
*find_const(const char *name
, int f
)
5459 struct rconst
*cur
= const_hash
[hash_ident(name
)];
5460 while (cur
&& strcmp(cur
->name
, name
))
5463 if (f
) error_loc("constant '%s' not found\n", name
);
5469 static void write_libid(const typelib_t
*typelib
)
5471 const UUID
*uuid
= get_attrp(typelib
->attrs
, ATTR_UUID
);
5472 write_guid(idfile
, "LIBID", typelib
->name
, uuid
);
5475 static void write_clsid(type_t
*cls
)
5477 const UUID
*uuid
= get_attrp(cls
->attrs
, ATTR_UUID
);
5478 write_guid(idfile
, "CLSID", cls
->name
, uuid
);
5481 static void write_diid(type_t
*iface
)
5483 const UUID
*uuid
= get_attrp(iface
->attrs
, ATTR_UUID
);
5484 write_guid(idfile
, "DIID", iface
->name
, uuid
);
5487 static void write_iid(type_t
*iface
)
5489 const UUID
*uuid
= get_attrp(iface
->attrs
, ATTR_UUID
);
5490 write_guid(idfile
, "IID", iface
->name
, uuid
);
5493 static int compute_method_indexes(type_t
*iface
)
5499 idx
= compute_method_indexes(iface
->ref
);
5506 LIST_FOR_EACH_ENTRY( f
, iface
->funcs
, func_t
, entry
)
5507 if (! is_callas(f
->def
->attrs
))
5513 static char *gen_name(void)
5515 static const char format
[] = "__WIDL_%s_generated_name_%08lX";
5516 static unsigned long n
= 0;
5517 static const char *file_id
;
5523 char *dst
= dup_basename(input_name
, ".idl");
5527 if (! isalnum((unsigned char) *dst
))
5530 size
= sizeof format
- 7 + strlen(file_id
) + 8;
5533 name
= xmalloc(size
);
5534 sprintf(name
, format
, file_id
, n
++);
5540 unsigned int dce_compatible
: 1;
5541 unsigned int acf
: 1;
5542 unsigned int on_interface
: 1;
5543 unsigned int on_function
: 1;
5544 unsigned int on_arg
: 1;
5545 unsigned int on_type
: 1;
5546 unsigned int on_field
: 1;
5547 unsigned int on_library
: 1;
5548 unsigned int on_dispinterface
: 1;
5549 unsigned int on_module
: 1;
5550 unsigned int on_coclass
: 1;
5551 const char *display_name
;
5554 struct allowed_attr allowed_attr
[] =
5556 /* attr { D ACF I Fn ARG T Fi L DI M C <display name> } */
5557 /* ATTR_AGGREGATABLE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "aggregatable" },
5558 /* ATTR_APPOBJECT */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "appobject" },
5559 /* ATTR_ASYNC */ { 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, "async" },
5560 /* ATTR_AUTO_HANDLE */ { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, "auto_handle" },
5561 /* ATTR_BINDABLE */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "bindable" },
5562 /* ATTR_BROADCAST */ { 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "broadcast" },
5563 /* ATTR_CALLAS */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "call_as" },
5564 /* ATTR_CALLCONV */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, NULL
},
5565 /* ATTR_CASE */ { 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, "case" },
5566 /* ATTR_CONST */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "const" },
5567 /* ATTR_CONTEXTHANDLE */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, "context_handle" },
5568 /* ATTR_CONTROL */ { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, "control" },
5569 /* ATTR_DEFAULT */ { 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, "default" },
5570 /* ATTR_DEFAULTCOLLELEM */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "defaultcollelem" },
5571 /* ATTR_DEFAULTVALUE */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, "defaultvalue" },
5572 /* ATTR_DEFAULTVTABLE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "defaultvtable" },
5573 /* ATTR_DISPINTERFACE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL
},
5574 /* ATTR_DISPLAYBIND */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "displaybind" },
5575 /* ATTR_DLLNAME */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, "dllname" },
5576 /* ATTR_DUAL */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "dual" },
5577 /* ATTR_ENDPOINT */ { 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "endpoint" },
5578 /* ATTR_ENTRY */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "entry" },
5579 /* ATTR_EXPLICIT_HANDLE */ { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, "explicit_handle" },
5580 /* ATTR_HANDLE */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, "handle" },
5581 /* ATTR_HELPCONTEXT */ { 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, "helpcontext" },
5582 /* ATTR_HELPFILE */ { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, "helpfile" },
5583 /* ATTR_HELPSTRING */ { 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, "helpstring" },
5584 /* ATTR_HELPSTRINGCONTEXT */ { 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, "helpstringcontext" },
5585 /* ATTR_HELPSTRINGDLL */ { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, "helpstringdll" },
5586 /* ATTR_HIDDEN */ { 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, "hidden" },
5587 /* ATTR_ID */ { 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, "id" },
5588 /* ATTR_IDEMPOTENT */ { 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "idempotent" },
5589 /* ATTR_IIDIS */ { 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, "iid_is" },
5590 /* ATTR_IMMEDIATEBIND */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "immediatebind" },
5591 /* ATTR_IMPLICIT_HANDLE */ { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, "implicit_handle" },
5592 /* ATTR_IN */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, "in" },
5593 /* ATTR_INLINE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "inline" },
5594 /* ATTR_INPUTSYNC */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "inputsync" },
5595 /* ATTR_LENGTHIS */ { 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, "length_is" },
5596 /* ATTR_LIBLCID */ { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, "lcid" },
5597 /* ATTR_LOCAL */ { 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, "local" },
5598 /* ATTR_NONBROWSABLE */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "nonbrowsable" },
5599 /* ATTR_NONCREATABLE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "noncreatable" },
5600 /* ATTR_NONEXTENSIBLE */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "nonextensible" },
5601 /* ATTR_OBJECT */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "object" },
5602 /* ATTR_ODL */ { 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, "odl" },
5603 /* ATTR_OLEAUTOMATION */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "oleautomation" },
5604 /* ATTR_OPTIONAL */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, "optional" },
5605 /* ATTR_OUT */ { 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, "out" },
5606 /* ATTR_POINTERDEFAULT */ { 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "pointer_default" },
5607 /* ATTR_POINTERTYPE */ { 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, "ref, unique or ptr" },
5608 /* ATTR_PROPGET */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "propget" },
5609 /* ATTR_PROPPUT */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "propput" },
5610 /* ATTR_PROPPUTREF */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "propputref" },
5611 /* ATTR_PUBLIC */ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, "public" },
5612 /* ATTR_RANGE */ { 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, "range" },
5613 /* ATTR_READONLY */ { 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, "readonly" },
5614 /* ATTR_REQUESTEDIT */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "requestedit" },
5615 /* ATTR_RESTRICTED */ { 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, "restricted" },
5616 /* ATTR_RETVAL */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, "retval" },
5617 /* ATTR_SIZEIS */ { 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, "size_is" },
5618 /* ATTR_SOURCE */ { 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, "source" },
5619 /* ATTR_STRICTCONTEXTHANDLE */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "strict_context_handle" },
5620 /* ATTR_STRING */ { 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, "string" },
5621 /* ATTR_SWITCHIS */ { 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, "switch_is" },
5622 /* ATTR_SWITCHTYPE */ { 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, "switch_type" },
5623 /* ATTR_TRANSMITAS */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, "transmit_as" },
5624 /* ATTR_UUID */ { 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, "uuid" },
5625 /* ATTR_V1ENUM */ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, "v1_enum" },
5626 /* ATTR_VARARG */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "vararg" },
5627 /* ATTR_VERSION */ { 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, "version" },
5628 /* ATTR_WIREMARSHAL */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, "wire_marshal" },
5631 const char *get_attr_display_name(enum attr_type type
)
5633 return allowed_attr
[type
].display_name
;
5636 static attr_list_t
*check_iface_attrs(const char *name
, attr_list_t
*attrs
)
5639 if (!attrs
) return attrs
;
5640 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
5642 if (!allowed_attr
[attr
->type
].on_interface
)
5643 error_loc("inapplicable attribute %s for interface %s\n",
5644 allowed_attr
[attr
->type
].display_name
, name
);
5649 static attr_list_t
*check_function_attrs(const char *name
, attr_list_t
*attrs
)
5652 if (!attrs
) return attrs
;
5653 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
5655 if (!allowed_attr
[attr
->type
].on_function
)
5656 error_loc("inapplicable attribute %s for function %s\n",
5657 allowed_attr
[attr
->type
].display_name
, name
);
5662 static void check_arg(var_t
*arg
)
5664 const type_t
*t
= arg
->type
;
5667 if (t
->type
== 0 && ! is_var_ptr(arg
))
5668 error_loc("argument '%s' has void type\n", arg
->name
);
5672 LIST_FOR_EACH_ENTRY(attr
, arg
->attrs
, const attr_t
, entry
)
5674 if (!allowed_attr
[attr
->type
].on_arg
)
5675 error_loc("inapplicable attribute %s for argument %s\n",
5676 allowed_attr
[attr
->type
].display_name
, arg
->name
);
5681 static attr_list_t
*check_typedef_attrs(attr_list_t
*attrs
)
5684 if (!attrs
) return attrs
;
5685 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
5687 if (!allowed_attr
[attr
->type
].on_type
)
5688 error_loc("inapplicable attribute %s for typedef\n",
5689 allowed_attr
[attr
->type
].display_name
);
5694 static attr_list_t
*check_field_attrs(const char *name
, attr_list_t
*attrs
)
5697 if (!attrs
) return attrs
;
5698 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
5700 if (!allowed_attr
[attr
->type
].on_field
)
5701 error_loc("inapplicable attribute %s for field %s\n",
5702 allowed_attr
[attr
->type
].display_name
, name
);
5707 static attr_list_t
*check_library_attrs(const char *name
, attr_list_t
*attrs
)
5710 if (!attrs
) return attrs
;
5711 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
5713 if (!allowed_attr
[attr
->type
].on_library
)
5714 error_loc("inapplicable attribute %s for library %s\n",
5715 allowed_attr
[attr
->type
].display_name
, name
);
5720 static attr_list_t
*check_dispiface_attrs(const char *name
, attr_list_t
*attrs
)
5723 if (!attrs
) return attrs
;
5724 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
5726 if (!allowed_attr
[attr
->type
].on_dispinterface
)
5727 error_loc("inapplicable attribute %s for dispinterface %s\n",
5728 allowed_attr
[attr
->type
].display_name
, name
);
5733 static attr_list_t
*check_module_attrs(const char *name
, attr_list_t
*attrs
)
5736 if (!attrs
) return attrs
;
5737 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
5739 if (!allowed_attr
[attr
->type
].on_module
)
5740 error_loc("inapplicable attribute %s for module %s\n",
5741 allowed_attr
[attr
->type
].display_name
, name
);
5746 static attr_list_t
*check_coclass_attrs(const char *name
, attr_list_t
*attrs
)
5749 if (!attrs
) return attrs
;
5750 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
5752 if (!allowed_attr
[attr
->type
].on_coclass
)
5753 error_loc("inapplicable attribute %s for coclass %s\n",
5754 allowed_attr
[attr
->type
].display_name
, name
);
5759 static int is_allowed_conf_type(const type_t
*type
)
5780 static int is_ptr_guid_type(const type_t
*type
)
5782 unsigned int align
= 0;
5785 if (type
->kind
== TKIND_ALIAS
)
5787 else if (is_ptr(type
))
5795 return (type_memsize(type
, &align
) == 16);
5798 static void check_conformance_expr_list(const char *attr_name
, const var_t
*arg
, const type_t
*container_type
, expr_list_t
*expr_list
)
5801 struct expr_loc expr_loc
;
5803 expr_loc
.attr
= attr_name
;
5804 if (expr_list
) LIST_FOR_EACH_ENTRY(dim
, expr_list
, expr_t
, entry
)
5806 if (dim
->type
!= EXPR_VOID
)
5808 const type_t
*expr_type
= expr_resolve_type(&expr_loc
, container_type
, dim
);
5809 if (!is_allowed_conf_type(expr_type
))
5810 error_loc_info(&arg
->loc_info
, "expression must resolve to integral type <= 32bits for attribute %s\n",
5816 static void check_remoting_fields(const var_t
*var
, type_t
*type
);
5818 /* checks that properties common to fields and arguments are consistent */
5819 static void check_field_common(const type_t
*container_type
,
5820 const char *container_name
, const var_t
*arg
)
5822 type_t
*type
= arg
->type
;
5823 int is_wire_marshal
= 0;
5824 int is_context_handle
= 0;
5825 const char *container_type_name
= NULL
;
5827 if (is_struct(container_type
->type
))
5828 container_type_name
= "struct";
5829 else if (is_union(container_type
->type
))
5830 container_type_name
= "union";
5831 else if (container_type
->type
== RPC_FC_FUNCTION
)
5832 container_type_name
= "function";
5834 if (is_attr(arg
->attrs
, ATTR_LENGTHIS
) &&
5835 (is_attr(arg
->attrs
, ATTR_STRING
) || is_aliaschain_attr(arg
->type
, ATTR_STRING
)))
5836 error_loc_info(&arg
->loc_info
,
5837 "string and length_is specified for argument %s are mutually exclusive attributes\n",
5840 if (is_attr(arg
->attrs
, ATTR_SIZEIS
))
5842 expr_list_t
*size_is_exprs
= get_attrp(arg
->attrs
, ATTR_SIZEIS
);
5843 check_conformance_expr_list("size_is", arg
, container_type
, size_is_exprs
);
5845 if (is_attr(arg
->attrs
, ATTR_LENGTHIS
))
5847 expr_list_t
*length_is_exprs
= get_attrp(arg
->attrs
, ATTR_LENGTHIS
);
5848 check_conformance_expr_list("length_is", arg
, container_type
, length_is_exprs
);
5850 if (is_attr(arg
->attrs
, ATTR_IIDIS
))
5852 struct expr_loc expr_loc
;
5853 expr_t
*expr
= get_attrp(arg
->attrs
, ATTR_IIDIS
);
5854 if (expr
->type
!= EXPR_VOID
)
5856 const type_t
*expr_type
;
5858 expr_loc
.attr
= "iid_is";
5859 expr_type
= expr_resolve_type(&expr_loc
, container_type
, expr
);
5860 if (!expr_type
|| !is_ptr_guid_type(expr_type
))
5861 error_loc_info(&arg
->loc_info
, "expression must resolve to pointer to GUID type for attribute iid_is\n");
5864 if (is_attr(arg
->attrs
, ATTR_SWITCHIS
))
5866 struct expr_loc expr_loc
;
5867 expr_t
*expr
= get_attrp(arg
->attrs
, ATTR_SWITCHIS
);
5868 if (expr
->type
!= EXPR_VOID
)
5870 const type_t
*expr_type
;
5872 expr_loc
.attr
= "switch_is";
5873 expr_type
= expr_resolve_type(&expr_loc
, container_type
, expr
);
5874 if (!expr_type
|| !is_allowed_conf_type(expr_type
))
5875 error_loc_info(&arg
->loc_info
, "expression must resolve to integral type <= 32bits for attribute %s\n",
5880 /* get fundamental type for the argument */
5883 if (is_attr(type
->attrs
, ATTR_WIREMARSHAL
))
5885 is_wire_marshal
= 1;
5888 if (is_attr(type
->attrs
, ATTR_CONTEXTHANDLE
))
5890 is_context_handle
= 1;
5893 if (type
->kind
== TKIND_ALIAS
)
5895 else if (is_ptr(type
) || is_array(type
))
5901 if (type
->type
== 0 && !is_attr(arg
->attrs
, ATTR_IIDIS
) && !is_wire_marshal
&& !is_context_handle
)
5902 error_loc_info(&arg
->loc_info
, "parameter \'%s\' of %s \'%s\' cannot derive from void *\n", arg
->name
, container_type_name
, container_name
);
5903 else if (type
->type
== RPC_FC_FUNCTION
)
5904 error_loc_info(&arg
->loc_info
, "parameter \'%s\' of %s \'%s\' cannot be a function pointer\n", arg
->name
, container_type_name
, container_name
);
5905 else if (!is_wire_marshal
&& (is_struct(type
->type
) || is_union(type
->type
)))
5906 check_remoting_fields(arg
, type
);
5909 static void check_remoting_fields(const var_t
*var
, type_t
*type
)
5912 const var_list_t
*fields
= NULL
;
5917 type
->checked
= TRUE
;
5919 if (is_struct(type
->type
))
5920 fields
= type
->fields_or_args
;
5921 else if (is_union(type
->type
))
5923 if (type
->type
== RPC_FC_ENCAPSULATED_UNION
)
5925 const var_t
*uv
= LIST_ENTRY(list_tail(type
->fields_or_args
), const var_t
, entry
);
5926 fields
= uv
->type
->fields_or_args
;
5929 fields
= type
->fields_or_args
;
5932 if (fields
) LIST_FOR_EACH_ENTRY( field
, type
->fields_or_args
, const var_t
, entry
)
5933 if (field
->type
) check_field_common(type
, type
->name
, field
);
5936 /* checks that arguments for a function make sense for marshalling and unmarshalling */
5937 static void check_remoting_args(const func_t
*func
)
5939 const char *funcname
= func
->def
->name
;
5942 if (func
->args
) LIST_FOR_EACH_ENTRY( arg
, func
->args
, const var_t
, entry
)
5945 const type_t
*type
= arg
->type
;
5947 /* get pointer level and fundamental type for the argument */
5950 if (is_attr(type
->attrs
, ATTR_WIREMARSHAL
))
5952 if (is_attr(type
->attrs
, ATTR_CONTEXTHANDLE
))
5954 if (type
->kind
== TKIND_ALIAS
)
5956 else if (is_ptr(type
))
5965 /* check that [out] parameters have enough pointer levels */
5966 if (is_attr(arg
->attrs
, ATTR_OUT
))
5968 if (!is_array(type
))
5971 error_loc_info(&arg
->loc_info
, "out parameter \'%s\' of function \'%s\' is not a pointer\n", arg
->name
, funcname
);
5972 if (type
->type
== RPC_FC_IP
&& ptr_level
== 1)
5973 error_loc_info(&arg
->loc_info
, "out interface pointer \'%s\' of function \'%s\' is not a double pointer\n", arg
->name
, funcname
);
5977 check_field_common(func
->def
->type
, funcname
, arg
);
5981 static void add_explicit_handle_if_necessary(func_t
*func
)
5983 const var_t
* explicit_handle_var
;
5984 const var_t
* explicit_generic_handle_var
= NULL
;
5985 const var_t
* context_handle_var
= NULL
;
5987 /* check for a defined binding handle */
5988 explicit_handle_var
= get_explicit_handle_var(func
);
5989 if (!explicit_handle_var
)
5991 explicit_generic_handle_var
= get_explicit_generic_handle_var(func
);
5992 if (!explicit_generic_handle_var
)
5994 context_handle_var
= get_context_handle_var(func
);
5995 if (!context_handle_var
)
5997 /* no explicit handle specified so add
5998 * "[in] handle_t IDL_handle" as the first parameter to the
6000 var_t
*idl_handle
= make_var(xstrdup("IDL_handle"));
6001 idl_handle
->attrs
= append_attr(NULL
, make_attr(ATTR_IN
));
6002 idl_handle
->type
= find_type("handle_t", 0);
6003 if (!func
->def
->type
->fields_or_args
)
6005 func
->def
->type
->fields_or_args
= xmalloc( sizeof(*func
->def
->type
->fields_or_args
) );
6006 list_init( func
->def
->type
->fields_or_args
);
6008 list_add_head( func
->def
->type
->fields_or_args
, &idl_handle
->entry
);
6009 func
->args
= func
->def
->type
->fields_or_args
;
6015 static void check_functions(const type_t
*iface
)
6017 if (is_attr(iface
->attrs
, ATTR_EXPLICIT_HANDLE
) && iface
->funcs
)
6020 LIST_FOR_EACH_ENTRY( func
, iface
->funcs
, func_t
, entry
)
6021 add_explicit_handle_if_necessary(func
);
6023 if (!is_inside_library
&& !is_attr(iface
->attrs
, ATTR_LOCAL
))
6026 if (iface
->funcs
) LIST_FOR_EACH_ENTRY( func
, iface
->funcs
, const func_t
, entry
)
6028 if (!is_attr(func
->def
->attrs
, ATTR_LOCAL
))
6029 check_remoting_args(func
);
6034 static void check_all_user_types(const statement_list_t
*stmts
)
6036 const statement_t
*stmt
;
6038 if (stmts
) LIST_FOR_EACH_ENTRY(stmt
, stmts
, const statement_t
, entry
)
6040 if (stmt
->type
== STMT_LIBRARY
)
6041 check_all_user_types(stmt
->u
.lib
->stmts
);
6042 else if (stmt
->type
== STMT_TYPE
&& stmt
->u
.type
->type
== RPC_FC_IP
)
6045 const func_list_t
*fs
= stmt
->u
.type
->funcs
;
6046 if (fs
) LIST_FOR_EACH_ENTRY(f
, fs
, const func_t
, entry
)
6047 check_for_additional_prototype_types(f
->args
);
6052 int is_valid_uuid(const char *s
)
6056 for (i
= 0; i
< 36; ++i
)
6057 if (i
== 8 || i
== 13 || i
== 18 || i
== 23)
6063 if (!isxdigit(s
[i
]))
6066 return s
[i
] == '\0';
6069 static statement_t
*make_statement(enum statement_type type
)
6071 statement_t
*stmt
= xmalloc(sizeof(*stmt
));
6076 static statement_t
*make_statement_type_decl(type_t
*type
)
6078 statement_t
*stmt
= make_statement(STMT_TYPE
);
6079 stmt
->u
.type
= type
;
6083 static statement_t
*make_statement_reference(type_t
*type
)
6085 statement_t
*stmt
= make_statement(STMT_TYPEREF
);
6086 stmt
->u
.type
= type
;
6090 static statement_t
*make_statement_declaration(var_t
*var
)
6092 statement_t
*stmt
= make_statement(STMT_DECLARATION
);
6094 if (var
->stgclass
== STG_EXTERN
&& var
->eval
)
6095 warning("'%s' initialised and declared extern\n", var
->name
);
6096 if (is_const_decl(var
))
6101 else if ((var
->stgclass
== STG_NONE
|| var
->stgclass
== STG_REGISTER
) &&
6102 var
->type
->type
!= RPC_FC_FUNCTION
)
6103 error_loc("instantiation of data is illegal\n");
6107 static statement_t
*make_statement_library(typelib_t
*typelib
)
6109 statement_t
*stmt
= make_statement(STMT_LIBRARY
);
6110 stmt
->u
.lib
= typelib
;
6114 static statement_t
*make_statement_cppquote(const char *str
)
6116 statement_t
*stmt
= make_statement(STMT_CPPQUOTE
);
6121 static statement_t
*make_statement_importlib(const char *str
)
6123 statement_t
*stmt
= make_statement(STMT_IMPORTLIB
);
6128 static statement_t
*make_statement_import(const char *str
)
6130 statement_t
*stmt
= make_statement(STMT_IMPORT
);
6135 static statement_t
*make_statement_module(type_t
*type
)
6137 statement_t
*stmt
= make_statement(STMT_MODULE
);
6138 stmt
->u
.type
= type
;
6142 static statement_t
*process_typedefs(declarator_list_t
*decls
)
6144 declarator_t
*decl
, *next
;
6146 type_list_t
**type_list
;
6148 if (!decls
) return NULL
;
6150 stmt
= make_statement(STMT_TYPEDEF
);
6151 stmt
->u
.type_list
= NULL
;
6152 type_list
= &stmt
->u
.type_list
;
6154 LIST_FOR_EACH_ENTRY_SAFE( decl
, next
, decls
, declarator_t
, entry
)
6156 var_t
*var
= decl
->var
;
6157 type_t
*type
= find_type(var
->name
, 0);
6158 *type_list
= xmalloc(sizeof(type_list_t
));
6159 (*type_list
)->type
= type
;
6160 (*type_list
)->next
= NULL
;
6162 if (! parse_only
&& do_header
)
6163 write_typedef(type
);
6164 if (in_typelib
&& is_attr(type
->attrs
, ATTR_PUBLIC
))
6165 add_typelib_entry(type
);
6167 type_list
= &(*type_list
)->next
;
6175 static statement_list_t
*append_statement(statement_list_t
*list
, statement_t
*stmt
)
6177 if (!stmt
) return list
;
6180 list
= xmalloc( sizeof(*list
) );
6183 list_add_tail( list
, &stmt
->entry
);
6187 static func_list_t
*append_func_from_statement(func_list_t
*list
, statement_t
*stmt
)
6189 if (stmt
->type
== STMT_DECLARATION
)
6191 var_t
*var
= stmt
->u
.var
;
6192 if (var
->stgclass
== STG_NONE
&& var
->type
->type
== RPC_FC_FUNCTION
)
6194 check_function_attrs(var
->name
, var
->type
->attrs
);
6195 return append_func(list
, make_func(stmt
->u
.var
));