1 /* A Bison parser, made by GNU Bison 3.0. */
3 /* Bison implementation for Yacc-like parsers in C
5 Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20 /* As a special exception, you may create a larger work that contains
21 part or all of the Bison parser skeleton and distribute that work
22 under terms of your choice, so long as that work isn't itself a
23 parser generator using the skeleton or a modified version thereof
24 as a parser skeleton. Alternatively, if you modify or redistribute
25 the parser skeleton itself, you may (at your option) remove this
26 special exception, which will cause the skeleton and the resulting
27 Bison output files to be licensed under the GNU General Public
28 License without this special exception.
30 This special exception was added by the Free Software Foundation in
31 version 2.2 of Bison. */
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34 simplifying the original so-called "semantic" parser. */
36 /* All symbols defined below should begin with yy or YY, to avoid
37 infringing on user name space. This should be done even for local
38 variables, as they might otherwise be expanded by user macros.
39 There are some unavoidable exceptions within include files to
40 define necessary library symbols; they are noted "INFRINGES ON
41 USER NAME SPACE" below. */
43 /* Identify Bison output. */
47 #define YYBISON_VERSION "3.0"
50 #define YYSKELETON_NAME "yacc.c"
62 /* Substitute the variable and function names. */
63 #define yyparse parser_parse
64 #define yylex parser_lex
65 #define yyerror parser_error
66 #define yydebug parser_debug
67 #define yynerrs parser_nerrs
69 #define yylval parser_lval
70 #define yychar parser_char
72 /* Copy the first part of user declarations. */
73 #line 1 "parser.y" /* yacc.c:339 */
78 * Copyright 2002 Ove Kaaven
79 * Copyright 2006-2008 Robert Shearman
81 * This library is free software; you can redistribute it and/or
82 * modify it under the terms of the GNU Lesser General Public
83 * License as published by the Free Software Foundation; either
84 * version 2.1 of the License, or (at your option) any later version.
86 * This library is distributed in the hope that it will be useful,
87 * but WITHOUT ANY WARRANTY; without even the implied warranty of
88 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
89 * Lesser General Public License for more details.
91 * You should have received a copy of the GNU Lesser General Public
92 * License along with this library; if not, write to the Free Software
93 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
112 #include "typetree.h"
114 static unsigned char pointer_default
= RPC_FC_UP
;
116 typedef struct list typelist_t
;
125 int import_performed
;
128 typedef struct _decl_spec_t
132 enum storage_class stgclass
;
135 typelist_t incomplete_types
= LIST_INIT(incomplete_types
);
137 static void fix_incomplete(void);
138 static void fix_incomplete_types(type_t
*complete_type
);
140 static str_list_t
*append_str(str_list_t
*list
, char *str
);
141 static attr_list_t
*append_attr(attr_list_t
*list
, attr_t
*attr
);
142 static attr_list_t
*append_attr_list(attr_list_t
*new_list
, attr_list_t
*old_list
);
143 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
);
144 static attr_t
*make_attr(enum attr_type type
);
145 static attr_t
*make_attrv(enum attr_type type
, unsigned int val
);
146 static attr_t
*make_attrp(enum attr_type type
, void *val
);
147 static expr_list_t
*append_expr(expr_list_t
*list
, expr_t
*expr
);
148 static array_dims_t
*append_array(array_dims_t
*list
, expr_t
*expr
);
149 static var_t
*declare_var(attr_list_t
*attrs
, decl_spec_t
*decl_spec
, const declarator_t
*decl
, int top
);
150 static var_list_t
*set_var_types(attr_list_t
*attrs
, decl_spec_t
*decl_spec
, declarator_list_t
*decls
);
151 static ifref_list_t
*append_ifref(ifref_list_t
*list
, ifref_t
*iface
);
152 static ifref_t
*make_ifref(type_t
*iface
);
153 static var_list_t
*append_var_list(var_list_t
*list
, var_list_t
*vars
);
154 static declarator_list_t
*append_declarator(declarator_list_t
*list
, declarator_t
*p
);
155 static declarator_t
*make_declarator(var_t
*var
);
156 static type_t
*make_safearray(type_t
*type
);
157 static typelib_t
*make_library(const char *name
, const attr_list_t
*attrs
);
158 static type_t
*append_ptrchain_type(type_t
*ptrchain
, type_t
*type
);
159 static warning_list_t
*append_warning(warning_list_t
*, int);
161 static type_t
*reg_typedefs(decl_spec_t
*decl_spec
, var_list_t
*names
, attr_list_t
*attrs
);
162 static type_t
*find_type_or_error(const char *name
, int t
);
163 static type_t
*find_type_or_error2(char *name
, int t
);
165 static var_t
*reg_const(var_t
*var
);
167 static void push_namespace(const char *name
);
168 static void pop_namespace(const char *name
);
170 static char *gen_name(void);
171 static void check_arg_attrs(const var_t
*arg
);
172 static void check_statements(const statement_list_t
*stmts
, int is_inside_library
);
173 static void check_all_user_types(const statement_list_t
*stmts
);
174 static attr_list_t
*check_iface_attrs(const char *name
, attr_list_t
*attrs
);
175 static attr_list_t
*check_function_attrs(const char *name
, attr_list_t
*attrs
);
176 static attr_list_t
*check_typedef_attrs(attr_list_t
*attrs
);
177 static attr_list_t
*check_enum_attrs(attr_list_t
*attrs
);
178 static attr_list_t
*check_struct_attrs(attr_list_t
*attrs
);
179 static attr_list_t
*check_union_attrs(attr_list_t
*attrs
);
180 static attr_list_t
*check_field_attrs(const char *name
, attr_list_t
*attrs
);
181 static attr_list_t
*check_library_attrs(const char *name
, attr_list_t
*attrs
);
182 static attr_list_t
*check_dispiface_attrs(const char *name
, attr_list_t
*attrs
);
183 static attr_list_t
*check_module_attrs(const char *name
, attr_list_t
*attrs
);
184 static attr_list_t
*check_coclass_attrs(const char *name
, attr_list_t
*attrs
);
185 const char *get_attr_display_name(enum attr_type type
);
186 static void add_explicit_handle_if_necessary(const type_t
*iface
, var_t
*func
);
187 static void check_def(const type_t
*t
);
189 static statement_t
*make_statement(enum statement_type type
);
190 static statement_t
*make_statement_type_decl(type_t
*type
);
191 static statement_t
*make_statement_reference(type_t
*type
);
192 static statement_t
*make_statement_declaration(var_t
*var
);
193 static statement_t
*make_statement_library(typelib_t
*typelib
);
194 static statement_t
*make_statement_pragma(const char *str
);
195 static statement_t
*make_statement_cppquote(const char *str
);
196 static statement_t
*make_statement_importlib(const char *str
);
197 static statement_t
*make_statement_module(type_t
*type
);
198 static statement_t
*make_statement_typedef(var_list_t
*names
);
199 static statement_t
*make_statement_import(const char *str
);
200 static statement_list_t
*append_statement(statement_list_t
*list
, statement_t
*stmt
);
201 static statement_list_t
*append_statements(statement_list_t
*, statement_list_t
*);
202 static attr_list_t
*append_attribs(attr_list_t
*, attr_list_t
*);
204 static struct namespace global_namespace
= {
205 NULL
, NULL
, LIST_INIT(global_namespace
.entry
), LIST_INIT(global_namespace
.children
)
208 static struct namespace *current_namespace
= &global_namespace
;
211 #line 212 "parser.tab.c" /* yacc.c:339 */
214 # if defined __cplusplus && 201103L <= __cplusplus
215 # define YY_NULL nullptr
221 /* Enabling verbose error messages. */
222 #ifdef YYERROR_VERBOSE
223 # undef YYERROR_VERBOSE
224 # define YYERROR_VERBOSE 1
226 # define YYERROR_VERBOSE 1
229 /* In a future release of Bison, this section will be replaced
230 by #include "parser.tab.h". */
231 #ifndef YY_PARSER_E_REACTOSSYNC_GCC_HOST_TOOLS_SDK_TOOLS_WIDL_PARSER_TAB_H_INCLUDED
232 # define YY_PARSER_E_REACTOSSYNC_GCC_HOST_TOOLS_SDK_TOOLS_WIDL_PARSER_TAB_H_INCLUDED
238 extern int parser_debug
;
288 tCONTEXTHANDLE
= 300,
289 tCONTEXTHANDLENOSERIALIZE
= 301,
290 tCONTEXTHANDLESERIALIZE
= 302,
296 tDEFAULTCOLLELEM
= 308,
298 tDEFAULTVTABLE
= 310,
299 tDISABLECONSISTENCYCHECK
= 311,
301 tDISPINTERFACE
= 313,
305 tENABLEALLOCATE
= 317,
311 tEXPLICITHANDLE
= 323,
317 tFORCEALLOCATE
= 329,
323 tHELPSTRINGCONTEXT
= 335,
324 tHELPSTRINGDLL
= 336,
331 tIMMEDIATEBIND
= 343,
332 tIMPLICITHANDLE
= 344,
357 tNONEXTENSIBLE
= 369,
363 tOLEAUTOMATION
= 375,
367 tPARTIALIGNORE
= 379,
369 tPOINTERDEFAULT
= 381,
370 tPRAGMA_WARNING
= 382,
396 tSTRICTCONTEXTHANDLE
= 408,
410 tUSESGETLASTERROR
= 422,
434 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
435 typedef union YYSTYPE YYSTYPE
;
438 #line 138 "parser.y" /* yacc.c:355 */
441 attr_list_t
*attr_list
;
442 str_list_t
*str_list
;
444 expr_list_t
*expr_list
;
445 array_dims_t
*array_dims
;
448 var_list_t
*var_list
;
449 declarator_t
*declarator
;
450 declarator_list_t
*declarator_list
;
451 statement_t
*statement
;
452 statement_list_t
*stmt_list
;
454 warning_list_t
*warning_list
;
456 ifref_list_t
*ifref_list
;
461 interface_info_t ifinfo
;
463 struct _import_t
*import
;
464 struct _decl_spec_t
*declspec
;
465 enum storage_class stgclass
;
467 #line 468 "parser.tab.c" /* yacc.c:355 */
469 # define YYSTYPE_IS_TRIVIAL 1
470 # define YYSTYPE_IS_DECLARED 1
474 extern YYSTYPE parser_lval
;
476 int parser_parse (void);
478 #endif /* !YY_PARSER_E_REACTOSSYNC_GCC_HOST_TOOLS_SDK_TOOLS_WIDL_PARSER_TAB_H_INCLUDED */
480 /* Copy the second part of user declarations. */
482 #line 483 "parser.tab.c" /* yacc.c:358 */
489 typedef YYTYPE_UINT8 yytype_uint8
;
491 typedef unsigned char yytype_uint8
;
495 typedef YYTYPE_INT8 yytype_int8
;
497 typedef signed char yytype_int8
;
501 typedef YYTYPE_UINT16 yytype_uint16
;
503 typedef unsigned short int yytype_uint16
;
507 typedef YYTYPE_INT16 yytype_int16
;
509 typedef short int yytype_int16
;
513 # ifdef __SIZE_TYPE__
514 # define YYSIZE_T __SIZE_TYPE__
515 # elif defined size_t
516 # define YYSIZE_T size_t
517 # elif ! defined YYSIZE_T
518 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
519 # define YYSIZE_T size_t
521 # define YYSIZE_T unsigned int
525 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
528 # if defined YYENABLE_NLS && YYENABLE_NLS
530 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
531 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
535 # define YY_(Msgid) Msgid
539 #ifndef __attribute__
540 /* This feature is available in gcc versions 2.5 and later. */
541 # if (! defined __GNUC__ || __GNUC__ < 2 \
542 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5))
543 # define __attribute__(Spec) /* empty */
547 /* Suppress unused-variable warnings by "using" E. */
548 #if ! defined lint || defined __GNUC__
549 # define YYUSE(E) ((void) (E))
551 # define YYUSE(E) /* empty */
554 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
555 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
556 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
557 _Pragma ("GCC diagnostic push") \
558 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
559 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
560 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
561 _Pragma ("GCC diagnostic pop")
563 # define YY_INITIAL_VALUE(Value) Value
565 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
566 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
567 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
569 #ifndef YY_INITIAL_VALUE
570 # define YY_INITIAL_VALUE(Value) /* Nothing. */
574 #if ! defined yyoverflow || YYERROR_VERBOSE
576 /* The parser invokes alloca or malloc; define the necessary symbols. */
578 # ifdef YYSTACK_USE_ALLOCA
579 # if YYSTACK_USE_ALLOCA
581 # define YYSTACK_ALLOC __builtin_alloca
582 # elif defined __BUILTIN_VA_ARG_INCR
583 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
585 # define YYSTACK_ALLOC __alloca
586 # elif defined _MSC_VER
587 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
588 # define alloca _alloca
590 # define YYSTACK_ALLOC alloca
591 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
592 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
593 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
594 # ifndef EXIT_SUCCESS
595 # define EXIT_SUCCESS 0
602 # ifdef YYSTACK_ALLOC
603 /* Pacify GCC's 'empty if-body' warning. */
604 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
605 # ifndef YYSTACK_ALLOC_MAXIMUM
606 /* The OS might guarantee only one guard page at the bottom of the stack,
607 and a page size can be as small as 4096 bytes. So we cannot safely
608 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
609 to allow for a few compiler-allocated temporary stack slots. */
610 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
613 # define YYSTACK_ALLOC YYMALLOC
614 # define YYSTACK_FREE YYFREE
615 # ifndef YYSTACK_ALLOC_MAXIMUM
616 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
618 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
619 && ! ((defined YYMALLOC || defined malloc) \
620 && (defined YYFREE || defined free)))
621 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
622 # ifndef EXIT_SUCCESS
623 # define EXIT_SUCCESS 0
627 # define YYMALLOC malloc
628 # if ! defined malloc && ! defined EXIT_SUCCESS
629 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
634 # if ! defined free && ! defined EXIT_SUCCESS
635 void free (void *); /* INFRINGES ON USER NAME SPACE */
639 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
642 #if (! defined yyoverflow \
643 && (! defined __cplusplus \
644 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
646 /* A type that is properly aligned for any stack member. */
649 yytype_int16 yyss_alloc
;
653 /* The size of the maximum gap between one aligned stack and the next. */
654 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
656 /* The size of an array large to enough to hold all stacks, each with
658 # define YYSTACK_BYTES(N) \
659 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
660 + YYSTACK_GAP_MAXIMUM)
662 # define YYCOPY_NEEDED 1
664 /* Relocate STACK from its old location to the new one. The
665 local variables YYSIZE and YYSTACKSIZE give the old and new number of
666 elements in the stack, and YYPTR gives the new location of the
667 stack. Advance YYPTR to a properly aligned location for the next
669 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
672 YYSIZE_T yynewbytes; \
673 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
674 Stack = &yyptr->Stack_alloc; \
675 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
676 yyptr += yynewbytes / sizeof (*yyptr); \
682 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
683 /* Copy COUNT objects from SRC to DST. The source and destination do
686 # if defined __GNUC__ && 1 < __GNUC__
687 # define YYCOPY(Dst, Src, Count) \
688 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
690 # define YYCOPY(Dst, Src, Count) \
694 for (yyi = 0; yyi < (Count); yyi++) \
695 (Dst)[yyi] = (Src)[yyi]; \
700 #endif /* !YYCOPY_NEEDED */
702 /* YYFINAL -- State number of the termination state. */
704 /* YYLAST -- Last index in YYTABLE. */
707 /* YYNTOKENS -- Number of terminals. */
708 #define YYNTOKENS 211
709 /* YYNNTS -- Number of nonterminals. */
711 /* YYNRULES -- Number of rules. */
713 /* YYNSTATES -- Number of states. */
714 #define YYNSTATES 691
716 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
717 by yylex, with out-of-bounds checking. */
719 #define YYMAXUTOK 441
721 #define YYTRANSLATE(YYX) \
722 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
724 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
725 as returned by yylex, without out-of-bounds checking. */
726 static const yytype_uint8 yytranslate
[] =
728 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
729 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
730 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
731 2, 2, 2, 195, 2, 2, 2, 194, 187, 2,
732 208, 209, 192, 191, 182, 190, 202, 193, 2, 2,
733 2, 2, 2, 2, 2, 2, 2, 2, 184, 207,
734 188, 210, 189, 183, 2, 2, 2, 2, 2, 2,
735 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
736 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
737 2, 203, 2, 204, 186, 2, 2, 2, 2, 2,
738 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
739 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
740 2, 2, 2, 205, 185, 206, 196, 2, 2, 2,
741 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
742 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
743 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
744 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
745 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
746 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
747 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
748 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
749 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
750 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
751 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
752 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
753 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
754 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
755 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
756 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
757 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
758 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
759 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
760 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
761 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
762 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
763 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
764 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
765 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
766 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
767 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
768 145, 146, 147, 148, 149, 150, 151, 152, 153, 154,
769 155, 156, 157, 158, 159, 160, 161, 162, 163, 164,
770 165, 166, 167, 168, 169, 170, 171, 172, 173, 174,
771 175, 176, 177, 178, 179, 180, 181, 197, 198, 199,
776 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
777 static const yytype_uint16 yyrline
[] =
779 0, 321, 321, 335, 336, 336, 338, 339, 340, 343,
780 346, 347, 348, 351, 352, 353, 353, 355, 356, 357,
781 360, 361, 362, 363, 366, 367, 370, 371, 375, 376,
782 377, 378, 379, 380, 381, 384, 395, 396, 400, 401,
783 402, 403, 404, 405, 406, 407, 408, 411, 413, 421,
784 427, 431, 432, 434, 438, 445, 446, 449, 450, 453,
785 454, 458, 463, 470, 474, 475, 478, 479, 483, 486,
786 487, 488, 491, 492, 495, 496, 497, 498, 499, 500,
787 501, 502, 503, 504, 505, 506, 507, 508, 509, 510,
788 511, 512, 513, 514, 515, 516, 517, 518, 519, 520,
789 521, 522, 523, 524, 525, 526, 527, 528, 529, 530,
790 531, 532, 533, 534, 535, 536, 537, 538, 539, 540,
791 541, 542, 543, 544, 545, 546, 547, 548, 549, 550,
792 551, 552, 553, 554, 555, 556, 557, 558, 559, 560,
793 561, 562, 563, 564, 565, 566, 567, 568, 569, 570,
794 574, 575, 576, 577, 578, 579, 580, 581, 582, 583,
795 584, 585, 586, 587, 588, 589, 590, 591, 592, 593,
796 594, 595, 596, 597, 601, 602, 607, 608, 609, 610,
797 613, 614, 617, 621, 627, 628, 629, 632, 636, 648,
798 652, 657, 660, 661, 664, 665, 668, 669, 670, 671,
799 672, 673, 674, 675, 676, 677, 678, 679, 680, 681,
800 682, 683, 684, 685, 686, 687, 688, 689, 690, 691,
801 692, 693, 694, 695, 696, 697, 698, 699, 700, 701,
802 702, 703, 704, 705, 707, 709, 710, 713, 714, 717,
803 723, 729, 730, 733, 738, 745, 746, 749, 750, 754,
804 755, 758, 762, 768, 776, 780, 785, 786, 789, 790,
805 791, 794, 796, 799, 800, 801, 802, 803, 804, 805,
806 806, 807, 808, 809, 812, 813, 816, 817, 818, 819,
807 820, 821, 822, 823, 826, 827, 835, 841, 845, 848,
808 849, 853, 856, 857, 860, 869, 870, 873, 874, 877,
809 883, 889, 890, 893, 894, 897, 907, 916, 922, 926,
810 927, 930, 931, 934, 939, 946, 947, 948, 952, 956,
811 959, 960, 963, 964, 968, 969, 973, 974, 975, 979,
812 981, 983, 987, 988, 989, 990, 998, 1000, 1002, 1007,
813 1009, 1014, 1015, 1020, 1021, 1022, 1023, 1028, 1037, 1039,
814 1040, 1045, 1047, 1051, 1052, 1059, 1060, 1061, 1062, 1063,
815 1068, 1076, 1077, 1080, 1081, 1084, 1091, 1092, 1097, 1098,
816 1102, 1103, 1104, 1105, 1106, 1110, 1111, 1112, 1115, 1118,
817 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1130,
818 1137, 1139, 1145, 1146, 1147
822 #if YYDEBUG || YYERROR_VERBOSE || 1
823 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
824 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
825 static const char *const yytname
[] =
827 "$end", "error", "$undefined", "aIDENTIFIER", "aPRAGMA", "aKNOWNTYPE",
828 "aNUM", "aHEXNUM", "aDOUBLE", "aSTRING", "aWSTRING", "aSQSTRING",
829 "aUUID", "aEOF", "SHL", "SHR", "MEMBERPTR", "EQUALITY", "INEQUALITY",
830 "GREATEREQUAL", "LESSEQUAL", "LOGICALOR", "LOGICALAND", "ELLIPSIS",
831 "tAGGREGATABLE", "tALLOCATE", "tANNOTATION", "tAPPOBJECT", "tASYNC",
832 "tASYNCUUID", "tAUTOHANDLE", "tBINDABLE", "tBOOLEAN", "tBROADCAST",
833 "tBYTE", "tBYTECOUNT", "tCALLAS", "tCALLBACK", "tCASE", "tCDECL",
834 "tCHAR", "tCOCLASS", "tCODE", "tCOMMSTATUS", "tCONST", "tCONTEXTHANDLE",
835 "tCONTEXTHANDLENOSERIALIZE", "tCONTEXTHANDLESERIALIZE", "tCONTROL",
836 "tCPPQUOTE", "tDECODE", "tDEFAULT", "tDEFAULTBIND", "tDEFAULTCOLLELEM",
837 "tDEFAULTVALUE", "tDEFAULTVTABLE", "tDISABLECONSISTENCYCHECK",
838 "tDISPLAYBIND", "tDISPINTERFACE", "tDLLNAME", "tDOUBLE", "tDUAL",
839 "tENABLEALLOCATE", "tENCODE", "tENDPOINT", "tENTRY", "tENUM",
840 "tERRORSTATUST", "tEXPLICITHANDLE", "tEXTERN", "tFALSE", "tFASTCALL",
841 "tFAULTSTATUS", "tFLOAT", "tFORCEALLOCATE", "tHANDLE", "tHANDLET",
842 "tHELPCONTEXT", "tHELPFILE", "tHELPSTRING", "tHELPSTRINGCONTEXT",
843 "tHELPSTRINGDLL", "tHIDDEN", "tHYPER", "tID", "tIDEMPOTENT", "tIGNORE",
844 "tIIDIS", "tIMMEDIATEBIND", "tIMPLICITHANDLE", "tIMPORT", "tIMPORTLIB",
845 "tIN", "tIN_LINE", "tINLINE", "tINPUTSYNC", "tINT", "tINT3264", "tINT64",
846 "tINTERFACE", "tLCID", "tLENGTHIS", "tLIBRARY", "tLICENSED", "tLOCAL",
847 "tLONG", "tMAYBE", "tMESSAGE", "tMETHODS", "tMODULE", "tNAMESPACE",
848 "tNOCODE", "tNONBROWSABLE", "tNONCREATABLE", "tNONEXTENSIBLE", "tNOTIFY",
849 "tNOTIFYFLAG", "tNULL", "tOBJECT", "tODL", "tOLEAUTOMATION", "tOPTIMIZE",
850 "tOPTIONAL", "tOUT", "tPARTIALIGNORE", "tPASCAL", "tPOINTERDEFAULT",
851 "tPRAGMA_WARNING", "tPROGID", "tPROPERTIES", "tPROPGET", "tPROPPUT",
852 "tPROPPUTREF", "tPROXY", "tPTR", "tPUBLIC", "tRANGE", "tREADONLY",
853 "tREF", "tREGISTER", "tREPRESENTAS", "tREQUESTEDIT", "tRESTRICTED",
854 "tRETVAL", "tSAFEARRAY", "tSHORT", "tSIGNED", "tSIZEIS", "tSIZEOF",
855 "tSMALL", "tSOURCE", "tSTATIC", "tSTDCALL", "tSTRICTCONTEXTHANDLE",
856 "tSTRING", "tSTRUCT", "tSWITCH", "tSWITCHIS", "tSWITCHTYPE",
857 "tTHREADING", "tTRANSMITAS", "tTRUE", "tTYPEDEF", "tUIDEFAULT", "tUNION",
858 "tUNIQUE", "tUNSIGNED", "tUSESGETLASTERROR", "tUSERMARSHAL", "tUUID",
859 "tV1ENUM", "tVARARG", "tVERSION", "tVIPROGID", "tVOID", "tWCHAR",
860 "tWIREMARSHAL", "tAPARTMENT", "tNEUTRAL", "tSINGLE", "tFREE", "tBOTH",
861 "','", "'?'", "':'", "'|'", "'^'", "'&'", "'<'", "'>'", "'-'", "'+'",
862 "'*'", "'/'", "'%'", "'!'", "'~'", "CAST", "PPTR", "POS", "NEG",
863 "ADDRESSOF", "'.'", "'['", "']'", "'{'", "'}'", "';'", "'('", "')'",
864 "'='", "$accept", "input", "gbl_statements", "$@1", "imp_statements",
865 "$@2", "int_statements", "semicolon_opt", "statement", "pragma_warning",
866 "warnings", "typedecl", "cppquote", "import_start", "import",
867 "importlib", "libraryhdr", "library_start", "librarydef", "m_args",
868 "arg_list", "args", "arg", "array", "m_attributes", "attributes",
869 "attrib_list", "str_list", "attribute", "uuid_string", "callconv",
870 "cases", "case", "enums", "enum_list", "enum", "enumdef", "m_exprs",
871 "m_expr", "expr", "expr_list_int_const", "expr_int_const", "expr_const",
872 "fields", "field", "ne_union_field", "ne_union_fields", "union_field",
873 "s_field", "funcdef", "declaration", "m_ident", "t_ident", "ident",
874 "base_type", "m_int", "int_std", "coclass", "coclasshdr", "coclassdef",
875 "namespacedef", "coclass_ints", "coclass_int", "dispinterface",
876 "dispinterfacehdr", "dispint_props", "dispint_meths", "dispinterfacedef",
877 "inherit", "interface", "interfacehdr", "interfacedef", "interfacedec",
878 "module", "modulehdr", "moduledef", "storage_cls_spec",
879 "function_specifier", "type_qualifier", "m_type_qual_list", "decl_spec",
880 "m_decl_spec_no_type", "decl_spec_no_type", "declarator",
881 "direct_declarator", "abstract_declarator",
882 "abstract_declarator_no_direct", "m_abstract_declarator",
883 "abstract_direct_declarator", "any_declarator",
884 "any_declarator_no_direct", "m_any_declarator", "any_direct_declarator",
885 "declarator_list", "m_bitfield", "struct_declarator",
886 "struct_declarator_list", "init_declarator", "threading_type",
887 "pointer_type", "structdef", "type", "typedef", "uniondef", "version", YY_NULL
892 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
893 (internal) symbol number NUM (which must be that of a token). */
894 static const yytype_uint16 yytoknum
[] =
896 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
897 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
898 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
899 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
900 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
901 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
902 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
903 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
904 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
905 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
906 355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
907 365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
908 375, 376, 377, 378, 379, 380, 381, 382, 383, 384,
909 385, 386, 387, 388, 389, 390, 391, 392, 393, 394,
910 395, 396, 397, 398, 399, 400, 401, 402, 403, 404,
911 405, 406, 407, 408, 409, 410, 411, 412, 413, 414,
912 415, 416, 417, 418, 419, 420, 421, 422, 423, 424,
913 425, 426, 427, 428, 429, 430, 431, 432, 433, 434,
914 435, 436, 44, 63, 58, 124, 94, 38, 60, 62,
915 45, 43, 42, 47, 37, 33, 126, 437, 438, 439,
916 440, 441, 46, 91, 93, 123, 125, 59, 40, 41,
921 #define YYPACT_NINF -521
923 #define yypact_value_is_default(Yystate) \
924 (!!((Yystate) == (-521)))
926 #define YYTABLE_NINF -260
928 #define yytable_value_is_error(Yytable_value) \
931 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
933 static const yytype_int16 yypact
[] =
935 -521, 89, 1646, -521, -521, -521, -521, -521, -521, 156,
936 -521, -136, 172, -521, 181, -521, -521, -521, -521, -6,
937 87, -521, -521, -521, -521, 218, -6, 105, -99, -521,
938 -75, -6, 384, -521, -521, 223, 255, 384, -521, -521,
939 2819, -521, -521, -39, -521, -521, -521, -521, -521, 25,
940 2519, -19, -15, -521, -521, -11, 6, -521, 24, 3,
941 27, 15, 29, 21, -521, -521, 66, -521, 44, 44,
942 44, 162, 2667, 79, 44, 106, 109, -521, -521, 208,
943 -521, -521, 94, -521, 74, -521, -521, 119, -521, -521,
944 -521, -521, 279, 2667, -521, -521, 97, 107, -127, -120,
945 -521, -521, 122, -521, -521, 125, -521, -521, -521, 126,
946 131, -521, -521, -521, -521, -521, -521, -521, -521, -521,
947 -521, 155, -521, -521, -521, 160, -521, -521, -521, 161,
948 173, -521, -521, -521, -521, 179, 180, 183, 184, 192,
949 -521, 193, -521, -521, 195, -521, 196, -521, -521, 197,
950 205, -521, -521, -521, -521, -521, -521, -521, -521, -521,
951 -521, -521, -521, -521, 211, -521, -521, -521, 212, 213,
952 -521, -521, -521, -521, -521, -521, 214, -521, -521, 215,
953 -521, -521, -521, 217, -521, -521, -521, 222, 246, 247,
954 251, -521, -521, -521, 252, 260, -521, -521, 261, 263,
955 264, -121, -521, -521, -521, 1528, 791, 177, 319, 322,
956 337, 343, 347, 207, 182, -521, -521, -521, -521, 162,
957 209, 268, -521, -521, -521, -521, -521, -55, -521, -521,
958 -521, 350, 271, -521, -521, -521, -521, -521, -521, -521,
959 -521, -521, -521, -521, -521, 162, 162, -521, 267, -96,
960 -521, -521, -521, 44, -521, -521, -521, 269, 355, -521,
961 289, 270, -521, 276, -521, 477, 61, 355, 646, 646,
962 478, 479, 646, 646, 482, 491, 646, 493, 646, 646,
963 2080, 646, 646, 494, -78, 497, 646, 2667, 646, 646,
964 2667, 194, 2667, 2667, 61, 75, 501, 2667, 2819, 308,
965 -521, 309, -521, -521, -521, 311, -521, 314, -521, -521,
966 -521, 15, 2593, -521, 326, -521, -521, -521, -521, 326,
967 -102, -521, -521, -37, -521, 332, -66, 320, 329, -521,
968 -521, 1130, 72, 327, -521, 646, 266, 2080, -521, -521,
969 -521, 333, 353, -521, 328, 534, -521, -30, 177, -21,
970 335, -521, -521, 336, 341, -521, -521, -521, -521, -521,
971 -521, -521, -521, -521, 339, -521, 646, 646, 646, 646,
972 646, 646, 575, 2328, -143, -521, 2328, 342, 344, -521,
973 -123, 346, 348, 349, 351, 352, 354, 357, 1334, 358,
974 2593, 159, 359, -118, -521, 2328, 362, 363, 364, 367,
975 365, -114, 2001, 368, -521, -521, -521, -521, -521, 370,
976 378, 379, 380, 374, -521, 381, 382, 383, -521, 2819,
977 543, -521, -521, -521, 162, 15, -23, -521, 1027, -521,
978 375, 2593, 387, 1410, 389, 474, 1233, 15, -521, 2593,
979 -521, -521, -521, -521, 594, -521, 2242, 390, 414, -521,
980 -521, -521, 355, 646, -521, 18, -521, 2593, -521, 397,
981 -521, 391, -521, 401, -521, -521, -521, 2593, 12, 12,
982 12, 12, 12, 12, 2111, 338, 646, 646, 607, 646,
983 646, 646, 646, 646, 646, 646, 646, 646, 646, 646,
984 646, 646, 646, 646, 646, 646, 608, 646, 646, -521,
985 -521, -521, 604, -521, -521, -521, -521, -521, -521, -521,
986 -521, -521, -521, 159, -521, 1775, -521, 159, -521, -521,
987 -521, -93, -521, 646, -521, -521, -521, -521, 646, -521,
988 -521, -521, -521, -521, -521, -521, -521, 610, -521, -521,
989 -521, -521, 405, -521, -521, 435, -521, -521, -521, -521,
990 162, 169, -521, -521, 2593, 413, -521, -521, -521, 15,
991 -521, -521, -521, -521, 2006, -521, -521, -521, -521, 159,
992 419, 355, -521, -521, 338, -521, -521, 1903, -521, 338,
993 -521, 420, -58, 204, 204, -521, 718, 718, 305, 305,
994 2198, 2347, 2307, 103, 506, 2354, 305, 305, 115, 115,
995 12, 12, 12, -521, 2270, -521, -521, -521, 340, -521,
996 421, 159, 423, -521, 2080, -521, -521, 425, -521, 15,
997 909, 162, -521, -521, 1336, -521, -521, -521, 444, -521,
998 -115, -521, 431, -521, 429, 498, -521, 430, 159, 434,
999 -521, 646, 2080, -521, 646, -521, -521, 340, -521, -521,
1000 -521, 437, -521, -521, -521, -521, 15, 646, -521, 159,
1001 -521, -521, -521, -521, 340, -521, -521, -521, 12, 438,
1002 2328, -521, -521, -521, -521, -521, -13, -521, -521, 646,
1003 475, -521, -521, 476, -52, -52, -521, -521, 454, -521,
1007 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
1008 Performed when YYTABLE does not specify something else to do. Zero
1009 means the default is an error. */
1010 static const yytype_uint16 yydefact
[] =
1012 3, 0, 2, 1, 33, 380, 271, 263, 282, 0,
1013 319, 0, 0, 270, 258, 272, 315, 269, 273, 274,
1014 0, 318, 276, 283, 281, 0, 274, 0, 0, 317,
1015 0, 274, 0, 278, 316, 258, 258, 268, 379, 264,
1016 74, 12, 34, 0, 28, 13, 31, 13, 11, 0,
1017 67, 382, 0, 381, 265, 0, 0, 9, 0, 0,
1018 0, 26, 0, 301, 7, 6, 0, 10, 324, 324,
1019 324, 0, 0, 384, 324, 0, 386, 284, 285, 0,
1020 292, 293, 383, 260, 0, 275, 280, 0, 303, 304,
1021 279, 288, 0, 0, 277, 266, 385, 0, 387, 0,
1022 267, 75, 0, 77, 78, 0, 79, 80, 81, 0,
1023 0, 84, 85, 86, 87, 88, 89, 90, 91, 92,
1024 93, 0, 95, 96, 97, 0, 99, 100, 101, 0,
1025 0, 104, 105, 106, 107, 0, 0, 0, 0, 0,
1026 113, 0, 115, 116, 0, 118, 0, 120, 121, 124,
1027 0, 125, 126, 127, 128, 129, 130, 131, 132, 133,
1028 134, 135, 136, 137, 0, 139, 140, 141, 0, 0,
1029 144, 145, 146, 147, 377, 148, 0, 150, 375, 0,
1030 152, 153, 154, 0, 156, 157, 158, 0, 0, 0,
1031 0, 163, 376, 164, 0, 0, 168, 169, 0, 0,
1032 0, 0, 69, 173, 29, 66, 66, 66, 258, 0,
1033 0, 258, 258, 0, 382, 286, 294, 305, 313, 0,
1034 384, 386, 30, 8, 289, 4, 310, 0, 27, 308,
1035 309, 0, 0, 24, 328, 325, 327, 326, 261, 262,
1036 176, 177, 178, 179, 320, 0, 0, 332, 368, 331,
1037 255, 382, 384, 324, 386, 322, 32, 0, 184, 48,
1038 0, 0, 241, 0, 247, 0, 0, 0, 0, 0,
1039 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1040 0, 0, 194, 0, 0, 0, 0, 0, 194, 0,
1041 0, 0, 0, 0, 0, 0, 0, 0, 74, 68,
1042 49, 0, 21, 22, 23, 0, 19, 0, 17, 14,
1043 20, 26, 0, 67, 383, 51, 52, 311, 312, 385,
1044 387, 53, 254, 66, 3, 0, 66, 0, 0, 302,
1045 24, 66, 0, 0, 330, 0, 0, 55, 334, 323,
1046 47, 0, 186, 187, 190, 0, 388, 66, 66, 66,
1047 0, 175, 174, 0, 0, 205, 196, 197, 198, 202,
1048 203, 204, 199, 200, 0, 201, 0, 0, 0, 0,
1049 0, 0, 0, 239, 0, 237, 240, 0, 0, 72,
1050 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1051 0, 353, 0, 0, 192, 195, 0, 0, 0, 0,
1052 0, 0, 0, 0, 370, 371, 372, 373, 374, 0,
1053 0, 0, 0, 392, 394, 0, 0, 0, 70, 74,
1054 0, 18, 15, 54, 0, 26, 0, 290, 66, 295,
1055 0, 0, 0, 0, 0, 0, 66, 26, 25, 67,
1056 321, 329, 333, 369, 0, 65, 0, 0, 59, 56,
1057 57, 191, 185, 0, 36, 0, 378, 0, 242, 0,
1058 390, 67, 248, 0, 76, 167, 82, 0, 229, 228,
1059 227, 230, 225, 226, 0, 341, 0, 0, 0, 0,
1060 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1061 0, 0, 0, 0, 0, 0, 0, 0, 0, 83,
1062 94, 98, 0, 102, 103, 108, 109, 110, 111, 112,
1063 114, 117, 119, 353, 320, 55, 358, 353, 355, 354,
1064 62, 350, 123, 194, 122, 138, 142, 143, 0, 151,
1065 155, 159, 160, 162, 161, 165, 166, 0, 170, 171,
1066 172, 71, 0, 13, 361, 389, 287, 291, 5, 297,
1067 0, 384, 296, 299, 0, 0, 253, 300, 24, 26,
1068 314, 64, 63, 335, 0, 188, 189, 37, 35, 0,
1069 386, 256, 246, 245, 341, 236, 320, 55, 345, 341,
1070 342, 0, 338, 218, 219, 231, 212, 213, 216, 217,
1071 207, 208, 0, 209, 210, 211, 215, 214, 221, 220,
1072 223, 224, 222, 232, 0, 238, 73, 61, 353, 320,
1073 0, 353, 0, 349, 55, 357, 193, 0, 393, 26,
1074 66, 0, 251, 298, 66, 306, 60, 58, 363, 366,
1075 0, 244, 0, 257, 0, 341, 320, 0, 353, 0,
1076 337, 0, 55, 344, 0, 235, 348, 353, 359, 352,
1077 356, 0, 149, 50, 16, 362, 26, 0, 365, 0,
1078 243, 180, 234, 336, 353, 346, 340, 343, 233, 0,
1079 206, 351, 360, 307, 364, 367, 0, 339, 347, 0,
1080 0, 391, 181, 0, 66, 66, 250, 183, 0, 182,
1084 /* YYPGOTO[NTERM-NUM]. */
1085 static const yytype_int16 yypgoto
[] =
1087 -521, -521, 360, -521, -42, -521, -304, -291, 0, -521,
1088 -521, -521, -521, -521, 227, -521, -521, -521, 10, -472,
1089 -521, -521, -266, -218, -191, -2, -521, -521, -275, 369,
1090 -65, -521, -521, -521, -521, 216, 13, 377, 143, -242,
1091 -521, -228, -264, -521, -521, -521, -521, -18, -177, -521,
1092 237, -521, -3, -67, -521, 110, 116, 5, -521, 11,
1093 17, -521, -521, 624, -521, -521, -521, -521, -521, -33,
1094 -521, 19, 16, -521, -521, 20, -521, -521, -298, -462,
1095 -49, 32, 30, -235, -521, -521, -521, -495, -521, -520,
1096 -521, -448, -521, -521, -521, 22, -521, 456, -521, 392,
1097 1, -31, -521, 7, -521
1100 /* YYDEFGOTO[NTERM-NUM]. */
1101 static const yytype_int16 yydefgoto
[] =
1103 -1, 1, 2, 324, 205, 543, 331, 229, 302, 42,
1104 455, 43, 44, 45, 46, 303, 213, 47, 304, 447,
1105 448, 449, 450, 516, 49, 313, 201, 380, 202, 353,
1106 517, 676, 682, 341, 342, 343, 251, 393, 394, 373,
1107 374, 375, 377, 347, 458, 462, 349, 687, 688, 555,
1108 52, 632, 84, 518, 53, 86, 54, 305, 56, 306,
1109 307, 323, 427, 59, 60, 326, 433, 61, 232, 62,
1110 63, 308, 309, 218, 66, 310, 68, 69, 70, 332,
1111 71, 234, 72, 248, 249, 580, 639, 581, 582, 519,
1112 612, 520, 521, 545, 658, 629, 630, 250, 409, 203,
1113 252, 74, 75, 254, 415
1116 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
1117 positive, shift that token. If negative, reduce the rule whose
1118 number is the opposite. If YYTABLE_NINF, syntax error. */
1119 static const yytype_int16 yytable
[] =
1121 50, 219, 41, 73, 247, 206, 246, 55, 381, 76,
1122 333, 334, 48, 57, 389, 51, 312, 217, 65, 58,
1123 423, 64, 67, 418, 567, 679, 436, 376, 478, -259,
1124 376, 338, 97, 99, 440, 12, 263, 388, 680, 498,
1125 395, 253, 430, 610, 25, 382, 395, 402, 385, 628,
1126 387, 220, 608, 392, -259, 215, 174, 221, 399, 502,
1127 178, 298, 261, 214, 523, 607, 499, 659, 523, 613,
1128 351, 443, 79, 352, 325, 238, 25, 239, -259, 634,
1129 -43, 413, 414, 299, 640, 264, 503, 192, 10, 3,
1130 85, 524, 660, 376, 446, 530, 87, 441, 235, 235,
1131 235, 236, 237, -259, 235, 637, 255, 336, 91, 92,
1132 336, 240, 337, 16, 635, 614, 10, 476, 477, 478,
1133 479, 480, 481, 482, 468, 469, 470, 471, 472, 473,
1134 474, 478, 426, 93, 546, 431, 90, 40, 21, 628,
1135 663, 94, 651, 241, 541, 336, 560, 647, 95, 432,
1136 642, 40, 247, 100, 246, 686, 457, 431, 431, 77,
1137 646, 78, 238, 649, 239, 238, 40, 239, 204, 425,
1138 669, 459, 463, 40, 664, 80, 456, 81, 247, 247,
1139 246, 246, 40, 29, 82, 460, 83, 207, -38, 544,
1140 666, 344, 222, 681, 327, 34, 223, 242, 240, 671,
1141 354, 240, 471, 50, 50, 231, 73, 73, 97, 99,
1142 226, 224, 76, 76, 496, 497, 677, 257, 51, 51,
1143 478, 88, 228, 89, 243, 566, 96, 568, 83, 225,
1144 241, 391, 227, 241, 583, 584, 230, 586, 587, 588,
1145 589, 590, 591, 592, 593, 594, 595, 596, 597, 598,
1146 599, 600, 601, 602, 624, 604, 400, 578, 98, 403,
1147 83, 410, 411, 424, 244, 247, 417, 246, 625, 355,
1148 605, 233, 356, 357, 358, 359, 360, 361, 390, 258,
1149 245, 395, 260, 235, 242, 339, -40, 242, 391, 487,
1150 488, 489, 490, 491, 492, 493, 494, 495, 627, -259,
1151 617, -39, -259, 615, -41, 496, 497, 493, 494, 495,
1152 440, 243, 262, 256, 243, 622, -42, 496, 497, 476,
1153 477, 478, 314, 475, 83, 315, 259, 316, 653, 439,
1154 265, 438, 73, 266, 267, 390, 362, 440, 76, 268,
1155 317, 513, 318, 238, 51, 239, 319, 461, 83, 440,
1156 320, 514, 83, 328, 244, 329, 578, 247, 238, 246,
1157 239, 578, 336, 269, 643, 673, 440, 515, 270, 271,
1158 245, 404, 405, 406, 407, 408, -252, 240, -252, 240,
1159 40, 272, 550, 363, 10, 344, 655, 273, 274, -44,
1160 219, 275, 276, 674, 491, 492, 493, 494, 495, 668,
1161 277, 278, 670, 279, 280, 281, 496, 497, 569, 241,
1162 579, 241, 321, 282, 364, 376, -45, 578, 574, 283,
1163 284, 285, 286, 287, 8, 288, 50, 365, 41, 73,
1164 289, 554, 551, 55, 439, 76, 438, 73, 48, 57,
1165 220, 51, 547, 76, 65, 58, 221, 64, 67, 51,
1166 611, 683, 214, 366, 290, 291, 367, 368, 444, 292,
1167 293, 370, 371, 242, 570, 242, 391, 19, 294, 295,
1168 445, 296, 297, 345, 372, -46, 330, 335, 340, 346,
1169 22, 23, 24, 247, 348, 246, 350, 378, 379, 26,
1170 243, 383, 243, 431, 431, 491, 492, 493, 494, 495,
1171 384, 620, 386, 396, 633, 219, 398, 496, 497, 579,
1172 416, 419, 638, 390, 579, 391, 429, 420, 421, 422,
1173 476, 477, 478, 479, 480, 481, 482, 434, 391, 31,
1174 576, -259, 514, 33, 435, 452, 442, 240, 453, 451,
1175 454, 336, 10, 336, 464, 465, 577, 467, 515, 528,
1176 466, 500, 542, 501, 247, 504, 246, 505, 506, 549,
1177 507, 508, 390, 509, 20, 391, 510, 512, 522, 241,
1178 579, 525, 526, 527, 529, 390, 537, 532, 355, 533,
1179 5, 356, 357, 358, 359, 360, 361, 534, 535, 536,
1180 538, 539, 540, 391, 552, 557, 564, 355, 572, 563,
1181 356, 357, 358, 359, 360, 361, 571, 6, 573, 7,
1182 585, 603, 390, 606, 619, 8, 618, 621, 50, 10,
1183 623, 73, 439, 242, 438, 73, 631, 76, 657, 641,
1184 648, 76, 650, 51, 652, 13, 661, 51, 662, 665,
1185 390, 208, 15, 667, 16, 362, 672, 678, 17, 355,
1186 243, 18, 356, 357, 358, 359, 360, 361, 19, 684,
1187 685, 690, 558, 412, 362, 401, 616, 689, 565, 21,
1188 556, 22, 23, 24, 216, 322, 397, 0, 0, 0,
1189 26, 675, 0, 0, 428, 0, 0, 0, 0, 0,
1190 576, 0, 363, 488, 489, 490, 491, 492, 493, 494,
1191 495, 336, 0, 0, 0, 0, 577, 0, 496, 497,
1192 0, 363, 0, 0, 29, 0, 362, 0, 0, 30,
1193 31, 32, 0, 364, 33, 0, 34, 0, 0, 0,
1194 211, 0, 476, 477, 478, 0, 365, 481, 482, 212,
1195 0, 37, 364, 0, 0, 0, 0, 0, 0, 38,
1196 39, 0, 0, 0, 0, 365, 0, 0, 0, 0,
1197 0, 0, 366, 363, 0, 367, 368, 369, 0, 0,
1198 370, 371, 0, 0, 0, 0, 0, 0, 0, 0,
1199 0, 366, 0, 372, 367, 368, 369, 0, 0, 370,
1200 371, 0, 0, 0, 364, 4, 5, 0, 561, 0,
1201 0, 0, 372, 0, 0, 0, 0, 365, 0, 0,
1202 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1203 0, 0, 0, 6, 0, 7, 0, 0, 0, 0,
1204 0, 8, 9, 366, 0, 10, 367, 368, 369, 0,
1205 11, 370, 371, 0, 0, 0, 0, 0, 0, 12,
1206 0, 13, 0, 0, 372, 0, 0, 14, 15, 0,
1207 16, 0, 0, 0, 17, 0, 0, 18, 0, 0,
1208 0, 0, 0, 0, 19, 0, 0, 0, 0, 0,
1209 0, 20, 301, 0, 0, 21, 0, 22, 23, 24,
1210 25, 0, 0, 0, 0, 0, 26, 0, 0, 0,
1211 0, 27, 0, 0, 0, 0, 489, 490, 491, 492,
1212 493, 494, 495, 4, 5, 0, 0, 0, 28, 0,
1213 496, 497, 0, 0, 0, 0, 0, 0, 0, 0,
1214 29, 0, 0, 0, 0, 30, 31, 32, 0, 0,
1215 33, 6, 34, 7, 0, 0, 35, 0, 0, 8,
1216 9, 0, 0, 10, 0, 36, 0, 37, 11, 0,
1217 0, 0, 0, 0, 0, 38, 39, 12, 0, 13,
1218 0, 0, 0, 0, 0, 14, 15, 0, 16, 0,
1219 0, 0, 17, 0, 0, 18, 0, 0, 0, 0,
1220 0, 0, 19, 0, 40, 0, 0, 311, 0, 20,
1221 301, 0, 0, 21, 0, 22, 23, 24, 25, 0,
1222 0, 0, 0, 0, 26, 0, 0, 0, 0, 27,
1223 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1224 0, 4, 5, 0, 0, 0, 28, 0, 0, 0,
1225 0, 0, 0, 0, 0, 0, 0, 0, 29, 0,
1226 0, 0, 0, 30, 31, 32, 0, 0, 33, 6,
1227 34, 7, 0, 0, 35, 0, 0, 8, 9, 0,
1228 0, 10, 0, 36, 0, 37, 11, 0, 0, 0,
1229 0, 0, 0, 38, 39, 12, 0, 13, 0, 0,
1230 0, 0, 0, 14, 15, 0, 16, 0, 0, 0,
1231 17, 0, 0, 18, 0, 0, 0, 0, 0, 0,
1232 19, 0, 40, 0, 0, 654, 0, 20, 0, 0,
1233 0, 21, 0, 22, 23, 24, 25, 0, 0, 0,
1234 0, 0, 26, 0, 4, 5, 0, 27, 0, 0,
1235 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1236 0, 0, 0, 0, 28, 0, 0, 0, 0, 0,
1237 0, 0, 6, 0, 7, 0, 29, 0, 0, 0,
1238 8, 30, 31, 32, 10, 0, 33, 0, 34, 11,
1239 0, 0, 35, 0, 0, 0, 0, 0, 0, 0,
1240 13, 36, 0, 37, 0, 0, 14, 15, 0, 16,
1241 0, 38, 39, 17, 0, 0, 18, 0, 0, 0,
1242 0, 0, 0, 19, 0, 0, 0, 0, 0, 0,
1243 20, 0, 0, 0, 21, 0, 22, 23, 24, 0,
1244 40, 0, 0, 548, 0, 26, 0, 4, 5, 0,
1245 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1246 0, 0, 0, 0, 0, 0, 0, 28, 0, 0,
1247 0, 0, 0, 0, 0, 6, 0, 7, 0, 29,
1248 0, 0, 0, 8, 30, 31, 32, 10, 0, 33,
1249 0, 34, 11, 0, 0, 35, 0, 0, 0, 0,
1250 0, 0, 0, 13, 36, 0, 37, 0, 0, 14,
1251 15, 0, 16, 0, 38, 39, 17, 0, 0, 18,
1252 0, 0, 0, 0, 0, 0, 19, 0, 0, 0,
1253 0, 0, 0, 20, 0, 0, 0, 21, 0, 22,
1254 23, 24, 0, 40, 0, 0, 437, 0, 26, 0,
1255 4, 5, 0, 0, 0, 0, 0, 0, 476, 477,
1256 478, 479, 480, 481, 482, 483, 484, 0, 0, 0,
1257 28, 0, 0, 0, 0, 0, 0, 0, 6, 0,
1258 7, 0, 29, 0, 0, 0, 8, 30, 31, 32,
1259 10, 0, 33, 0, 34, 11, 0, 0, 35, 0,
1260 0, 0, 0, 0, 0, 0, 13, 36, 0, 37,
1261 0, 0, 14, 15, 0, 16, 0, 38, 39, 17,
1262 0, 0, 18, 0, 0, 5, 0, 0, 0, 19,
1263 0, 0, 0, 0, 0, 0, 20, 0, 0, 0,
1264 21, 0, 22, 23, 24, 0, 40, 0, 0, 559,
1265 0, 26, 6, 0, 7, 0, 0, 0, 0, 0,
1266 8, 0, 0, 0, 10, 0, 0, 0, 0, 0,
1267 0, 0, 0, 28, 0, 0, 0, 0, 0, 0,
1268 13, 0, 0, 0, 0, 29, 208, 15, 0, 16,
1269 30, 31, 32, 17, 0, 33, 18, 34, 0, 0,
1270 0, 35, 0, 19, 0, 0, 0, 0, 0, 0,
1271 36, 0, 37, 0, 21, 0, 22, 23, 24, 0,
1272 38, 39, 0, 0, 0, 26, 0, 485, 0, 486,
1273 487, 488, 489, 490, 491, 492, 493, 494, 495, 0,
1274 0, 0, 4, 5, 0, 0, 496, 497, 0, 40,
1275 0, 300, 656, 511, 0, 0, 0, 0, 0, 29,
1276 0, 0, 0, 0, 30, 31, 32, 0, 0, 33,
1277 6, 34, 7, 0, 0, 211, 0, 0, 8, 9,
1278 0, 0, 10, 0, 212, 0, 37, 11, 0, 0,
1279 0, 0, 0, 0, 38, 39, 12, 0, 13, 0,
1280 0, 0, 0, 0, 14, 15, 0, 16, 0, 0,
1281 0, 17, 0, 0, 18, 0, 0, 0, 0, 0,
1282 0, 19, 0, 40, 0, 0, 553, 0, 20, 301,
1283 0, 0, 21, 0, 22, 23, 24, 25, 0, 0,
1284 0, 0, 0, 26, 0, 0, 0, 0, 27, 0,
1285 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1286 4, 5, 0, 0, 0, 28, 0, 0, 0, 0,
1287 0, 0, 0, 0, 0, 0, 0, 29, 0, 0,
1288 0, 0, 30, 31, 32, 0, 0, 33, 6, 34,
1289 7, 0, 0, 35, 0, 0, 8, 9, 0, 0,
1290 10, 0, 36, 0, 37, 11, 0, 0, 0, 0,
1291 0, 0, 38, 39, 12, 0, 13, 0, 0, 0,
1292 0, 0, 14, 15, 0, 16, 0, 0, 0, 17,
1293 0, 0, 18, 0, 0, 0, 0, 0, 0, 19,
1294 0, 40, 0, 0, 0, 0, 20, 0, 0, 0,
1295 21, 0, 22, 23, 24, 25, 0, 0, 0, 0,
1296 0, 26, 0, 0, 0, 0, 27, 0, 0, 0,
1297 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1298 0, 0, 0, 28, 0, 0, 0, 0, 0, 0,
1299 5, 0, 0, 0, 0, 29, 0, 0, 0, 0,
1300 30, 31, 32, 0, 0, 33, 0, 34, 0, 0,
1301 0, 35, 0, 0, 0, 0, 0, 6, -66, 7,
1302 36, 0, 37, 0, 240, 8, 0, 0, 0, 10,
1303 38, 39, 0, 0, 0, 0, 0, 0, 0, 0,
1304 0, 0, 0, 0, 0, 13, 0, 0, 0, 0,
1305 0, 208, 15, 0, 16, 0, 241, 0, 17, 40,
1306 0, 18, 0, 0, 0, 0, 0, 0, 19, 0,
1307 0, 0, 0, 0, 0, 0, 0, 0, 0, 21,
1308 0, 22, 23, 24, 0, 0, 0, 0, 0, 0,
1309 26, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1310 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1311 242, 0, 0, 0, 0, 0, 0, 0, 5, 0,
1312 0, 0, 0, 0, 29, 0, 0, 0, 0, 30,
1313 31, 32, 0, 0, 33, 0, 34, 243, 0, 0,
1314 211, 0, 0, 0, 0, 6, 0, 7, 0, 212,
1315 0, 37, 240, 8, 0, 0, 0, 10, 0, 38,
1316 39, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1317 0, 0, 0, 13, 0, 0, 0, 609, 0, 208,
1318 15, 0, 16, 0, 241, 0, 17, 0, 40, 18,
1319 0, 0, 0, 0, 0, 0, 19, 0, 0, 0,
1320 0, 0, 0, 0, 0, 0, 0, 21, 0, 22,
1321 23, 24, 0, 0, 0, 0, 0, 0, 26, 0,
1322 0, 5, 0, 0, 0, 476, 477, 478, 479, 480,
1323 481, 482, 483, 484, 0, 0, 0, 0, 242, 626,
1324 0, 0, 0, 0, 0, 0, 0, 0, 6, 0,
1325 7, 0, 29, 0, 0, 0, 8, 30, 31, 32,
1326 10, 0, 33, 0, 34, 243, 0, 0, 211, 0,
1327 0, 0, 0, 0, 0, 0, 13, 212, 0, 37,
1328 0, 0, 208, 15, 0, 16, 0, 38, 39, 17,
1329 0, 0, 18, 0, 0, 5, 0, 0, 0, 19,
1330 0, 0, 0, 0, 0, 636, 0, 0, 0, 0,
1331 21, 0, 22, 23, 24, 0, 40, 0, 0, 0,
1332 0, 26, 6, 0, 7, 0, 0, 0, 0, 0,
1333 8, 0, 0, 0, 10, 476, 477, 478, 479, 480,
1334 481, 482, 483, 484, 0, 0, 0, 0, 0, 0,
1335 13, 0, 0, 0, 0, 29, 208, 15, 0, 16,
1336 30, 31, 32, 17, 0, 33, 18, 34, 0, 0,
1337 0, 211, 0, 19, 0, 0, 0, 0, 0, 0,
1338 212, 0, 37, 0, 21, 0, 22, 23, 24, 0,
1339 38, 39, 0, 0, 485, 26, 486, 487, 488, 489,
1340 490, 491, 492, 493, 494, 495, 0, 0, 0, 0,
1341 0, 0, 0, 496, 497, 0, 0, 0, 0, 40,
1342 531, 0, 476, 477, 478, 479, 480, 481, 482, 29,
1343 484, 0, 0, 0, 30, 31, 32, 0, 0, 33,
1344 0, 34, 0, 0, 0, 211, 0, 0, 0, 0,
1345 0, 0, 0, 0, 212, 0, 37, 0, 0, 0,
1346 0, 0, 0, 0, 38, 39, 476, 477, 478, 479,
1347 480, 481, 482, 483, 484, 0, 0, 0, 0, 0,
1348 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1349 0, 0, 0, 40, 476, 477, 478, 479, 480, 481,
1350 482, 483, 484, 0, 485, 0, 486, 487, 488, 489,
1351 490, 491, 492, 493, 494, 495, 0, 0, 0, 0,
1352 0, 0, 0, 496, 497, 0, 0, 0, 0, 0,
1353 575, 476, 477, 478, 479, 480, 481, 482, 483, 484,
1354 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1355 0, 0, 476, 477, 478, 479, 480, 481, 482, 483,
1356 484, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1357 0, 476, 477, 478, 479, 480, 481, 482, 476, 477,
1358 478, 479, 480, 481, 482, 0, 0, 0, 0, 0,
1359 0, 0, 0, 486, 487, 488, 489, 490, 491, 492,
1360 493, 494, 495, 0, 0, 0, 0, 0, 0, 0,
1361 496, 497, 0, 0, 0, 0, 0, 0, 0, 0,
1362 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1363 0, 0, 0, 0, 0, 485, 0, 486, 487, 488,
1364 489, 490, 491, 492, 493, 494, 495, 0, 0, 0,
1365 0, 0, 0, 0, 496, 497, 562, 0, 0, 0,
1366 0, 0, 0, 485, 0, 486, 487, 488, 489, 490,
1367 491, 492, 493, 494, 495, 0, 0, 0, 0, 0,
1368 0, 0, 496, 497, 645, 0, 0, 0, 0, 0,
1369 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1370 485, 644, 486, 487, 488, 489, 490, 491, 492, 493,
1371 494, 495, 0, 0, 0, 0, 0, 0, 0, 496,
1372 497, 485, 0, 486, 487, 488, 489, 490, 491, 492,
1373 493, 494, 495, 0, 5, 0, 0, 0, 0, 0,
1374 496, 497, 486, 487, 488, 489, 490, 491, 492, 493,
1375 494, 495, 489, 490, 491, 492, 493, 494, 495, 496,
1376 497, 6, 0, 7, 0, 0, 496, 497, 0, 8,
1377 9, 0, 0, 10, 0, 0, 0, 0, 0, 0,
1378 0, 0, 0, 0, 0, 0, 0, 12, 0, 13,
1379 0, 0, 0, 0, 0, 208, 15, 0, 16, 0,
1380 0, 0, 17, 0, 0, 18, 0, 0, 5, 0,
1381 0, 0, 19, 0, 0, 0, 0, 0, 0, 0,
1382 0, 0, 0, 21, 0, 22, 23, 24, 25, 0,
1383 0, 209, 0, 0, 26, 6, 0, 7, 210, 0,
1384 0, 0, 0, 8, 0, 0, 0, 10, 0, 0,
1385 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1386 0, 0, 0, 13, 0, 0, 0, 0, 29, 208,
1387 15, 0, 16, 30, 31, 32, 17, 0, 33, 18,
1388 34, 0, 5, 0, 211, 0, 19, 0, 0, 0,
1389 0, 0, 0, 212, 0, 37, 0, 21, 0, 22,
1390 23, 24, 0, 38, 39, 0, 0, 0, 26, 6,
1391 0, 7, 0, 0, 0, 0, 0, 8, 0, 0,
1392 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1393 0, 0, 0, 0, 0, 0, 0, 13, 0, 0,
1394 0, 0, 29, 208, 15, 0, 0, 30, 31, 32,
1395 17, 0, 33, 18, 34, 0, 0, 0, 211, 0,
1396 19, 0, 0, 0, 0, 0, 0, 212, 0, 37,
1397 0, 0, 0, 22, 23, 24, 0, 38, 39, 0,
1398 0, 0, 26, 0, 0, 0, 0, 0, 0, 0,
1399 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1400 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1401 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1402 0, 30, 31, 32, 0, 0, 33, 0, 0, 0,
1403 0, 0, 211, 0, 0, 0, 0, 0, 0, 0,
1404 0, 212, 0, 37, 0, 0, 0, 0, 0, 0,
1405 0, 38, 39, 101, 0, 102, 103, 104, 105, 106,
1406 107, 0, 108, 0, 0, 109, 0, 110, 0, 0,
1407 0, 111, 112, 0, 113, 114, 115, 116, 0, 117,
1408 118, 119, 120, 121, 122, 123, 124, 0, 125, 0,
1409 126, 127, 128, 129, 130, 0, 0, 131, 0, 0,
1410 0, 132, 0, 133, 134, 0, 135, 136, 137, 138,
1411 139, 140, 0, 141, 142, 143, 144, 145, 146, 0,
1412 0, 147, 0, 0, 148, 0, 0, 0, 0, 149,
1413 150, 0, 151, 152, 0, 153, 154, 0, 0, 0,
1414 155, 156, 157, 158, 159, 160, 0, 161, 162, 163,
1415 164, 165, 166, 167, 0, 168, 0, 169, 0, 170,
1416 171, 172, 173, 174, 175, 176, 177, 178, 0, 179,
1417 180, 181, 182, 0, 0, 0, 183, 0, 0, 184,
1418 0, 0, 185, 186, 0, 0, 187, 188, 189, 190,
1419 0, 0, 191, 0, 192, 0, 193, 194, 195, 196,
1420 197, 198, 199, 0, 0, 200
1423 static const yytype_int16 yycheck
[] =
1425 2, 50, 2, 2, 71, 47, 71, 2, 272, 2,
1426 245, 246, 2, 2, 280, 2, 207, 50, 2, 2,
1427 311, 2, 2, 298, 6, 38, 330, 269, 16, 156,
1428 272, 249, 35, 36, 332, 58, 156, 279, 51, 182,
1429 282, 72, 108, 515, 99, 273, 288, 289, 276, 569,
1430 278, 50, 514, 281, 156, 50, 134, 50, 286, 182,
1431 138, 182, 93, 50, 182, 513, 209, 182, 182, 517,
1432 9, 335, 208, 12, 129, 3, 99, 5, 205, 574,
1433 207, 6, 7, 204, 579, 205, 209, 165, 44, 0,
1434 96, 209, 207, 335, 336, 209, 9, 332, 68, 69,
1435 70, 69, 70, 205, 74, 577, 74, 203, 3, 208,
1436 203, 39, 208, 69, 576, 208, 44, 14, 15, 16,
1437 17, 18, 19, 20, 366, 367, 368, 369, 370, 371,
1438 372, 16, 323, 208, 425, 326, 26, 203, 94, 659,
1439 635, 31, 614, 71, 419, 203, 437, 609, 32, 326,
1440 208, 203, 219, 37, 219, 207, 347, 348, 349, 3,
1441 608, 5, 3, 611, 5, 3, 203, 5, 207, 206,
1442 642, 348, 349, 203, 636, 3, 206, 5, 245, 246,
1443 245, 246, 203, 139, 3, 206, 5, 162, 207, 424,
1444 638, 258, 207, 206, 227, 151, 207, 125, 39, 647,
1445 267, 39, 444, 205, 206, 184, 205, 206, 211, 212,
1446 207, 205, 205, 206, 202, 203, 664, 9, 205, 206,
1447 16, 3, 207, 5, 152, 453, 3, 209, 5, 205,
1448 71, 280, 205, 71, 476, 477, 207, 479, 480, 481,
1449 482, 483, 484, 485, 486, 487, 488, 489, 490, 491,
1450 492, 493, 494, 495, 558, 497, 287, 475, 3, 290,
1451 5, 292, 293, 312, 192, 332, 297, 332, 559, 3,
1452 498, 205, 6, 7, 8, 9, 10, 11, 280, 205,
1453 208, 523, 3, 253, 125, 253, 207, 125, 337, 186,
1454 187, 188, 189, 190, 191, 192, 193, 194, 564, 205,
1455 528, 207, 205, 521, 207, 202, 203, 192, 193, 194,
1456 608, 152, 205, 207, 152, 550, 207, 202, 203, 14,
1457 15, 16, 3, 372, 5, 3, 207, 5, 619, 331,
1458 208, 331, 331, 208, 208, 337, 70, 635, 331, 208,
1459 3, 390, 5, 3, 331, 5, 3, 349, 5, 647,
1460 3, 192, 5, 3, 192, 5, 574, 424, 3, 424,
1461 5, 579, 203, 208, 582, 656, 664, 208, 208, 208,
1462 208, 177, 178, 179, 180, 181, 207, 39, 209, 39,
1463 203, 208, 431, 117, 44, 452, 621, 208, 208, 207,
1464 439, 208, 208, 657, 190, 191, 192, 193, 194, 641,
1465 208, 208, 644, 208, 208, 208, 202, 203, 457, 71,
1466 475, 71, 205, 208, 148, 657, 207, 635, 467, 208,
1467 208, 208, 208, 208, 40, 208, 428, 161, 428, 428,
1468 208, 433, 431, 428, 436, 428, 436, 436, 428, 428,
1469 439, 428, 426, 436, 428, 428, 439, 428, 428, 436,
1470 515, 679, 439, 187, 208, 208, 190, 191, 192, 208,
1471 208, 195, 196, 125, 457, 125, 515, 83, 208, 208,
1472 204, 208, 208, 184, 208, 207, 205, 210, 209, 209,
1473 96, 97, 98, 550, 208, 550, 9, 9, 9, 105,
1474 152, 9, 152, 684, 685, 190, 191, 192, 193, 194,
1475 9, 543, 9, 9, 571, 554, 9, 202, 203, 574,
1476 9, 203, 577, 515, 579, 564, 184, 208, 207, 205,
1477 14, 15, 16, 17, 18, 19, 20, 207, 577, 145,
1478 192, 205, 192, 149, 205, 182, 209, 39, 210, 206,
1479 6, 203, 44, 203, 209, 209, 208, 208, 208, 182,
1480 209, 209, 9, 209, 621, 209, 621, 209, 209, 184,
1481 209, 209, 564, 209, 90, 614, 209, 209, 209, 71,
1482 635, 209, 209, 209, 209, 577, 202, 209, 3, 209,
1483 5, 6, 7, 8, 9, 10, 11, 209, 209, 209,
1484 209, 209, 209, 642, 207, 206, 182, 3, 207, 209,
1485 6, 7, 8, 9, 10, 11, 209, 32, 207, 34,
1486 3, 3, 614, 9, 209, 40, 6, 182, 620, 44,
1487 207, 620, 624, 125, 624, 624, 207, 620, 184, 209,
1488 209, 624, 209, 620, 209, 60, 205, 624, 209, 209,
1489 642, 66, 67, 209, 69, 70, 209, 209, 73, 3,
1490 152, 76, 6, 7, 8, 9, 10, 11, 83, 184,
1491 184, 207, 435, 294, 70, 288, 523, 685, 452, 94,
1492 433, 96, 97, 98, 50, 219, 284, -1, -1, -1,
1493 105, 659, -1, -1, 324, -1, -1, -1, -1, -1,
1494 192, -1, 117, 187, 188, 189, 190, 191, 192, 193,
1495 194, 203, -1, -1, -1, -1, 208, -1, 202, 203,
1496 -1, 117, -1, -1, 139, -1, 70, -1, -1, 144,
1497 145, 146, -1, 148, 149, -1, 151, -1, -1, -1,
1498 155, -1, 14, 15, 16, -1, 161, 19, 20, 164,
1499 -1, 166, 148, -1, -1, -1, -1, -1, -1, 174,
1500 175, -1, -1, -1, -1, 161, -1, -1, -1, -1,
1501 -1, -1, 187, 117, -1, 190, 191, 192, -1, -1,
1502 195, 196, -1, -1, -1, -1, -1, -1, -1, -1,
1503 -1, 187, -1, 208, 190, 191, 192, -1, -1, 195,
1504 196, -1, -1, -1, 148, 4, 5, -1, 204, -1,
1505 -1, -1, 208, -1, -1, -1, -1, 161, -1, -1,
1506 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1507 -1, -1, -1, 32, -1, 34, -1, -1, -1, -1,
1508 -1, 40, 41, 187, -1, 44, 190, 191, 192, -1,
1509 49, 195, 196, -1, -1, -1, -1, -1, -1, 58,
1510 -1, 60, -1, -1, 208, -1, -1, 66, 67, -1,
1511 69, -1, -1, -1, 73, -1, -1, 76, -1, -1,
1512 -1, -1, -1, -1, 83, -1, -1, -1, -1, -1,
1513 -1, 90, 91, -1, -1, 94, -1, 96, 97, 98,
1514 99, -1, -1, -1, -1, -1, 105, -1, -1, -1,
1515 -1, 110, -1, -1, -1, -1, 188, 189, 190, 191,
1516 192, 193, 194, 4, 5, -1, -1, -1, 127, -1,
1517 202, 203, -1, -1, -1, -1, -1, -1, -1, -1,
1518 139, -1, -1, -1, -1, 144, 145, 146, -1, -1,
1519 149, 32, 151, 34, -1, -1, 155, -1, -1, 40,
1520 41, -1, -1, 44, -1, 164, -1, 166, 49, -1,
1521 -1, -1, -1, -1, -1, 174, 175, 58, -1, 60,
1522 -1, -1, -1, -1, -1, 66, 67, -1, 69, -1,
1523 -1, -1, 73, -1, -1, 76, -1, -1, -1, -1,
1524 -1, -1, 83, -1, 203, -1, -1, 206, -1, 90,
1525 91, -1, -1, 94, -1, 96, 97, 98, 99, -1,
1526 -1, -1, -1, -1, 105, -1, -1, -1, -1, 110,
1527 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1528 -1, 4, 5, -1, -1, -1, 127, -1, -1, -1,
1529 -1, -1, -1, -1, -1, -1, -1, -1, 139, -1,
1530 -1, -1, -1, 144, 145, 146, -1, -1, 149, 32,
1531 151, 34, -1, -1, 155, -1, -1, 40, 41, -1,
1532 -1, 44, -1, 164, -1, 166, 49, -1, -1, -1,
1533 -1, -1, -1, 174, 175, 58, -1, 60, -1, -1,
1534 -1, -1, -1, 66, 67, -1, 69, -1, -1, -1,
1535 73, -1, -1, 76, -1, -1, -1, -1, -1, -1,
1536 83, -1, 203, -1, -1, 206, -1, 90, -1, -1,
1537 -1, 94, -1, 96, 97, 98, 99, -1, -1, -1,
1538 -1, -1, 105, -1, 4, 5, -1, 110, -1, -1,
1539 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1540 -1, -1, -1, -1, 127, -1, -1, -1, -1, -1,
1541 -1, -1, 32, -1, 34, -1, 139, -1, -1, -1,
1542 40, 144, 145, 146, 44, -1, 149, -1, 151, 49,
1543 -1, -1, 155, -1, -1, -1, -1, -1, -1, -1,
1544 60, 164, -1, 166, -1, -1, 66, 67, -1, 69,
1545 -1, 174, 175, 73, -1, -1, 76, -1, -1, -1,
1546 -1, -1, -1, 83, -1, -1, -1, -1, -1, -1,
1547 90, -1, -1, -1, 94, -1, 96, 97, 98, -1,
1548 203, -1, -1, 206, -1, 105, -1, 4, 5, -1,
1549 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1550 -1, -1, -1, -1, -1, -1, -1, 127, -1, -1,
1551 -1, -1, -1, -1, -1, 32, -1, 34, -1, 139,
1552 -1, -1, -1, 40, 144, 145, 146, 44, -1, 149,
1553 -1, 151, 49, -1, -1, 155, -1, -1, -1, -1,
1554 -1, -1, -1, 60, 164, -1, 166, -1, -1, 66,
1555 67, -1, 69, -1, 174, 175, 73, -1, -1, 76,
1556 -1, -1, -1, -1, -1, -1, 83, -1, -1, -1,
1557 -1, -1, -1, 90, -1, -1, -1, 94, -1, 96,
1558 97, 98, -1, 203, -1, -1, 206, -1, 105, -1,
1559 4, 5, -1, -1, -1, -1, -1, -1, 14, 15,
1560 16, 17, 18, 19, 20, 21, 22, -1, -1, -1,
1561 127, -1, -1, -1, -1, -1, -1, -1, 32, -1,
1562 34, -1, 139, -1, -1, -1, 40, 144, 145, 146,
1563 44, -1, 149, -1, 151, 49, -1, -1, 155, -1,
1564 -1, -1, -1, -1, -1, -1, 60, 164, -1, 166,
1565 -1, -1, 66, 67, -1, 69, -1, 174, 175, 73,
1566 -1, -1, 76, -1, -1, 5, -1, -1, -1, 83,
1567 -1, -1, -1, -1, -1, -1, 90, -1, -1, -1,
1568 94, -1, 96, 97, 98, -1, 203, -1, -1, 206,
1569 -1, 105, 32, -1, 34, -1, -1, -1, -1, -1,
1570 40, -1, -1, -1, 44, -1, -1, -1, -1, -1,
1571 -1, -1, -1, 127, -1, -1, -1, -1, -1, -1,
1572 60, -1, -1, -1, -1, 139, 66, 67, -1, 69,
1573 144, 145, 146, 73, -1, 149, 76, 151, -1, -1,
1574 -1, 155, -1, 83, -1, -1, -1, -1, -1, -1,
1575 164, -1, 166, -1, 94, -1, 96, 97, 98, -1,
1576 174, 175, -1, -1, -1, 105, -1, 183, -1, 185,
1577 186, 187, 188, 189, 190, 191, 192, 193, 194, -1,
1578 -1, -1, 4, 5, -1, -1, 202, 203, -1, 203,
1579 -1, 13, 206, 209, -1, -1, -1, -1, -1, 139,
1580 -1, -1, -1, -1, 144, 145, 146, -1, -1, 149,
1581 32, 151, 34, -1, -1, 155, -1, -1, 40, 41,
1582 -1, -1, 44, -1, 164, -1, 166, 49, -1, -1,
1583 -1, -1, -1, -1, 174, 175, 58, -1, 60, -1,
1584 -1, -1, -1, -1, 66, 67, -1, 69, -1, -1,
1585 -1, 73, -1, -1, 76, -1, -1, -1, -1, -1,
1586 -1, 83, -1, 203, -1, -1, 206, -1, 90, 91,
1587 -1, -1, 94, -1, 96, 97, 98, 99, -1, -1,
1588 -1, -1, -1, 105, -1, -1, -1, -1, 110, -1,
1589 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1590 4, 5, -1, -1, -1, 127, -1, -1, -1, -1,
1591 -1, -1, -1, -1, -1, -1, -1, 139, -1, -1,
1592 -1, -1, 144, 145, 146, -1, -1, 149, 32, 151,
1593 34, -1, -1, 155, -1, -1, 40, 41, -1, -1,
1594 44, -1, 164, -1, 166, 49, -1, -1, -1, -1,
1595 -1, -1, 174, 175, 58, -1, 60, -1, -1, -1,
1596 -1, -1, 66, 67, -1, 69, -1, -1, -1, 73,
1597 -1, -1, 76, -1, -1, -1, -1, -1, -1, 83,
1598 -1, 203, -1, -1, -1, -1, 90, -1, -1, -1,
1599 94, -1, 96, 97, 98, 99, -1, -1, -1, -1,
1600 -1, 105, -1, -1, -1, -1, 110, -1, -1, -1,
1601 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1602 -1, -1, -1, 127, -1, -1, -1, -1, -1, -1,
1603 5, -1, -1, -1, -1, 139, -1, -1, -1, -1,
1604 144, 145, 146, -1, -1, 149, -1, 151, -1, -1,
1605 -1, 155, -1, -1, -1, -1, -1, 32, 162, 34,
1606 164, -1, 166, -1, 39, 40, -1, -1, -1, 44,
1607 174, 175, -1, -1, -1, -1, -1, -1, -1, -1,
1608 -1, -1, -1, -1, -1, 60, -1, -1, -1, -1,
1609 -1, 66, 67, -1, 69, -1, 71, -1, 73, 203,
1610 -1, 76, -1, -1, -1, -1, -1, -1, 83, -1,
1611 -1, -1, -1, -1, -1, -1, -1, -1, -1, 94,
1612 -1, 96, 97, 98, -1, -1, -1, -1, -1, -1,
1613 105, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1614 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1615 125, -1, -1, -1, -1, -1, -1, -1, 5, -1,
1616 -1, -1, -1, -1, 139, -1, -1, -1, -1, 144,
1617 145, 146, -1, -1, 149, -1, 151, 152, -1, -1,
1618 155, -1, -1, -1, -1, 32, -1, 34, -1, 164,
1619 -1, 166, 39, 40, -1, -1, -1, 44, -1, 174,
1620 175, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1621 -1, -1, -1, 60, -1, -1, -1, 192, -1, 66,
1622 67, -1, 69, -1, 71, -1, 73, -1, 203, 76,
1623 -1, -1, -1, -1, -1, -1, 83, -1, -1, -1,
1624 -1, -1, -1, -1, -1, -1, -1, 94, -1, 96,
1625 97, 98, -1, -1, -1, -1, -1, -1, 105, -1,
1626 -1, 5, -1, -1, -1, 14, 15, 16, 17, 18,
1627 19, 20, 21, 22, -1, -1, -1, -1, 125, 23,
1628 -1, -1, -1, -1, -1, -1, -1, -1, 32, -1,
1629 34, -1, 139, -1, -1, -1, 40, 144, 145, 146,
1630 44, -1, 149, -1, 151, 152, -1, -1, 155, -1,
1631 -1, -1, -1, -1, -1, -1, 60, 164, -1, 166,
1632 -1, -1, 66, 67, -1, 69, -1, 174, 175, 73,
1633 -1, -1, 76, -1, -1, 5, -1, -1, -1, 83,
1634 -1, -1, -1, -1, -1, 192, -1, -1, -1, -1,
1635 94, -1, 96, 97, 98, -1, 203, -1, -1, -1,
1636 -1, 105, 32, -1, 34, -1, -1, -1, -1, -1,
1637 40, -1, -1, -1, 44, 14, 15, 16, 17, 18,
1638 19, 20, 21, 22, -1, -1, -1, -1, -1, -1,
1639 60, -1, -1, -1, -1, 139, 66, 67, -1, 69,
1640 144, 145, 146, 73, -1, 149, 76, 151, -1, -1,
1641 -1, 155, -1, 83, -1, -1, -1, -1, -1, -1,
1642 164, -1, 166, -1, 94, -1, 96, 97, 98, -1,
1643 174, 175, -1, -1, 183, 105, 185, 186, 187, 188,
1644 189, 190, 191, 192, 193, 194, -1, -1, -1, -1,
1645 -1, -1, -1, 202, 203, -1, -1, -1, -1, 203,
1646 209, -1, 14, 15, 16, 17, 18, 19, 20, 139,
1647 22, -1, -1, -1, 144, 145, 146, -1, -1, 149,
1648 -1, 151, -1, -1, -1, 155, -1, -1, -1, -1,
1649 -1, -1, -1, -1, 164, -1, 166, -1, -1, -1,
1650 -1, -1, -1, -1, 174, 175, 14, 15, 16, 17,
1651 18, 19, 20, 21, 22, -1, -1, -1, -1, -1,
1652 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1653 -1, -1, -1, 203, 14, 15, 16, 17, 18, 19,
1654 20, 21, 22, -1, 183, -1, 185, 186, 187, 188,
1655 189, 190, 191, 192, 193, 194, -1, -1, -1, -1,
1656 -1, -1, -1, 202, 203, -1, -1, -1, -1, -1,
1657 209, 14, 15, 16, 17, 18, 19, 20, 21, 22,
1658 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1659 -1, -1, 14, 15, 16, 17, 18, 19, 20, 21,
1660 22, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1661 -1, 14, 15, 16, 17, 18, 19, 20, 14, 15,
1662 16, 17, 18, 19, 20, -1, -1, -1, -1, -1,
1663 -1, -1, -1, 185, 186, 187, 188, 189, 190, 191,
1664 192, 193, 194, -1, -1, -1, -1, -1, -1, -1,
1665 202, 203, -1, -1, -1, -1, -1, -1, -1, -1,
1666 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1667 -1, -1, -1, -1, -1, 183, -1, 185, 186, 187,
1668 188, 189, 190, 191, 192, 193, 194, -1, -1, -1,
1669 -1, -1, -1, -1, 202, 203, 204, -1, -1, -1,
1670 -1, -1, -1, 183, -1, 185, 186, 187, 188, 189,
1671 190, 191, 192, 193, 194, -1, -1, -1, -1, -1,
1672 -1, -1, 202, 203, 204, -1, -1, -1, -1, -1,
1673 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1674 183, 184, 185, 186, 187, 188, 189, 190, 191, 192,
1675 193, 194, -1, -1, -1, -1, -1, -1, -1, 202,
1676 203, 183, -1, 185, 186, 187, 188, 189, 190, 191,
1677 192, 193, 194, -1, 5, -1, -1, -1, -1, -1,
1678 202, 203, 185, 186, 187, 188, 189, 190, 191, 192,
1679 193, 194, 188, 189, 190, 191, 192, 193, 194, 202,
1680 203, 32, -1, 34, -1, -1, 202, 203, -1, 40,
1681 41, -1, -1, 44, -1, -1, -1, -1, -1, -1,
1682 -1, -1, -1, -1, -1, -1, -1, 58, -1, 60,
1683 -1, -1, -1, -1, -1, 66, 67, -1, 69, -1,
1684 -1, -1, 73, -1, -1, 76, -1, -1, 5, -1,
1685 -1, -1, 83, -1, -1, -1, -1, -1, -1, -1,
1686 -1, -1, -1, 94, -1, 96, 97, 98, 99, -1,
1687 -1, 102, -1, -1, 105, 32, -1, 34, 109, -1,
1688 -1, -1, -1, 40, -1, -1, -1, 44, -1, -1,
1689 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1690 -1, -1, -1, 60, -1, -1, -1, -1, 139, 66,
1691 67, -1, 69, 144, 145, 146, 73, -1, 149, 76,
1692 151, -1, 5, -1, 155, -1, 83, -1, -1, -1,
1693 -1, -1, -1, 164, -1, 166, -1, 94, -1, 96,
1694 97, 98, -1, 174, 175, -1, -1, -1, 105, 32,
1695 -1, 34, -1, -1, -1, -1, -1, 40, -1, -1,
1696 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1697 -1, -1, -1, -1, -1, -1, -1, 60, -1, -1,
1698 -1, -1, 139, 66, 67, -1, -1, 144, 145, 146,
1699 73, -1, 149, 76, 151, -1, -1, -1, 155, -1,
1700 83, -1, -1, -1, -1, -1, -1, 164, -1, 166,
1701 -1, -1, -1, 96, 97, 98, -1, 174, 175, -1,
1702 -1, -1, 105, -1, -1, -1, -1, -1, -1, -1,
1703 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1704 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1705 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1706 -1, 144, 145, 146, -1, -1, 149, -1, -1, -1,
1707 -1, -1, 155, -1, -1, -1, -1, -1, -1, -1,
1708 -1, 164, -1, 166, -1, -1, -1, -1, -1, -1,
1709 -1, 174, 175, 24, -1, 26, 27, 28, 29, 30,
1710 31, -1, 33, -1, -1, 36, -1, 38, -1, -1,
1711 -1, 42, 43, -1, 45, 46, 47, 48, -1, 50,
1712 51, 52, 53, 54, 55, 56, 57, -1, 59, -1,
1713 61, 62, 63, 64, 65, -1, -1, 68, -1, -1,
1714 -1, 72, -1, 74, 75, -1, 77, 78, 79, 80,
1715 81, 82, -1, 84, 85, 86, 87, 88, 89, -1,
1716 -1, 92, -1, -1, 95, -1, -1, -1, -1, 100,
1717 101, -1, 103, 104, -1, 106, 107, -1, -1, -1,
1718 111, 112, 113, 114, 115, 116, -1, 118, 119, 120,
1719 121, 122, 123, 124, -1, 126, -1, 128, -1, 130,
1720 131, 132, 133, 134, 135, 136, 137, 138, -1, 140,
1721 141, 142, 143, -1, -1, -1, 147, -1, -1, 150,
1722 -1, -1, 153, 154, -1, -1, 157, 158, 159, 160,
1723 -1, -1, 163, -1, 165, -1, 167, 168, 169, 170,
1724 171, 172, 173, -1, -1, 176
1727 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1728 symbol of state STATE-NUM. */
1729 static const yytype_uint16 yystos
[] =
1731 0, 212, 213, 0, 4, 5, 32, 34, 40, 41,
1732 44, 49, 58, 60, 66, 67, 69, 73, 76, 83,
1733 90, 94, 96, 97, 98, 99, 105, 110, 127, 139,
1734 144, 145, 146, 149, 151, 155, 164, 166, 174, 175,
1735 203, 219, 220, 222, 223, 224, 225, 228, 229, 235,
1736 236, 247, 261, 265, 267, 268, 269, 270, 271, 274,
1737 275, 278, 280, 281, 282, 283, 285, 286, 287, 288,
1738 289, 291, 293, 311, 312, 313, 314, 3, 5, 208,
1739 3, 5, 3, 5, 263, 96, 266, 9, 3, 5,
1740 266, 3, 208, 208, 266, 267, 3, 263, 3, 263,
1741 267, 24, 26, 27, 28, 29, 30, 31, 33, 36,
1742 38, 42, 43, 45, 46, 47, 48, 50, 51, 52,
1743 53, 54, 55, 56, 57, 59, 61, 62, 63, 64,
1744 65, 68, 72, 74, 75, 77, 78, 79, 80, 81,
1745 82, 84, 85, 86, 87, 88, 89, 92, 95, 100,
1746 101, 103, 104, 106, 107, 111, 112, 113, 114, 115,
1747 116, 118, 119, 120, 121, 122, 123, 124, 126, 128,
1748 130, 131, 132, 133, 134, 135, 136, 137, 138, 140,
1749 141, 142, 143, 147, 150, 153, 154, 157, 158, 159,
1750 160, 163, 165, 167, 168, 169, 170, 171, 172, 173,
1751 176, 237, 239, 310, 207, 215, 215, 162, 66, 102,
1752 109, 155, 164, 227, 247, 268, 274, 280, 284, 291,
1753 311, 314, 207, 207, 205, 205, 207, 205, 207, 218,
1754 207, 184, 279, 205, 292, 293, 292, 292, 3, 5,
1755 39, 71, 125, 152, 192, 208, 241, 264, 294, 295,
1756 308, 247, 311, 312, 314, 292, 207, 9, 205, 207,
1757 3, 312, 205, 156, 205, 208, 208, 208, 208, 208,
1758 208, 208, 208, 208, 208, 208, 208, 208, 208, 208,
1759 208, 208, 208, 208, 208, 208, 208, 208, 208, 208,
1760 208, 208, 208, 208, 208, 208, 208, 208, 182, 204,
1761 13, 91, 219, 226, 229, 268, 270, 271, 282, 283,
1762 286, 206, 235, 236, 3, 3, 5, 3, 5, 3,
1763 3, 205, 308, 272, 214, 129, 276, 280, 3, 5,
1764 205, 217, 290, 294, 294, 210, 203, 208, 234, 292,
1765 209, 244, 245, 246, 264, 184, 209, 254, 208, 257,
1766 9, 9, 12, 240, 264, 3, 6, 7, 8, 9,
1767 10, 11, 70, 117, 148, 161, 187, 190, 191, 192,
1768 195, 196, 208, 250, 251, 252, 250, 253, 9, 9,
1769 238, 253, 252, 9, 9, 252, 9, 252, 250, 233,
1770 236, 291, 252, 248, 249, 250, 9, 310, 9, 252,
1771 312, 248, 250, 312, 177, 178, 179, 180, 181, 309,
1772 312, 312, 240, 6, 7, 315, 9, 312, 239, 203,
1773 208, 207, 205, 218, 291, 206, 235, 273, 213, 184,
1774 108, 235, 259, 277, 207, 205, 217, 206, 219, 236,
1775 289, 294, 209, 253, 192, 204, 250, 230, 231, 232,
1776 233, 206, 182, 210, 6, 221, 206, 235, 255, 259,
1777 206, 236, 256, 259, 209, 209, 209, 208, 250, 250,
1778 250, 250, 250, 250, 250, 291, 14, 15, 16, 17,
1779 18, 19, 20, 21, 22, 183, 185, 186, 187, 188,
1780 189, 190, 191, 192, 193, 194, 202, 203, 182, 209,
1781 209, 209, 182, 209, 209, 209, 209, 209, 209, 209,
1782 209, 209, 209, 291, 192, 208, 234, 241, 264, 300,
1783 302, 303, 209, 182, 209, 209, 209, 209, 182, 209,
1784 209, 209, 209, 209, 209, 209, 209, 202, 209, 209,
1785 209, 239, 9, 216, 294, 304, 218, 283, 206, 184,
1786 291, 311, 207, 206, 236, 260, 261, 206, 225, 206,
1787 218, 204, 204, 209, 182, 246, 252, 6, 209, 291,
1788 314, 209, 207, 207, 291, 209, 192, 208, 234, 241,
1789 296, 298, 299, 250, 250, 3, 250, 250, 250, 250,
1790 250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
1791 250, 250, 250, 3, 250, 252, 9, 302, 290, 192,
1792 230, 241, 301, 302, 208, 234, 249, 252, 6, 209,
1793 215, 182, 294, 207, 217, 218, 23, 233, 300, 306,
1794 307, 207, 262, 264, 298, 290, 192, 230, 241, 297,
1795 298, 209, 208, 234, 184, 204, 302, 290, 209, 302,
1796 209, 230, 209, 218, 206, 294, 206, 184, 305, 182,
1797 207, 205, 209, 298, 290, 209, 302, 209, 250, 230,
1798 250, 302, 209, 218, 253, 306, 242, 302, 209, 38,
1799 51, 206, 243, 252, 184, 184, 207, 258, 259, 258,
1803 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
1804 static const yytype_uint16 yyr1
[] =
1806 0, 211, 212, 213, 214, 213, 213, 213, 213, 213,
1807 213, 213, 213, 215, 215, 216, 215, 215, 215, 215,
1808 215, 215, 215, 215, 217, 217, 218, 218, 219, 219,
1809 219, 219, 219, 219, 219, 220, 221, 221, 222, 222,
1810 222, 222, 222, 222, 222, 222, 222, 223, 224, 225,
1811 226, 227, 227, 228, 229, 230, 230, 231, 231, 232,
1812 232, 233, 233, 234, 234, 234, 235, 235, 236, 237,
1813 237, 237, 238, 238, 239, 239, 239, 239, 239, 239,
1814 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
1815 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
1816 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
1817 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
1818 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
1819 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
1820 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
1821 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
1822 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
1823 239, 239, 239, 239, 240, 240, 241, 241, 241, 241,
1824 242, 242, 243, 243, 244, 244, 244, 245, 245, 246,
1825 246, 247, 248, 248, 249, 249, 250, 250, 250, 250,
1826 250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
1827 250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
1828 250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
1829 250, 250, 250, 250, 250, 250, 250, 251, 251, 252,
1830 253, 254, 254, 255, 255, 256, 256, 257, 257, 258,
1831 258, 259, 259, 260, 261, 261, 262, 262, 263, 263,
1832 263, 264, 264, 265, 265, 265, 265, 265, 265, 265,
1833 265, 265, 265, 265, 266, 266, 267, 267, 267, 267,
1834 267, 267, 267, 267, 268, 268, 269, 270, 271, 272,
1835 272, 273, 274, 274, 275, 276, 276, 277, 277, 278,
1836 278, 279, 279, 280, 280, 281, 282, 282, 282, 283,
1837 283, 284, 284, 285, 286, 287, 287, 287, 288, 289,
1838 290, 290, 291, 291, 292, 292, 293, 293, 293, 294,
1839 294, 294, 295, 295, 295, 295, 296, 296, 296, 297,
1840 297, 298, 298, 299, 299, 299, 299, 299, 300, 300,
1841 300, 301, 301, 302, 302, 303, 303, 303, 303, 303,
1842 303, 304, 304, 305, 305, 306, 307, 307, 308, 308,
1843 309, 309, 309, 309, 309, 310, 310, 310, 311, 312,
1844 312, 312, 312, 312, 312, 312, 312, 312, 312, 313,
1845 314, 314, 315, 315, 315
1848 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
1849 static const yytype_uint8 yyr2
[] =
1851 0, 2, 1, 0, 0, 6, 2, 2, 3, 2,
1852 2, 2, 2, 0, 2, 0, 6, 2, 3, 2,
1853 2, 2, 2, 2, 0, 2, 0, 1, 1, 2,
1854 2, 1, 2, 1, 1, 6, 1, 2, 1, 2,
1855 1, 2, 1, 2, 2, 2, 2, 4, 3, 3,
1856 5, 2, 2, 3, 4, 0, 1, 1, 3, 1,
1857 3, 3, 2, 3, 3, 2, 0, 1, 3, 1,
1858 3, 4, 1, 3, 0, 1, 4, 1, 1, 1,
1859 1, 1, 4, 4, 1, 1, 1, 1, 1, 1,
1860 1, 1, 1, 1, 4, 1, 1, 1, 4, 1,
1861 1, 1, 4, 4, 1, 1, 1, 1, 4, 4,
1862 4, 4, 4, 1, 4, 1, 1, 4, 1, 4,
1863 1, 1, 4, 4, 1, 1, 1, 1, 1, 1,
1864 1, 1, 1, 1, 1, 1, 1, 1, 4, 1,
1865 1, 1, 4, 4, 1, 1, 1, 1, 1, 6,
1866 1, 4, 1, 1, 1, 4, 1, 1, 1, 4,
1867 4, 4, 4, 1, 1, 4, 4, 4, 1, 1,
1868 4, 4, 4, 1, 1, 1, 1, 1, 1, 1,
1869 0, 2, 4, 3, 0, 2, 1, 1, 3, 3,
1870 1, 5, 1, 3, 0, 1, 1, 1, 1, 1,
1871 1, 1, 1, 1, 1, 1, 5, 3, 3, 3,
1872 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
1873 3, 3, 3, 3, 3, 2, 2, 2, 2, 2,
1874 2, 3, 3, 5, 5, 4, 3, 1, 3, 1,
1875 1, 0, 2, 4, 3, 2, 2, 0, 2, 2,
1876 1, 3, 2, 1, 3, 2, 0, 1, 0, 1,
1877 1, 1, 1, 1, 1, 1, 2, 2, 1, 1,
1878 1, 1, 1, 1, 0, 1, 1, 2, 1, 2,
1879 2, 1, 1, 1, 2, 2, 2, 5, 2, 0,
1880 2, 2, 2, 2, 2, 2, 3, 2, 3, 5,
1881 5, 0, 2, 2, 2, 2, 6, 8, 2, 2,
1882 2, 2, 2, 2, 5, 1, 1, 1, 1, 1,
1883 0, 2, 2, 3, 0, 1, 2, 2, 2, 3,
1884 2, 1, 1, 3, 2, 4, 3, 2, 1, 3,
1885 2, 0, 1, 3, 2, 1, 3, 4, 3, 2,
1886 1, 3, 2, 0, 1, 1, 3, 2, 1, 3,
1887 4, 1, 3, 0, 2, 2, 1, 3, 1, 3,
1888 1, 1, 1, 1, 1, 1, 1, 1, 5, 1,
1889 1, 1, 1, 2, 1, 2, 1, 2, 4, 5,
1894 #define yyerrok (yyerrstatus = 0)
1895 #define yyclearin (yychar = YYEMPTY)
1896 #define YYEMPTY (-2)
1899 #define YYACCEPT goto yyacceptlab
1900 #define YYABORT goto yyabortlab
1901 #define YYERROR goto yyerrorlab
1904 #define YYRECOVERING() (!!yyerrstatus)
1906 #define YYBACKUP(Token, Value) \
1908 if (yychar == YYEMPTY) \
1912 YYPOPSTACK (yylen); \
1918 yyerror (YY_("syntax error: cannot back up")); \
1923 /* Error token number */
1925 #define YYERRCODE 256
1929 /* Enable debugging if requested. */
1933 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1934 # define YYFPRINTF fprintf
1937 # define YYDPRINTF(Args) \
1943 /* This macro is provided for backward compatibility. */
1944 #ifndef YY_LOCATION_PRINT
1945 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1949 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1953 YYFPRINTF (stderr, "%s ", Title); \
1954 yy_symbol_print (stderr, \
1956 YYFPRINTF (stderr, "\n"); \
1961 /*----------------------------------------.
1962 | Print this symbol's value on YYOUTPUT. |
1963 `----------------------------------------*/
1966 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
)
1968 FILE *yyo
= yyoutput
;
1973 if (yytype
< YYNTOKENS
)
1974 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1980 /*--------------------------------.
1981 | Print this symbol on YYOUTPUT. |
1982 `--------------------------------*/
1985 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
)
1987 YYFPRINTF (yyoutput
, "%s %s (",
1988 yytype
< YYNTOKENS
? "token" : "nterm", yytname
[yytype
]);
1990 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
);
1991 YYFPRINTF (yyoutput
, ")");
1994 /*------------------------------------------------------------------.
1995 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1997 `------------------------------------------------------------------*/
2000 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
2002 YYFPRINTF (stderr
, "Stack now");
2003 for (; yybottom
<= yytop
; yybottom
++)
2005 int yybot
= *yybottom
;
2006 YYFPRINTF (stderr
, " %d", yybot
);
2008 YYFPRINTF (stderr
, "\n");
2011 # define YY_STACK_PRINT(Bottom, Top) \
2014 yy_stack_print ((Bottom), (Top)); \
2018 /*------------------------------------------------.
2019 | Report that the YYRULE is going to be reduced. |
2020 `------------------------------------------------*/
2023 yy_reduce_print (yytype_int16
*yyssp
, YYSTYPE
*yyvsp
, int yyrule
)
2025 unsigned long int yylno
= yyrline
[yyrule
];
2026 int yynrhs
= yyr2
[yyrule
];
2028 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
2030 /* The symbols being reduced. */
2031 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
2033 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
2034 yy_symbol_print (stderr
,
2035 yystos
[yyssp
[yyi
+ 1 - yynrhs
]],
2036 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
2038 YYFPRINTF (stderr
, "\n");
2042 # define YY_REDUCE_PRINT(Rule) \
2045 yy_reduce_print (yyssp, yyvsp, Rule); \
2048 /* Nonzero means print parse trace. It is left uninitialized so that
2049 multiple parsers can coexist. */
2051 #else /* !YYDEBUG */
2052 # define YYDPRINTF(Args)
2053 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
2054 # define YY_STACK_PRINT(Bottom, Top)
2055 # define YY_REDUCE_PRINT(Rule)
2056 #endif /* !YYDEBUG */
2059 /* YYINITDEPTH -- initial size of the parser's stacks. */
2061 # define YYINITDEPTH 200
2064 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
2065 if the built-in stack extension method is used).
2067 Do not make this value too large; the results are undefined if
2068 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
2069 evaluated with infinite-precision integer arithmetic. */
2072 # define YYMAXDEPTH 10000
2079 # if defined __GLIBC__ && defined _STRING_H
2080 # define yystrlen strlen
2082 /* Return the length of YYSTR. */
2084 yystrlen (const char *yystr
)
2087 for (yylen
= 0; yystr
[yylen
]; yylen
++)
2095 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
2096 # define yystpcpy stpcpy
2098 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
2101 yystpcpy (char *yydest
, const char *yysrc
)
2104 const char *yys
= yysrc
;
2106 while ((*yyd
++ = *yys
++) != '\0')
2115 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
2116 quotes and backslashes, so that it's suitable for yyerror. The
2117 heuristic is that double-quoting is unnecessary unless the string
2118 contains an apostrophe, a comma, or backslash (other than
2119 backslash-backslash). YYSTR is taken from yytname. If YYRES is
2120 null, do not copy; instead, return the length of what the result
2123 yytnamerr (char *yyres
, const char *yystr
)
2128 char const *yyp
= yystr
;
2135 goto do_not_strip_quotes
;
2139 goto do_not_strip_quotes
;
2152 do_not_strip_quotes
: ;
2156 return yystrlen (yystr
);
2158 return yystpcpy (yyres
, yystr
) - yyres
;
2162 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
2163 about the unexpected token YYTOKEN for the state stack whose top is
2166 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
2167 not large enough to hold the message. In that case, also set
2168 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
2169 required number of bytes is too large to store. */
2171 yysyntax_error (YYSIZE_T
*yymsg_alloc
, char **yymsg
,
2172 yytype_int16
*yyssp
, int yytoken
)
2174 YYSIZE_T yysize0
= yytnamerr (YY_NULL
, yytname
[yytoken
]);
2175 YYSIZE_T yysize
= yysize0
;
2176 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
2177 /* Internationalized format string. */
2178 const char *yyformat
= YY_NULL
;
2179 /* Arguments of yyformat. */
2180 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
2181 /* Number of reported tokens (one for the "unexpected", one per
2185 /* There are many possibilities here to consider:
2186 - If this state is a consistent state with a default action, then
2187 the only way this function was invoked is if the default action
2188 is an error action. In that case, don't check for expected
2189 tokens because there are none.
2190 - The only way there can be no lookahead present (in yychar) is if
2191 this state is a consistent state with a default action. Thus,
2192 detecting the absence of a lookahead is sufficient to determine
2193 that there is no unexpected or expected token to report. In that
2194 case, just report a simple "syntax error".
2195 - Don't assume there isn't a lookahead just because this state is a
2196 consistent state with a default action. There might have been a
2197 previous inconsistent state, consistent state with a non-default
2198 action, or user semantic action that manipulated yychar.
2199 - Of course, the expected token list depends on states to have
2200 correct lookahead information, and it depends on the parser not
2201 to perform extra reductions after fetching a lookahead from the
2202 scanner and before detecting a syntax error. Thus, state merging
2203 (from LALR or IELR) and default reductions corrupt the expected
2204 token list. However, the list is correct for canonical LR with
2205 one exception: it will still contain any token that will not be
2206 accepted due to an error action in a later state.
2208 if (yytoken
!= YYEMPTY
)
2210 int yyn
= yypact
[*yyssp
];
2211 yyarg
[yycount
++] = yytname
[yytoken
];
2212 if (!yypact_value_is_default (yyn
))
2214 /* Start YYX at -YYN if negative to avoid negative indexes in
2215 YYCHECK. In other words, skip the first -YYN actions for
2216 this state because they are default actions. */
2217 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
2218 /* Stay within bounds of both yycheck and yytname. */
2219 int yychecklim
= YYLAST
- yyn
+ 1;
2220 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
2223 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
2224 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
2225 && !yytable_value_is_error (yytable
[yyx
+ yyn
]))
2227 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
2233 yyarg
[yycount
++] = yytname
[yyx
];
2235 YYSIZE_T yysize1
= yysize
+ yytnamerr (YY_NULL
, yytname
[yyx
]);
2236 if (! (yysize
<= yysize1
2237 && yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
2247 # define YYCASE_(N, S) \
2251 YYCASE_(0, YY_("syntax error"));
2252 YYCASE_(1, YY_("syntax error, unexpected %s"));
2253 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
2254 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
2255 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
2256 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
2261 YYSIZE_T yysize1
= yysize
+ yystrlen (yyformat
);
2262 if (! (yysize
<= yysize1
&& yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
2267 if (*yymsg_alloc
< yysize
)
2269 *yymsg_alloc
= 2 * yysize
;
2270 if (! (yysize
<= *yymsg_alloc
2271 && *yymsg_alloc
<= YYSTACK_ALLOC_MAXIMUM
))
2272 *yymsg_alloc
= YYSTACK_ALLOC_MAXIMUM
;
2276 /* Avoid sprintf, as that infringes on the user's name space.
2277 Don't have undefined behavior even if the translation
2278 produced a string with the wrong number of "%s"s. */
2282 while ((*yyp
= *yyformat
) != '\0')
2283 if (*yyp
== '%' && yyformat
[1] == 's' && yyi
< yycount
)
2285 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
2296 #endif /* YYERROR_VERBOSE */
2298 /*-----------------------------------------------.
2299 | Release the memory associated to this symbol. |
2300 `-----------------------------------------------*/
2303 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
)
2308 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
2310 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2312 YY_IGNORE_MAYBE_UNINITIALIZED_END
2318 /* The lookahead symbol. */
2321 /* The semantic value of the lookahead symbol. */
2323 /* Number of syntax errors so far. */
2335 /* Number of tokens to shift before error messages enabled. */
2338 /* The stacks and their tools:
2339 'yyss': related to states.
2340 'yyvs': related to semantic values.
2342 Refer to the stacks through separate pointers, to allow yyoverflow
2343 to reallocate them elsewhere. */
2345 /* The state stack. */
2346 yytype_int16 yyssa
[YYINITDEPTH
];
2348 yytype_int16
*yyssp
;
2350 /* The semantic value stack. */
2351 YYSTYPE yyvsa
[YYINITDEPTH
];
2355 YYSIZE_T yystacksize
;
2359 /* Lookahead token as an internal (translated) token number. */
2361 /* The variables used to return semantic value and location from the
2366 /* Buffer for error messages, and its allocated size. */
2368 char *yymsg
= yymsgbuf
;
2369 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
2372 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
2374 /* The number of symbols on the RHS of the reduced rule.
2375 Keep to zero when no symbol should be popped. */
2378 yyssp
= yyss
= yyssa
;
2379 yyvsp
= yyvs
= yyvsa
;
2380 yystacksize
= YYINITDEPTH
;
2382 YYDPRINTF ((stderr
, "Starting parse\n"));
2387 yychar
= YYEMPTY
; /* Cause a token to be read. */
2390 /*------------------------------------------------------------.
2391 | yynewstate -- Push a new state, which is found in yystate. |
2392 `------------------------------------------------------------*/
2394 /* In all cases, when you get here, the value and location stacks
2395 have just been pushed. So pushing a state here evens the stacks. */
2401 if (yyss
+ yystacksize
- 1 <= yyssp
)
2403 /* Get the current used size of the three stacks, in elements. */
2404 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
2408 /* Give user a chance to reallocate the stack. Use copies of
2409 these so that the &'s don't force the real ones into
2411 YYSTYPE
*yyvs1
= yyvs
;
2412 yytype_int16
*yyss1
= yyss
;
2414 /* Each stack pointer address is followed by the size of the
2415 data in use in that stack, in bytes. This used to be a
2416 conditional around just the two extra args, but that might
2417 be undefined if yyoverflow is a macro. */
2418 yyoverflow (YY_("memory exhausted"),
2419 &yyss1
, yysize
* sizeof (*yyssp
),
2420 &yyvs1
, yysize
* sizeof (*yyvsp
),
2426 #else /* no yyoverflow */
2427 # ifndef YYSTACK_RELOCATE
2428 goto yyexhaustedlab
;
2430 /* Extend the stack our own way. */
2431 if (YYMAXDEPTH
<= yystacksize
)
2432 goto yyexhaustedlab
;
2434 if (YYMAXDEPTH
< yystacksize
)
2435 yystacksize
= YYMAXDEPTH
;
2438 yytype_int16
*yyss1
= yyss
;
2439 union yyalloc
*yyptr
=
2440 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
2442 goto yyexhaustedlab
;
2443 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
2444 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
2445 # undef YYSTACK_RELOCATE
2447 YYSTACK_FREE (yyss1
);
2450 #endif /* no yyoverflow */
2452 yyssp
= yyss
+ yysize
- 1;
2453 yyvsp
= yyvs
+ yysize
- 1;
2455 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
2456 (unsigned long int) yystacksize
));
2458 if (yyss
+ yystacksize
- 1 <= yyssp
)
2462 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
2464 if (yystate
== YYFINAL
)
2474 /* Do appropriate processing given the current state. Read a
2475 lookahead token if we need one and don't already have one. */
2477 /* First try to decide what to do without reference to lookahead token. */
2478 yyn
= yypact
[yystate
];
2479 if (yypact_value_is_default (yyn
))
2482 /* Not known => get a lookahead token if don't already have one. */
2484 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
2485 if (yychar
== YYEMPTY
)
2487 YYDPRINTF ((stderr
, "Reading a token: "));
2491 if (yychar
<= YYEOF
)
2493 yychar
= yytoken
= YYEOF
;
2494 YYDPRINTF ((stderr
, "Now at end of input.\n"));
2498 yytoken
= YYTRANSLATE (yychar
);
2499 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
2502 /* If the proper action on seeing token YYTOKEN is to reduce or to
2503 detect an error, take that action. */
2505 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
2510 if (yytable_value_is_error (yyn
))
2516 /* Count tokens shifted since error; after three, turn off error
2521 /* Shift the lookahead token. */
2522 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
2524 /* Discard the shifted token. */
2528 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2530 YY_IGNORE_MAYBE_UNINITIALIZED_END
2535 /*-----------------------------------------------------------.
2536 | yydefault -- do the default action for the current state. |
2537 `-----------------------------------------------------------*/
2539 yyn
= yydefact
[yystate
];
2545 /*-----------------------------.
2546 | yyreduce -- Do a reduction. |
2547 `-----------------------------*/
2549 /* yyn is the number of a rule to reduce with. */
2552 /* If YYLEN is nonzero, implement the default value of the action:
2555 Otherwise, the following line sets YYVAL to garbage.
2556 This behavior is undocumented and Bison
2557 users should not rely upon it. Assigning to YYVAL
2558 unconditionally makes the parser a bit smaller, and it avoids a
2559 GCC warning that YYVAL may be used uninitialized. */
2560 yyval
= yyvsp
[1-yylen
];
2563 YY_REDUCE_PRINT (yyn
);
2567 #line 321 "parser.y" /* yacc.c:1646 */
2569 check_statements((yyvsp
[0].stmt_list
), FALSE
);
2570 check_all_user_types((yyvsp
[0].stmt_list
));
2571 write_header((yyvsp
[0].stmt_list
));
2572 write_id_data((yyvsp
[0].stmt_list
));
2573 write_proxies((yyvsp
[0].stmt_list
));
2574 write_client((yyvsp
[0].stmt_list
));
2575 write_server((yyvsp
[0].stmt_list
));
2576 write_regscript((yyvsp
[0].stmt_list
));
2577 write_dlldata((yyvsp
[0].stmt_list
));
2578 write_local_stubs((yyvsp
[0].stmt_list
));
2580 #line 2581 "parser.tab.c" /* yacc.c:1646 */
2584 #line 335 "parser.y" /* yacc.c:1646 */
2585 { (yyval
.stmt_list
) = NULL
; }
2586 #line 2587 "parser.tab.c" /* yacc.c:1646 */
2590 #line 336 "parser.y" /* yacc.c:1646 */
2591 { push_namespace((yyvsp
[-1].str
)); }
2592 #line 2593 "parser.tab.c" /* yacc.c:1646 */
2596 #line 337 "parser.y" /* yacc.c:1646 */
2597 { pop_namespace((yyvsp
[-4].str
)); (yyval
.stmt_list
) = append_statements((yyvsp
[-5].stmt_list
), (yyvsp
[-1].stmt_list
)); }
2598 #line 2599 "parser.tab.c" /* yacc.c:1646 */
2602 #line 338 "parser.y" /* yacc.c:1646 */
2603 { (yyval
.stmt_list
) = append_statement((yyvsp
[-1].stmt_list
), make_statement_reference((yyvsp
[0].type
))); }
2604 #line 2605 "parser.tab.c" /* yacc.c:1646 */
2608 #line 339 "parser.y" /* yacc.c:1646 */
2609 { (yyval
.stmt_list
) = append_statement((yyvsp
[-1].stmt_list
), make_statement_type_decl((yyvsp
[0].type
))); }
2610 #line 2611 "parser.tab.c" /* yacc.c:1646 */
2614 #line 340 "parser.y" /* yacc.c:1646 */
2615 { (yyval
.stmt_list
) = (yyvsp
[-2].stmt_list
);
2616 reg_type((yyvsp
[-1].type
), (yyvsp
[-1].type
)->name
, current_namespace
, 0);
2618 #line 2619 "parser.tab.c" /* yacc.c:1646 */
2622 #line 343 "parser.y" /* yacc.c:1646 */
2623 { (yyval
.stmt_list
) = append_statement((yyvsp
[-1].stmt_list
), make_statement_type_decl((yyvsp
[0].type
)));
2624 reg_type((yyvsp
[0].type
), (yyvsp
[0].type
)->name
, current_namespace
, 0);
2626 #line 2627 "parser.tab.c" /* yacc.c:1646 */
2630 #line 346 "parser.y" /* yacc.c:1646 */
2631 { (yyval
.stmt_list
) = append_statement((yyvsp
[-1].stmt_list
), make_statement_module((yyvsp
[0].type
))); }
2632 #line 2633 "parser.tab.c" /* yacc.c:1646 */
2636 #line 347 "parser.y" /* yacc.c:1646 */
2637 { (yyval
.stmt_list
) = append_statement((yyvsp
[-1].stmt_list
), make_statement_library((yyvsp
[0].typelib
))); }
2638 #line 2639 "parser.tab.c" /* yacc.c:1646 */
2642 #line 348 "parser.y" /* yacc.c:1646 */
2643 { (yyval
.stmt_list
) = append_statement((yyvsp
[-1].stmt_list
), (yyvsp
[0].statement
)); }
2644 #line 2645 "parser.tab.c" /* yacc.c:1646 */
2648 #line 351 "parser.y" /* yacc.c:1646 */
2649 { (yyval
.stmt_list
) = NULL
; }
2650 #line 2651 "parser.tab.c" /* yacc.c:1646 */
2654 #line 352 "parser.y" /* yacc.c:1646 */
2655 { (yyval
.stmt_list
) = append_statement((yyvsp
[-1].stmt_list
), make_statement_reference((yyvsp
[0].type
))); }
2656 #line 2657 "parser.tab.c" /* yacc.c:1646 */
2660 #line 353 "parser.y" /* yacc.c:1646 */
2661 { push_namespace((yyvsp
[-1].str
)); }
2662 #line 2663 "parser.tab.c" /* yacc.c:1646 */
2666 #line 354 "parser.y" /* yacc.c:1646 */
2667 { pop_namespace((yyvsp
[-4].str
)); (yyval
.stmt_list
) = append_statements((yyvsp
[-5].stmt_list
), (yyvsp
[-1].stmt_list
)); }
2668 #line 2669 "parser.tab.c" /* yacc.c:1646 */
2672 #line 355 "parser.y" /* yacc.c:1646 */
2673 { (yyval
.stmt_list
) = append_statement((yyvsp
[-1].stmt_list
), make_statement_type_decl((yyvsp
[0].type
))); }
2674 #line 2675 "parser.tab.c" /* yacc.c:1646 */
2678 #line 356 "parser.y" /* yacc.c:1646 */
2679 { (yyval
.stmt_list
) = (yyvsp
[-2].stmt_list
); reg_type((yyvsp
[-1].type
), (yyvsp
[-1].type
)->name
, current_namespace
, 0); }
2680 #line 2681 "parser.tab.c" /* yacc.c:1646 */
2684 #line 357 "parser.y" /* yacc.c:1646 */
2685 { (yyval
.stmt_list
) = append_statement((yyvsp
[-1].stmt_list
), make_statement_type_decl((yyvsp
[0].type
)));
2686 reg_type((yyvsp
[0].type
), (yyvsp
[0].type
)->name
, current_namespace
, 0);
2688 #line 2689 "parser.tab.c" /* yacc.c:1646 */
2692 #line 360 "parser.y" /* yacc.c:1646 */
2693 { (yyval
.stmt_list
) = append_statement((yyvsp
[-1].stmt_list
), make_statement_module((yyvsp
[0].type
))); }
2694 #line 2695 "parser.tab.c" /* yacc.c:1646 */
2698 #line 361 "parser.y" /* yacc.c:1646 */
2699 { (yyval
.stmt_list
) = append_statement((yyvsp
[-1].stmt_list
), (yyvsp
[0].statement
)); }
2700 #line 2701 "parser.tab.c" /* yacc.c:1646 */
2704 #line 362 "parser.y" /* yacc.c:1646 */
2705 { (yyval
.stmt_list
) = append_statement((yyvsp
[-1].stmt_list
), make_statement_importlib((yyvsp
[0].str
))); }
2706 #line 2707 "parser.tab.c" /* yacc.c:1646 */
2710 #line 363 "parser.y" /* yacc.c:1646 */
2711 { (yyval
.stmt_list
) = append_statement((yyvsp
[-1].stmt_list
), make_statement_library((yyvsp
[0].typelib
))); }
2712 #line 2713 "parser.tab.c" /* yacc.c:1646 */
2716 #line 366 "parser.y" /* yacc.c:1646 */
2717 { (yyval
.stmt_list
) = NULL
; }
2718 #line 2719 "parser.tab.c" /* yacc.c:1646 */
2722 #line 367 "parser.y" /* yacc.c:1646 */
2723 { (yyval
.stmt_list
) = append_statement((yyvsp
[-1].stmt_list
), (yyvsp
[0].statement
)); }
2724 #line 2725 "parser.tab.c" /* yacc.c:1646 */
2728 #line 375 "parser.y" /* yacc.c:1646 */
2729 { (yyval
.statement
) = make_statement_cppquote((yyvsp
[0].str
)); }
2730 #line 2731 "parser.tab.c" /* yacc.c:1646 */
2734 #line 376 "parser.y" /* yacc.c:1646 */
2735 { (yyval
.statement
) = make_statement_type_decl((yyvsp
[-1].type
)); }
2736 #line 2737 "parser.tab.c" /* yacc.c:1646 */
2740 #line 377 "parser.y" /* yacc.c:1646 */
2741 { (yyval
.statement
) = make_statement_declaration((yyvsp
[-1].var
)); }
2742 #line 2743 "parser.tab.c" /* yacc.c:1646 */
2746 #line 378 "parser.y" /* yacc.c:1646 */
2747 { (yyval
.statement
) = make_statement_import((yyvsp
[0].str
)); }
2748 #line 2749 "parser.tab.c" /* yacc.c:1646 */
2752 #line 379 "parser.y" /* yacc.c:1646 */
2753 { (yyval
.statement
) = (yyvsp
[-1].statement
); }
2754 #line 2755 "parser.tab.c" /* yacc.c:1646 */
2758 #line 380 "parser.y" /* yacc.c:1646 */
2759 { (yyval
.statement
) = make_statement_pragma((yyvsp
[0].str
)); }
2760 #line 2761 "parser.tab.c" /* yacc.c:1646 */
2764 #line 381 "parser.y" /* yacc.c:1646 */
2765 { (yyval
.statement
) = NULL
; }
2766 #line 2767 "parser.tab.c" /* yacc.c:1646 */
2770 #line 385 "parser.y" /* yacc.c:1646 */
2773 (yyval
.statement
) = NULL
;
2774 result
= do_warning((yyvsp
[-3].str
), (yyvsp
[-1].warning_list
));
2776 error_loc("expected \"disable\" or \"enable\"\n");
2778 #line 2779 "parser.tab.c" /* yacc.c:1646 */
2782 #line 395 "parser.y" /* yacc.c:1646 */
2783 { (yyval
.warning_list
) = append_warning(NULL
, (yyvsp
[0].num
)); }
2784 #line 2785 "parser.tab.c" /* yacc.c:1646 */
2788 #line 396 "parser.y" /* yacc.c:1646 */
2789 { (yyval
.warning_list
) = append_warning((yyvsp
[-1].warning_list
), (yyvsp
[0].num
)); }
2790 #line 2791 "parser.tab.c" /* yacc.c:1646 */
2794 #line 401 "parser.y" /* yacc.c:1646 */
2795 { (yyval
.type
) = type_new_enum((yyvsp
[0].str
), current_namespace
, FALSE
, NULL
); }
2796 #line 2797 "parser.tab.c" /* yacc.c:1646 */
2800 #line 403 "parser.y" /* yacc.c:1646 */
2801 { (yyval
.type
) = type_new_struct((yyvsp
[0].str
), current_namespace
, FALSE
, NULL
); }
2802 #line 2803 "parser.tab.c" /* yacc.c:1646 */
2806 #line 405 "parser.y" /* yacc.c:1646 */
2807 { (yyval
.type
) = type_new_nonencapsulated_union((yyvsp
[0].str
), FALSE
, NULL
); }
2808 #line 2809 "parser.tab.c" /* yacc.c:1646 */
2812 #line 406 "parser.y" /* yacc.c:1646 */
2813 { (yyval
.type
) = (yyvsp
[0].type
); (yyval
.type
)->attrs
= check_enum_attrs((yyvsp
[-1].attr_list
)); }
2814 #line 2815 "parser.tab.c" /* yacc.c:1646 */
2818 #line 407 "parser.y" /* yacc.c:1646 */
2819 { (yyval
.type
) = (yyvsp
[0].type
); (yyval
.type
)->attrs
= check_struct_attrs((yyvsp
[-1].attr_list
)); }
2820 #line 2821 "parser.tab.c" /* yacc.c:1646 */
2824 #line 408 "parser.y" /* yacc.c:1646 */
2825 { (yyval
.type
) = (yyvsp
[0].type
); (yyval
.type
)->attrs
= check_union_attrs((yyvsp
[-1].attr_list
)); }
2826 #line 2827 "parser.tab.c" /* yacc.c:1646 */
2830 #line 411 "parser.y" /* yacc.c:1646 */
2831 { (yyval
.str
) = (yyvsp
[-1].str
); }
2832 #line 2833 "parser.tab.c" /* yacc.c:1646 */
2836 #line 413 "parser.y" /* yacc.c:1646 */
2837 { assert(yychar
== YYEMPTY
);
2838 (yyval
.import
) = xmalloc(sizeof(struct _import_t
));
2839 (yyval
.import
)->name
= (yyvsp
[-1].str
);
2840 (yyval
.import
)->import_performed
= do_import((yyvsp
[-1].str
));
2841 if (!(yyval
.import
)->import_performed
) yychar
= aEOF
;
2843 #line 2844 "parser.tab.c" /* yacc.c:1646 */
2847 #line 421 "parser.y" /* yacc.c:1646 */
2848 { (yyval
.str
) = (yyvsp
[-2].import
)->name
;
2849 if ((yyvsp
[-2].import
)->import_performed
) pop_import();
2850 free((yyvsp
[-2].import
));
2852 #line 2853 "parser.tab.c" /* yacc.c:1646 */
2856 #line 428 "parser.y" /* yacc.c:1646 */
2857 { (yyval
.str
) = (yyvsp
[-2].str
); if(!parse_only
) add_importlib((yyvsp
[-2].str
)); }
2858 #line 2859 "parser.tab.c" /* yacc.c:1646 */
2862 #line 431 "parser.y" /* yacc.c:1646 */
2863 { (yyval
.str
) = (yyvsp
[0].str
); }
2864 #line 2865 "parser.tab.c" /* yacc.c:1646 */
2868 #line 432 "parser.y" /* yacc.c:1646 */
2869 { (yyval
.str
) = (yyvsp
[0].str
); }
2870 #line 2871 "parser.tab.c" /* yacc.c:1646 */
2874 #line 434 "parser.y" /* yacc.c:1646 */
2875 { (yyval
.typelib
) = make_library((yyvsp
[-1].str
), check_library_attrs((yyvsp
[-1].str
), (yyvsp
[-2].attr_list
)));
2876 if (!parse_only
) start_typelib((yyval
.typelib
));
2878 #line 2879 "parser.tab.c" /* yacc.c:1646 */
2882 #line 439 "parser.y" /* yacc.c:1646 */
2883 { (yyval
.typelib
) = (yyvsp
[-3].typelib
);
2884 (yyval
.typelib
)->stmts
= (yyvsp
[-2].stmt_list
);
2885 if (!parse_only
) end_typelib();
2887 #line 2888 "parser.tab.c" /* yacc.c:1646 */
2891 #line 445 "parser.y" /* yacc.c:1646 */
2892 { (yyval
.var_list
) = NULL
; }
2893 #line 2894 "parser.tab.c" /* yacc.c:1646 */
2897 #line 449 "parser.y" /* yacc.c:1646 */
2898 { check_arg_attrs((yyvsp
[0].var
)); (yyval
.var_list
) = append_var( NULL
, (yyvsp
[0].var
) ); }
2899 #line 2900 "parser.tab.c" /* yacc.c:1646 */
2903 #line 450 "parser.y" /* yacc.c:1646 */
2904 { check_arg_attrs((yyvsp
[0].var
)); (yyval
.var_list
) = append_var( (yyvsp
[-2].var_list
), (yyvsp
[0].var
) ); }
2905 #line 2906 "parser.tab.c" /* yacc.c:1646 */
2909 #line 454 "parser.y" /* yacc.c:1646 */
2910 { (yyval
.var_list
) = append_var( (yyvsp
[-2].var_list
), make_var(strdup("...")) ); }
2911 #line 2912 "parser.tab.c" /* yacc.c:1646 */
2915 #line 458 "parser.y" /* yacc.c:1646 */
2916 { if ((yyvsp
[-1].declspec
)->stgclass
!= STG_NONE
&& (yyvsp
[-1].declspec
)->stgclass
!= STG_REGISTER
)
2917 error_loc("invalid storage class for function parameter\n");
2918 (yyval
.var
) = declare_var((yyvsp
[-2].attr_list
), (yyvsp
[-1].declspec
), (yyvsp
[0].declarator
), TRUE
);
2919 free((yyvsp
[-1].declspec
)); free((yyvsp
[0].declarator
));
2921 #line 2922 "parser.tab.c" /* yacc.c:1646 */
2925 #line 463 "parser.y" /* yacc.c:1646 */
2926 { if ((yyvsp
[-1].declspec
)->stgclass
!= STG_NONE
&& (yyvsp
[-1].declspec
)->stgclass
!= STG_REGISTER
)
2927 error_loc("invalid storage class for function parameter\n");
2928 (yyval
.var
) = declare_var(NULL
, (yyvsp
[-1].declspec
), (yyvsp
[0].declarator
), TRUE
);
2929 free((yyvsp
[-1].declspec
)); free((yyvsp
[0].declarator
));
2931 #line 2932 "parser.tab.c" /* yacc.c:1646 */
2935 #line 470 "parser.y" /* yacc.c:1646 */
2936 { (yyval
.expr
) = (yyvsp
[-1].expr
);
2937 if (!(yyval
.expr
)->is_const
)
2938 error_loc("array dimension is not an integer constant\n");
2940 #line 2941 "parser.tab.c" /* yacc.c:1646 */
2944 #line 474 "parser.y" /* yacc.c:1646 */
2945 { (yyval
.expr
) = make_expr(EXPR_VOID
); }
2946 #line 2947 "parser.tab.c" /* yacc.c:1646 */
2950 #line 475 "parser.y" /* yacc.c:1646 */
2951 { (yyval
.expr
) = make_expr(EXPR_VOID
); }
2952 #line 2953 "parser.tab.c" /* yacc.c:1646 */
2956 #line 478 "parser.y" /* yacc.c:1646 */
2957 { (yyval
.attr_list
) = NULL
; }
2958 #line 2959 "parser.tab.c" /* yacc.c:1646 */
2962 #line 483 "parser.y" /* yacc.c:1646 */
2963 { (yyval
.attr_list
) = (yyvsp
[-1].attr_list
); }
2964 #line 2965 "parser.tab.c" /* yacc.c:1646 */
2968 #line 486 "parser.y" /* yacc.c:1646 */
2969 { (yyval
.attr_list
) = append_attr( NULL
, (yyvsp
[0].attr
) ); }
2970 #line 2971 "parser.tab.c" /* yacc.c:1646 */
2974 #line 487 "parser.y" /* yacc.c:1646 */
2975 { (yyval
.attr_list
) = append_attr( (yyvsp
[-2].attr_list
), (yyvsp
[0].attr
) ); }
2976 #line 2977 "parser.tab.c" /* yacc.c:1646 */
2980 #line 488 "parser.y" /* yacc.c:1646 */
2981 { (yyval
.attr_list
) = append_attr( (yyvsp
[-3].attr_list
), (yyvsp
[0].attr
) ); }
2982 #line 2983 "parser.tab.c" /* yacc.c:1646 */
2986 #line 491 "parser.y" /* yacc.c:1646 */
2987 { (yyval
.str_list
) = append_str( NULL
, (yyvsp
[0].str
) ); }
2988 #line 2989 "parser.tab.c" /* yacc.c:1646 */
2992 #line 492 "parser.y" /* yacc.c:1646 */
2993 { (yyval
.str_list
) = append_str( (yyvsp
[-2].str_list
), (yyvsp
[0].str
) ); }
2994 #line 2995 "parser.tab.c" /* yacc.c:1646 */
2998 #line 495 "parser.y" /* yacc.c:1646 */
2999 { (yyval
.attr
) = NULL
; }
3000 #line 3001 "parser.tab.c" /* yacc.c:1646 */
3004 #line 496 "parser.y" /* yacc.c:1646 */
3005 { (yyval
.attr
) = make_attr(ATTR_AGGREGATABLE
); }
3006 #line 3007 "parser.tab.c" /* yacc.c:1646 */
3010 #line 497 "parser.y" /* yacc.c:1646 */
3011 { (yyval
.attr
) = make_attrp(ATTR_ANNOTATION
, (yyvsp
[-1].str
)); }
3012 #line 3013 "parser.tab.c" /* yacc.c:1646 */
3016 #line 498 "parser.y" /* yacc.c:1646 */
3017 { (yyval
.attr
) = make_attr(ATTR_APPOBJECT
); }
3018 #line 3019 "parser.tab.c" /* yacc.c:1646 */
3022 #line 499 "parser.y" /* yacc.c:1646 */
3023 { (yyval
.attr
) = make_attr(ATTR_ASYNC
); }
3024 #line 3025 "parser.tab.c" /* yacc.c:1646 */
3028 #line 500 "parser.y" /* yacc.c:1646 */
3029 { (yyval
.attr
) = make_attr(ATTR_AUTO_HANDLE
); }
3030 #line 3031 "parser.tab.c" /* yacc.c:1646 */
3034 #line 501 "parser.y" /* yacc.c:1646 */
3035 { (yyval
.attr
) = make_attr(ATTR_BINDABLE
); }
3036 #line 3037 "parser.tab.c" /* yacc.c:1646 */
3040 #line 502 "parser.y" /* yacc.c:1646 */
3041 { (yyval
.attr
) = make_attr(ATTR_BROADCAST
); }
3042 #line 3043 "parser.tab.c" /* yacc.c:1646 */
3046 #line 503 "parser.y" /* yacc.c:1646 */
3047 { (yyval
.attr
) = make_attrp(ATTR_CALLAS
, (yyvsp
[-1].var
)); }
3048 #line 3049 "parser.tab.c" /* yacc.c:1646 */
3052 #line 504 "parser.y" /* yacc.c:1646 */
3053 { (yyval
.attr
) = make_attrp(ATTR_CASE
, (yyvsp
[-1].expr_list
)); }
3054 #line 3055 "parser.tab.c" /* yacc.c:1646 */
3058 #line 505 "parser.y" /* yacc.c:1646 */
3059 { (yyval
.attr
) = make_attr(ATTR_CODE
); }
3060 #line 3061 "parser.tab.c" /* yacc.c:1646 */
3064 #line 506 "parser.y" /* yacc.c:1646 */
3065 { (yyval
.attr
) = make_attr(ATTR_COMMSTATUS
); }
3066 #line 3067 "parser.tab.c" /* yacc.c:1646 */
3070 #line 507 "parser.y" /* yacc.c:1646 */
3071 { (yyval
.attr
) = make_attrv(ATTR_CONTEXTHANDLE
, 0); }
3072 #line 3073 "parser.tab.c" /* yacc.c:1646 */
3076 #line 508 "parser.y" /* yacc.c:1646 */
3077 { (yyval
.attr
) = make_attrv(ATTR_CONTEXTHANDLE
, 0); /* RPC_CONTEXT_HANDLE_DONT_SERIALIZE */ }
3078 #line 3079 "parser.tab.c" /* yacc.c:1646 */
3082 #line 509 "parser.y" /* yacc.c:1646 */
3083 { (yyval
.attr
) = make_attrv(ATTR_CONTEXTHANDLE
, 0); /* RPC_CONTEXT_HANDLE_SERIALIZE */ }
3084 #line 3085 "parser.tab.c" /* yacc.c:1646 */
3088 #line 510 "parser.y" /* yacc.c:1646 */
3089 { (yyval
.attr
) = make_attr(ATTR_CONTROL
); }
3090 #line 3091 "parser.tab.c" /* yacc.c:1646 */
3094 #line 511 "parser.y" /* yacc.c:1646 */
3095 { (yyval
.attr
) = make_attr(ATTR_DECODE
); }
3096 #line 3097 "parser.tab.c" /* yacc.c:1646 */
3100 #line 512 "parser.y" /* yacc.c:1646 */
3101 { (yyval
.attr
) = make_attr(ATTR_DEFAULT
); }
3102 #line 3103 "parser.tab.c" /* yacc.c:1646 */
3106 #line 513 "parser.y" /* yacc.c:1646 */
3107 { (yyval
.attr
) = make_attr(ATTR_DEFAULTBIND
); }
3108 #line 3109 "parser.tab.c" /* yacc.c:1646 */
3112 #line 514 "parser.y" /* yacc.c:1646 */
3113 { (yyval
.attr
) = make_attr(ATTR_DEFAULTCOLLELEM
); }
3114 #line 3115 "parser.tab.c" /* yacc.c:1646 */
3118 #line 515 "parser.y" /* yacc.c:1646 */
3119 { (yyval
.attr
) = make_attrp(ATTR_DEFAULTVALUE
, (yyvsp
[-1].expr
)); }
3120 #line 3121 "parser.tab.c" /* yacc.c:1646 */
3124 #line 516 "parser.y" /* yacc.c:1646 */
3125 { (yyval
.attr
) = make_attr(ATTR_DEFAULTVTABLE
); }
3126 #line 3127 "parser.tab.c" /* yacc.c:1646 */
3130 #line 517 "parser.y" /* yacc.c:1646 */
3131 { (yyval
.attr
) = make_attr(ATTR_DISABLECONSISTENCYCHECK
); }
3132 #line 3133 "parser.tab.c" /* yacc.c:1646 */
3136 #line 518 "parser.y" /* yacc.c:1646 */
3137 { (yyval
.attr
) = make_attr(ATTR_DISPLAYBIND
); }
3138 #line 3139 "parser.tab.c" /* yacc.c:1646 */
3142 #line 519 "parser.y" /* yacc.c:1646 */
3143 { (yyval
.attr
) = make_attrp(ATTR_DLLNAME
, (yyvsp
[-1].str
)); }
3144 #line 3145 "parser.tab.c" /* yacc.c:1646 */
3148 #line 520 "parser.y" /* yacc.c:1646 */
3149 { (yyval
.attr
) = make_attr(ATTR_DUAL
); }
3150 #line 3151 "parser.tab.c" /* yacc.c:1646 */
3154 #line 521 "parser.y" /* yacc.c:1646 */
3155 { (yyval
.attr
) = make_attr(ATTR_ENABLEALLOCATE
); }
3156 #line 3157 "parser.tab.c" /* yacc.c:1646 */
3160 #line 522 "parser.y" /* yacc.c:1646 */
3161 { (yyval
.attr
) = make_attr(ATTR_ENCODE
); }
3162 #line 3163 "parser.tab.c" /* yacc.c:1646 */
3166 #line 523 "parser.y" /* yacc.c:1646 */
3167 { (yyval
.attr
) = make_attrp(ATTR_ENDPOINT
, (yyvsp
[-1].str_list
)); }
3168 #line 3169 "parser.tab.c" /* yacc.c:1646 */
3172 #line 524 "parser.y" /* yacc.c:1646 */
3173 { (yyval
.attr
) = make_attrp(ATTR_ENTRY
, (yyvsp
[-1].expr
)); }
3174 #line 3175 "parser.tab.c" /* yacc.c:1646 */
3178 #line 525 "parser.y" /* yacc.c:1646 */
3179 { (yyval
.attr
) = make_attr(ATTR_EXPLICIT_HANDLE
); }
3180 #line 3181 "parser.tab.c" /* yacc.c:1646 */
3184 #line 526 "parser.y" /* yacc.c:1646 */
3185 { (yyval
.attr
) = make_attr(ATTR_FAULTSTATUS
); }
3186 #line 3187 "parser.tab.c" /* yacc.c:1646 */
3190 #line 527 "parser.y" /* yacc.c:1646 */
3191 { (yyval
.attr
) = make_attr(ATTR_FORCEALLOCATE
); }
3192 #line 3193 "parser.tab.c" /* yacc.c:1646 */
3196 #line 528 "parser.y" /* yacc.c:1646 */
3197 { (yyval
.attr
) = make_attr(ATTR_HANDLE
); }
3198 #line 3199 "parser.tab.c" /* yacc.c:1646 */
3202 #line 529 "parser.y" /* yacc.c:1646 */
3203 { (yyval
.attr
) = make_attrp(ATTR_HELPCONTEXT
, (yyvsp
[-1].expr
)); }
3204 #line 3205 "parser.tab.c" /* yacc.c:1646 */
3208 #line 530 "parser.y" /* yacc.c:1646 */
3209 { (yyval
.attr
) = make_attrp(ATTR_HELPFILE
, (yyvsp
[-1].str
)); }
3210 #line 3211 "parser.tab.c" /* yacc.c:1646 */
3214 #line 531 "parser.y" /* yacc.c:1646 */
3215 { (yyval
.attr
) = make_attrp(ATTR_HELPSTRING
, (yyvsp
[-1].str
)); }
3216 #line 3217 "parser.tab.c" /* yacc.c:1646 */
3220 #line 532 "parser.y" /* yacc.c:1646 */
3221 { (yyval
.attr
) = make_attrp(ATTR_HELPSTRINGCONTEXT
, (yyvsp
[-1].expr
)); }
3222 #line 3223 "parser.tab.c" /* yacc.c:1646 */
3226 #line 533 "parser.y" /* yacc.c:1646 */
3227 { (yyval
.attr
) = make_attrp(ATTR_HELPSTRINGDLL
, (yyvsp
[-1].str
)); }
3228 #line 3229 "parser.tab.c" /* yacc.c:1646 */
3232 #line 534 "parser.y" /* yacc.c:1646 */
3233 { (yyval
.attr
) = make_attr(ATTR_HIDDEN
); }
3234 #line 3235 "parser.tab.c" /* yacc.c:1646 */
3238 #line 535 "parser.y" /* yacc.c:1646 */
3239 { (yyval
.attr
) = make_attrp(ATTR_ID
, (yyvsp
[-1].expr
)); }
3240 #line 3241 "parser.tab.c" /* yacc.c:1646 */
3244 #line 536 "parser.y" /* yacc.c:1646 */
3245 { (yyval
.attr
) = make_attr(ATTR_IDEMPOTENT
); }
3246 #line 3247 "parser.tab.c" /* yacc.c:1646 */
3250 #line 537 "parser.y" /* yacc.c:1646 */
3251 { (yyval
.attr
) = make_attr(ATTR_IGNORE
); }
3252 #line 3253 "parser.tab.c" /* yacc.c:1646 */
3256 #line 538 "parser.y" /* yacc.c:1646 */
3257 { (yyval
.attr
) = make_attrp(ATTR_IIDIS
, (yyvsp
[-1].expr
)); }
3258 #line 3259 "parser.tab.c" /* yacc.c:1646 */
3262 #line 539 "parser.y" /* yacc.c:1646 */
3263 { (yyval
.attr
) = make_attr(ATTR_IMMEDIATEBIND
); }
3264 #line 3265 "parser.tab.c" /* yacc.c:1646 */
3268 #line 540 "parser.y" /* yacc.c:1646 */
3269 { (yyval
.attr
) = make_attrp(ATTR_IMPLICIT_HANDLE
, (yyvsp
[-1].var
)); }
3270 #line 3271 "parser.tab.c" /* yacc.c:1646 */
3274 #line 541 "parser.y" /* yacc.c:1646 */
3275 { (yyval
.attr
) = make_attr(ATTR_IN
); }
3276 #line 3277 "parser.tab.c" /* yacc.c:1646 */
3280 #line 542 "parser.y" /* yacc.c:1646 */
3281 { (yyval
.attr
) = make_attr(ATTR_INPUTSYNC
); }
3282 #line 3283 "parser.tab.c" /* yacc.c:1646 */
3286 #line 543 "parser.y" /* yacc.c:1646 */
3287 { (yyval
.attr
) = make_attrp(ATTR_LENGTHIS
, (yyvsp
[-1].expr_list
)); }
3288 #line 3289 "parser.tab.c" /* yacc.c:1646 */
3292 #line 544 "parser.y" /* yacc.c:1646 */
3293 { (yyval
.attr
) = make_attrp(ATTR_LIBLCID
, (yyvsp
[-1].expr
)); }
3294 #line 3295 "parser.tab.c" /* yacc.c:1646 */
3298 #line 545 "parser.y" /* yacc.c:1646 */
3299 { (yyval
.attr
) = make_attr(ATTR_PARAMLCID
); }
3300 #line 3301 "parser.tab.c" /* yacc.c:1646 */
3304 #line 546 "parser.y" /* yacc.c:1646 */
3305 { (yyval
.attr
) = make_attr(ATTR_LICENSED
); }
3306 #line 3307 "parser.tab.c" /* yacc.c:1646 */
3310 #line 547 "parser.y" /* yacc.c:1646 */
3311 { (yyval
.attr
) = make_attr(ATTR_LOCAL
); }
3312 #line 3313 "parser.tab.c" /* yacc.c:1646 */
3316 #line 548 "parser.y" /* yacc.c:1646 */
3317 { (yyval
.attr
) = make_attr(ATTR_MAYBE
); }
3318 #line 3319 "parser.tab.c" /* yacc.c:1646 */
3322 #line 549 "parser.y" /* yacc.c:1646 */
3323 { (yyval
.attr
) = make_attr(ATTR_MESSAGE
); }
3324 #line 3325 "parser.tab.c" /* yacc.c:1646 */
3328 #line 550 "parser.y" /* yacc.c:1646 */
3329 { (yyval
.attr
) = make_attr(ATTR_NOCODE
); }
3330 #line 3331 "parser.tab.c" /* yacc.c:1646 */
3334 #line 551 "parser.y" /* yacc.c:1646 */
3335 { (yyval
.attr
) = make_attr(ATTR_NONBROWSABLE
); }
3336 #line 3337 "parser.tab.c" /* yacc.c:1646 */
3340 #line 552 "parser.y" /* yacc.c:1646 */
3341 { (yyval
.attr
) = make_attr(ATTR_NONCREATABLE
); }
3342 #line 3343 "parser.tab.c" /* yacc.c:1646 */
3346 #line 553 "parser.y" /* yacc.c:1646 */
3347 { (yyval
.attr
) = make_attr(ATTR_NONEXTENSIBLE
); }
3348 #line 3349 "parser.tab.c" /* yacc.c:1646 */
3352 #line 554 "parser.y" /* yacc.c:1646 */
3353 { (yyval
.attr
) = make_attr(ATTR_NOTIFY
); }
3354 #line 3355 "parser.tab.c" /* yacc.c:1646 */
3358 #line 555 "parser.y" /* yacc.c:1646 */
3359 { (yyval
.attr
) = make_attr(ATTR_NOTIFYFLAG
); }
3360 #line 3361 "parser.tab.c" /* yacc.c:1646 */
3364 #line 556 "parser.y" /* yacc.c:1646 */
3365 { (yyval
.attr
) = make_attr(ATTR_OBJECT
); }
3366 #line 3367 "parser.tab.c" /* yacc.c:1646 */
3370 #line 557 "parser.y" /* yacc.c:1646 */
3371 { (yyval
.attr
) = make_attr(ATTR_ODL
); }
3372 #line 3373 "parser.tab.c" /* yacc.c:1646 */
3376 #line 558 "parser.y" /* yacc.c:1646 */
3377 { (yyval
.attr
) = make_attr(ATTR_OLEAUTOMATION
); }
3378 #line 3379 "parser.tab.c" /* yacc.c:1646 */
3382 #line 559 "parser.y" /* yacc.c:1646 */
3383 { (yyval
.attr
) = make_attrp(ATTR_OPTIMIZE
, (yyvsp
[-1].str
)); }
3384 #line 3385 "parser.tab.c" /* yacc.c:1646 */
3388 #line 560 "parser.y" /* yacc.c:1646 */
3389 { (yyval
.attr
) = make_attr(ATTR_OPTIONAL
); }
3390 #line 3391 "parser.tab.c" /* yacc.c:1646 */
3394 #line 561 "parser.y" /* yacc.c:1646 */
3395 { (yyval
.attr
) = make_attr(ATTR_OUT
); }
3396 #line 3397 "parser.tab.c" /* yacc.c:1646 */
3400 #line 562 "parser.y" /* yacc.c:1646 */
3401 { (yyval
.attr
) = make_attr(ATTR_PARTIALIGNORE
); }
3402 #line 3403 "parser.tab.c" /* yacc.c:1646 */
3406 #line 563 "parser.y" /* yacc.c:1646 */
3407 { (yyval
.attr
) = make_attrv(ATTR_POINTERDEFAULT
, (yyvsp
[-1].num
)); }
3408 #line 3409 "parser.tab.c" /* yacc.c:1646 */
3412 #line 564 "parser.y" /* yacc.c:1646 */
3413 { (yyval
.attr
) = make_attrp(ATTR_PROGID
, (yyvsp
[-1].str
)); }
3414 #line 3415 "parser.tab.c" /* yacc.c:1646 */
3418 #line 565 "parser.y" /* yacc.c:1646 */
3419 { (yyval
.attr
) = make_attr(ATTR_PROPGET
); }
3420 #line 3421 "parser.tab.c" /* yacc.c:1646 */
3424 #line 566 "parser.y" /* yacc.c:1646 */
3425 { (yyval
.attr
) = make_attr(ATTR_PROPPUT
); }
3426 #line 3427 "parser.tab.c" /* yacc.c:1646 */
3430 #line 567 "parser.y" /* yacc.c:1646 */
3431 { (yyval
.attr
) = make_attr(ATTR_PROPPUTREF
); }
3432 #line 3433 "parser.tab.c" /* yacc.c:1646 */
3436 #line 568 "parser.y" /* yacc.c:1646 */
3437 { (yyval
.attr
) = make_attr(ATTR_PROXY
); }
3438 #line 3439 "parser.tab.c" /* yacc.c:1646 */
3442 #line 569 "parser.y" /* yacc.c:1646 */
3443 { (yyval
.attr
) = make_attr(ATTR_PUBLIC
); }
3444 #line 3445 "parser.tab.c" /* yacc.c:1646 */
3448 #line 571 "parser.y" /* yacc.c:1646 */
3449 { expr_list_t
*list
= append_expr( NULL
, (yyvsp
[-3].expr
) );
3450 list
= append_expr( list
, (yyvsp
[-1].expr
) );
3451 (yyval
.attr
) = make_attrp(ATTR_RANGE
, list
); }
3452 #line 3453 "parser.tab.c" /* yacc.c:1646 */
3456 #line 574 "parser.y" /* yacc.c:1646 */
3457 { (yyval
.attr
) = make_attr(ATTR_READONLY
); }
3458 #line 3459 "parser.tab.c" /* yacc.c:1646 */
3462 #line 575 "parser.y" /* yacc.c:1646 */
3463 { (yyval
.attr
) = make_attrp(ATTR_REPRESENTAS
, (yyvsp
[-1].type
)); }
3464 #line 3465 "parser.tab.c" /* yacc.c:1646 */
3468 #line 576 "parser.y" /* yacc.c:1646 */
3469 { (yyval
.attr
) = make_attr(ATTR_REQUESTEDIT
); }
3470 #line 3471 "parser.tab.c" /* yacc.c:1646 */
3474 #line 577 "parser.y" /* yacc.c:1646 */
3475 { (yyval
.attr
) = make_attr(ATTR_RESTRICTED
); }
3476 #line 3477 "parser.tab.c" /* yacc.c:1646 */
3480 #line 578 "parser.y" /* yacc.c:1646 */
3481 { (yyval
.attr
) = make_attr(ATTR_RETVAL
); }
3482 #line 3483 "parser.tab.c" /* yacc.c:1646 */
3486 #line 579 "parser.y" /* yacc.c:1646 */
3487 { (yyval
.attr
) = make_attrp(ATTR_SIZEIS
, (yyvsp
[-1].expr_list
)); }
3488 #line 3489 "parser.tab.c" /* yacc.c:1646 */
3492 #line 580 "parser.y" /* yacc.c:1646 */
3493 { (yyval
.attr
) = make_attr(ATTR_SOURCE
); }
3494 #line 3495 "parser.tab.c" /* yacc.c:1646 */
3498 #line 581 "parser.y" /* yacc.c:1646 */
3499 { (yyval
.attr
) = make_attr(ATTR_STRICTCONTEXTHANDLE
); }
3500 #line 3501 "parser.tab.c" /* yacc.c:1646 */
3504 #line 582 "parser.y" /* yacc.c:1646 */
3505 { (yyval
.attr
) = make_attr(ATTR_STRING
); }
3506 #line 3507 "parser.tab.c" /* yacc.c:1646 */
3510 #line 583 "parser.y" /* yacc.c:1646 */
3511 { (yyval
.attr
) = make_attrp(ATTR_SWITCHIS
, (yyvsp
[-1].expr
)); }
3512 #line 3513 "parser.tab.c" /* yacc.c:1646 */
3516 #line 584 "parser.y" /* yacc.c:1646 */
3517 { (yyval
.attr
) = make_attrp(ATTR_SWITCHTYPE
, (yyvsp
[-1].type
)); }
3518 #line 3519 "parser.tab.c" /* yacc.c:1646 */
3522 #line 585 "parser.y" /* yacc.c:1646 */
3523 { (yyval
.attr
) = make_attrp(ATTR_TRANSMITAS
, (yyvsp
[-1].type
)); }
3524 #line 3525 "parser.tab.c" /* yacc.c:1646 */
3528 #line 586 "parser.y" /* yacc.c:1646 */
3529 { (yyval
.attr
) = make_attrv(ATTR_THREADING
, (yyvsp
[-1].num
)); }
3530 #line 3531 "parser.tab.c" /* yacc.c:1646 */
3534 #line 587 "parser.y" /* yacc.c:1646 */
3535 { (yyval
.attr
) = make_attr(ATTR_UIDEFAULT
); }
3536 #line 3537 "parser.tab.c" /* yacc.c:1646 */
3540 #line 588 "parser.y" /* yacc.c:1646 */
3541 { (yyval
.attr
) = make_attr(ATTR_USESGETLASTERROR
); }
3542 #line 3543 "parser.tab.c" /* yacc.c:1646 */
3546 #line 589 "parser.y" /* yacc.c:1646 */
3547 { (yyval
.attr
) = make_attrp(ATTR_USERMARSHAL
, (yyvsp
[-1].type
)); }
3548 #line 3549 "parser.tab.c" /* yacc.c:1646 */
3552 #line 590 "parser.y" /* yacc.c:1646 */
3553 { (yyval
.attr
) = make_attrp(ATTR_UUID
, (yyvsp
[-1].uuid
)); }
3554 #line 3555 "parser.tab.c" /* yacc.c:1646 */
3558 #line 591 "parser.y" /* yacc.c:1646 */
3559 { (yyval
.attr
) = make_attrp(ATTR_ASYNCUUID
, (yyvsp
[-1].uuid
)); }
3560 #line 3561 "parser.tab.c" /* yacc.c:1646 */
3564 #line 592 "parser.y" /* yacc.c:1646 */
3565 { (yyval
.attr
) = make_attr(ATTR_V1ENUM
); }
3566 #line 3567 "parser.tab.c" /* yacc.c:1646 */
3570 #line 593 "parser.y" /* yacc.c:1646 */
3571 { (yyval
.attr
) = make_attr(ATTR_VARARG
); }
3572 #line 3573 "parser.tab.c" /* yacc.c:1646 */
3576 #line 594 "parser.y" /* yacc.c:1646 */
3577 { (yyval
.attr
) = make_attrv(ATTR_VERSION
, (yyvsp
[-1].num
)); }
3578 #line 3579 "parser.tab.c" /* yacc.c:1646 */
3582 #line 595 "parser.y" /* yacc.c:1646 */
3583 { (yyval
.attr
) = make_attrp(ATTR_VIPROGID
, (yyvsp
[-1].str
)); }
3584 #line 3585 "parser.tab.c" /* yacc.c:1646 */
3588 #line 596 "parser.y" /* yacc.c:1646 */
3589 { (yyval
.attr
) = make_attrp(ATTR_WIREMARSHAL
, (yyvsp
[-1].type
)); }
3590 #line 3591 "parser.tab.c" /* yacc.c:1646 */
3594 #line 597 "parser.y" /* yacc.c:1646 */
3595 { (yyval
.attr
) = make_attrv(ATTR_POINTERTYPE
, (yyvsp
[0].num
)); }
3596 #line 3597 "parser.tab.c" /* yacc.c:1646 */
3600 #line 602 "parser.y" /* yacc.c:1646 */
3601 { if (!is_valid_uuid((yyvsp
[0].str
)))
3602 error_loc("invalid UUID: %s\n", (yyvsp
[0].str
));
3603 (yyval
.uuid
) = parse_uuid((yyvsp
[0].str
)); }
3604 #line 3605 "parser.tab.c" /* yacc.c:1646 */
3608 #line 607 "parser.y" /* yacc.c:1646 */
3609 { (yyval
.str
) = xstrdup("__cdecl"); }
3610 #line 3611 "parser.tab.c" /* yacc.c:1646 */
3614 #line 608 "parser.y" /* yacc.c:1646 */
3615 { (yyval
.str
) = xstrdup("__fastcall"); }
3616 #line 3617 "parser.tab.c" /* yacc.c:1646 */
3620 #line 609 "parser.y" /* yacc.c:1646 */
3621 { (yyval
.str
) = xstrdup("__pascal"); }
3622 #line 3623 "parser.tab.c" /* yacc.c:1646 */
3626 #line 610 "parser.y" /* yacc.c:1646 */
3627 { (yyval
.str
) = xstrdup("__stdcall"); }
3628 #line 3629 "parser.tab.c" /* yacc.c:1646 */
3632 #line 613 "parser.y" /* yacc.c:1646 */
3633 { (yyval
.var_list
) = NULL
; }
3634 #line 3635 "parser.tab.c" /* yacc.c:1646 */
3638 #line 614 "parser.y" /* yacc.c:1646 */
3639 { (yyval
.var_list
) = append_var( (yyvsp
[-1].var_list
), (yyvsp
[0].var
) ); }
3640 #line 3641 "parser.tab.c" /* yacc.c:1646 */
3644 #line 617 "parser.y" /* yacc.c:1646 */
3645 { attr_t
*a
= make_attrp(ATTR_CASE
, append_expr( NULL
, (yyvsp
[-2].expr
) ));
3646 (yyval
.var
) = (yyvsp
[0].var
); if (!(yyval
.var
)) (yyval
.var
) = make_var(NULL
);
3647 (yyval
.var
)->attrs
= append_attr( (yyval
.var
)->attrs
, a
);
3649 #line 3650 "parser.tab.c" /* yacc.c:1646 */
3653 #line 621 "parser.y" /* yacc.c:1646 */
3654 { attr_t
*a
= make_attr(ATTR_DEFAULT
);
3655 (yyval
.var
) = (yyvsp
[0].var
); if (!(yyval
.var
)) (yyval
.var
) = make_var(NULL
);
3656 (yyval
.var
)->attrs
= append_attr( (yyval
.var
)->attrs
, a
);
3658 #line 3659 "parser.tab.c" /* yacc.c:1646 */
3662 #line 627 "parser.y" /* yacc.c:1646 */
3663 { (yyval
.var_list
) = NULL
; }
3664 #line 3665 "parser.tab.c" /* yacc.c:1646 */
3668 #line 628 "parser.y" /* yacc.c:1646 */
3669 { (yyval
.var_list
) = (yyvsp
[-1].var_list
); }
3670 #line 3671 "parser.tab.c" /* yacc.c:1646 */
3674 #line 632 "parser.y" /* yacc.c:1646 */
3675 { if (!(yyvsp
[0].var
)->eval
)
3676 (yyvsp
[0].var
)->eval
= make_exprl(EXPR_NUM
, 0 /* default for first enum entry */);
3677 (yyval
.var_list
) = append_var( NULL
, (yyvsp
[0].var
) );
3679 #line 3680 "parser.tab.c" /* yacc.c:1646 */
3683 #line 636 "parser.y" /* yacc.c:1646 */
3684 { if (!(yyvsp
[0].var
)->eval
)
3686 var_t
*last
= LIST_ENTRY( list_tail((yyval
.var_list
)), var_t
, entry
);
3687 enum expr_type type
= EXPR_NUM
;
3688 if (last
->eval
->type
== EXPR_HEXNUM
) type
= EXPR_HEXNUM
;
3689 if (last
->eval
->cval
+ 1 < 0) type
= EXPR_HEXNUM
;
3690 (yyvsp
[0].var
)->eval
= make_exprl(type
, last
->eval
->cval
+ 1);
3692 (yyval
.var_list
) = append_var( (yyvsp
[-2].var_list
), (yyvsp
[0].var
) );
3694 #line 3695 "parser.tab.c" /* yacc.c:1646 */
3698 #line 648 "parser.y" /* yacc.c:1646 */
3699 { (yyval
.var
) = reg_const((yyvsp
[-2].var
));
3700 (yyval
.var
)->eval
= (yyvsp
[0].expr
);
3701 (yyval
.var
)->type
= type_new_int(TYPE_BASIC_INT
, 0);
3703 #line 3704 "parser.tab.c" /* yacc.c:1646 */
3707 #line 652 "parser.y" /* yacc.c:1646 */
3708 { (yyval
.var
) = reg_const((yyvsp
[0].var
));
3709 (yyval
.var
)->type
= type_new_int(TYPE_BASIC_INT
, 0);
3711 #line 3712 "parser.tab.c" /* yacc.c:1646 */
3715 #line 657 "parser.y" /* yacc.c:1646 */
3716 { (yyval
.type
) = type_new_enum((yyvsp
[-3].str
), current_namespace
, TRUE
, (yyvsp
[-1].var_list
)); }
3717 #line 3718 "parser.tab.c" /* yacc.c:1646 */
3721 #line 660 "parser.y" /* yacc.c:1646 */
3722 { (yyval
.expr_list
) = append_expr( NULL
, (yyvsp
[0].expr
) ); }
3723 #line 3724 "parser.tab.c" /* yacc.c:1646 */
3727 #line 661 "parser.y" /* yacc.c:1646 */
3728 { (yyval
.expr_list
) = append_expr( (yyvsp
[-2].expr_list
), (yyvsp
[0].expr
) ); }
3729 #line 3730 "parser.tab.c" /* yacc.c:1646 */
3733 #line 664 "parser.y" /* yacc.c:1646 */
3734 { (yyval
.expr
) = make_expr(EXPR_VOID
); }
3735 #line 3736 "parser.tab.c" /* yacc.c:1646 */
3739 #line 668 "parser.y" /* yacc.c:1646 */
3740 { (yyval
.expr
) = make_exprl(EXPR_NUM
, (yyvsp
[0].num
)); }
3741 #line 3742 "parser.tab.c" /* yacc.c:1646 */
3745 #line 669 "parser.y" /* yacc.c:1646 */
3746 { (yyval
.expr
) = make_exprl(EXPR_HEXNUM
, (yyvsp
[0].num
)); }
3747 #line 3748 "parser.tab.c" /* yacc.c:1646 */
3751 #line 670 "parser.y" /* yacc.c:1646 */
3752 { (yyval
.expr
) = make_exprd(EXPR_DOUBLE
, (yyvsp
[0].dbl
)); }
3753 #line 3754 "parser.tab.c" /* yacc.c:1646 */
3757 #line 671 "parser.y" /* yacc.c:1646 */
3758 { (yyval
.expr
) = make_exprl(EXPR_TRUEFALSE
, 0); }
3759 #line 3760 "parser.tab.c" /* yacc.c:1646 */
3763 #line 672 "parser.y" /* yacc.c:1646 */
3764 { (yyval
.expr
) = make_exprl(EXPR_NUM
, 0); }
3765 #line 3766 "parser.tab.c" /* yacc.c:1646 */
3769 #line 673 "parser.y" /* yacc.c:1646 */
3770 { (yyval
.expr
) = make_exprl(EXPR_TRUEFALSE
, 1); }
3771 #line 3772 "parser.tab.c" /* yacc.c:1646 */
3775 #line 674 "parser.y" /* yacc.c:1646 */
3776 { (yyval
.expr
) = make_exprs(EXPR_STRLIT
, (yyvsp
[0].str
)); }
3777 #line 3778 "parser.tab.c" /* yacc.c:1646 */
3781 #line 675 "parser.y" /* yacc.c:1646 */
3782 { (yyval
.expr
) = make_exprs(EXPR_WSTRLIT
, (yyvsp
[0].str
)); }
3783 #line 3784 "parser.tab.c" /* yacc.c:1646 */
3787 #line 676 "parser.y" /* yacc.c:1646 */
3788 { (yyval
.expr
) = make_exprs(EXPR_CHARCONST
, (yyvsp
[0].str
)); }
3789 #line 3790 "parser.tab.c" /* yacc.c:1646 */
3793 #line 677 "parser.y" /* yacc.c:1646 */
3794 { (yyval
.expr
) = make_exprs(EXPR_IDENTIFIER
, (yyvsp
[0].str
)); }
3795 #line 3796 "parser.tab.c" /* yacc.c:1646 */
3799 #line 678 "parser.y" /* yacc.c:1646 */
3800 { (yyval
.expr
) = make_expr3(EXPR_COND
, (yyvsp
[-4].expr
), (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); }
3801 #line 3802 "parser.tab.c" /* yacc.c:1646 */
3805 #line 679 "parser.y" /* yacc.c:1646 */
3806 { (yyval
.expr
) = make_expr2(EXPR_LOGOR
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); }
3807 #line 3808 "parser.tab.c" /* yacc.c:1646 */
3811 #line 680 "parser.y" /* yacc.c:1646 */
3812 { (yyval
.expr
) = make_expr2(EXPR_LOGAND
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); }
3813 #line 3814 "parser.tab.c" /* yacc.c:1646 */
3817 #line 681 "parser.y" /* yacc.c:1646 */
3818 { (yyval
.expr
) = make_expr2(EXPR_OR
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); }
3819 #line 3820 "parser.tab.c" /* yacc.c:1646 */
3823 #line 682 "parser.y" /* yacc.c:1646 */
3824 { (yyval
.expr
) = make_expr2(EXPR_XOR
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); }
3825 #line 3826 "parser.tab.c" /* yacc.c:1646 */
3829 #line 683 "parser.y" /* yacc.c:1646 */
3830 { (yyval
.expr
) = make_expr2(EXPR_AND
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); }
3831 #line 3832 "parser.tab.c" /* yacc.c:1646 */
3835 #line 684 "parser.y" /* yacc.c:1646 */
3836 { (yyval
.expr
) = make_expr2(EXPR_EQUALITY
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); }
3837 #line 3838 "parser.tab.c" /* yacc.c:1646 */
3841 #line 685 "parser.y" /* yacc.c:1646 */
3842 { (yyval
.expr
) = make_expr2(EXPR_INEQUALITY
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); }
3843 #line 3844 "parser.tab.c" /* yacc.c:1646 */
3847 #line 686 "parser.y" /* yacc.c:1646 */
3848 { (yyval
.expr
) = make_expr2(EXPR_GTR
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); }
3849 #line 3850 "parser.tab.c" /* yacc.c:1646 */
3853 #line 687 "parser.y" /* yacc.c:1646 */
3854 { (yyval
.expr
) = make_expr2(EXPR_LESS
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); }
3855 #line 3856 "parser.tab.c" /* yacc.c:1646 */
3859 #line 688 "parser.y" /* yacc.c:1646 */
3860 { (yyval
.expr
) = make_expr2(EXPR_GTREQL
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); }
3861 #line 3862 "parser.tab.c" /* yacc.c:1646 */
3865 #line 689 "parser.y" /* yacc.c:1646 */
3866 { (yyval
.expr
) = make_expr2(EXPR_LESSEQL
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); }
3867 #line 3868 "parser.tab.c" /* yacc.c:1646 */
3871 #line 690 "parser.y" /* yacc.c:1646 */
3872 { (yyval
.expr
) = make_expr2(EXPR_SHL
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); }
3873 #line 3874 "parser.tab.c" /* yacc.c:1646 */
3877 #line 691 "parser.y" /* yacc.c:1646 */
3878 { (yyval
.expr
) = make_expr2(EXPR_SHR
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); }
3879 #line 3880 "parser.tab.c" /* yacc.c:1646 */
3883 #line 692 "parser.y" /* yacc.c:1646 */
3884 { (yyval
.expr
) = make_expr2(EXPR_ADD
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); }
3885 #line 3886 "parser.tab.c" /* yacc.c:1646 */
3889 #line 693 "parser.y" /* yacc.c:1646 */
3890 { (yyval
.expr
) = make_expr2(EXPR_SUB
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); }
3891 #line 3892 "parser.tab.c" /* yacc.c:1646 */
3895 #line 694 "parser.y" /* yacc.c:1646 */
3896 { (yyval
.expr
) = make_expr2(EXPR_MOD
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); }
3897 #line 3898 "parser.tab.c" /* yacc.c:1646 */
3901 #line 695 "parser.y" /* yacc.c:1646 */
3902 { (yyval
.expr
) = make_expr2(EXPR_MUL
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); }
3903 #line 3904 "parser.tab.c" /* yacc.c:1646 */
3907 #line 696 "parser.y" /* yacc.c:1646 */
3908 { (yyval
.expr
) = make_expr2(EXPR_DIV
, (yyvsp
[-2].expr
), (yyvsp
[0].expr
)); }
3909 #line 3910 "parser.tab.c" /* yacc.c:1646 */
3913 #line 697 "parser.y" /* yacc.c:1646 */
3914 { (yyval
.expr
) = make_expr1(EXPR_LOGNOT
, (yyvsp
[0].expr
)); }
3915 #line 3916 "parser.tab.c" /* yacc.c:1646 */
3919 #line 698 "parser.y" /* yacc.c:1646 */
3920 { (yyval
.expr
) = make_expr1(EXPR_NOT
, (yyvsp
[0].expr
)); }
3921 #line 3922 "parser.tab.c" /* yacc.c:1646 */
3925 #line 699 "parser.y" /* yacc.c:1646 */
3926 { (yyval
.expr
) = make_expr1(EXPR_POS
, (yyvsp
[0].expr
)); }
3927 #line 3928 "parser.tab.c" /* yacc.c:1646 */
3931 #line 700 "parser.y" /* yacc.c:1646 */
3932 { (yyval
.expr
) = make_expr1(EXPR_NEG
, (yyvsp
[0].expr
)); }
3933 #line 3934 "parser.tab.c" /* yacc.c:1646 */
3937 #line 701 "parser.y" /* yacc.c:1646 */
3938 { (yyval
.expr
) = make_expr1(EXPR_ADDRESSOF
, (yyvsp
[0].expr
)); }
3939 #line 3940 "parser.tab.c" /* yacc.c:1646 */
3943 #line 702 "parser.y" /* yacc.c:1646 */
3944 { (yyval
.expr
) = make_expr1(EXPR_PPTR
, (yyvsp
[0].expr
)); }
3945 #line 3946 "parser.tab.c" /* yacc.c:1646 */
3949 #line 703 "parser.y" /* yacc.c:1646 */
3950 { (yyval
.expr
) = make_expr2(EXPR_MEMBER
, make_expr1(EXPR_PPTR
, (yyvsp
[-2].expr
)), make_exprs(EXPR_IDENTIFIER
, (yyvsp
[0].str
))); }
3951 #line 3952 "parser.tab.c" /* yacc.c:1646 */
3955 #line 704 "parser.y" /* yacc.c:1646 */
3956 { (yyval
.expr
) = make_expr2(EXPR_MEMBER
, (yyvsp
[-2].expr
), make_exprs(EXPR_IDENTIFIER
, (yyvsp
[0].str
))); }
3957 #line 3958 "parser.tab.c" /* yacc.c:1646 */
3961 #line 706 "parser.y" /* yacc.c:1646 */
3962 { (yyval
.expr
) = make_exprt(EXPR_CAST
, declare_var(NULL
, (yyvsp
[-3].declspec
), (yyvsp
[-2].declarator
), 0), (yyvsp
[0].expr
)); free((yyvsp
[-3].declspec
)); free((yyvsp
[-2].declarator
)); }
3963 #line 3964 "parser.tab.c" /* yacc.c:1646 */
3967 #line 708 "parser.y" /* yacc.c:1646 */
3968 { (yyval
.expr
) = make_exprt(EXPR_SIZEOF
, declare_var(NULL
, (yyvsp
[-2].declspec
), (yyvsp
[-1].declarator
), 0), NULL
); free((yyvsp
[-2].declspec
)); free((yyvsp
[-1].declarator
)); }
3969 #line 3970 "parser.tab.c" /* yacc.c:1646 */
3973 #line 709 "parser.y" /* yacc.c:1646 */
3974 { (yyval
.expr
) = make_expr2(EXPR_ARRAY
, (yyvsp
[-3].expr
), (yyvsp
[-1].expr
)); }
3975 #line 3976 "parser.tab.c" /* yacc.c:1646 */
3979 #line 710 "parser.y" /* yacc.c:1646 */
3980 { (yyval
.expr
) = (yyvsp
[-1].expr
); }
3981 #line 3982 "parser.tab.c" /* yacc.c:1646 */
3985 #line 713 "parser.y" /* yacc.c:1646 */
3986 { (yyval
.expr_list
) = append_expr( NULL
, (yyvsp
[0].expr
) ); }
3987 #line 3988 "parser.tab.c" /* yacc.c:1646 */
3991 #line 714 "parser.y" /* yacc.c:1646 */
3992 { (yyval
.expr_list
) = append_expr( (yyvsp
[-2].expr_list
), (yyvsp
[0].expr
) ); }
3993 #line 3994 "parser.tab.c" /* yacc.c:1646 */
3997 #line 717 "parser.y" /* yacc.c:1646 */
3998 { (yyval
.expr
) = (yyvsp
[0].expr
);
3999 if (!(yyval
.expr
)->is_const
)
4000 error_loc("expression is not an integer constant\n");
4002 #line 4003 "parser.tab.c" /* yacc.c:1646 */
4006 #line 723 "parser.y" /* yacc.c:1646 */
4007 { (yyval
.expr
) = (yyvsp
[0].expr
);
4008 if (!(yyval
.expr
)->is_const
&& (yyval
.expr
)->type
!= EXPR_STRLIT
&& (yyval
.expr
)->type
!= EXPR_WSTRLIT
)
4009 error_loc("expression is not constant\n");
4011 #line 4012 "parser.tab.c" /* yacc.c:1646 */
4015 #line 729 "parser.y" /* yacc.c:1646 */
4016 { (yyval
.var_list
) = NULL
; }
4017 #line 4018 "parser.tab.c" /* yacc.c:1646 */
4021 #line 730 "parser.y" /* yacc.c:1646 */
4022 { (yyval
.var_list
) = append_var_list((yyvsp
[-1].var_list
), (yyvsp
[0].var_list
)); }
4023 #line 4024 "parser.tab.c" /* yacc.c:1646 */
4027 #line 734 "parser.y" /* yacc.c:1646 */
4028 { const char *first
= LIST_ENTRY(list_head((yyvsp
[-1].declarator_list
)), declarator_t
, entry
)->var
->name
;
4029 check_field_attrs(first
, (yyvsp
[-3].attr_list
));
4030 (yyval
.var_list
) = set_var_types((yyvsp
[-3].attr_list
), (yyvsp
[-2].declspec
), (yyvsp
[-1].declarator_list
));
4032 #line 4033 "parser.tab.c" /* yacc.c:1646 */
4036 #line 738 "parser.y" /* yacc.c:1646 */
4037 { var_t
*v
= make_var(NULL
);
4038 v
->type
= (yyvsp
[-1].type
); v
->attrs
= (yyvsp
[-2].attr_list
);
4039 (yyval
.var_list
) = append_var(NULL
, v
);
4041 #line 4042 "parser.tab.c" /* yacc.c:1646 */
4045 #line 745 "parser.y" /* yacc.c:1646 */
4046 { (yyval
.var
) = (yyvsp
[-1].var
); }
4047 #line 4048 "parser.tab.c" /* yacc.c:1646 */
4051 #line 746 "parser.y" /* yacc.c:1646 */
4052 { (yyval
.var
) = make_var(NULL
); (yyval
.var
)->attrs
= (yyvsp
[-1].attr_list
); }
4053 #line 4054 "parser.tab.c" /* yacc.c:1646 */
4057 #line 749 "parser.y" /* yacc.c:1646 */
4058 { (yyval
.var_list
) = NULL
; }
4059 #line 4060 "parser.tab.c" /* yacc.c:1646 */
4063 #line 750 "parser.y" /* yacc.c:1646 */
4064 { (yyval
.var_list
) = append_var( (yyvsp
[-1].var_list
), (yyvsp
[0].var
) ); }
4065 #line 4066 "parser.tab.c" /* yacc.c:1646 */
4069 #line 754 "parser.y" /* yacc.c:1646 */
4070 { (yyval
.var
) = (yyvsp
[-1].var
); }
4071 #line 4072 "parser.tab.c" /* yacc.c:1646 */
4075 #line 755 "parser.y" /* yacc.c:1646 */
4076 { (yyval
.var
) = NULL
; }
4077 #line 4078 "parser.tab.c" /* yacc.c:1646 */
4081 #line 758 "parser.y" /* yacc.c:1646 */
4082 { (yyval
.var
) = declare_var(check_field_attrs((yyvsp
[0].declarator
)->var
->name
, (yyvsp
[-2].attr_list
)),
4083 (yyvsp
[-1].declspec
), (yyvsp
[0].declarator
), FALSE
);
4084 free((yyvsp
[0].declarator
));
4086 #line 4087 "parser.tab.c" /* yacc.c:1646 */
4090 #line 762 "parser.y" /* yacc.c:1646 */
4091 { var_t
*v
= make_var(NULL
);
4092 v
->type
= (yyvsp
[0].type
); v
->attrs
= (yyvsp
[-1].attr_list
);
4095 #line 4096 "parser.tab.c" /* yacc.c:1646 */
4099 #line 768 "parser.y" /* yacc.c:1646 */
4100 { (yyval
.var
) = (yyvsp
[0].var
);
4101 if (type_get_type((yyval
.var
)->type
) != TYPE_FUNCTION
)
4102 error_loc("only methods may be declared inside the methods section of a dispinterface\n");
4103 check_function_attrs((yyval
.var
)->name
, (yyval
.var
)->attrs
);
4105 #line 4106 "parser.tab.c" /* yacc.c:1646 */
4109 #line 777 "parser.y" /* yacc.c:1646 */
4110 { (yyval
.var
) = declare_var((yyvsp
[-2].attr_list
), (yyvsp
[-1].declspec
), (yyvsp
[0].declarator
), FALSE
);
4111 free((yyvsp
[0].declarator
));
4113 #line 4114 "parser.tab.c" /* yacc.c:1646 */
4117 #line 780 "parser.y" /* yacc.c:1646 */
4118 { (yyval
.var
) = declare_var(NULL
, (yyvsp
[-1].declspec
), (yyvsp
[0].declarator
), FALSE
);
4119 free((yyvsp
[0].declarator
));
4121 #line 4122 "parser.tab.c" /* yacc.c:1646 */
4125 #line 785 "parser.y" /* yacc.c:1646 */
4126 { (yyval
.var
) = NULL
; }
4127 #line 4128 "parser.tab.c" /* yacc.c:1646 */
4131 #line 789 "parser.y" /* yacc.c:1646 */
4132 { (yyval
.str
) = NULL
; }
4133 #line 4134 "parser.tab.c" /* yacc.c:1646 */
4137 #line 790 "parser.y" /* yacc.c:1646 */
4138 { (yyval
.str
) = (yyvsp
[0].str
); }
4139 #line 4140 "parser.tab.c" /* yacc.c:1646 */
4143 #line 791 "parser.y" /* yacc.c:1646 */
4144 { (yyval
.str
) = (yyvsp
[0].str
); }
4145 #line 4146 "parser.tab.c" /* yacc.c:1646 */
4149 #line 794 "parser.y" /* yacc.c:1646 */
4150 { (yyval
.var
) = make_var((yyvsp
[0].str
)); }
4151 #line 4152 "parser.tab.c" /* yacc.c:1646 */
4155 #line 796 "parser.y" /* yacc.c:1646 */
4156 { (yyval
.var
) = make_var((yyvsp
[0].str
)); }
4157 #line 4158 "parser.tab.c" /* yacc.c:1646 */
4161 #line 799 "parser.y" /* yacc.c:1646 */
4162 { (yyval
.type
) = find_type_or_error((yyvsp
[0].str
), 0); }
4163 #line 4164 "parser.tab.c" /* yacc.c:1646 */
4167 #line 800 "parser.y" /* yacc.c:1646 */
4168 { (yyval
.type
) = find_type_or_error((yyvsp
[0].str
), 0); }
4169 #line 4170 "parser.tab.c" /* yacc.c:1646 */
4173 #line 802 "parser.y" /* yacc.c:1646 */
4174 { (yyval
.type
) = type_new_int(type_basic_get_type((yyvsp
[0].type
)), -1); }
4175 #line 4176 "parser.tab.c" /* yacc.c:1646 */
4179 #line 803 "parser.y" /* yacc.c:1646 */
4180 { (yyval
.type
) = type_new_int(type_basic_get_type((yyvsp
[0].type
)), 1); }
4181 #line 4182 "parser.tab.c" /* yacc.c:1646 */
4185 #line 804 "parser.y" /* yacc.c:1646 */
4186 { (yyval
.type
) = type_new_int(TYPE_BASIC_INT
, 1); }
4187 #line 4188 "parser.tab.c" /* yacc.c:1646 */
4191 #line 805 "parser.y" /* yacc.c:1646 */
4192 { (yyval
.type
) = find_type_or_error((yyvsp
[0].str
), 0); }
4193 #line 4194 "parser.tab.c" /* yacc.c:1646 */
4197 #line 806 "parser.y" /* yacc.c:1646 */
4198 { (yyval
.type
) = find_type_or_error((yyvsp
[0].str
), 0); }
4199 #line 4200 "parser.tab.c" /* yacc.c:1646 */
4203 #line 807 "parser.y" /* yacc.c:1646 */
4204 { (yyval
.type
) = find_type_or_error((yyvsp
[0].str
), 0); }
4205 #line 4206 "parser.tab.c" /* yacc.c:1646 */
4209 #line 808 "parser.y" /* yacc.c:1646 */
4210 { (yyval
.type
) = find_type_or_error((yyvsp
[0].str
), 0); }
4211 #line 4212 "parser.tab.c" /* yacc.c:1646 */
4215 #line 809 "parser.y" /* yacc.c:1646 */
4216 { (yyval
.type
) = find_type_or_error((yyvsp
[0].str
), 0); }
4217 #line 4218 "parser.tab.c" /* yacc.c:1646 */
4221 #line 816 "parser.y" /* yacc.c:1646 */
4222 { (yyval
.type
) = type_new_int(TYPE_BASIC_INT
, 0); }
4223 #line 4224 "parser.tab.c" /* yacc.c:1646 */
4227 #line 817 "parser.y" /* yacc.c:1646 */
4228 { (yyval
.type
) = type_new_int(TYPE_BASIC_INT16
, 0); }
4229 #line 4230 "parser.tab.c" /* yacc.c:1646 */
4233 #line 818 "parser.y" /* yacc.c:1646 */
4234 { (yyval
.type
) = type_new_int(TYPE_BASIC_INT8
, 0); }
4235 #line 4236 "parser.tab.c" /* yacc.c:1646 */
4239 #line 819 "parser.y" /* yacc.c:1646 */
4240 { (yyval
.type
) = type_new_int(TYPE_BASIC_INT32
, 0); }
4241 #line 4242 "parser.tab.c" /* yacc.c:1646 */
4245 #line 820 "parser.y" /* yacc.c:1646 */
4246 { (yyval
.type
) = type_new_int(TYPE_BASIC_HYPER
, 0); }
4247 #line 4248 "parser.tab.c" /* yacc.c:1646 */
4251 #line 821 "parser.y" /* yacc.c:1646 */
4252 { (yyval
.type
) = type_new_int(TYPE_BASIC_INT64
, 0); }
4253 #line 4254 "parser.tab.c" /* yacc.c:1646 */
4257 #line 822 "parser.y" /* yacc.c:1646 */
4258 { (yyval
.type
) = type_new_int(TYPE_BASIC_CHAR
, 0); }
4259 #line 4260 "parser.tab.c" /* yacc.c:1646 */
4263 #line 823 "parser.y" /* yacc.c:1646 */
4264 { (yyval
.type
) = type_new_int(TYPE_BASIC_INT3264
, 0); }
4265 #line 4266 "parser.tab.c" /* yacc.c:1646 */
4269 #line 826 "parser.y" /* yacc.c:1646 */
4270 { (yyval
.type
) = type_new_coclass((yyvsp
[0].str
)); }
4271 #line 4272 "parser.tab.c" /* yacc.c:1646 */
4275 #line 827 "parser.y" /* yacc.c:1646 */
4276 { (yyval
.type
) = find_type((yyvsp
[0].str
), NULL
, 0);
4277 if (type_get_type_detect_alias((yyval
.type
)) != TYPE_COCLASS
)
4278 error_loc("%s was not declared a coclass at %s:%d\n",
4279 (yyvsp
[0].str
), (yyval
.type
)->loc_info
.input_name
,
4280 (yyval
.type
)->loc_info
.line_number
);
4282 #line 4283 "parser.tab.c" /* yacc.c:1646 */
4286 #line 835 "parser.y" /* yacc.c:1646 */
4287 { (yyval
.type
) = (yyvsp
[0].type
);
4288 check_def((yyval
.type
));
4289 (yyval
.type
)->attrs
= check_coclass_attrs((yyvsp
[0].type
)->name
, (yyvsp
[-1].attr_list
));
4291 #line 4292 "parser.tab.c" /* yacc.c:1646 */
4295 #line 842 "parser.y" /* yacc.c:1646 */
4296 { (yyval
.type
) = type_coclass_define((yyvsp
[-4].type
), (yyvsp
[-2].ifref_list
)); }
4297 #line 4298 "parser.tab.c" /* yacc.c:1646 */
4301 #line 845 "parser.y" /* yacc.c:1646 */
4302 { (yyval
.str
) = (yyvsp
[0].str
); }
4303 #line 4304 "parser.tab.c" /* yacc.c:1646 */
4307 #line 848 "parser.y" /* yacc.c:1646 */
4308 { (yyval
.ifref_list
) = NULL
; }
4309 #line 4310 "parser.tab.c" /* yacc.c:1646 */
4313 #line 849 "parser.y" /* yacc.c:1646 */
4314 { (yyval
.ifref_list
) = append_ifref( (yyvsp
[-1].ifref_list
), (yyvsp
[0].ifref
) ); }
4315 #line 4316 "parser.tab.c" /* yacc.c:1646 */
4319 #line 853 "parser.y" /* yacc.c:1646 */
4320 { (yyval
.ifref
) = make_ifref((yyvsp
[0].type
)); (yyval
.ifref
)->attrs
= (yyvsp
[-1].attr_list
); }
4321 #line 4322 "parser.tab.c" /* yacc.c:1646 */
4325 #line 856 "parser.y" /* yacc.c:1646 */
4326 { (yyval
.type
) = get_type(TYPE_INTERFACE
, (yyvsp
[0].str
), current_namespace
, 0); }
4327 #line 4328 "parser.tab.c" /* yacc.c:1646 */
4331 #line 857 "parser.y" /* yacc.c:1646 */
4332 { (yyval
.type
) = get_type(TYPE_INTERFACE
, (yyvsp
[0].str
), current_namespace
, 0); }
4333 #line 4334 "parser.tab.c" /* yacc.c:1646 */
4337 #line 860 "parser.y" /* yacc.c:1646 */
4339 (yyval
.type
) = (yyvsp
[0].type
);
4340 check_def((yyval
.type
));
4341 attrs
= make_attr(ATTR_DISPINTERFACE
);
4342 (yyval
.type
)->attrs
= append_attr( check_dispiface_attrs((yyvsp
[0].type
)->name
, (yyvsp
[-1].attr_list
)), attrs
);
4343 (yyval
.type
)->defined
= TRUE
;
4345 #line 4346 "parser.tab.c" /* yacc.c:1646 */
4349 #line 869 "parser.y" /* yacc.c:1646 */
4350 { (yyval
.var_list
) = NULL
; }
4351 #line 4352 "parser.tab.c" /* yacc.c:1646 */
4355 #line 870 "parser.y" /* yacc.c:1646 */
4356 { (yyval
.var_list
) = append_var( (yyvsp
[-2].var_list
), (yyvsp
[-1].var
) ); }
4357 #line 4358 "parser.tab.c" /* yacc.c:1646 */
4361 #line 873 "parser.y" /* yacc.c:1646 */
4362 { (yyval
.var_list
) = NULL
; }
4363 #line 4364 "parser.tab.c" /* yacc.c:1646 */
4367 #line 874 "parser.y" /* yacc.c:1646 */
4368 { (yyval
.var_list
) = append_var( (yyvsp
[-2].var_list
), (yyvsp
[-1].var
) ); }
4369 #line 4370 "parser.tab.c" /* yacc.c:1646 */
4373 #line 880 "parser.y" /* yacc.c:1646 */
4374 { (yyval
.type
) = (yyvsp
[-4].type
);
4375 type_dispinterface_define((yyval
.type
), (yyvsp
[-2].var_list
), (yyvsp
[-1].var_list
));
4377 #line 4378 "parser.tab.c" /* yacc.c:1646 */
4381 #line 884 "parser.y" /* yacc.c:1646 */
4382 { (yyval
.type
) = (yyvsp
[-4].type
);
4383 type_dispinterface_define_from_iface((yyval
.type
), (yyvsp
[-2].type
));
4385 #line 4386 "parser.tab.c" /* yacc.c:1646 */
4389 #line 889 "parser.y" /* yacc.c:1646 */
4390 { (yyval
.type
) = NULL
; }
4391 #line 4392 "parser.tab.c" /* yacc.c:1646 */
4395 #line 890 "parser.y" /* yacc.c:1646 */
4396 { (yyval
.type
) = find_type_or_error2((yyvsp
[0].str
), 0); }
4397 #line 4398 "parser.tab.c" /* yacc.c:1646 */
4401 #line 893 "parser.y" /* yacc.c:1646 */
4402 { (yyval
.type
) = get_type(TYPE_INTERFACE
, (yyvsp
[0].str
), current_namespace
, 0); }
4403 #line 4404 "parser.tab.c" /* yacc.c:1646 */
4407 #line 894 "parser.y" /* yacc.c:1646 */
4408 { (yyval
.type
) = get_type(TYPE_INTERFACE
, (yyvsp
[0].str
), current_namespace
, 0); }
4409 #line 4410 "parser.tab.c" /* yacc.c:1646 */
4413 #line 897 "parser.y" /* yacc.c:1646 */
4414 { (yyval
.ifinfo
).interface
= (yyvsp
[0].type
);
4415 (yyval
.ifinfo
).old_pointer_default
= pointer_default
;
4416 if (is_attr((yyvsp
[-1].attr_list
), ATTR_POINTERDEFAULT
))
4417 pointer_default
= get_attrv((yyvsp
[-1].attr_list
), ATTR_POINTERDEFAULT
);
4418 check_def((yyvsp
[0].type
));
4419 (yyvsp
[0].type
)->attrs
= check_iface_attrs((yyvsp
[0].type
)->name
, (yyvsp
[-1].attr_list
));
4420 (yyvsp
[0].type
)->defined
= TRUE
;
4422 #line 4423 "parser.tab.c" /* yacc.c:1646 */
4426 #line 908 "parser.y" /* yacc.c:1646 */
4427 { (yyval
.type
) = (yyvsp
[-5].ifinfo
).interface
;
4428 if((yyval
.type
) == (yyvsp
[-4].type
))
4429 error_loc("Interface can't inherit from itself\n");
4430 type_interface_define((yyval
.type
), (yyvsp
[-4].type
), (yyvsp
[-2].stmt_list
));
4431 pointer_default
= (yyvsp
[-5].ifinfo
).old_pointer_default
;
4433 #line 4434 "parser.tab.c" /* yacc.c:1646 */
4437 #line 918 "parser.y" /* yacc.c:1646 */
4438 { (yyval
.type
) = (yyvsp
[-7].ifinfo
).interface
;
4439 type_interface_define((yyval
.type
), find_type_or_error2((yyvsp
[-5].str
), 0), (yyvsp
[-2].stmt_list
));
4440 pointer_default
= (yyvsp
[-7].ifinfo
).old_pointer_default
;
4442 #line 4443 "parser.tab.c" /* yacc.c:1646 */
4446 #line 922 "parser.y" /* yacc.c:1646 */
4447 { (yyval
.type
) = (yyvsp
[-1].type
); }
4448 #line 4449 "parser.tab.c" /* yacc.c:1646 */
4452 #line 926 "parser.y" /* yacc.c:1646 */
4453 { (yyval
.type
) = (yyvsp
[-1].type
); }
4454 #line 4455 "parser.tab.c" /* yacc.c:1646 */
4458 #line 927 "parser.y" /* yacc.c:1646 */
4459 { (yyval
.type
) = (yyvsp
[-1].type
); }
4460 #line 4461 "parser.tab.c" /* yacc.c:1646 */
4464 #line 930 "parser.y" /* yacc.c:1646 */
4465 { (yyval
.type
) = type_new_module((yyvsp
[0].str
)); }
4466 #line 4467 "parser.tab.c" /* yacc.c:1646 */
4470 #line 931 "parser.y" /* yacc.c:1646 */
4471 { (yyval
.type
) = type_new_module((yyvsp
[0].str
)); }
4472 #line 4473 "parser.tab.c" /* yacc.c:1646 */
4476 #line 934 "parser.y" /* yacc.c:1646 */
4477 { (yyval
.type
) = (yyvsp
[0].type
);
4478 (yyval
.type
)->attrs
= check_module_attrs((yyvsp
[0].type
)->name
, (yyvsp
[-1].attr_list
));
4480 #line 4481 "parser.tab.c" /* yacc.c:1646 */
4484 #line 940 "parser.y" /* yacc.c:1646 */
4485 { (yyval
.type
) = (yyvsp
[-4].type
);
4486 type_module_define((yyval
.type
), (yyvsp
[-2].stmt_list
));
4488 #line 4489 "parser.tab.c" /* yacc.c:1646 */
4492 #line 946 "parser.y" /* yacc.c:1646 */
4493 { (yyval
.stgclass
) = STG_EXTERN
; }
4494 #line 4495 "parser.tab.c" /* yacc.c:1646 */
4498 #line 947 "parser.y" /* yacc.c:1646 */
4499 { (yyval
.stgclass
) = STG_STATIC
; }
4500 #line 4501 "parser.tab.c" /* yacc.c:1646 */
4504 #line 948 "parser.y" /* yacc.c:1646 */
4505 { (yyval
.stgclass
) = STG_REGISTER
; }
4506 #line 4507 "parser.tab.c" /* yacc.c:1646 */
4510 #line 952 "parser.y" /* yacc.c:1646 */
4511 { (yyval
.attr
) = make_attr(ATTR_INLINE
); }
4512 #line 4513 "parser.tab.c" /* yacc.c:1646 */
4516 #line 956 "parser.y" /* yacc.c:1646 */
4517 { (yyval
.attr
) = make_attr(ATTR_CONST
); }
4518 #line 4519 "parser.tab.c" /* yacc.c:1646 */
4522 #line 959 "parser.y" /* yacc.c:1646 */
4523 { (yyval
.attr_list
) = NULL
; }
4524 #line 4525 "parser.tab.c" /* yacc.c:1646 */
4528 #line 960 "parser.y" /* yacc.c:1646 */
4529 { (yyval
.attr_list
) = append_attr((yyvsp
[-1].attr_list
), (yyvsp
[0].attr
)); }
4530 #line 4531 "parser.tab.c" /* yacc.c:1646 */
4534 #line 963 "parser.y" /* yacc.c:1646 */
4535 { (yyval
.declspec
) = make_decl_spec((yyvsp
[-1].type
), (yyvsp
[0].declspec
), NULL
, NULL
, STG_NONE
); }
4536 #line 4537 "parser.tab.c" /* yacc.c:1646 */
4540 #line 965 "parser.y" /* yacc.c:1646 */
4541 { (yyval
.declspec
) = make_decl_spec((yyvsp
[-1].type
), (yyvsp
[-2].declspec
), (yyvsp
[0].declspec
), NULL
, STG_NONE
); }
4542 #line 4543 "parser.tab.c" /* yacc.c:1646 */
4546 #line 968 "parser.y" /* yacc.c:1646 */
4547 { (yyval
.declspec
) = NULL
; }
4548 #line 4549 "parser.tab.c" /* yacc.c:1646 */
4552 #line 973 "parser.y" /* yacc.c:1646 */
4553 { (yyval
.declspec
) = make_decl_spec(NULL
, (yyvsp
[0].declspec
), NULL
, (yyvsp
[-1].attr
), STG_NONE
); }
4554 #line 4555 "parser.tab.c" /* yacc.c:1646 */
4558 #line 974 "parser.y" /* yacc.c:1646 */
4559 { (yyval
.declspec
) = make_decl_spec(NULL
, (yyvsp
[0].declspec
), NULL
, (yyvsp
[-1].attr
), STG_NONE
); }
4560 #line 4561 "parser.tab.c" /* yacc.c:1646 */
4564 #line 975 "parser.y" /* yacc.c:1646 */
4565 { (yyval
.declspec
) = make_decl_spec(NULL
, (yyvsp
[0].declspec
), NULL
, NULL
, (yyvsp
[-1].stgclass
)); }
4566 #line 4567 "parser.tab.c" /* yacc.c:1646 */
4570 #line 980 "parser.y" /* yacc.c:1646 */
4571 { (yyval
.declarator
) = (yyvsp
[0].declarator
); (yyval
.declarator
)->type
= append_ptrchain_type((yyval
.declarator
)->type
, type_new_pointer(pointer_default
, NULL
, (yyvsp
[-1].attr_list
))); }
4572 #line 4573 "parser.tab.c" /* yacc.c:1646 */
4576 #line 981 "parser.y" /* yacc.c:1646 */
4577 { (yyval
.declarator
) = (yyvsp
[0].declarator
); if ((yyval
.declarator
)->func_type
) (yyval
.declarator
)->func_type
->attrs
= append_attr((yyval
.declarator
)->func_type
->attrs
, make_attrp(ATTR_CALLCONV
, (yyvsp
[-1].str
)));
4578 else if ((yyval
.declarator
)->type
) (yyval
.declarator
)->type
->attrs
= append_attr((yyval
.declarator
)->type
->attrs
, make_attrp(ATTR_CALLCONV
, (yyvsp
[-1].str
))); }
4579 #line 4580 "parser.tab.c" /* yacc.c:1646 */
4583 #line 987 "parser.y" /* yacc.c:1646 */
4584 { (yyval
.declarator
) = make_declarator((yyvsp
[0].var
)); }
4585 #line 4586 "parser.tab.c" /* yacc.c:1646 */
4589 #line 988 "parser.y" /* yacc.c:1646 */
4590 { (yyval
.declarator
) = (yyvsp
[-1].declarator
); }
4591 #line 4592 "parser.tab.c" /* yacc.c:1646 */
4595 #line 989 "parser.y" /* yacc.c:1646 */
4596 { (yyval
.declarator
) = (yyvsp
[-1].declarator
); (yyval
.declarator
)->array
= append_array((yyval
.declarator
)->array
, (yyvsp
[0].expr
)); }
4597 #line 4598 "parser.tab.c" /* yacc.c:1646 */
4601 #line 990 "parser.y" /* yacc.c:1646 */
4602 { (yyval
.declarator
) = (yyvsp
[-3].declarator
);
4603 (yyval
.declarator
)->func_type
= append_ptrchain_type((yyval
.declarator
)->type
, type_new_function((yyvsp
[-1].var_list
)));
4604 (yyval
.declarator
)->type
= NULL
;
4606 #line 4607 "parser.tab.c" /* yacc.c:1646 */
4610 #line 999 "parser.y" /* yacc.c:1646 */
4611 { (yyval
.declarator
) = (yyvsp
[0].declarator
); (yyval
.declarator
)->type
= append_ptrchain_type((yyval
.declarator
)->type
, type_new_pointer(pointer_default
, NULL
, (yyvsp
[-1].attr_list
))); }
4612 #line 4613 "parser.tab.c" /* yacc.c:1646 */
4616 #line 1000 "parser.y" /* yacc.c:1646 */
4617 { (yyval
.declarator
) = (yyvsp
[0].declarator
); if ((yyval
.declarator
)->func_type
) (yyval
.declarator
)->func_type
->attrs
= append_attr((yyval
.declarator
)->func_type
->attrs
, make_attrp(ATTR_CALLCONV
, (yyvsp
[-1].str
)));
4618 else if ((yyval
.declarator
)->type
) (yyval
.declarator
)->type
->attrs
= append_attr((yyval
.declarator
)->type
->attrs
, make_attrp(ATTR_CALLCONV
, (yyvsp
[-1].str
))); }
4619 #line 4620 "parser.tab.c" /* yacc.c:1646 */
4623 #line 1008 "parser.y" /* yacc.c:1646 */
4624 { (yyval
.declarator
) = (yyvsp
[0].declarator
); (yyval
.declarator
)->type
= append_ptrchain_type((yyval
.declarator
)->type
, type_new_pointer(pointer_default
, NULL
, (yyvsp
[-1].attr_list
))); }
4625 #line 4626 "parser.tab.c" /* yacc.c:1646 */
4629 #line 1009 "parser.y" /* yacc.c:1646 */
4630 { (yyval
.declarator
) = (yyvsp
[0].declarator
); if ((yyval
.declarator
)->func_type
) (yyval
.declarator
)->func_type
->attrs
= append_attr((yyval
.declarator
)->func_type
->attrs
, make_attrp(ATTR_CALLCONV
, (yyvsp
[-1].str
)));
4631 else if ((yyval
.declarator
)->type
) (yyval
.declarator
)->type
->attrs
= append_attr((yyval
.declarator
)->type
->attrs
, make_attrp(ATTR_CALLCONV
, (yyvsp
[-1].str
))); }
4632 #line 4633 "parser.tab.c" /* yacc.c:1646 */
4636 #line 1014 "parser.y" /* yacc.c:1646 */
4637 { (yyval
.declarator
) = make_declarator(NULL
); }
4638 #line 4639 "parser.tab.c" /* yacc.c:1646 */
4642 #line 1020 "parser.y" /* yacc.c:1646 */
4643 { (yyval
.declarator
) = (yyvsp
[-1].declarator
); }
4644 #line 4645 "parser.tab.c" /* yacc.c:1646 */
4648 #line 1021 "parser.y" /* yacc.c:1646 */
4649 { (yyval
.declarator
) = (yyvsp
[-1].declarator
); (yyval
.declarator
)->array
= append_array((yyval
.declarator
)->array
, (yyvsp
[0].expr
)); }
4650 #line 4651 "parser.tab.c" /* yacc.c:1646 */
4654 #line 1022 "parser.y" /* yacc.c:1646 */
4655 { (yyval
.declarator
) = make_declarator(NULL
); (yyval
.declarator
)->array
= append_array((yyval
.declarator
)->array
, (yyvsp
[0].expr
)); }
4656 #line 4657 "parser.tab.c" /* yacc.c:1646 */
4660 #line 1024 "parser.y" /* yacc.c:1646 */
4661 { (yyval
.declarator
) = make_declarator(NULL
);
4662 (yyval
.declarator
)->func_type
= append_ptrchain_type((yyval
.declarator
)->type
, type_new_function((yyvsp
[-1].var_list
)));
4663 (yyval
.declarator
)->type
= NULL
;
4665 #line 4666 "parser.tab.c" /* yacc.c:1646 */
4669 #line 1029 "parser.y" /* yacc.c:1646 */
4670 { (yyval
.declarator
) = (yyvsp
[-3].declarator
);
4671 (yyval
.declarator
)->func_type
= append_ptrchain_type((yyval
.declarator
)->type
, type_new_function((yyvsp
[-1].var_list
)));
4672 (yyval
.declarator
)->type
= NULL
;
4674 #line 4675 "parser.tab.c" /* yacc.c:1646 */
4678 #line 1038 "parser.y" /* yacc.c:1646 */
4679 { (yyval
.declarator
) = (yyvsp
[0].declarator
); (yyval
.declarator
)->type
= append_ptrchain_type((yyval
.declarator
)->type
, type_new_pointer(pointer_default
, NULL
, (yyvsp
[-1].attr_list
))); }
4680 #line 4681 "parser.tab.c" /* yacc.c:1646 */
4684 #line 1039 "parser.y" /* yacc.c:1646 */
4685 { (yyval
.declarator
) = (yyvsp
[0].declarator
); (yyval
.declarator
)->type
->attrs
= append_attr((yyval
.declarator
)->type
->attrs
, make_attrp(ATTR_CALLCONV
, (yyvsp
[-1].str
))); }
4686 #line 4687 "parser.tab.c" /* yacc.c:1646 */
4690 #line 1046 "parser.y" /* yacc.c:1646 */
4691 { (yyval
.declarator
) = (yyvsp
[0].declarator
); (yyval
.declarator
)->type
= append_ptrchain_type((yyval
.declarator
)->type
, type_new_pointer(pointer_default
, NULL
, (yyvsp
[-1].attr_list
))); }
4692 #line 4693 "parser.tab.c" /* yacc.c:1646 */
4696 #line 1047 "parser.y" /* yacc.c:1646 */
4697 { (yyval
.declarator
) = (yyvsp
[0].declarator
); (yyval
.declarator
)->type
->attrs
= append_attr((yyval
.declarator
)->type
->attrs
, make_attrp(ATTR_CALLCONV
, (yyvsp
[-1].str
))); }
4698 #line 4699 "parser.tab.c" /* yacc.c:1646 */
4702 #line 1051 "parser.y" /* yacc.c:1646 */
4703 { (yyval
.declarator
) = make_declarator(NULL
); }
4704 #line 4705 "parser.tab.c" /* yacc.c:1646 */
4708 #line 1059 "parser.y" /* yacc.c:1646 */
4709 { (yyval
.declarator
) = make_declarator((yyvsp
[0].var
)); }
4710 #line 4711 "parser.tab.c" /* yacc.c:1646 */
4714 #line 1060 "parser.y" /* yacc.c:1646 */
4715 { (yyval
.declarator
) = (yyvsp
[-1].declarator
); }
4716 #line 4717 "parser.tab.c" /* yacc.c:1646 */
4720 #line 1061 "parser.y" /* yacc.c:1646 */
4721 { (yyval
.declarator
) = (yyvsp
[-1].declarator
); (yyval
.declarator
)->array
= append_array((yyval
.declarator
)->array
, (yyvsp
[0].expr
)); }
4722 #line 4723 "parser.tab.c" /* yacc.c:1646 */
4726 #line 1062 "parser.y" /* yacc.c:1646 */
4727 { (yyval
.declarator
) = make_declarator(NULL
); (yyval
.declarator
)->array
= append_array((yyval
.declarator
)->array
, (yyvsp
[0].expr
)); }
4728 #line 4729 "parser.tab.c" /* yacc.c:1646 */
4732 #line 1064 "parser.y" /* yacc.c:1646 */
4733 { (yyval
.declarator
) = make_declarator(NULL
);
4734 (yyval
.declarator
)->func_type
= append_ptrchain_type((yyval
.declarator
)->type
, type_new_function((yyvsp
[-1].var_list
)));
4735 (yyval
.declarator
)->type
= NULL
;
4737 #line 4738 "parser.tab.c" /* yacc.c:1646 */
4741 #line 1069 "parser.y" /* yacc.c:1646 */
4742 { (yyval
.declarator
) = (yyvsp
[-3].declarator
);
4743 (yyval
.declarator
)->func_type
= append_ptrchain_type((yyval
.declarator
)->type
, type_new_function((yyvsp
[-1].var_list
)));
4744 (yyval
.declarator
)->type
= NULL
;
4746 #line 4747 "parser.tab.c" /* yacc.c:1646 */
4750 #line 1076 "parser.y" /* yacc.c:1646 */
4751 { (yyval
.declarator_list
) = append_declarator( NULL
, (yyvsp
[0].declarator
) ); }
4752 #line 4753 "parser.tab.c" /* yacc.c:1646 */
4756 #line 1077 "parser.y" /* yacc.c:1646 */
4757 { (yyval
.declarator_list
) = append_declarator( (yyvsp
[-2].declarator_list
), (yyvsp
[0].declarator
) ); }
4758 #line 4759 "parser.tab.c" /* yacc.c:1646 */
4762 #line 1080 "parser.y" /* yacc.c:1646 */
4763 { (yyval
.expr
) = NULL
; }
4764 #line 4765 "parser.tab.c" /* yacc.c:1646 */
4768 #line 1081 "parser.y" /* yacc.c:1646 */
4769 { (yyval
.expr
) = (yyvsp
[0].expr
); }
4770 #line 4771 "parser.tab.c" /* yacc.c:1646 */
4774 #line 1084 "parser.y" /* yacc.c:1646 */
4775 { (yyval
.declarator
) = (yyvsp
[-1].declarator
); (yyval
.declarator
)->bits
= (yyvsp
[0].expr
);
4776 if (!(yyval
.declarator
)->bits
&& !(yyval
.declarator
)->var
->name
)
4777 error_loc("unnamed fields are not allowed\n");
4779 #line 4780 "parser.tab.c" /* yacc.c:1646 */
4783 #line 1091 "parser.y" /* yacc.c:1646 */
4784 { (yyval
.declarator_list
) = append_declarator( NULL
, (yyvsp
[0].declarator
) ); }
4785 #line 4786 "parser.tab.c" /* yacc.c:1646 */
4789 #line 1093 "parser.y" /* yacc.c:1646 */
4790 { (yyval
.declarator_list
) = append_declarator( (yyvsp
[-2].declarator_list
), (yyvsp
[0].declarator
) ); }
4791 #line 4792 "parser.tab.c" /* yacc.c:1646 */
4795 #line 1097 "parser.y" /* yacc.c:1646 */
4796 { (yyval
.declarator
) = (yyvsp
[0].declarator
); }
4797 #line 4798 "parser.tab.c" /* yacc.c:1646 */
4801 #line 1098 "parser.y" /* yacc.c:1646 */
4802 { (yyval
.declarator
) = (yyvsp
[-2].declarator
); (yyvsp
[-2].declarator
)->var
->eval
= (yyvsp
[0].expr
); }
4803 #line 4804 "parser.tab.c" /* yacc.c:1646 */
4807 #line 1102 "parser.y" /* yacc.c:1646 */
4808 { (yyval
.num
) = THREADING_APARTMENT
; }
4809 #line 4810 "parser.tab.c" /* yacc.c:1646 */
4813 #line 1103 "parser.y" /* yacc.c:1646 */
4814 { (yyval
.num
) = THREADING_NEUTRAL
; }
4815 #line 4816 "parser.tab.c" /* yacc.c:1646 */
4819 #line 1104 "parser.y" /* yacc.c:1646 */
4820 { (yyval
.num
) = THREADING_SINGLE
; }
4821 #line 4822 "parser.tab.c" /* yacc.c:1646 */
4825 #line 1105 "parser.y" /* yacc.c:1646 */
4826 { (yyval
.num
) = THREADING_FREE
; }
4827 #line 4828 "parser.tab.c" /* yacc.c:1646 */
4831 #line 1106 "parser.y" /* yacc.c:1646 */
4832 { (yyval
.num
) = THREADING_BOTH
; }
4833 #line 4834 "parser.tab.c" /* yacc.c:1646 */
4837 #line 1110 "parser.y" /* yacc.c:1646 */
4838 { (yyval
.num
) = RPC_FC_RP
; }
4839 #line 4840 "parser.tab.c" /* yacc.c:1646 */
4843 #line 1111 "parser.y" /* yacc.c:1646 */
4844 { (yyval
.num
) = RPC_FC_UP
; }
4845 #line 4846 "parser.tab.c" /* yacc.c:1646 */
4849 #line 1112 "parser.y" /* yacc.c:1646 */
4850 { (yyval
.num
) = RPC_FC_FP
; }
4851 #line 4852 "parser.tab.c" /* yacc.c:1646 */
4855 #line 1115 "parser.y" /* yacc.c:1646 */
4856 { (yyval
.type
) = type_new_struct((yyvsp
[-3].str
), current_namespace
, TRUE
, (yyvsp
[-1].var_list
)); }
4857 #line 4858 "parser.tab.c" /* yacc.c:1646 */
4861 #line 1118 "parser.y" /* yacc.c:1646 */
4862 { (yyval
.type
) = type_new_void(); }
4863 #line 4864 "parser.tab.c" /* yacc.c:1646 */
4867 #line 1119 "parser.y" /* yacc.c:1646 */
4868 { (yyval
.type
) = find_type_or_error((yyvsp
[0].str
), 0); }
4869 #line 4870 "parser.tab.c" /* yacc.c:1646 */
4873 #line 1120 "parser.y" /* yacc.c:1646 */
4874 { (yyval
.type
) = (yyvsp
[0].type
); }
4875 #line 4876 "parser.tab.c" /* yacc.c:1646 */
4879 #line 1121 "parser.y" /* yacc.c:1646 */
4880 { (yyval
.type
) = (yyvsp
[0].type
); }
4881 #line 4882 "parser.tab.c" /* yacc.c:1646 */
4885 #line 1122 "parser.y" /* yacc.c:1646 */
4886 { (yyval
.type
) = type_new_enum((yyvsp
[0].str
), current_namespace
, FALSE
, NULL
); }
4887 #line 4888 "parser.tab.c" /* yacc.c:1646 */
4891 #line 1123 "parser.y" /* yacc.c:1646 */
4892 { (yyval
.type
) = (yyvsp
[0].type
); }
4893 #line 4894 "parser.tab.c" /* yacc.c:1646 */
4897 #line 1124 "parser.y" /* yacc.c:1646 */
4898 { (yyval
.type
) = type_new_struct((yyvsp
[0].str
), current_namespace
, FALSE
, NULL
); }
4899 #line 4900 "parser.tab.c" /* yacc.c:1646 */
4903 #line 1125 "parser.y" /* yacc.c:1646 */
4904 { (yyval
.type
) = (yyvsp
[0].type
); }
4905 #line 4906 "parser.tab.c" /* yacc.c:1646 */
4909 #line 1126 "parser.y" /* yacc.c:1646 */
4910 { (yyval
.type
) = type_new_nonencapsulated_union((yyvsp
[0].str
), FALSE
, NULL
); }
4911 #line 4912 "parser.tab.c" /* yacc.c:1646 */
4915 #line 1127 "parser.y" /* yacc.c:1646 */
4916 { (yyval
.type
) = make_safearray((yyvsp
[-1].type
)); }
4917 #line 4918 "parser.tab.c" /* yacc.c:1646 */
4921 #line 1131 "parser.y" /* yacc.c:1646 */
4922 { (yyvsp
[-4].attr_list
) = append_attribs((yyvsp
[-4].attr_list
), (yyvsp
[-2].attr_list
));
4923 reg_typedefs((yyvsp
[-1].declspec
), (yyvsp
[0].declarator_list
), check_typedef_attrs((yyvsp
[-4].attr_list
)));
4924 (yyval
.statement
) = make_statement_typedef((yyvsp
[0].declarator_list
));
4926 #line 4927 "parser.tab.c" /* yacc.c:1646 */
4930 #line 1138 "parser.y" /* yacc.c:1646 */
4931 { (yyval
.type
) = type_new_nonencapsulated_union((yyvsp
[-3].str
), TRUE
, (yyvsp
[-1].var_list
)); }
4932 #line 4933 "parser.tab.c" /* yacc.c:1646 */
4936 #line 1141 "parser.y" /* yacc.c:1646 */
4937 { (yyval
.type
) = type_new_encapsulated_union((yyvsp
[-8].str
), (yyvsp
[-5].var
), (yyvsp
[-3].var
), (yyvsp
[-1].var_list
)); }
4938 #line 4939 "parser.tab.c" /* yacc.c:1646 */
4942 #line 1145 "parser.y" /* yacc.c:1646 */
4943 { (yyval
.num
) = MAKEVERSION((yyvsp
[0].num
), 0); }
4944 #line 4945 "parser.tab.c" /* yacc.c:1646 */
4948 #line 1146 "parser.y" /* yacc.c:1646 */
4949 { (yyval
.num
) = MAKEVERSION((yyvsp
[-2].num
), (yyvsp
[0].num
)); }
4950 #line 4951 "parser.tab.c" /* yacc.c:1646 */
4954 #line 1147 "parser.y" /* yacc.c:1646 */
4955 { (yyval
.num
) = (yyvsp
[0].num
); }
4956 #line 4957 "parser.tab.c" /* yacc.c:1646 */
4960 #line 4961 "parser.tab.c" /* yacc.c:1646 */
4963 /* User semantic actions sometimes alter yychar, and that requires
4964 that yytoken be updated with the new translation. We take the
4965 approach of translating immediately before every use of yytoken.
4966 One alternative is translating here after every semantic action,
4967 but that translation would be missed if the semantic action invokes
4968 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
4969 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
4970 incorrect destructor might then be invoked immediately. In the
4971 case of YYERROR or YYBACKUP, subsequent parser actions might lead
4972 to an incorrect destructor call or verbose syntax error message
4973 before the lookahead is translated. */
4974 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
4978 YY_STACK_PRINT (yyss
, yyssp
);
4982 /* Now 'shift' the result of the reduction. Determine what state
4983 that goes to, based on the state we popped back to and the rule
4984 number reduced by. */
4988 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
4989 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
4990 yystate
= yytable
[yystate
];
4992 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
4997 /*--------------------------------------.
4998 | yyerrlab -- here on detecting error. |
4999 `--------------------------------------*/
5001 /* Make sure we have latest lookahead translation. See comments at
5002 user semantic actions for why this is necessary. */
5003 yytoken
= yychar
== YYEMPTY
? YYEMPTY
: YYTRANSLATE (yychar
);
5005 /* If not already recovering from an error, report this error. */
5009 #if ! YYERROR_VERBOSE
5010 yyerror (YY_("syntax error"));
5012 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
5015 char const *yymsgp
= YY_("syntax error");
5016 int yysyntax_error_status
;
5017 yysyntax_error_status
= YYSYNTAX_ERROR
;
5018 if (yysyntax_error_status
== 0)
5020 else if (yysyntax_error_status
== 1)
5022 if (yymsg
!= yymsgbuf
)
5023 YYSTACK_FREE (yymsg
);
5024 yymsg
= (char *) YYSTACK_ALLOC (yymsg_alloc
);
5028 yymsg_alloc
= sizeof yymsgbuf
;
5029 yysyntax_error_status
= 2;
5033 yysyntax_error_status
= YYSYNTAX_ERROR
;
5038 if (yysyntax_error_status
== 2)
5039 goto yyexhaustedlab
;
5041 # undef YYSYNTAX_ERROR
5047 if (yyerrstatus
== 3)
5049 /* If just tried and failed to reuse lookahead token after an
5050 error, discard it. */
5052 if (yychar
<= YYEOF
)
5054 /* Return failure if at end of input. */
5055 if (yychar
== YYEOF
)
5060 yydestruct ("Error: discarding",
5066 /* Else will try to reuse lookahead token after shifting the error
5071 /*---------------------------------------------------.
5072 | yyerrorlab -- error raised explicitly by YYERROR. |
5073 `---------------------------------------------------*/
5076 /* Pacify compilers like GCC when the user code never invokes
5077 YYERROR and the label yyerrorlab therefore never appears in user
5079 if (/*CONSTCOND*/ 0)
5082 /* Do not reclaim the symbols of the rule whose action triggered
5086 YY_STACK_PRINT (yyss
, yyssp
);
5091 /*-------------------------------------------------------------.
5092 | yyerrlab1 -- common code for both syntax error and YYERROR. |
5093 `-------------------------------------------------------------*/
5095 yyerrstatus
= 3; /* Each real token shifted decrements this. */
5099 yyn
= yypact
[yystate
];
5100 if (!yypact_value_is_default (yyn
))
5103 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
5111 /* Pop the current state because it cannot handle the error token. */
5116 yydestruct ("Error: popping",
5117 yystos
[yystate
], yyvsp
);
5120 YY_STACK_PRINT (yyss
, yyssp
);
5123 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
5125 YY_IGNORE_MAYBE_UNINITIALIZED_END
5128 /* Shift the error token. */
5129 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
5135 /*-------------------------------------.
5136 | yyacceptlab -- YYACCEPT comes here. |
5137 `-------------------------------------*/
5142 /*-----------------------------------.
5143 | yyabortlab -- YYABORT comes here. |
5144 `-----------------------------------*/
5149 #if !defined yyoverflow || YYERROR_VERBOSE
5150 /*-------------------------------------------------.
5151 | yyexhaustedlab -- memory exhaustion comes here. |
5152 `-------------------------------------------------*/
5154 yyerror (YY_("memory exhausted"));
5160 if (yychar
!= YYEMPTY
)
5162 /* Make sure we have latest lookahead translation. See comments at
5163 user semantic actions for why this is necessary. */
5164 yytoken
= YYTRANSLATE (yychar
);
5165 yydestruct ("Cleanup: discarding lookahead",
5168 /* Do not reclaim the symbols of the rule whose action triggered
5169 this YYABORT or YYACCEPT. */
5171 YY_STACK_PRINT (yyss
, yyssp
);
5172 while (yyssp
!= yyss
)
5174 yydestruct ("Cleanup: popping",
5175 yystos
[*yyssp
], yyvsp
);
5180 YYSTACK_FREE (yyss
);
5183 if (yymsg
!= yymsgbuf
)
5184 YYSTACK_FREE (yymsg
);
5188 #line 1150 "parser.y" /* yacc.c:1906 */
5191 static void decl_builtin_basic(const char *name
, enum type_basic_type type
)
5193 type_t
*t
= type_new_basic(type
);
5194 reg_type(t
, name
, NULL
, 0);
5197 static void decl_builtin_alias(const char *name
, type_t
*t
)
5199 reg_type(type_new_alias(t
, name
), name
, NULL
, 0);
5202 void init_types(void)
5204 decl_builtin_basic("byte", TYPE_BASIC_BYTE
);
5205 decl_builtin_basic("wchar_t", TYPE_BASIC_WCHAR
);
5206 decl_builtin_basic("float", TYPE_BASIC_FLOAT
);
5207 decl_builtin_basic("double", TYPE_BASIC_DOUBLE
);
5208 decl_builtin_basic("error_status_t", TYPE_BASIC_ERROR_STATUS_T
);
5209 decl_builtin_basic("handle_t", TYPE_BASIC_HANDLE
);
5210 decl_builtin_alias("boolean", type_new_basic(TYPE_BASIC_BYTE
));
5213 static str_list_t
*append_str(str_list_t
*list
, char *str
)
5215 struct str_list_entry_t
*entry
;
5217 if (!str
) return list
;
5220 list
= xmalloc( sizeof(*list
) );
5223 entry
= xmalloc( sizeof(*entry
) );
5225 list_add_tail( list
, &entry
->entry
);
5229 static attr_list_t
*append_attr(attr_list_t
*list
, attr_t
*attr
)
5231 attr_t
*attr_existing
;
5232 if (!attr
) return list
;
5235 list
= xmalloc( sizeof(*list
) );
5238 LIST_FOR_EACH_ENTRY(attr_existing
, list
, attr_t
, entry
)
5239 if (attr_existing
->type
== attr
->type
)
5241 parser_warning("duplicate attribute %s\n", get_attr_display_name(attr
->type
));
5242 /* use the last attribute, like MIDL does */
5243 list_remove(&attr_existing
->entry
);
5246 list_add_tail( list
, &attr
->entry
);
5250 static attr_list_t
*move_attr(attr_list_t
*dst
, attr_list_t
*src
, enum attr_type type
)
5253 if (!src
) return dst
;
5254 LIST_FOR_EACH_ENTRY(attr
, src
, attr_t
, entry
)
5255 if (attr
->type
== type
)
5257 list_remove(&attr
->entry
);
5258 return append_attr(dst
, attr
);
5263 static attr_list_t
*append_attr_list(attr_list_t
*new_list
, attr_list_t
*old_list
)
5267 if (!old_list
) return new_list
;
5269 while ((entry
= list_head(old_list
)))
5271 attr_t
*attr
= LIST_ENTRY(entry
, attr_t
, entry
);
5273 new_list
= append_attr(new_list
, attr
);
5278 static attr_list_t
*dupattrs(const attr_list_t
*list
)
5280 attr_list_t
*new_list
;
5283 if (!list
) return NULL
;
5285 new_list
= xmalloc( sizeof(*list
) );
5286 list_init( new_list
);
5287 LIST_FOR_EACH_ENTRY(attr
, list
, const attr_t
, entry
)
5289 attr_t
*new_attr
= xmalloc(sizeof(*new_attr
));
5291 list_add_tail(new_list
, &new_attr
->entry
);
5296 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
)
5298 decl_spec_t
*declspec
= left
? left
: right
;
5301 declspec
= xmalloc(sizeof(*declspec
));
5302 declspec
->type
= NULL
;
5303 declspec
->attrs
= NULL
;
5304 declspec
->stgclass
= STG_NONE
;
5306 declspec
->type
= type
;
5307 if (left
&& declspec
!= left
)
5309 declspec
->attrs
= append_attr_list(declspec
->attrs
, left
->attrs
);
5310 if (declspec
->stgclass
== STG_NONE
)
5311 declspec
->stgclass
= left
->stgclass
;
5312 else if (left
->stgclass
!= STG_NONE
)
5313 error_loc("only one storage class can be specified\n");
5314 assert(!left
->type
);
5317 if (right
&& declspec
!= right
)
5319 declspec
->attrs
= append_attr_list(declspec
->attrs
, right
->attrs
);
5320 if (declspec
->stgclass
== STG_NONE
)
5321 declspec
->stgclass
= right
->stgclass
;
5322 else if (right
->stgclass
!= STG_NONE
)
5323 error_loc("only one storage class can be specified\n");
5324 assert(!right
->type
);
5328 declspec
->attrs
= append_attr(declspec
->attrs
, attr
);
5329 if (declspec
->stgclass
== STG_NONE
)
5330 declspec
->stgclass
= stgclass
;
5331 else if (stgclass
!= STG_NONE
)
5332 error_loc("only one storage class can be specified\n");
5334 /* apply attributes to type */
5335 if (type
&& declspec
->attrs
)
5338 declspec
->type
= duptype(type
, 1);
5339 attrs
= dupattrs(type
->attrs
);
5340 declspec
->type
->attrs
= append_attr_list(attrs
, declspec
->attrs
);
5341 declspec
->attrs
= NULL
;
5347 static attr_t
*make_attr(enum attr_type type
)
5349 attr_t
*a
= xmalloc(sizeof(attr_t
));
5355 static attr_t
*make_attrv(enum attr_type type
, unsigned int val
)
5357 attr_t
*a
= xmalloc(sizeof(attr_t
));
5363 static attr_t
*make_attrp(enum attr_type type
, void *val
)
5365 attr_t
*a
= xmalloc(sizeof(attr_t
));
5371 static expr_list_t
*append_expr(expr_list_t
*list
, expr_t
*expr
)
5373 if (!expr
) return list
;
5376 list
= xmalloc( sizeof(*list
) );
5379 list_add_tail( list
, &expr
->entry
);
5383 static array_dims_t
*append_array(array_dims_t
*list
, expr_t
*expr
)
5385 if (!expr
) return list
;
5388 list
= xmalloc( sizeof(*list
) );
5391 list_add_tail( list
, &expr
->entry
);
5395 static struct list type_pool
= LIST_INIT(type_pool
);
5402 type_t
*alloc_type(void)
5404 type_pool_node_t
*node
= xmalloc(sizeof *node
);
5405 list_add_tail(&type_pool
, &node
->link
);
5409 void set_all_tfswrite(int val
)
5411 type_pool_node_t
*node
;
5412 LIST_FOR_EACH_ENTRY(node
, &type_pool
, type_pool_node_t
, link
)
5413 node
->data
.tfswrite
= val
;
5416 void clear_all_offsets(void)
5418 type_pool_node_t
*node
;
5419 LIST_FOR_EACH_ENTRY(node
, &type_pool
, type_pool_node_t
, link
)
5420 node
->data
.typestring_offset
= node
->data
.ptrdesc
= 0;
5423 static void type_function_add_head_arg(type_t
*type
, var_t
*arg
)
5425 if (!type
->details
.function
->args
)
5427 type
->details
.function
->args
= xmalloc( sizeof(*type
->details
.function
->args
) );
5428 list_init( type
->details
.function
->args
);
5430 list_add_head( type
->details
.function
->args
, &arg
->entry
);
5433 static int is_allowed_range_type(const type_t
*type
)
5435 switch (type_get_type(type
))
5440 switch (type_basic_get_type(type
))
5442 case TYPE_BASIC_INT8
:
5443 case TYPE_BASIC_INT16
:
5444 case TYPE_BASIC_INT32
:
5445 case TYPE_BASIC_INT64
:
5446 case TYPE_BASIC_INT
:
5447 case TYPE_BASIC_INT3264
:
5448 case TYPE_BASIC_BYTE
:
5449 case TYPE_BASIC_CHAR
:
5450 case TYPE_BASIC_WCHAR
:
5451 case TYPE_BASIC_HYPER
:
5453 case TYPE_BASIC_FLOAT
:
5454 case TYPE_BASIC_DOUBLE
:
5455 case TYPE_BASIC_ERROR_STATUS_T
:
5456 case TYPE_BASIC_HANDLE
:
5465 static type_t
*append_ptrchain_type(type_t
*ptrchain
, type_t
*type
)
5467 type_t
*ptrchain_type
;
5470 for (ptrchain_type
= ptrchain
; type_pointer_get_ref(ptrchain_type
); ptrchain_type
= type_pointer_get_ref(ptrchain_type
))
5472 assert(ptrchain_type
->type_type
== TYPE_POINTER
);
5473 ptrchain_type
->details
.pointer
.ref
= type
;
5477 static warning_list_t
*append_warning(warning_list_t
*list
, int num
)
5483 list
= xmalloc( sizeof(*list
) );
5486 entry
= xmalloc( sizeof(*entry
) );
5488 list_add_tail( list
, &entry
->entry
);
5492 static var_t
*declare_var(attr_list_t
*attrs
, decl_spec_t
*decl_spec
, const declarator_t
*decl
,
5495 var_t
*v
= decl
->var
;
5496 expr_list_t
*sizes
= get_attrp(attrs
, ATTR_SIZEIS
);
5497 expr_list_t
*lengs
= get_attrp(attrs
, ATTR_LENGTHIS
);
5501 array_dims_t
*arr
= decl
? decl
->array
: NULL
;
5502 type_t
*func_type
= decl
? decl
->func_type
: NULL
;
5503 type_t
*type
= decl_spec
->type
;
5505 if (is_attr(type
->attrs
, ATTR_INLINE
))
5508 error_loc("inline attribute applied to non-function type\n");
5512 /* move inline attribute from return type node to function node */
5513 for (t
= func_type
; is_ptr(t
); t
= type_pointer_get_ref(t
))
5515 t
->attrs
= move_attr(t
->attrs
, type
->attrs
, ATTR_INLINE
);
5519 /* add type onto the end of the pointers in pident->type */
5520 v
->type
= append_ptrchain_type(decl
? decl
->type
: NULL
, type
);
5521 v
->stgclass
= decl_spec
->stgclass
;
5524 /* check for pointer attribute being applied to non-pointer, non-array
5528 int ptr_attr
= get_attrv(v
->attrs
, ATTR_POINTERTYPE
);
5529 const type_t
*ptr
= NULL
;
5530 /* pointer attributes on the left side of the type belong to the function
5531 * pointer, if one is being declared */
5532 type_t
**pt
= func_type
? &func_type
: &v
->type
;
5533 for (ptr
= *pt
; ptr
&& !ptr_attr
; )
5535 ptr_attr
= get_attrv(ptr
->attrs
, ATTR_POINTERTYPE
);
5536 if (!ptr_attr
&& type_is_alias(ptr
))
5537 ptr
= type_alias_get_aliasee(ptr
);
5543 if (ptr_attr
&& ptr_attr
!= RPC_FC_UP
&&
5544 type_get_type(type_pointer_get_ref(ptr
)) == TYPE_INTERFACE
)
5545 warning_loc_info(&v
->loc_info
,
5546 "%s: pointer attribute applied to interface "
5547 "pointer type has no effect\n", v
->name
);
5548 if (!ptr_attr
&& top
&& (*pt
)->details
.pointer
.def_fc
!= RPC_FC_RP
)
5550 /* FIXME: this is a horrible hack to cope with the issue that we
5551 * store an offset to the typeformat string in the type object, but
5552 * two typeformat strings may be written depending on whether the
5553 * pointer is a toplevel parameter or not */
5554 *pt
= duptype(*pt
, 1);
5558 error_loc("%s: pointer attribute applied to non-pointer type\n", v
->name
);
5561 if (is_attr(v
->attrs
, ATTR_STRING
))
5565 if (!is_ptr(v
->type
) && !arr
)
5566 error_loc("'%s': [string] attribute applied to non-pointer, non-array type\n",
5570 t
= type_pointer_get_ref(t
);
5572 if (type_get_type(t
) != TYPE_BASIC
&&
5573 (get_basic_fc(t
) != RPC_FC_CHAR
&&
5574 get_basic_fc(t
) != RPC_FC_BYTE
&&
5575 get_basic_fc(t
) != RPC_FC_WCHAR
))
5577 error_loc("'%s': [string] attribute is only valid on 'char', 'byte', or 'wchar_t' pointers and arrays\n",
5582 if (is_attr(v
->attrs
, ATTR_V1ENUM
))
5584 if (type_get_type_detect_alias(v
->type
) != TYPE_ENUM
)
5585 error_loc("'%s': [v1_enum] attribute applied to non-enum type\n", v
->name
);
5588 if (is_attr(v
->attrs
, ATTR_RANGE
) && !is_allowed_range_type(v
->type
))
5589 error_loc("'%s': [range] attribute applied to non-integer type\n",
5594 if (arr
) LIST_FOR_EACH_ENTRY_REV(dim
, arr
, expr_t
, entry
)
5597 error_loc("%s: only the first array dimension can be unspecified\n", v
->name
);
5602 error_loc("%s: array dimension must be positive\n", v
->name
);
5604 /* FIXME: should use a type_memsize that allows us to pass in a pointer size */
5607 unsigned int size
= type_memsize(v
->type
);
5609 if (0xffffffffu
/ size
< dim
->cval
)
5610 error_loc("%s: total array size is too large\n", v
->name
);
5616 *ptype
= type_new_array(NULL
, *ptype
, FALSE
,
5617 dim
->is_const
? dim
->cval
: 0,
5618 dim
->is_const
? NULL
: dim
, NULL
,
5623 if (sizes
) LIST_FOR_EACH_ENTRY(dim
, sizes
, expr_t
, entry
)
5625 if (dim
->type
!= EXPR_VOID
)
5627 if (is_array(*ptype
))
5629 if (!type_array_get_conformance(*ptype
) ||
5630 type_array_get_conformance(*ptype
)->type
!= EXPR_VOID
)
5631 error_loc("%s: cannot specify size_is for an already sized array\n", v
->name
);
5633 *ptype
= type_new_array((*ptype
)->name
,
5634 type_array_get_element(*ptype
), FALSE
,
5637 else if (is_ptr(*ptype
))
5638 *ptype
= type_new_array((*ptype
)->name
, type_pointer_get_ref(*ptype
), TRUE
,
5639 0, dim
, NULL
, pointer_default
);
5641 error_loc("%s: size_is attribute applied to illegal type\n", v
->name
);
5645 ptype
= &(*ptype
)->details
.pointer
.ref
;
5646 else if (is_array(*ptype
))
5647 ptype
= &(*ptype
)->details
.array
.elem
;
5649 error_loc("%s: too many expressions in size_is attribute\n", v
->name
);
5653 if (lengs
) LIST_FOR_EACH_ENTRY(dim
, lengs
, expr_t
, entry
)
5655 if (dim
->type
!= EXPR_VOID
)
5657 if (is_array(*ptype
))
5659 *ptype
= type_new_array((*ptype
)->name
,
5660 type_array_get_element(*ptype
),
5661 type_array_is_decl_as_ptr(*ptype
),
5662 type_array_get_dim(*ptype
),
5663 type_array_get_conformance(*ptype
),
5664 dim
, type_array_get_ptr_default_fc(*ptype
));
5667 error_loc("%s: length_is attribute applied to illegal type\n", v
->name
);
5671 ptype
= &(*ptype
)->details
.pointer
.ref
;
5672 else if (is_array(*ptype
))
5673 ptype
= &(*ptype
)->details
.array
.elem
;
5675 error_loc("%s: too many expressions in length_is attribute\n", v
->name
);
5678 /* v->type is currently pointing to the type on the left-side of the
5679 * declaration, so we need to fix this up so that it is the return type of the
5680 * function and make v->type point to the function side of the declaration */
5684 type_t
*return_type
= v
->type
;
5685 v
->type
= func_type
;
5686 for (ft
= v
->type
; is_ptr(ft
); ft
= type_pointer_get_ref(ft
))
5688 assert(type_get_type_detect_alias(ft
) == TYPE_FUNCTION
);
5689 ft
->details
.function
->retval
= make_var(xstrdup("_RetVal"));
5690 ft
->details
.function
->retval
->type
= return_type
;
5691 /* move calling convention attribute, if present, from pointer nodes to
5693 for (t
= v
->type
; is_ptr(t
); t
= type_pointer_get_ref(t
))
5694 ft
->attrs
= move_attr(ft
->attrs
, t
->attrs
, ATTR_CALLCONV
);
5699 for (t
= v
->type
; is_ptr(t
); t
= type_pointer_get_ref(t
))
5700 if (is_attr(t
->attrs
, ATTR_CALLCONV
))
5701 error_loc("calling convention applied to non-function-pointer type\n");
5705 v
->type
= type_new_bitfield(v
->type
, decl
->bits
);
5710 static var_list_t
*set_var_types(attr_list_t
*attrs
, decl_spec_t
*decl_spec
, declarator_list_t
*decls
)
5712 declarator_t
*decl
, *next
;
5713 var_list_t
*var_list
= NULL
;
5715 LIST_FOR_EACH_ENTRY_SAFE( decl
, next
, decls
, declarator_t
, entry
)
5717 var_t
*var
= declare_var(attrs
, decl_spec
, decl
, 0);
5718 var_list
= append_var(var_list
, var
);
5725 static ifref_list_t
*append_ifref(ifref_list_t
*list
, ifref_t
*iface
)
5727 if (!iface
) return list
;
5730 list
= xmalloc( sizeof(*list
) );
5733 list_add_tail( list
, &iface
->entry
);
5737 static ifref_t
*make_ifref(type_t
*iface
)
5739 ifref_t
*l
= xmalloc(sizeof(ifref_t
));
5745 var_list_t
*append_var(var_list_t
*list
, var_t
*var
)
5747 if (!var
) return list
;
5750 list
= xmalloc( sizeof(*list
) );
5753 list_add_tail( list
, &var
->entry
);
5757 static var_list_t
*append_var_list(var_list_t
*list
, var_list_t
*vars
)
5759 if (!vars
) return list
;
5762 list
= xmalloc( sizeof(*list
) );
5765 list_move_tail( list
, vars
);
5769 var_t
*make_var(char *name
)
5771 var_t
*v
= xmalloc(sizeof(var_t
));
5776 v
->stgclass
= STG_NONE
;
5777 init_loc_info(&v
->loc_info
);
5781 static declarator_list_t
*append_declarator(declarator_list_t
*list
, declarator_t
*d
)
5783 if (!d
) return list
;
5785 list
= xmalloc(sizeof(*list
));
5788 list_add_tail(list
, &d
->entry
);
5792 static declarator_t
*make_declarator(var_t
*var
)
5794 declarator_t
*d
= xmalloc(sizeof(*d
));
5795 d
->var
= var
? var
: make_var(NULL
);
5797 d
->func_type
= NULL
;
5803 static type_t
*make_safearray(type_t
*type
)
5805 return type_new_array(NULL
, type_new_alias(type
, "SAFEARRAY"), TRUE
, 0,
5806 NULL
, NULL
, RPC_FC_RP
);
5809 static typelib_t
*make_library(const char *name
, const attr_list_t
*attrs
)
5811 typelib_t
*typelib
= xmalloc(sizeof(*typelib
));
5812 typelib
->name
= xstrdup(name
);
5813 typelib
->attrs
= attrs
;
5814 list_init( &typelib
->importlibs
);
5818 static int hash_ident(const char *name
)
5820 const char *p
= name
;
5822 /* a simple sum hash is probably good enough */
5827 return sum
& (HASHMAX
-1);
5830 /***** type repository *****/
5832 static struct namespace *find_sub_namespace(struct namespace *namespace, const char *name
)
5834 struct namespace *cur
;
5836 LIST_FOR_EACH_ENTRY(cur
, &namespace->children
, struct namespace, entry
) {
5837 if(!strcmp(cur
->name
, name
))
5844 static void push_namespace(const char *name
)
5846 struct namespace *namespace;
5848 namespace = find_sub_namespace(current_namespace
, name
);
5850 namespace = xmalloc(sizeof(*namespace));
5851 namespace->name
= xstrdup(name
);
5852 namespace->parent
= current_namespace
;
5853 list_add_tail(¤t_namespace
->children
, &namespace->entry
);
5854 list_init(&namespace->children
);
5855 memset(namespace->type_hash
, 0, sizeof(namespace->type_hash
));
5858 current_namespace
= namespace;
5861 static void pop_namespace(const char *name
)
5863 assert(!strcmp(current_namespace
->name
, name
) && current_namespace
->parent
);
5864 current_namespace
= current_namespace
->parent
;
5874 type_t
*reg_type(type_t
*type
, const char *name
, struct namespace *namespace, int t
)
5879 error_loc("registering named type without name\n");
5883 namespace = &global_namespace
;
5884 hash
= hash_ident(name
);
5885 nt
= xmalloc(sizeof(struct rtype
));
5887 if (is_global_namespace(namespace))
5888 type
->c_name
= name
;
5890 type
->c_name
= format_namespace(namespace, "__x_", "_C", name
);
5893 nt
->next
= namespace->type_hash
[hash
];
5894 namespace->type_hash
[hash
] = nt
;
5895 if ((t
== tsSTRUCT
|| t
== tsUNION
))
5896 fix_incomplete_types(type
);
5900 static int is_incomplete(const type_t
*t
)
5902 return !t
->defined
&&
5903 (type_get_type_detect_alias(t
) == TYPE_STRUCT
||
5904 type_get_type_detect_alias(t
) == TYPE_UNION
||
5905 type_get_type_detect_alias(t
) == TYPE_ENCAPSULATED_UNION
);
5908 void add_incomplete(type_t
*t
)
5910 struct typenode
*tn
= xmalloc(sizeof *tn
);
5912 list_add_tail(&incomplete_types
, &tn
->entry
);
5915 static void fix_type(type_t
*t
)
5917 if (type_is_alias(t
) && is_incomplete(t
)) {
5918 type_t
*ot
= type_alias_get_aliasee(t
);
5920 if (type_get_type_detect_alias(ot
) == TYPE_STRUCT
||
5921 type_get_type_detect_alias(ot
) == TYPE_UNION
||
5922 type_get_type_detect_alias(ot
) == TYPE_ENCAPSULATED_UNION
)
5923 t
->details
.structure
= ot
->details
.structure
;
5924 t
->defined
= ot
->defined
;
5928 static void fix_incomplete(void)
5930 struct typenode
*tn
, *next
;
5932 LIST_FOR_EACH_ENTRY_SAFE(tn
, next
, &incomplete_types
, struct typenode
, entry
) {
5934 list_remove(&tn
->entry
);
5939 static void fix_incomplete_types(type_t
*complete_type
)
5941 struct typenode
*tn
, *next
;
5943 LIST_FOR_EACH_ENTRY_SAFE(tn
, next
, &incomplete_types
, struct typenode
, entry
)
5945 if (type_is_equal(complete_type
, tn
->type
))
5947 tn
->type
->details
.structure
= complete_type
->details
.structure
;
5948 list_remove(&tn
->entry
);
5954 static type_t
*reg_typedefs(decl_spec_t
*decl_spec
, declarator_list_t
*decls
, attr_list_t
*attrs
)
5956 const declarator_t
*decl
;
5957 type_t
*type
= decl_spec
->type
;
5959 if (is_attr(attrs
, ATTR_UUID
) && !is_attr(attrs
, ATTR_PUBLIC
))
5960 attrs
= append_attr( attrs
, make_attr(ATTR_PUBLIC
) );
5962 /* We must generate names for tagless enum, struct or union.
5963 Typedef-ing a tagless enum, struct or union means we want the typedef
5964 to be included in a library hence the public attribute. */
5965 if (type_get_type_detect_alias(type
) == TYPE_ENUM
||
5966 type_get_type_detect_alias(type
) == TYPE_STRUCT
||
5967 type_get_type_detect_alias(type
) == TYPE_UNION
||
5968 type_get_type_detect_alias(type
) == TYPE_ENCAPSULATED_UNION
)
5971 type
->name
= gen_name();
5973 /* replace existing attributes when generating a typelib */
5975 type
->attrs
= attrs
;
5978 #ifdef __REACTOS__ /* r53187 / 5bf224e */
5979 /* Append the SWITCHTYPE attribute to a non-encapsulated union if it does not already have it. */
5980 if (type_get_type_detect_alias(type
) == TYPE_UNION
&&
5981 is_attr(attrs
, ATTR_SWITCHTYPE
) &&
5982 !is_attr(type
->attrs
, ATTR_SWITCHTYPE
))
5983 type
->attrs
= append_attr(type
->attrs
, make_attrp(ATTR_SWITCHTYPE
, get_attrp(attrs
, ATTR_SWITCHTYPE
)));
5986 LIST_FOR_EACH_ENTRY( decl
, decls
, const declarator_t
, entry
)
5989 if (decl
->var
->name
) {
5993 cur
= find_type(decl
->var
->name
, current_namespace
, 0);
5996 * MIDL allows shadowing types that are declared in imported files.
5997 * We don't throw an error in this case and instead add a new type
5998 * (which is earlier on the list in hash table, so it will be used
5999 * instead of shadowed type).
6001 * FIXME: We may consider string separated type tables for each input
6002 * for cleaner solution.
6004 if (cur
&& input_name
== cur
->loc_info
.input_name
)
6005 error_loc("%s: redefinition error; original definition was at %s:%d\n",
6006 cur
->name
, cur
->loc_info
.input_name
,
6007 cur
->loc_info
.line_number
);
6009 name
= declare_var(attrs
, decl_spec
, decl
, 0);
6010 cur
= type_new_alias(name
->type
, name
->name
);
6013 if (is_incomplete(cur
))
6014 add_incomplete(cur
);
6015 reg_type(cur
, cur
->name
, current_namespace
, 0);
6021 type_t
*find_type(const char *name
, struct namespace *namespace, int t
)
6025 if(namespace && namespace != &global_namespace
) {
6026 for(cur
= namespace->type_hash
[hash_ident(name
)]; cur
; cur
= cur
->next
) {
6027 if(cur
->t
== t
&& !strcmp(cur
->name
, name
))
6031 for(cur
= global_namespace
.type_hash
[hash_ident(name
)]; cur
; cur
= cur
->next
) {
6032 if(cur
->t
== t
&& !strcmp(cur
->name
, name
))
6038 static type_t
*find_type_or_error(const char *name
, int t
)
6040 type_t
*type
= find_type(name
, NULL
, t
);
6042 error_loc("type '%s' not found\n", name
);
6048 static type_t
*find_type_or_error2(char *name
, int t
)
6050 type_t
*tp
= find_type_or_error(name
, t
);
6055 int is_type(const char *name
)
6057 return find_type(name
, current_namespace
, 0) != NULL
;
6060 type_t
*get_type(enum type_type type
, char *name
, struct namespace *namespace, int t
)
6064 namespace = &global_namespace
;
6066 tp
= find_type(name
, namespace, t
);
6072 tp
= make_type(type
);
6074 tp
->namespace = namespace;
6075 if (!name
) return tp
;
6076 return reg_type(tp
, name
, namespace, t
);
6079 /***** constant repository *****/
6084 struct rconst
*next
;
6087 struct rconst
*const_hash
[HASHMAX
];
6089 static var_t
*reg_const(var_t
*var
)
6094 error_loc("registering constant without name\n");
6097 hash
= hash_ident(var
->name
);
6098 nc
= xmalloc(sizeof(struct rconst
));
6099 nc
->name
= var
->name
;
6101 nc
->next
= const_hash
[hash
];
6102 const_hash
[hash
] = nc
;
6106 var_t
*find_const(const char *name
, int f
)
6108 struct rconst
*cur
= const_hash
[hash_ident(name
)];
6109 while (cur
&& strcmp(cur
->name
, name
))
6112 if (f
) error_loc("constant '%s' not found\n", name
);
6118 static char *gen_name(void)
6120 static const char format
[] = "__WIDL_%s_generated_name_%08lX";
6121 static unsigned long n
= 0;
6122 static const char *file_id
;
6128 char *dst
= dup_basename(input_idl_name
, ".idl");
6132 if (! isalnum((unsigned char) *dst
))
6135 size
= sizeof format
- 7 + strlen(file_id
) + 8;
6138 name
= xmalloc(size
);
6139 sprintf(name
, format
, file_id
, n
++);
6145 unsigned int dce_compatible
: 1;
6146 unsigned int acf
: 1;
6147 unsigned int on_interface
: 1;
6148 unsigned int on_function
: 1;
6149 unsigned int on_arg
: 1;
6150 unsigned int on_type
: 1;
6151 unsigned int on_enum
: 1;
6152 unsigned int on_struct
: 2;
6153 unsigned int on_union
: 1;
6154 unsigned int on_field
: 1;
6155 unsigned int on_library
: 1;
6156 unsigned int on_dispinterface
: 1;
6157 unsigned int on_module
: 1;
6158 unsigned int on_coclass
: 1;
6159 const char *display_name
;
6162 struct allowed_attr allowed_attr
[] =
6164 /* attr { D ACF I Fn ARG T En St Un Fi L DI M C <display name> } */
6165 /* ATTR_AGGREGATABLE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "aggregatable" },
6166 /* ATTR_ANNOTATION */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "annotation" },
6167 /* ATTR_APPOBJECT */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "appobject" },
6168 /* ATTR_ASYNC */ { 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "async" },
6169 /* ATTR_ASYNCUUID */ { 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, "async_uuid" },
6170 /* ATTR_AUTO_HANDLE */ { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "auto_handle" },
6171 /* ATTR_BINDABLE */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "bindable" },
6172 /* ATTR_BROADCAST */ { 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "broadcast" },
6173 /* ATTR_CALLAS */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "call_as" },
6174 /* ATTR_CALLCONV */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL
},
6175 /* ATTR_CASE */ { 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, "case" },
6176 /* ATTR_CODE */ { 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "code" },
6177 /* ATTR_COMMSTATUS */ { 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "comm_status" },
6178 /* ATTR_CONST */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "const" },
6179 /* ATTR_CONTEXTHANDLE */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "context_handle" },
6180 /* ATTR_CONTROL */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, "control" },
6181 /* ATTR_DECODE */ { 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "decode" },
6182 /* ATTR_DEFAULT */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, "default" },
6183 /* ATTR_DEFAULTBIND */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "defaultbind" },
6184 /* ATTR_DEFAULTCOLLELEM */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "defaultcollelem" },
6185 /* ATTR_DEFAULTVALUE */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "defaultvalue" },
6186 /* ATTR_DEFAULTVTABLE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "defaultvtable" },
6187 /* ATTR_DISABLECONSISTENCYCHECK */{ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "disable_consistency_check" },
6188 /* ATTR_DISPINTERFACE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL
},
6189 /* ATTR_DISPLAYBIND */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "displaybind" },
6190 /* ATTR_DLLNAME */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, "dllname" },
6191 /* ATTR_DUAL */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "dual" },
6192 /* ATTR_ENABLEALLOCATE */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "enable_allocate" },
6193 /* ATTR_ENCODE */ { 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "encode" },
6194 /* ATTR_ENDPOINT */ { 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "endpoint" },
6195 /* ATTR_ENTRY */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "entry" },
6196 /* ATTR_EXPLICIT_HANDLE */ { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "explicit_handle" },
6197 /* ATTR_FAULTSTATUS */ { 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "fault_status" },
6198 /* ATTR_FORCEALLOCATE */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "force_allocate" },
6199 /* ATTR_HANDLE */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "handle" },
6200 /* ATTR_HELPCONTEXT */ { 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, "helpcontext" },
6201 /* ATTR_HELPFILE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, "helpfile" },
6202 /* ATTR_HELPSTRING */ { 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, "helpstring" },
6203 /* ATTR_HELPSTRINGCONTEXT */ { 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, "helpstringcontext" },
6204 /* ATTR_HELPSTRINGDLL */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, "helpstringdll" },
6205 /* ATTR_HIDDEN */ { 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, "hidden" },
6206 /* ATTR_ID */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, "id" },
6207 /* ATTR_IDEMPOTENT */ { 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "idempotent" },
6208 /* ATTR_IGNORE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, "ignore" },
6209 /* ATTR_IIDIS */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, "iid_is" },
6210 /* ATTR_IMMEDIATEBIND */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "immediatebind" },
6211 /* ATTR_IMPLICIT_HANDLE */ { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "implicit_handle" },
6212 /* ATTR_IN */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "in" },
6213 /* ATTR_INLINE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "inline" },
6214 /* ATTR_INPUTSYNC */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "inputsync" },
6215 /* ATTR_LENGTHIS */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, "length_is" },
6216 /* ATTR_LIBLCID */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, "lcid" },
6217 /* ATTR_LICENSED */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "licensed" },
6218 /* ATTR_LOCAL */ { 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "local" },
6219 /* ATTR_MAYBE */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "maybe" },
6220 /* ATTR_MESSAGE */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "message" },
6221 /* ATTR_NOCODE */ { 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "nocode" },
6222 /* ATTR_NONBROWSABLE */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "nonbrowsable" },
6223 /* ATTR_NONCREATABLE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "noncreatable" },
6224 /* ATTR_NONEXTENSIBLE */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "nonextensible" },
6225 /* ATTR_NOTIFY */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "notify" },
6226 /* ATTR_NOTIFYFLAG */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "notify_flag" },
6227 /* ATTR_OBJECT */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "object" },
6228 /* ATTR_ODL */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, "odl" },
6229 /* ATTR_OLEAUTOMATION */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "oleautomation" },
6230 /* ATTR_OPTIMIZE */ { 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "optimize" },
6231 /* ATTR_OPTIONAL */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "optional" },
6232 /* ATTR_OUT */ { 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "out" },
6233 /* ATTR_PARAMLCID */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "lcid" },
6234 /* ATTR_PARTIALIGNORE */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "partial_ignore" },
6235 /* ATTR_POINTERDEFAULT */ { 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "pointer_default" },
6236 /* ATTR_POINTERTYPE */ { 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, "ref, unique or ptr" },
6237 /* ATTR_PROGID */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "progid" },
6238 /* ATTR_PROPGET */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "propget" },
6239 /* ATTR_PROPPUT */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "propput" },
6240 /* ATTR_PROPPUTREF */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "propputref" },
6241 /* ATTR_PROXY */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "proxy" },
6242 /* ATTR_PUBLIC */ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "public" },
6243 /* ATTR_RANGE */ { 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, "range" },
6244 /* ATTR_READONLY */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, "readonly" },
6245 /* ATTR_REPRESENTAS */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "represent_as" },
6246 /* ATTR_REQUESTEDIT */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "requestedit" },
6247 /* ATTR_RESTRICTED */ { 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, "restricted" },
6248 /* ATTR_RETVAL */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "retval" },
6249 /* ATTR_SIZEIS */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, "size_is" },
6250 /* ATTR_SOURCE */ { 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, "source" },
6251 /* ATTR_STRICTCONTEXTHANDLE */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "strict_context_handle" },
6252 /* ATTR_STRING */ { 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, "string" },
6253 /* ATTR_SWITCHIS */ { 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, "switch_is" },
6254 /* ATTR_SWITCHTYPE */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, "switch_type" },
6255 /* ATTR_THREADING */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "threading" },
6256 /* ATTR_TRANSMITAS */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "transmit_as" },
6257 /* ATTR_UIDEFAULT */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "uidefault" },
6258 /* ATTR_USESGETLASTERROR */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "usesgetlasterror" },
6259 /* ATTR_USERMARSHAL */ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "user_marshal" },
6260 /* ATTR_UUID */ { 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, "uuid" },
6261 /* ATTR_V1ENUM */ { 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, "v1_enum" },
6262 /* ATTR_VARARG */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "vararg" },
6263 /* ATTR_VERSION */ { 1, 0, 1, 0, 0, 1, 1, 2, 0, 0, 1, 0, 0, 1, "version" },
6264 /* ATTR_VIPROGID */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "vi_progid" },
6265 /* ATTR_WIREMARSHAL */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "wire_marshal" },
6268 const char *get_attr_display_name(enum attr_type type
)
6270 return allowed_attr
[type
].display_name
;
6273 static attr_list_t
*check_iface_attrs(const char *name
, attr_list_t
*attrs
)
6276 if (!attrs
) return attrs
;
6277 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
6279 if (!allowed_attr
[attr
->type
].on_interface
)
6280 error_loc("inapplicable attribute %s for interface %s\n",
6281 allowed_attr
[attr
->type
].display_name
, name
);
6282 if (attr
->type
== ATTR_IMPLICIT_HANDLE
)
6284 const var_t
*var
= attr
->u
.pval
;
6285 if (type_get_type( var
->type
) == TYPE_BASIC
&&
6286 type_basic_get_type( var
->type
) == TYPE_BASIC_HANDLE
)
6288 if (is_aliaschain_attr( var
->type
, ATTR_HANDLE
))
6290 error_loc("attribute %s requires a handle type in interface %s\n",
6291 allowed_attr
[attr
->type
].display_name
, name
);
6297 static attr_list_t
*check_function_attrs(const char *name
, attr_list_t
*attrs
)
6300 if (!attrs
) return attrs
;
6301 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
6303 if (!allowed_attr
[attr
->type
].on_function
)
6304 error_loc("inapplicable attribute %s for function %s\n",
6305 allowed_attr
[attr
->type
].display_name
, name
);
6310 static void check_arg_attrs(const var_t
*arg
)
6316 LIST_FOR_EACH_ENTRY(attr
, arg
->attrs
, const attr_t
, entry
)
6318 if (!allowed_attr
[attr
->type
].on_arg
)
6319 error_loc("inapplicable attribute %s for argument %s\n",
6320 allowed_attr
[attr
->type
].display_name
, arg
->name
);
6325 static attr_list_t
*check_typedef_attrs(attr_list_t
*attrs
)
6328 if (!attrs
) return attrs
;
6329 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
6331 if (!allowed_attr
[attr
->type
].on_type
)
6332 error_loc("inapplicable attribute %s for typedef\n",
6333 allowed_attr
[attr
->type
].display_name
);
6338 static attr_list_t
*check_enum_attrs(attr_list_t
*attrs
)
6341 if (!attrs
) return attrs
;
6342 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
6344 if (!allowed_attr
[attr
->type
].on_enum
)
6345 error_loc("inapplicable attribute %s for enum\n",
6346 allowed_attr
[attr
->type
].display_name
);
6351 static attr_list_t
*check_struct_attrs(attr_list_t
*attrs
)
6353 int mask
= winrt_mode
? 3 : 1;
6355 if (!attrs
) return attrs
;
6356 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
6358 if (!(allowed_attr
[attr
->type
].on_struct
& mask
))
6359 error_loc("inapplicable attribute %s for struct\n",
6360 allowed_attr
[attr
->type
].display_name
);
6365 static attr_list_t
*check_union_attrs(attr_list_t
*attrs
)
6368 if (!attrs
) return attrs
;
6369 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
6371 if (!allowed_attr
[attr
->type
].on_union
)
6372 error_loc("inapplicable attribute %s for union\n",
6373 allowed_attr
[attr
->type
].display_name
);
6378 static attr_list_t
*check_field_attrs(const char *name
, attr_list_t
*attrs
)
6381 if (!attrs
) return attrs
;
6382 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
6384 if (!allowed_attr
[attr
->type
].on_field
)
6385 error_loc("inapplicable attribute %s for field %s\n",
6386 allowed_attr
[attr
->type
].display_name
, name
);
6391 static attr_list_t
*check_library_attrs(const char *name
, attr_list_t
*attrs
)
6394 if (!attrs
) return attrs
;
6395 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
6397 if (!allowed_attr
[attr
->type
].on_library
)
6398 error_loc("inapplicable attribute %s for library %s\n",
6399 allowed_attr
[attr
->type
].display_name
, name
);
6404 static attr_list_t
*check_dispiface_attrs(const char *name
, attr_list_t
*attrs
)
6407 if (!attrs
) return attrs
;
6408 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
6410 if (!allowed_attr
[attr
->type
].on_dispinterface
)
6411 error_loc("inapplicable attribute %s for dispinterface %s\n",
6412 allowed_attr
[attr
->type
].display_name
, name
);
6417 static attr_list_t
*check_module_attrs(const char *name
, attr_list_t
*attrs
)
6420 if (!attrs
) return attrs
;
6421 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
6423 if (!allowed_attr
[attr
->type
].on_module
)
6424 error_loc("inapplicable attribute %s for module %s\n",
6425 allowed_attr
[attr
->type
].display_name
, name
);
6430 static attr_list_t
*check_coclass_attrs(const char *name
, attr_list_t
*attrs
)
6433 if (!attrs
) return attrs
;
6434 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
6436 if (!allowed_attr
[attr
->type
].on_coclass
)
6437 error_loc("inapplicable attribute %s for coclass %s\n",
6438 allowed_attr
[attr
->type
].display_name
, name
);
6443 static int is_allowed_conf_type(const type_t
*type
)
6445 switch (type_get_type(type
))
6450 switch (type_basic_get_type(type
))
6452 case TYPE_BASIC_INT8
:
6453 case TYPE_BASIC_INT16
:
6454 case TYPE_BASIC_INT32
:
6455 case TYPE_BASIC_INT64
:
6456 case TYPE_BASIC_INT
:
6457 case TYPE_BASIC_CHAR
:
6458 case TYPE_BASIC_HYPER
:
6459 case TYPE_BASIC_BYTE
:
6460 case TYPE_BASIC_WCHAR
:
6466 /* shouldn't get here because of type_get_type call above */
6471 case TYPE_ENCAPSULATED_UNION
:
6478 case TYPE_INTERFACE
:
6485 static int is_ptr_guid_type(const type_t
*type
)
6487 /* first, make sure it is a pointer to something */
6488 if (!is_ptr(type
)) return FALSE
;
6490 /* second, make sure it is a pointer to something of size sizeof(GUID),
6492 return (type_memsize(type_pointer_get_ref(type
)) == 16);
6495 static void check_conformance_expr_list(const char *attr_name
, const var_t
*arg
, const type_t
*container_type
, expr_list_t
*expr_list
)
6498 struct expr_loc expr_loc
;
6500 expr_loc
.attr
= attr_name
;
6501 if (expr_list
) LIST_FOR_EACH_ENTRY(dim
, expr_list
, expr_t
, entry
)
6503 if (dim
->type
!= EXPR_VOID
)
6505 const type_t
*expr_type
= expr_resolve_type(&expr_loc
, container_type
, dim
);
6506 if (!is_allowed_conf_type(expr_type
))
6507 error_loc_info(&arg
->loc_info
, "expression must resolve to integral type <= 32bits for attribute %s\n",
6513 static void check_remoting_fields(const var_t
*var
, type_t
*type
);
6515 /* checks that properties common to fields and arguments are consistent */
6516 static void check_field_common(const type_t
*container_type
,
6517 const char *container_name
, const var_t
*arg
)
6519 type_t
*type
= arg
->type
;
6521 const char *container_type_name
;
6522 const char *var_type
;
6524 switch (type_get_type(container_type
))
6527 container_type_name
= "struct";
6531 container_type_name
= "union";
6534 case TYPE_ENCAPSULATED_UNION
:
6535 container_type_name
= "encapsulated union";
6539 container_type_name
= "function";
6540 var_type
= "parameter";
6543 /* should be no other container types */
6548 if (is_attr(arg
->attrs
, ATTR_LENGTHIS
) &&
6549 (is_attr(arg
->attrs
, ATTR_STRING
) || is_aliaschain_attr(arg
->type
, ATTR_STRING
)))
6550 error_loc_info(&arg
->loc_info
,
6551 "string and length_is specified for argument %s are mutually exclusive attributes\n",
6554 if (is_attr(arg
->attrs
, ATTR_SIZEIS
))
6556 expr_list_t
*size_is_exprs
= get_attrp(arg
->attrs
, ATTR_SIZEIS
);
6557 check_conformance_expr_list("size_is", arg
, container_type
, size_is_exprs
);
6559 if (is_attr(arg
->attrs
, ATTR_LENGTHIS
))
6561 expr_list_t
*length_is_exprs
= get_attrp(arg
->attrs
, ATTR_LENGTHIS
);
6562 check_conformance_expr_list("length_is", arg
, container_type
, length_is_exprs
);
6564 if (is_attr(arg
->attrs
, ATTR_IIDIS
))
6566 struct expr_loc expr_loc
;
6567 expr_t
*expr
= get_attrp(arg
->attrs
, ATTR_IIDIS
);
6568 if (expr
->type
!= EXPR_VOID
)
6570 const type_t
*expr_type
;
6572 expr_loc
.attr
= "iid_is";
6573 expr_type
= expr_resolve_type(&expr_loc
, container_type
, expr
);
6574 if (!expr_type
|| !is_ptr_guid_type(expr_type
))
6575 error_loc_info(&arg
->loc_info
, "expression must resolve to pointer to GUID type for attribute iid_is\n");
6578 if (is_attr(arg
->attrs
, ATTR_SWITCHIS
))
6580 struct expr_loc expr_loc
;
6581 expr_t
*expr
= get_attrp(arg
->attrs
, ATTR_SWITCHIS
);
6582 if (expr
->type
!= EXPR_VOID
)
6584 const type_t
*expr_type
;
6586 expr_loc
.attr
= "switch_is";
6587 expr_type
= expr_resolve_type(&expr_loc
, container_type
, expr
);
6588 if (!expr_type
|| !is_allowed_conf_type(expr_type
))
6589 error_loc_info(&arg
->loc_info
, "expression must resolve to integral type <= 32bits for attribute %s\n",
6598 switch (typegen_detect_type(type
, arg
->attrs
, TDT_IGNORE_STRINGS
))
6602 check_remoting_fields(arg
, type
);
6606 const char *reason
= "is invalid";
6607 switch (type_get_type(type
))
6610 reason
= "cannot derive from void *";
6613 reason
= "cannot be a function pointer";
6616 reason
= "cannot be a bit-field";
6619 reason
= "cannot be a class";
6621 case TYPE_INTERFACE
:
6622 reason
= "cannot be a non-pointer to an interface";
6625 reason
= "cannot be a module";
6630 error_loc_info(&arg
->loc_info
, "%s \'%s\' of %s \'%s\' %s\n",
6631 var_type
, arg
->name
, container_type_name
, container_name
, reason
);
6634 case TGT_CTXT_HANDLE
:
6635 case TGT_CTXT_HANDLE_POINTER
:
6636 if (type_get_type(container_type
) != TYPE_FUNCTION
)
6637 error_loc_info(&arg
->loc_info
,
6638 "%s \'%s\' of %s \'%s\' cannot be a context handle\n",
6639 var_type
, arg
->name
, container_type_name
,
6644 const type_t
*t
= type
;
6646 t
= type_pointer_get_ref(t
);
6647 if (is_aliaschain_attr(t
, ATTR_RANGE
))
6648 warning_loc_info(&arg
->loc_info
, "%s: range not verified for a string of ranged types\n", arg
->name
);
6652 type
= type_pointer_get_ref(type
);
6656 type
= type_array_get_element(type
);
6660 case TGT_IFACE_POINTER
:
6667 } while (more_to_do
);
6670 static void check_remoting_fields(const var_t
*var
, type_t
*type
)
6673 const var_list_t
*fields
= NULL
;
6675 type
= type_get_real_type(type
);
6680 type
->checked
= TRUE
;
6682 if (type_get_type(type
) == TYPE_STRUCT
)
6684 if (type_is_complete(type
))
6685 fields
= type_struct_get_fields(type
);
6687 error_loc_info(&var
->loc_info
, "undefined type declaration %s\n", type
->name
);
6689 else if (type_get_type(type
) == TYPE_UNION
|| type_get_type(type
) == TYPE_ENCAPSULATED_UNION
)
6690 fields
= type_union_get_cases(type
);
6692 if (fields
) LIST_FOR_EACH_ENTRY( field
, fields
, const var_t
, entry
)
6693 if (field
->type
) check_field_common(type
, type
->name
, field
);
6696 /* checks that arguments for a function make sense for marshalling and unmarshalling */
6697 static void check_remoting_args(const var_t
*func
)
6699 const char *funcname
= func
->name
;
6702 if (func
->type
->details
.function
->args
) LIST_FOR_EACH_ENTRY( arg
, func
->type
->details
.function
->args
, const var_t
, entry
)
6704 const type_t
*type
= arg
->type
;
6706 /* check that [out] parameters have enough pointer levels */
6707 if (is_attr(arg
->attrs
, ATTR_OUT
))
6709 switch (typegen_detect_type(type
, arg
->attrs
, TDT_ALL_TYPES
))
6716 case TGT_CTXT_HANDLE
:
6718 error_loc_info(&arg
->loc_info
, "out parameter \'%s\' of function \'%s\' is not a pointer\n", arg
->name
, funcname
);
6720 case TGT_IFACE_POINTER
:
6721 error_loc_info(&arg
->loc_info
, "out interface pointer \'%s\' of function \'%s\' is not a double pointer\n", arg
->name
, funcname
);
6726 /* needs conformance or fixed dimension */
6727 if (type_array_has_conformance(type
) &&
6728 type_array_get_conformance(type
)->type
!= EXPR_VOID
) break;
6729 if (!type_array_has_conformance(type
) && type_array_get_dim(type
)) break;
6731 if (is_attr( arg
->attrs
, ATTR_IN
)) break;
6732 error_loc_info(&arg
->loc_info
, "out parameter \'%s\' of function \'%s\' cannot be an unsized string\n", arg
->name
, funcname
);
6735 /* already error'd before we get here */
6736 case TGT_CTXT_HANDLE_POINTER
:
6744 check_field_common(func
->type
, funcname
, arg
);
6747 if (type_get_type(type_function_get_rettype(func
->type
)) != TYPE_VOID
)
6751 var
.type
= type_function_get_rettype(func
->type
);
6752 var
.name
= xstrdup("return value");
6753 check_field_common(func
->type
, funcname
, &var
);
6758 static void add_explicit_handle_if_necessary(const type_t
*iface
, var_t
*func
)
6760 unsigned char explicit_fc
, implicit_fc
;
6762 /* check for a defined binding handle */
6763 if (!get_func_handle_var( iface
, func
, &explicit_fc
, &implicit_fc
) || !explicit_fc
)
6765 /* no explicit handle specified so add
6766 * "[in] handle_t IDL_handle" as the first parameter to the
6768 var_t
*idl_handle
= make_var(xstrdup("IDL_handle"));
6769 idl_handle
->attrs
= append_attr(NULL
, make_attr(ATTR_IN
));
6770 idl_handle
->type
= find_type_or_error("handle_t", 0);
6771 type_function_add_head_arg(func
->type
, idl_handle
);
6775 static void check_functions(const type_t
*iface
, int is_inside_library
)
6777 const statement_t
*stmt
;
6778 if (is_attr(iface
->attrs
, ATTR_EXPLICIT_HANDLE
))
6780 STATEMENTS_FOR_EACH_FUNC( stmt
, type_iface_get_stmts(iface
) )
6782 var_t
*func
= stmt
->u
.var
;
6783 add_explicit_handle_if_necessary(iface
, func
);
6786 if (!is_inside_library
&& !is_attr(iface
->attrs
, ATTR_LOCAL
))
6788 STATEMENTS_FOR_EACH_FUNC( stmt
, type_iface_get_stmts(iface
) )
6790 const var_t
*func
= stmt
->u
.var
;
6791 if (!is_attr(func
->attrs
, ATTR_LOCAL
))
6792 check_remoting_args(func
);
6797 static void check_statements(const statement_list_t
*stmts
, int is_inside_library
)
6799 const statement_t
*stmt
;
6801 if (stmts
) LIST_FOR_EACH_ENTRY(stmt
, stmts
, const statement_t
, entry
)
6803 switch(stmt
->type
) {
6805 check_statements(stmt
->u
.lib
->stmts
, TRUE
);
6808 switch(type_get_type(stmt
->u
.type
)) {
6809 case TYPE_INTERFACE
:
6810 check_functions(stmt
->u
.type
, is_inside_library
);
6814 error_loc("coclass is not allowed in Windows Runtime mode\n");
6826 static void check_all_user_types(const statement_list_t
*stmts
)
6828 const statement_t
*stmt
;
6830 if (stmts
) LIST_FOR_EACH_ENTRY(stmt
, stmts
, const statement_t
, entry
)
6832 if (stmt
->type
== STMT_LIBRARY
)
6833 check_all_user_types(stmt
->u
.lib
->stmts
);
6834 else if (stmt
->type
== STMT_TYPE
&& type_get_type(stmt
->u
.type
) == TYPE_INTERFACE
&&
6835 !is_local(stmt
->u
.type
->attrs
))
6837 const statement_t
*stmt_func
;
6838 STATEMENTS_FOR_EACH_FUNC(stmt_func
, type_iface_get_stmts(stmt
->u
.type
)) {
6839 const var_t
*func
= stmt_func
->u
.var
;
6840 check_for_additional_prototype_types(func
->type
->details
.function
->args
);
6846 int is_valid_uuid(const char *s
)
6850 for (i
= 0; i
< 36; ++i
)
6851 if (i
== 8 || i
== 13 || i
== 18 || i
== 23)
6857 if (!isxdigit(s
[i
]))
6860 return s
[i
] == '\0';
6863 static statement_t
*make_statement(enum statement_type type
)
6865 statement_t
*stmt
= xmalloc(sizeof(*stmt
));
6870 static statement_t
*make_statement_type_decl(type_t
*type
)
6872 statement_t
*stmt
= make_statement(STMT_TYPE
);
6873 stmt
->u
.type
= type
;
6877 static statement_t
*make_statement_reference(type_t
*type
)
6879 statement_t
*stmt
= make_statement(STMT_TYPEREF
);
6880 stmt
->u
.type
= type
;
6884 static statement_t
*make_statement_declaration(var_t
*var
)
6886 statement_t
*stmt
= make_statement(STMT_DECLARATION
);
6888 if (var
->stgclass
== STG_EXTERN
&& var
->eval
)
6889 warning("'%s' initialised and declared extern\n", var
->name
);
6890 if (is_const_decl(var
))
6895 else if (type_get_type(var
->type
) == TYPE_FUNCTION
)
6896 check_function_attrs(var
->name
, var
->attrs
);
6897 else if (var
->stgclass
== STG_NONE
|| var
->stgclass
== STG_REGISTER
)
6898 error_loc("instantiation of data is illegal\n");
6902 static statement_t
*make_statement_library(typelib_t
*typelib
)
6904 statement_t
*stmt
= make_statement(STMT_LIBRARY
);
6905 stmt
->u
.lib
= typelib
;
6909 static statement_t
*make_statement_pragma(const char *str
)
6911 statement_t
*stmt
= make_statement(STMT_PRAGMA
);
6916 static statement_t
*make_statement_cppquote(const char *str
)
6918 statement_t
*stmt
= make_statement(STMT_CPPQUOTE
);
6923 static statement_t
*make_statement_importlib(const char *str
)
6925 statement_t
*stmt
= make_statement(STMT_IMPORTLIB
);
6930 static statement_t
*make_statement_import(const char *str
)
6932 statement_t
*stmt
= make_statement(STMT_IMPORT
);
6937 static statement_t
*make_statement_module(type_t
*type
)
6939 statement_t
*stmt
= make_statement(STMT_MODULE
);
6940 stmt
->u
.type
= type
;
6944 static statement_t
*make_statement_typedef(declarator_list_t
*decls
)
6946 declarator_t
*decl
, *next
;
6948 type_list_t
**type_list
;
6950 if (!decls
) return NULL
;
6952 stmt
= make_statement(STMT_TYPEDEF
);
6953 stmt
->u
.type_list
= NULL
;
6954 type_list
= &stmt
->u
.type_list
;
6956 LIST_FOR_EACH_ENTRY_SAFE( decl
, next
, decls
, declarator_t
, entry
)
6958 var_t
*var
= decl
->var
;
6959 type_t
*type
= find_type_or_error(var
->name
, 0);
6960 *type_list
= xmalloc(sizeof(type_list_t
));
6961 (*type_list
)->type
= type
;
6962 (*type_list
)->next
= NULL
;
6964 type_list
= &(*type_list
)->next
;
6972 static statement_list_t
*append_statements(statement_list_t
*l1
, statement_list_t
*l2
)
6975 if (!l1
|| l1
== l2
) return l2
;
6976 list_move_tail (l1
, l2
);
6980 static attr_list_t
*append_attribs(attr_list_t
*l1
, attr_list_t
*l2
)
6983 if (!l1
|| l1
== l2
) return l2
;
6984 list_move_tail (l1
, l2
);
6988 static statement_list_t
*append_statement(statement_list_t
*list
, statement_t
*stmt
)
6990 if (!stmt
) return list
;
6993 list
= xmalloc( sizeof(*list
) );
6996 list_add_tail( list
, &stmt
->entry
);
7000 void init_loc_info(loc_info_t
*i
)
7002 i
->input_name
= input_name
? input_name
: "stdin";
7003 i
->line_number
= line_number
;
7004 i
->near_text
= parser_text
;
7007 static void check_def(const type_t
*t
)
7010 error_loc("%s: redefinition error; original definition was at %s:%d\n",
7011 t
->name
, t
->loc_info
.input_name
, t
->loc_info
.line_number
);