2 /* A Bison parser, made by GNU Bison 2.4.1. */
4 /* Skeleton implementation for Bison's Yacc-like parsers in C
6 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
7 Free Software Foundation, Inc.
9 This program is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>. */
22 /* As a special exception, you may create a larger work that contains
23 part or all of the Bison parser skeleton and distribute that work
24 under terms of your choice, so long as that work isn't itself a
25 parser generator using the skeleton or a modified version thereof
26 as a parser skeleton. Alternatively, if you modify or redistribute
27 the parser skeleton itself, you may (at your option) remove this
28 special exception, which will cause the skeleton and the resulting
29 Bison output files to be licensed under the GNU General Public
30 License without this special exception.
32 This special exception was added by the Free Software Foundation in
33 version 2.2 of Bison. */
35 /* C LALR(1) parser skeleton written by Richard Stallman, by
36 simplifying the original so-called "semantic" parser. */
38 /* All symbols defined below should begin with yy or YY, to avoid
39 infringing on user name space. This should be done even for local
40 variables, as they might otherwise be expanded by user macros.
41 There are some unavoidable exceptions within include files to
42 define necessary library symbols; they are noted "INFRINGES ON
43 USER NAME SPACE" below. */
45 /* Identify Bison output. */
49 #define YYBISON_VERSION "2.4.1"
52 #define YYSKELETON_NAME "yacc.c"
63 /* Using locations. */
64 #define YYLSP_NEEDED 0
66 /* Substitute the variable and function names. */
67 #define yyparse parser_parse
68 #define yylex parser_lex
69 #define yyerror parser_error
70 #define yylval parser_lval
71 #define yychar parser_char
72 #define yydebug parser_debug
73 #define yynerrs parser_nerrs
76 /* Copy the first part of user declarations. */
78 /* Line 189 of yacc.c */
84 * Copyright 2002 Ove Kaaven
85 * Copyright 2006-2008 Robert Shearman
87 * This library is free software; you can redistribute it and/or
88 * modify it under the terms of the GNU Lesser General Public
89 * License as published by the Free Software Foundation; either
90 * version 2.1 of the License, or (at your option) any later version.
92 * This library is distributed in the hope that it will be useful,
93 * but WITHOUT ANY WARRANTY; without even the implied warranty of
94 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
95 * Lesser General Public License for more details.
97 * You should have received a copy of the GNU Lesser General Public
98 * License along with this library; if not, write to the Free Software
99 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
118 #include "typetree.h"
121 /* Berkeley yacc (byacc) doesn't seem to know about these */
122 /* Some *BSD supplied versions do define these though */
124 # define YYEMPTY (-1) /* Empty lookahead value of yychar */
127 # define YYLEX yylex()
130 #elif defined(YYBISON)
131 /* Bison was used for original development */
132 /* #define YYEMPTY -2 */
133 /* #define YYLEX yylex() */
136 /* No yacc we know yet */
137 # if !defined(YYEMPTY) || !defined(YYLEX)
138 # error Yacc version/type unknown. This version needs to be verified for settings of YYEMPTY and YYLEX.
139 # elif defined(__GNUC__) /* gcc defines the #warning directive */
140 # warning Yacc version/type unknown. It defines YYEMPTY and YYLEX, but is not tested
141 /* #else we just take a chance that it works... */
145 #define YYERROR_VERBOSE
147 static unsigned char pointer_default
= RPC_FC_UP
;
148 static int is_object_interface
= FALSE
;
150 typedef struct list typelist_t
;
159 int import_performed
;
162 typedef struct _decl_spec_t
166 enum storage_class stgclass
;
169 typelist_t incomplete_types
= LIST_INIT(incomplete_types
);
171 static void fix_incomplete(void);
172 static void fix_incomplete_types(type_t
*complete_type
);
174 static str_list_t
*append_str(str_list_t
*list
, char *str
);
175 static attr_list_t
*append_attr(attr_list_t
*list
, attr_t
*attr
);
176 static attr_list_t
*append_attr_list(attr_list_t
*new_list
, attr_list_t
*old_list
);
177 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
);
178 static attr_t
*make_attr(enum attr_type type
);
179 static attr_t
*make_attrv(enum attr_type type
, unsigned long val
);
180 static attr_t
*make_attrp(enum attr_type type
, void *val
);
181 static expr_list_t
*append_expr(expr_list_t
*list
, expr_t
*expr
);
182 static array_dims_t
*append_array(array_dims_t
*list
, expr_t
*expr
);
183 static var_t
*declare_var(attr_list_t
*attrs
, decl_spec_t
*decl_spec
, const declarator_t
*decl
, int top
);
184 static var_list_t
*set_var_types(attr_list_t
*attrs
, decl_spec_t
*decl_spec
, declarator_list_t
*decls
);
185 static ifref_list_t
*append_ifref(ifref_list_t
*list
, ifref_t
*iface
);
186 static ifref_t
*make_ifref(type_t
*iface
);
187 static var_list_t
*append_var_list(var_list_t
*list
, var_list_t
*vars
);
188 static declarator_list_t
*append_declarator(declarator_list_t
*list
, declarator_t
*p
);
189 static declarator_t
*make_declarator(var_t
*var
);
190 static func_list_t
*append_func(func_list_t
*list
, func_t
*func
);
191 static func_t
*make_func(var_t
*def
);
192 static type_t
*make_safearray(type_t
*type
);
193 static typelib_t
*make_library(const char *name
, const attr_list_t
*attrs
);
194 static type_t
*append_ptrchain_type(type_t
*ptrchain
, type_t
*type
);
196 static type_t
*reg_typedefs(decl_spec_t
*decl_spec
, var_list_t
*names
, attr_list_t
*attrs
);
197 static type_t
*find_type_or_error(const char *name
, int t
);
198 static type_t
*find_type_or_error2(char *name
, int t
);
200 static var_t
*reg_const(var_t
*var
);
202 static char *gen_name(void);
203 static void check_arg_attrs(const var_t
*arg
);
204 static void check_statements(const statement_list_t
*stmts
, int is_inside_library
);
205 static void check_all_user_types(const statement_list_t
*stmts
);
206 static attr_list_t
*check_iface_attrs(const char *name
, attr_list_t
*attrs
);
207 static attr_list_t
*check_function_attrs(const char *name
, attr_list_t
*attrs
);
208 static attr_list_t
*check_typedef_attrs(attr_list_t
*attrs
);
209 static attr_list_t
*check_enum_attrs(attr_list_t
*attrs
);
210 static attr_list_t
*check_struct_attrs(attr_list_t
*attrs
);
211 static attr_list_t
*check_union_attrs(attr_list_t
*attrs
);
212 static attr_list_t
*check_field_attrs(const char *name
, attr_list_t
*attrs
);
213 static attr_list_t
*check_library_attrs(const char *name
, attr_list_t
*attrs
);
214 static attr_list_t
*check_dispiface_attrs(const char *name
, attr_list_t
*attrs
);
215 static attr_list_t
*check_module_attrs(const char *name
, attr_list_t
*attrs
);
216 static attr_list_t
*check_coclass_attrs(const char *name
, attr_list_t
*attrs
);
217 const char *get_attr_display_name(enum attr_type type
);
218 static void add_explicit_handle_if_necessary(var_t
*func
);
219 static void check_def(const type_t
*t
);
221 static statement_t
*make_statement(enum statement_type type
);
222 static statement_t
*make_statement_type_decl(type_t
*type
);
223 static statement_t
*make_statement_reference(type_t
*type
);
224 static statement_t
*make_statement_declaration(var_t
*var
);
225 static statement_t
*make_statement_library(typelib_t
*typelib
);
226 static statement_t
*make_statement_cppquote(const char *str
);
227 static statement_t
*make_statement_importlib(const char *str
);
228 static statement_t
*make_statement_module(type_t
*type
);
229 static statement_t
*make_statement_typedef(var_list_t
*names
);
230 static statement_t
*make_statement_import(const char *str
);
231 static statement_t
*make_statement_typedef(var_list_t
*names
);
232 static statement_list_t
*append_statement(statement_list_t
*list
, statement_t
*stmt
);
236 /* Line 189 of yacc.c */
237 #line 238 "parser.tab.c"
239 /* Enabling traces. */
244 /* Enabling verbose error messages. */
245 #ifdef YYERROR_VERBOSE
246 # undef YYERROR_VERBOSE
247 # define YYERROR_VERBOSE 1
249 # define YYERROR_VERBOSE 0
252 /* Enabling the token table. */
253 #ifndef YYTOKEN_TABLE
254 # define YYTOKEN_TABLE 0
261 /* Put the tokens into the symbol table, so that GDB and other debuggers
304 tCONTEXTHANDLE
= 298,
305 tCONTEXTHANDLENOSERIALIZE
= 299,
306 tCONTEXTHANDLESERIALIZE
= 300,
310 tDEFAULTCOLLELEM
= 304,
312 tDEFAULTVTABLE
= 306,
314 tDISPINTERFACE
= 308,
322 tEXPLICITHANDLE
= 316,
332 tHELPSTRINGCONTEXT
= 326,
333 tHELPSTRINGDLL
= 327,
339 tIMMEDIATEBIND
= 333,
340 tIMPLICITHANDLE
= 334,
360 tNONEXTENSIBLE
= 354,
364 tOLEAUTOMATION
= 358,
368 tPOINTERDEFAULT
= 362,
391 tSTRICTCONTEXTHANDLE
= 385,
420 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
421 typedef union YYSTYPE
424 /* Line 214 of yacc.c */
428 attr_list_t
*attr_list
;
429 str_list_t
*str_list
;
431 expr_list_t
*expr_list
;
432 array_dims_t
*array_dims
;
435 var_list_t
*var_list
;
436 declarator_t
*declarator
;
437 declarator_list_t
*declarator_list
;
439 func_list_t
*func_list
;
440 statement_t
*statement
;
441 statement_list_t
*stmt_list
;
443 ifref_list_t
*ifref_list
;
448 interface_info_t ifinfo
;
450 struct _import_t
*import
;
451 struct _decl_spec_t
*declspec
;
452 enum storage_class stgclass
;
456 /* Line 214 of yacc.c */
457 #line 458 "parser.tab.c"
459 # define YYSTYPE_IS_TRIVIAL 1
460 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
461 # define YYSTYPE_IS_DECLARED 1
465 /* Copy the second part of user declarations. */
468 /* Line 264 of yacc.c */
469 #line 470 "parser.tab.c"
476 typedef YYTYPE_UINT8 yytype_uint8
;
478 typedef unsigned char yytype_uint8
;
482 typedef YYTYPE_INT8 yytype_int8
;
483 #elif (defined __STDC__ || defined __C99__FUNC__ \
484 || defined __cplusplus || defined _MSC_VER)
485 typedef signed char yytype_int8
;
487 typedef short int yytype_int8
;
491 typedef YYTYPE_UINT16 yytype_uint16
;
493 typedef unsigned short int yytype_uint16
;
497 typedef YYTYPE_INT16 yytype_int16
;
499 typedef short int yytype_int16
;
503 # ifdef __SIZE_TYPE__
504 # define YYSIZE_T __SIZE_TYPE__
505 # elif defined size_t
506 # define YYSIZE_T size_t
507 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
508 || defined __cplusplus || defined _MSC_VER)
509 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
510 # define YYSIZE_T size_t
512 # define YYSIZE_T unsigned int
516 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
521 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
522 # define YY_(msgid) dgettext ("bison-runtime", msgid)
526 # define YY_(msgid) msgid
530 /* Suppress unused-variable warnings by "using" E. */
531 #if ! defined lint || defined __GNUC__
532 # define YYUSE(e) ((void) (e))
534 # define YYUSE(e) /* empty */
537 /* Identity function, used to suppress warnings about constant conditions. */
541 #if (defined __STDC__ || defined __C99__FUNC__ \
542 || defined __cplusplus || defined _MSC_VER)
555 #if ! defined yyoverflow || YYERROR_VERBOSE
557 /* The parser invokes alloca or malloc; define the necessary symbols. */
559 # ifdef YYSTACK_USE_ALLOCA
560 # if YYSTACK_USE_ALLOCA
562 # define YYSTACK_ALLOC __builtin_alloca
563 # elif defined __BUILTIN_VA_ARG_INCR
564 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
566 # define YYSTACK_ALLOC __alloca
567 # elif defined _MSC_VER
568 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
569 # define alloca _alloca
571 # define YYSTACK_ALLOC alloca
572 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
573 || defined __cplusplus || defined _MSC_VER)
574 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
583 # ifdef YYSTACK_ALLOC
584 /* Pacify GCC's `empty if-body' warning. */
585 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
586 # ifndef YYSTACK_ALLOC_MAXIMUM
587 /* The OS might guarantee only one guard page at the bottom of the stack,
588 and a page size can be as small as 4096 bytes. So we cannot safely
589 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
590 to allow for a few compiler-allocated temporary stack slots. */
591 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
594 # define YYSTACK_ALLOC YYMALLOC
595 # define YYSTACK_FREE YYFREE
596 # ifndef YYSTACK_ALLOC_MAXIMUM
597 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
599 # if (defined __cplusplus && ! defined _STDLIB_H \
600 && ! ((defined YYMALLOC || defined malloc) \
601 && (defined YYFREE || defined free)))
602 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
608 # define YYMALLOC malloc
609 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
610 || defined __cplusplus || defined _MSC_VER)
611 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
616 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
617 || defined __cplusplus || defined _MSC_VER)
618 void free (void *); /* INFRINGES ON USER NAME SPACE */
622 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
625 #if (! defined yyoverflow \
626 && (! defined __cplusplus \
627 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
629 /* A type that is properly aligned for any stack member. */
632 yytype_int16 yyss_alloc
;
636 /* The size of the maximum gap between one aligned stack and the next. */
637 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
639 /* The size of an array large to enough to hold all stacks, each with
641 # define YYSTACK_BYTES(N) \
642 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
643 + YYSTACK_GAP_MAXIMUM)
645 /* Copy COUNT objects from FROM to TO. The source and destination do
648 # if defined __GNUC__ && 1 < __GNUC__
649 # define YYCOPY(To, From, Count) \
650 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
652 # define YYCOPY(To, From, Count) \
656 for (yyi = 0; yyi < (Count); yyi++) \
657 (To)[yyi] = (From)[yyi]; \
663 /* Relocate STACK from its old location to the new one. The
664 local variables YYSIZE and YYSTACKSIZE give the old and new number of
665 elements in the stack, and YYPTR gives the new location of the
666 stack. Advance YYPTR to a properly aligned location for the next
668 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
671 YYSIZE_T yynewbytes; \
672 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
673 Stack = &yyptr->Stack_alloc; \
674 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
675 yyptr += yynewbytes / sizeof (*yyptr); \
681 /* YYFINAL -- State number of the termination state. */
683 /* YYLAST -- Last index in YYTABLE. */
686 /* YYNTOKENS -- Number of terminals. */
687 #define YYNTOKENS 178
688 /* YYNNTS -- Number of nonterminals. */
690 /* YYNRULES -- Number of rules. */
692 /* YYNRULES -- Number of states. */
693 #define YYNSTATES 606
695 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
697 #define YYMAXUTOK 408
699 #define YYTRANSLATE(YYX) \
700 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
702 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
703 static const yytype_uint8 yytranslate
[] =
705 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
706 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
707 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
708 2, 2, 2, 162, 2, 2, 2, 161, 154, 2,
709 173, 174, 159, 158, 149, 157, 169, 160, 2, 2,
710 2, 2, 2, 2, 2, 2, 2, 2, 151, 172,
711 155, 177, 156, 150, 2, 2, 2, 2, 2, 2,
712 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
713 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
714 2, 170, 2, 171, 153, 2, 2, 2, 2, 2,
715 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
716 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
717 2, 2, 2, 175, 152, 176, 163, 2, 2, 2,
718 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
719 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
720 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
721 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
722 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
723 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
724 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
725 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
726 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
727 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
728 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
729 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
730 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
731 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
732 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
733 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
734 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
735 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
736 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
737 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
738 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
739 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
740 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
741 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
742 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
743 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
744 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
745 145, 146, 147, 148, 164, 165, 166, 167, 168
749 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
751 static const yytype_uint16 yyprhs
[] =
753 0, 0, 3, 5, 6, 9, 12, 16, 19, 22,
754 25, 28, 29, 32, 35, 39, 42, 45, 48, 51,
755 54, 55, 58, 59, 61, 63, 66, 69, 71, 74,
756 76, 78, 80, 83, 86, 89, 94, 98, 102, 108,
757 111, 115, 120, 121, 123, 125, 129, 131, 135, 139,
758 142, 146, 150, 151, 153, 157, 159, 163, 168, 170,
759 174, 175, 177, 182, 184, 186, 188, 190, 192, 197,
760 202, 204, 206, 208, 210, 212, 214, 219, 221, 223,
761 228, 230, 235, 240, 242, 244, 249, 254, 259, 264,
762 269, 271, 276, 278, 283, 285, 291, 293, 295, 300,
763 305, 307, 309, 311, 313, 315, 317, 319, 321, 323,
764 325, 330, 332, 334, 336, 338, 345, 347, 349, 351,
765 353, 358, 360, 362, 364, 369, 374, 379, 384, 386,
766 388, 393, 398, 400, 402, 404, 406, 408, 410, 412,
767 413, 416, 421, 425, 426, 429, 431, 433, 437, 441,
768 443, 449, 451, 455, 456, 458, 460, 462, 464, 466,
769 468, 470, 472, 474, 476, 482, 486, 490, 494, 498,
770 502, 506, 510, 514, 518, 522, 526, 530, 534, 538,
771 542, 546, 550, 554, 557, 560, 563, 566, 569, 572,
772 576, 580, 586, 592, 597, 601, 603, 607, 609, 611,
773 612, 615, 620, 624, 627, 630, 631, 634, 637, 639,
774 643, 647, 651, 654, 655, 657, 658, 660, 662, 664,
775 666, 668, 670, 672, 675, 678, 680, 682, 684, 686,
776 688, 690, 691, 693, 695, 698, 700, 703, 706, 708,
777 710, 712, 715, 718, 721, 727, 728, 731, 734, 737,
778 740, 743, 746, 750, 753, 757, 763, 769, 770, 773,
779 776, 779, 782, 789, 798, 801, 804, 807, 810, 813,
780 816, 822, 824, 826, 828, 830, 832, 833, 836, 839,
781 843, 844, 846, 849, 852, 855, 859, 862, 864, 866,
782 870, 873, 878, 882, 885, 887, 891, 894, 895, 897,
783 901, 904, 906, 910, 915, 919, 922, 924, 928, 931,
784 932, 934, 936, 940, 943, 945, 949, 954, 956, 960,
785 961, 964, 967, 969, 973, 975, 979, 981, 983, 985,
786 991, 993, 995, 997, 999, 1002, 1004, 1007, 1009, 1012,
787 1017, 1022, 1028, 1039, 1041
790 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
791 static const yytype_int16 yyrhs
[] =
793 179, 0, -1, 180, -1, -1, 180, 245, -1, 180,
794 244, -1, 180, 231, 172, -1, 180, 233, -1, 180,
795 248, -1, 180, 192, -1, 180, 184, -1, -1, 181,
796 245, -1, 181, 244, -1, 181, 231, 172, -1, 181,
797 233, -1, 181, 248, -1, 181, 184, -1, 181, 189,
798 -1, 181, 192, -1, -1, 182, 184, -1, -1, 172,
799 -1, 186, -1, 185, 172, -1, 224, 172, -1, 188,
800 -1, 274, 172, -1, 210, -1, 272, -1, 275, -1,
801 199, 210, -1, 199, 272, -1, 199, 275, -1, 47,
802 173, 8, 174, -1, 80, 8, 172, -1, 187, 181,
803 11, -1, 81, 173, 8, 174, 183, -1, 92, 3,
804 -1, 199, 190, 175, -1, 191, 181, 176, 183, -1,
805 -1, 195, -1, 196, -1, 194, 149, 196, -1, 194,
806 -1, 194, 149, 21, -1, 199, 253, 264, -1, 253,
807 264, -1, 170, 212, 171, -1, 170, 159, 171, -1,
808 -1, 199, -1, 170, 200, 171, -1, 202, -1, 200,
809 149, 202, -1, 200, 171, 170, 202, -1, 8, -1,
810 201, 149, 8, -1, -1, 22, -1, 24, 173, 8,
811 174, -1, 25, -1, 26, -1, 28, -1, 29, -1,
812 31, -1, 34, 173, 227, 174, -1, 36, 173, 214,
813 174, -1, 43, -1, 44, -1, 45, -1, 46, -1,
814 48, -1, 49, -1, 50, 173, 216, 174, -1, 51,
815 -1, 52, -1, 54, 173, 8, 174, -1, 56, -1,
816 57, 173, 201, 174, -1, 58, 173, 216, 174, -1,
817 61, -1, 66, -1, 68, 173, 215, 174, -1, 69,
818 173, 8, 174, -1, 70, 173, 8, 174, -1, 71,
819 173, 215, 174, -1, 72, 173, 8, 174, -1, 73,
820 -1, 75, 173, 215, 174, -1, 76, -1, 77, 173,
821 213, 174, -1, 78, -1, 79, 173, 67, 3, 174,
822 -1, 82, -1, 85, -1, 91, 173, 211, 174, -1,
823 90, 173, 215, 174, -1, 90, -1, 93, -1, 97,
824 -1, 98, -1, 99, -1, 101, -1, 102, -1, 103,
825 -1, 104, -1, 105, -1, 107, 173, 271, 174, -1,
826 109, -1, 110, -1, 111, -1, 113, -1, 114, 173,
827 215, 149, 215, 174, -1, 115, -1, 118, -1, 119,
828 -1, 120, -1, 124, 173, 211, 174, -1, 127, -1,
829 130, -1, 131, -1, 134, 173, 213, 174, -1, 135,
830 173, 273, 174, -1, 136, 173, 273, 174, -1, 142,
831 173, 203, 174, -1, 143, -1, 144, -1, 145, 173,
832 276, 174, -1, 148, 173, 273, 174, -1, 271, -1,
833 10, -1, 8, -1, 37, -1, 64, -1, 106, -1,
834 129, -1, -1, 205, 206, -1, 36, 215, 151, 221,
835 -1, 48, 151, 221, -1, -1, 208, 149, -1, 208,
836 -1, 209, -1, 208, 149, 209, -1, 227, 177, 215,
837 -1, 227, -1, 59, 226, 175, 207, 176, -1, 212,
838 -1, 211, 149, 212, -1, -1, 213, -1, 5, -1,
839 6, -1, 7, -1, 63, -1, 100, -1, 137, -1,
840 8, -1, 9, -1, 3, -1, 213, 150, 213, 151,
841 213, -1, 213, 19, 213, -1, 213, 20, 213, -1,
842 213, 152, 213, -1, 213, 153, 213, -1, 213, 154,
843 213, -1, 213, 15, 213, -1, 213, 16, 213, -1,
844 213, 156, 213, -1, 213, 155, 213, -1, 213, 17,
845 213, -1, 213, 18, 213, -1, 213, 12, 213, -1,
846 213, 13, 213, -1, 213, 158, 213, -1, 213, 157,
847 213, -1, 213, 161, 213, -1, 213, 159, 213, -1,
848 213, 160, 213, -1, 162, 213, -1, 163, 213, -1,
849 158, 213, -1, 157, 213, -1, 154, 213, -1, 159,
850 213, -1, 213, 14, 3, -1, 213, 169, 3, -1,
851 173, 253, 260, 174, 213, -1, 125, 173, 253, 260,
852 174, -1, 213, 170, 213, 171, -1, 173, 213, 174,
853 -1, 215, -1, 214, 149, 215, -1, 213, -1, 213,
854 -1, -1, 217, 218, -1, 198, 253, 269, 172, -1,
855 198, 275, 172, -1, 222, 172, -1, 199, 172, -1,
856 -1, 220, 219, -1, 222, 172, -1, 172, -1, 198,
857 253, 256, -1, 198, 253, 256, -1, 199, 253, 270,
858 -1, 253, 270, -1, -1, 227, -1, -1, 3, -1,
859 4, -1, 3, -1, 4, -1, 32, -1, 147, -1,
860 230, -1, 123, 230, -1, 141, 230, -1, 141, -1,
861 65, -1, 55, -1, 30, -1, 60, -1, 67, -1,
862 -1, 86, -1, 86, -1, 122, 229, -1, 126, -1,
863 94, 229, -1, 74, 229, -1, 88, -1, 38, -1,
864 87, -1, 39, 3, -1, 39, 4, -1, 199, 231,
865 -1, 232, 175, 234, 176, 183, -1, -1, 234, 235,
866 -1, 198, 245, -1, 53, 3, -1, 53, 4, -1,
867 199, 236, -1, 108, 151, -1, 238, 222, 172, -1,
868 95, 151, -1, 239, 223, 172, -1, 237, 175, 238,
869 239, 176, -1, 237, 175, 242, 172, 176, -1, -1,
870 151, 4, -1, 89, 3, -1, 89, 4, -1, 199,
871 242, -1, 243, 241, 175, 182, 176, 183, -1, 243,
872 151, 3, 175, 188, 182, 176, 183, -1, 240, 183,
873 -1, 242, 172, -1, 236, 172, -1, 96, 3, -1,
874 96, 4, -1, 199, 246, -1, 247, 175, 182, 176,
875 183, -1, 62, -1, 128, -1, 117, -1, 84, -1,
876 42, -1, -1, 252, 251, -1, 273, 254, -1, 255,
877 273, 254, -1, -1, 255, -1, 251, 254, -1, 250,
878 254, -1, 249, 254, -1, 159, 252, 256, -1, 204,
879 256, -1, 257, -1, 227, -1, 173, 256, 174, -1,
880 257, 197, -1, 257, 173, 193, 174, -1, 159, 252,
881 260, -1, 204, 260, -1, 261, -1, 159, 252, 264,
882 -1, 204, 264, -1, -1, 258, -1, 173, 259, 174,
883 -1, 261, 197, -1, 197, -1, 173, 193, 174, -1,
884 261, 173, 193, 174, -1, 159, 252, 264, -1, 204,
885 264, -1, 265, -1, 159, 252, 264, -1, 204, 264,
886 -1, -1, 262, -1, 227, -1, 173, 263, 174, -1,
887 265, 197, -1, 197, -1, 173, 193, 174, -1, 265,
888 173, 193, 174, -1, 256, -1, 266, 149, 256, -1,
889 -1, 151, 216, -1, 262, 267, -1, 268, -1, 269,
890 149, 268, -1, 256, -1, 256, 177, 216, -1, 116,
891 -1, 140, -1, 112, -1, 132, 226, 175, 217, 176,
892 -1, 146, -1, 4, -1, 228, -1, 210, -1, 59,
893 3, -1, 272, -1, 132, 3, -1, 275, -1, 139,
894 3, -1, 121, 173, 273, 174, -1, 138, 198, 253,
895 266, -1, 139, 226, 175, 220, 176, -1, 139, 226,
896 133, 173, 222, 174, 225, 175, 205, 176, -1, 5,
900 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
901 static const yytype_uint16 yyrline
[] =
903 0, 330, 330, 343, 344, 345, 346, 349, 352, 353,
904 354, 357, 358, 359, 360, 361, 364, 365, 366, 367,
905 370, 371, 374, 375, 379, 380, 381, 382, 383, 387,
906 388, 389, 390, 391, 392, 395, 397, 405, 411, 415,
907 417, 421, 428, 429, 432, 433, 436, 437, 441, 446,
908 453, 454, 457, 458, 462, 465, 466, 467, 470, 471,
909 474, 475, 476, 477, 478, 479, 480, 481, 482, 483,
910 484, 485, 486, 487, 488, 489, 490, 491, 492, 493,
911 494, 495, 496, 497, 498, 499, 500, 501, 502, 503,
912 504, 505, 506, 507, 508, 509, 510, 511, 512, 513,
913 514, 515, 516, 517, 518, 519, 520, 521, 522, 523,
914 524, 525, 526, 527, 528, 529, 533, 534, 535, 536,
915 537, 538, 539, 540, 541, 542, 543, 544, 545, 546,
916 547, 548, 549, 553, 554, 559, 560, 561, 562, 565,
917 566, 569, 573, 579, 580, 581, 584, 588, 597, 601,
918 606, 609, 610, 623, 624, 627, 628, 629, 630, 631,
919 632, 633, 634, 635, 636, 637, 638, 639, 640, 641,
920 642, 643, 644, 645, 646, 647, 648, 649, 650, 651,
921 652, 653, 654, 655, 656, 657, 658, 659, 660, 661,
922 662, 663, 665, 667, 668, 671, 672, 675, 681, 687,
923 688, 691, 696, 703, 704, 707, 708, 712, 713, 716,
924 723, 732, 736, 741, 742, 745, 746, 747, 750, 752,
925 755, 756, 757, 758, 759, 760, 761, 762, 763, 764,
926 765, 768, 769, 772, 773, 774, 775, 776, 777, 778,
927 779, 782, 783, 791, 797, 801, 802, 806, 809, 810,
928 813, 823, 824, 827, 828, 831, 837, 843, 844, 847,
929 848, 851, 862, 869, 875, 879, 880, 883, 884, 887,
930 892, 899, 900, 901, 905, 909, 912, 913, 916, 917,
931 921, 922, 926, 927, 928, 932, 934, 935, 939, 940,
932 941, 942, 950, 952, 953, 958, 960, 964, 965, 970,
933 971, 972, 973, 978, 987, 989, 990, 995, 997, 1001,
934 1002, 1009, 1010, 1011, 1012, 1013, 1018, 1026, 1027, 1030,
935 1031, 1034, 1041, 1042, 1047, 1048, 1052, 1053, 1054, 1057,
936 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069,
937 1072, 1078, 1080, 1086, 1087
941 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
942 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
943 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
944 static const char *const yytname
[] =
946 "$end", "error", "$undefined", "aIDENTIFIER", "aKNOWNTYPE", "aNUM",
947 "aHEXNUM", "aDOUBLE", "aSTRING", "aWSTRING", "aUUID", "aEOF", "SHL",
948 "SHR", "MEMBERPTR", "EQUALITY", "INEQUALITY", "GREATEREQUAL",
949 "LESSEQUAL", "LOGICALOR", "LOGICALAND", "ELLIPSIS", "tAGGREGATABLE",
950 "tALLOCATE", "tANNOTATION", "tAPPOBJECT", "tASYNC", "tASYNCUUID",
951 "tAUTOHANDLE", "tBINDABLE", "tBOOLEAN", "tBROADCAST", "tBYTE",
952 "tBYTECOUNT", "tCALLAS", "tCALLBACK", "tCASE", "tCDECL", "tCHAR",
953 "tCOCLASS", "tCODE", "tCOMMSTATUS", "tCONST", "tCONTEXTHANDLE",
954 "tCONTEXTHANDLENOSERIALIZE", "tCONTEXTHANDLESERIALIZE", "tCONTROL",
955 "tCPPQUOTE", "tDEFAULT", "tDEFAULTCOLLELEM", "tDEFAULTVALUE",
956 "tDEFAULTVTABLE", "tDISPLAYBIND", "tDISPINTERFACE", "tDLLNAME",
957 "tDOUBLE", "tDUAL", "tENDPOINT", "tENTRY", "tENUM", "tERRORSTATUST",
958 "tEXPLICITHANDLE", "tEXTERN", "tFALSE", "tFASTCALL", "tFLOAT", "tHANDLE",
959 "tHANDLET", "tHELPCONTEXT", "tHELPFILE", "tHELPSTRING",
960 "tHELPSTRINGCONTEXT", "tHELPSTRINGDLL", "tHIDDEN", "tHYPER", "tID",
961 "tIDEMPOTENT", "tIIDIS", "tIMMEDIATEBIND", "tIMPLICITHANDLE", "tIMPORT",
962 "tIMPORTLIB", "tIN", "tIN_LINE", "tINLINE", "tINPUTSYNC", "tINT",
963 "tINT3264", "tINT64", "tINTERFACE", "tLCID", "tLENGTHIS", "tLIBRARY",
964 "tLOCAL", "tLONG", "tMETHODS", "tMODULE", "tNONBROWSABLE",
965 "tNONCREATABLE", "tNONEXTENSIBLE", "tNULL", "tOBJECT", "tODL",
966 "tOLEAUTOMATION", "tOPTIONAL", "tOUT", "tPASCAL", "tPOINTERDEFAULT",
967 "tPROPERTIES", "tPROPGET", "tPROPPUT", "tPROPPUTREF", "tPTR", "tPUBLIC",
968 "tRANGE", "tREADONLY", "tREF", "tREGISTER", "tREQUESTEDIT",
969 "tRESTRICTED", "tRETVAL", "tSAFEARRAY", "tSHORT", "tSIGNED", "tSIZEIS",
970 "tSIZEOF", "tSMALL", "tSOURCE", "tSTATIC", "tSTDCALL",
971 "tSTRICTCONTEXTHANDLE", "tSTRING", "tSTRUCT", "tSWITCH", "tSWITCHIS",
972 "tSWITCHTYPE", "tTRANSMITAS", "tTRUE", "tTYPEDEF", "tUNION", "tUNIQUE",
973 "tUNSIGNED", "tUUID", "tV1ENUM", "tVARARG", "tVERSION", "tVOID",
974 "tWCHAR", "tWIREMARSHAL", "','", "'?'", "':'", "'|'", "'^'", "'&'",
975 "'<'", "'>'", "'-'", "'+'", "'*'", "'/'", "'%'", "'!'", "'~'",
976 "ADDRESSOF", "NEG", "POS", "PPTR", "CAST", "'.'", "'['", "']'", "';'",
977 "'('", "')'", "'{'", "'}'", "'='", "$accept", "input", "gbl_statements",
978 "imp_statements", "int_statements", "semicolon_opt", "statement",
979 "typedecl", "cppquote", "import_start", "import", "importlib",
980 "libraryhdr", "library_start", "librarydef", "m_args", "arg_list",
981 "args", "arg", "array", "m_attributes", "attributes", "attrib_list",
982 "str_list", "attribute", "uuid_string", "callconv", "cases", "case",
983 "enums", "enum_list", "enum", "enumdef", "m_exprs", "m_expr", "expr",
984 "expr_list_int_const", "expr_int_const", "expr_const", "fields", "field",
985 "ne_union_field", "ne_union_fields", "union_field", "s_field", "funcdef",
986 "declaration", "m_ident", "t_ident", "ident", "base_type", "m_int",
987 "int_std", "coclass", "coclasshdr", "coclassdef", "coclass_ints",
988 "coclass_int", "dispinterface", "dispinterfacehdr", "dispint_props",
989 "dispint_meths", "dispinterfacedef", "inherit", "interface",
990 "interfacehdr", "interfacedef", "interfacedec", "module", "modulehdr",
991 "moduledef", "storage_cls_spec", "function_specifier", "type_qualifier",
992 "m_type_qual_list", "decl_spec", "m_decl_spec_no_type",
993 "decl_spec_no_type", "declarator", "direct_declarator",
994 "abstract_declarator", "abstract_declarator_no_direct",
995 "m_abstract_declarator", "abstract_direct_declarator", "any_declarator",
996 "any_declarator_no_direct", "m_any_declarator", "any_direct_declarator",
997 "declarator_list", "m_bitfield", "struct_declarator",
998 "struct_declarator_list", "init_declarator", "pointer_type", "structdef",
999 "type", "typedef", "uniondef", "version", 0
1004 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
1006 static const yytype_uint16 yytoknum
[] =
1008 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1009 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1010 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
1011 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
1012 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
1013 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
1014 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
1015 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
1016 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
1017 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
1018 355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
1019 365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
1020 375, 376, 377, 378, 379, 380, 381, 382, 383, 384,
1021 385, 386, 387, 388, 389, 390, 391, 392, 393, 394,
1022 395, 396, 397, 398, 399, 400, 401, 402, 403, 44,
1023 63, 58, 124, 94, 38, 60, 62, 45, 43, 42,
1024 47, 37, 33, 126, 404, 405, 406, 407, 408, 46,
1025 91, 93, 59, 40, 41, 123, 125, 61
1029 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
1030 static const yytype_uint16 yyr1
[] =
1032 0, 178, 179, 180, 180, 180, 180, 180, 180, 180,
1033 180, 181, 181, 181, 181, 181, 181, 181, 181, 181,
1034 182, 182, 183, 183, 184, 184, 184, 184, 184, 185,
1035 185, 185, 185, 185, 185, 186, 187, 188, 189, 190,
1036 191, 192, 193, 193, 194, 194, 195, 195, 196, 196,
1037 197, 197, 198, 198, 199, 200, 200, 200, 201, 201,
1038 202, 202, 202, 202, 202, 202, 202, 202, 202, 202,
1039 202, 202, 202, 202, 202, 202, 202, 202, 202, 202,
1040 202, 202, 202, 202, 202, 202, 202, 202, 202, 202,
1041 202, 202, 202, 202, 202, 202, 202, 202, 202, 202,
1042 202, 202, 202, 202, 202, 202, 202, 202, 202, 202,
1043 202, 202, 202, 202, 202, 202, 202, 202, 202, 202,
1044 202, 202, 202, 202, 202, 202, 202, 202, 202, 202,
1045 202, 202, 202, 203, 203, 204, 204, 204, 204, 205,
1046 205, 206, 206, 207, 207, 207, 208, 208, 209, 209,
1047 210, 211, 211, 212, 212, 213, 213, 213, 213, 213,
1048 213, 213, 213, 213, 213, 213, 213, 213, 213, 213,
1049 213, 213, 213, 213, 213, 213, 213, 213, 213, 213,
1050 213, 213, 213, 213, 213, 213, 213, 213, 213, 213,
1051 213, 213, 213, 213, 213, 214, 214, 215, 216, 217,
1052 217, 218, 218, 219, 219, 220, 220, 221, 221, 222,
1053 223, 224, 224, 225, 225, 226, 226, 226, 227, 227,
1054 228, 228, 228, 228, 228, 228, 228, 228, 228, 228,
1055 228, 229, 229, 230, 230, 230, 230, 230, 230, 230,
1056 230, 231, 231, 232, 233, 234, 234, 235, 236, 236,
1057 237, 238, 238, 239, 239, 240, 240, 241, 241, 242,
1058 242, 243, 244, 244, 244, 245, 245, 246, 246, 247,
1059 248, 249, 249, 249, 250, 251, 252, 252, 253, 253,
1060 254, 254, 255, 255, 255, 256, 256, 256, 257, 257,
1061 257, 257, 258, 258, 258, 259, 259, 260, 260, 261,
1062 261, 261, 261, 261, 262, 262, 262, 263, 263, 264,
1063 264, 265, 265, 265, 265, 265, 265, 266, 266, 267,
1064 267, 268, 269, 269, 270, 270, 271, 271, 271, 272,
1065 273, 273, 273, 273, 273, 273, 273, 273, 273, 273,
1066 274, 275, 275, 276, 276
1069 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
1070 static const yytype_uint8 yyr2
[] =
1072 0, 2, 1, 0, 2, 2, 3, 2, 2, 2,
1073 2, 0, 2, 2, 3, 2, 2, 2, 2, 2,
1074 0, 2, 0, 1, 1, 2, 2, 1, 2, 1,
1075 1, 1, 2, 2, 2, 4, 3, 3, 5, 2,
1076 3, 4, 0, 1, 1, 3, 1, 3, 3, 2,
1077 3, 3, 0, 1, 3, 1, 3, 4, 1, 3,
1078 0, 1, 4, 1, 1, 1, 1, 1, 4, 4,
1079 1, 1, 1, 1, 1, 1, 4, 1, 1, 4,
1080 1, 4, 4, 1, 1, 4, 4, 4, 4, 4,
1081 1, 4, 1, 4, 1, 5, 1, 1, 4, 4,
1082 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1083 4, 1, 1, 1, 1, 6, 1, 1, 1, 1,
1084 4, 1, 1, 1, 4, 4, 4, 4, 1, 1,
1085 4, 4, 1, 1, 1, 1, 1, 1, 1, 0,
1086 2, 4, 3, 0, 2, 1, 1, 3, 3, 1,
1087 5, 1, 3, 0, 1, 1, 1, 1, 1, 1,
1088 1, 1, 1, 1, 5, 3, 3, 3, 3, 3,
1089 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
1090 3, 3, 3, 2, 2, 2, 2, 2, 2, 3,
1091 3, 5, 5, 4, 3, 1, 3, 1, 1, 0,
1092 2, 4, 3, 2, 2, 0, 2, 2, 1, 3,
1093 3, 3, 2, 0, 1, 0, 1, 1, 1, 1,
1094 1, 1, 1, 2, 2, 1, 1, 1, 1, 1,
1095 1, 0, 1, 1, 2, 1, 2, 2, 1, 1,
1096 1, 2, 2, 2, 5, 0, 2, 2, 2, 2,
1097 2, 2, 3, 2, 3, 5, 5, 0, 2, 2,
1098 2, 2, 6, 8, 2, 2, 2, 2, 2, 2,
1099 5, 1, 1, 1, 1, 1, 0, 2, 2, 3,
1100 0, 1, 2, 2, 2, 3, 2, 1, 1, 3,
1101 2, 4, 3, 2, 1, 3, 2, 0, 1, 3,
1102 2, 1, 3, 4, 3, 2, 1, 3, 2, 0,
1103 1, 1, 3, 2, 1, 3, 4, 1, 3, 0,
1104 2, 2, 1, 3, 1, 3, 1, 1, 1, 5,
1105 1, 1, 1, 1, 2, 1, 2, 1, 2, 4,
1109 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
1110 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
1111 means the default is an error. */
1112 static const yytype_uint16 yydefact
[] =
1114 3, 0, 2, 1, 331, 228, 220, 239, 0, 275,
1115 0, 0, 227, 215, 229, 271, 226, 230, 231, 0,
1116 274, 233, 240, 238, 0, 231, 273, 0, 231, 0,
1117 235, 272, 215, 52, 215, 225, 330, 221, 60, 10,
1118 0, 24, 11, 27, 11, 9, 0, 333, 0, 332,
1119 222, 0, 0, 7, 0, 0, 22, 0, 257, 5,
1120 4, 0, 8, 280, 280, 280, 0, 0, 335, 280,
1121 0, 337, 241, 242, 0, 248, 249, 334, 217, 0,
1122 232, 237, 0, 259, 260, 236, 0, 234, 223, 336,
1123 0, 0, 53, 338, 0, 224, 61, 0, 63, 64,
1124 65, 66, 67, 0, 0, 70, 71, 72, 73, 74,
1125 75, 0, 77, 78, 0, 80, 0, 0, 83, 84,
1126 0, 0, 0, 0, 0, 90, 0, 92, 0, 94,
1127 0, 96, 97, 100, 0, 101, 102, 103, 104, 105,
1128 106, 107, 108, 109, 0, 111, 112, 113, 328, 114,
1129 0, 116, 326, 117, 118, 119, 0, 121, 122, 123,
1130 0, 0, 0, 327, 0, 128, 129, 0, 0, 0,
1131 55, 132, 25, 0, 0, 0, 0, 0, 333, 243,
1132 250, 261, 269, 0, 335, 337, 26, 6, 245, 266,
1133 0, 23, 264, 265, 0, 0, 20, 284, 281, 283,
1134 282, 218, 219, 135, 136, 137, 138, 276, 0, 0,
1135 288, 324, 287, 212, 333, 335, 280, 337, 278, 28,
1136 0, 143, 36, 0, 199, 0, 0, 205, 0, 0,
1137 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1138 0, 0, 0, 0, 153, 0, 0, 153, 0, 0,
1139 0, 0, 0, 0, 60, 54, 37, 0, 17, 18,
1140 19, 0, 15, 13, 12, 16, 22, 39, 267, 268,
1141 40, 211, 52, 0, 52, 0, 0, 258, 20, 0,
1142 0, 0, 286, 0, 153, 42, 290, 279, 35, 0,
1143 145, 146, 149, 339, 52, 317, 340, 52, 52, 0,
1144 0, 163, 155, 156, 157, 161, 162, 158, 159, 0,
1145 160, 0, 0, 0, 0, 0, 0, 0, 197, 0,
1146 195, 198, 0, 0, 58, 0, 0, 0, 0, 0,
1147 0, 0, 0, 0, 0, 0, 0, 151, 154, 0,
1148 0, 0, 0, 0, 0, 134, 133, 0, 343, 0,
1149 0, 56, 60, 0, 14, 41, 22, 0, 246, 251,
1150 0, 0, 0, 52, 0, 0, 0, 22, 21, 0,
1151 277, 285, 289, 325, 0, 0, 0, 46, 43, 44,
1152 0, 309, 150, 144, 0, 329, 0, 200, 0, 0,
1153 341, 53, 206, 0, 62, 68, 0, 187, 186, 185,
1154 188, 183, 184, 0, 297, 0, 0, 0, 0, 0,
1155 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1156 0, 0, 0, 0, 0, 0, 0, 0, 69, 76,
1157 79, 0, 81, 82, 85, 86, 87, 88, 89, 91,
1158 93, 0, 99, 153, 98, 110, 0, 120, 124, 125,
1159 126, 127, 0, 130, 131, 57, 0, 244, 247, 253,
1160 0, 252, 255, 0, 0, 256, 20, 22, 270, 51,
1161 50, 291, 0, 309, 276, 42, 314, 309, 311, 310,
1162 49, 306, 147, 148, 0, 337, 318, 213, 204, 203,
1163 297, 194, 276, 42, 301, 297, 298, 0, 294, 176,
1164 177, 189, 170, 171, 174, 175, 165, 166, 0, 167,
1165 168, 169, 173, 172, 179, 178, 181, 182, 180, 190,
1166 0, 196, 59, 95, 152, 0, 344, 22, 209, 0,
1167 254, 0, 262, 47, 45, 48, 309, 276, 0, 309,
1168 0, 305, 42, 313, 319, 322, 0, 202, 0, 214,
1169 0, 297, 276, 0, 309, 0, 293, 0, 42, 300,
1170 0, 193, 115, 38, 210, 22, 304, 309, 315, 308,
1171 312, 0, 0, 321, 0, 201, 139, 192, 292, 309,
1172 302, 296, 299, 191, 0, 164, 263, 307, 316, 320,
1173 323, 0, 295, 303, 0, 0, 342, 140, 0, 52,
1174 52, 208, 142, 0, 141, 207
1177 /* YYDEFGOTO[NTERM-NUM]. */
1178 static const yytype_int16 yydefgoto
[] =
1180 -1, 1, 2, 173, 279, 192, 368, 40, 41, 42,
1181 43, 259, 177, 44, 260, 376, 377, 378, 379, 476,
1182 361, 92, 169, 325, 170, 347, 477, 591, 597, 289,
1183 290, 291, 214, 336, 337, 318, 319, 320, 322, 294,
1184 387, 392, 298, 602, 603, 464, 48, 548, 79, 478,
1185 49, 81, 50, 261, 52, 262, 272, 358, 54, 55,
1186 274, 363, 56, 195, 57, 58, 263, 264, 182, 61,
1187 265, 63, 64, 65, 280, 66, 197, 67, 211, 212,
1188 496, 555, 497, 498, 479, 540, 480, 481, 296, 573,
1189 545, 546, 213, 171, 215, 69, 70, 217, 349
1192 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1194 #define YYPACT_NINF -472
1195 static const yytype_int16 yypact
[] =
1197 -472, 38, 1206, -472, -472, -472, -472, -472, 75, -472,
1198 -86, 228, -472, 238, -472, -472, -472, -472, 28, 101,
1199 -472, -472, -472, -472, 265, 28, -472, -23, 28, 408,
1200 -472, -472, 271, -3, 287, 408, -472, -472, 2244, -472,
1201 25, -472, -472, -472, -472, -472, 1982, 34, 47, -472,
1202 -472, 52, 54, -472, 73, 61, 106, 110, 62, -472,
1203 -472, 97, -472, 31, 31, 31, 114, 2135, 123, 31,
1204 133, 135, -472, -472, 218, -472, -472, 126, -472, 142,
1205 -472, -472, 146, -472, -472, -472, 2135, -472, -472, 126,
1206 148, 2060, -472, -99, -89, -472, -472, 151, -472, -472,
1207 -472, -472, -472, 153, 154, -472, -472, -472, -472, -472,
1208 -472, 156, -472, -472, 157, -472, 159, 160, -472, -472,
1209 161, 162, 163, 165, 167, -472, 169, -472, 173, -472,
1210 174, -472, -472, 185, 187, -472, -472, -472, -472, -472,
1211 -472, -472, -472, -472, 192, -472, -472, -472, -472, -472,
1212 194, -472, -472, -472, -472, -472, 201, -472, -472, -472,
1213 210, 212, 214, -472, 215, -472, -472, 216, 219, -79,
1214 -472, -472, -472, 1111, 425, 334, 290, 224, 230, -472,
1215 -472, -472, -472, 114, 233, 235, -472, -472, -472, -472,
1216 24, -472, -472, -472, 296, 225, -472, -472, -472, -472,
1217 -472, -472, -472, -472, -472, -472, -472, -472, 114, 114,
1218 -472, 229, -26, -472, -472, -472, 31, -472, -472, -472,
1219 236, 312, -472, 237, -472, 114, 242, -472, 400, 312,
1220 967, 967, 401, 409, 967, 967, 410, 411, 967, 413,
1221 967, 967, 349, 967, 967, -21, 967, 967, 967, 2135,
1222 2135, 129, 418, 2135, 2244, 254, -472, 260, -472, -472,
1223 -472, 263, -472, -472, -472, -472, 106, -472, -472, -472,
1224 -472, -472, -145, 285, -65, 266, 264, -472, -472, 520,
1225 64, 268, -472, 967, 974, 1552, -472, -472, -472, 269,
1226 292, -472, 272, -472, -54, -472, 294, -3, -36, 270,
1227 274, -472, -472, -472, -472, -472, -472, -472, -472, 277,
1228 -472, 967, 967, 967, 967, 967, 967, 805, 1801, -125,
1229 -472, 1801, 279, 280, -472, -110, 282, 284, 286, 288,
1230 291, 295, 297, 1557, 448, 300, -109, -472, 1801, 301,
1231 310, -72, 1615, 302, 303, -472, -472, 305, 299, 307,
1232 309, -472, 2244, 453, -472, -472, 106, 1, -472, -472,
1233 335, 2060, 321, -34, 322, 417, 615, 106, -472, 2060,
1234 -472, -472, -472, -472, 895, 329, 330, 354, -472, -472,
1235 2060, 57, -472, 312, 967, -472, 2060, -472, 114, 333,
1236 -472, 336, -472, 338, -472, -472, 2060, 18, 18, 18,
1237 18, 18, 18, 1638, 267, 967, 967, 512, 967, 967,
1238 967, 967, 967, 967, 967, 967, 967, 967, 967, 967,
1239 967, 967, 967, 967, 967, 513, 967, 967, -472, -472,
1240 -472, 510, -472, -472, -472, -472, -472, -472, -472, -472,
1241 -472, 346, -472, 967, -472, -472, 967, -472, -472, -472,
1242 -472, -472, 516, -472, -472, -472, 348, -472, -472, -472,
1243 114, -472, -472, 2060, 351, -472, -472, 106, -472, -472,
1244 -472, -472, 1474, 57, -472, 1318, -472, 57, -472, -472,
1245 -472, 41, -472, -472, 57, 353, -472, 312, -472, -472,
1246 267, -472, -472, 1396, -472, 267, -472, 352, 48, 193,
1247 193, -472, 221, 221, 152, 152, 1688, 1765, 1742, 1819,
1248 1838, 1870, 152, 152, 234, 234, 18, 18, 18, -472,
1249 1720, -472, -472, -472, -472, 358, -472, 106, -472, 114,
1250 -472, 710, -472, -472, -472, -472, 32, -472, 361, 57,
1251 362, -472, 1552, -472, 376, -472, -45, -472, 363, -472,
1252 365, 255, -472, 367, 57, 369, -472, 967, 1552, -472,
1253 967, -472, -472, -472, -472, 106, -472, 32, -472, -472,
1254 -472, 370, 967, -472, 57, -472, -472, -472, -472, 32,
1255 -472, -472, -472, 18, 371, 1801, -472, -472, -472, -472,
1256 -472, 23, -472, -472, 967, 377, -472, -472, 398, 20,
1257 20, -472, -472, 382, -472, -472
1260 /* YYPGOTO[NTERM-NUM]. */
1261 static const yytype_int16 yypgoto
[] =
1263 -472, -472, -472, 511, -271, -257, 10, -472, -472, -472,
1264 195, -472, -472, -472, 557, -409, -472, -472, 89, -192,
1265 -6, -2, -472, -472, -244, -472, -63, -472, -472, -472,
1266 -472, 182, 2, 323, -261, -159, -472, -224, -228, -472,
1267 -472, -472, -472, -32, -167, -472, -472, -472, 164, -40,
1268 -472, 200, 100, 51, -472, 567, -472, -472, 527, -472,
1269 -472, -472, -472, -472, -13, -472, 572, -1, -472, -472,
1270 574, -472, -472, -265, -411, -41, -7, -22, -180, -472,
1271 -472, -472, -439, -472, -471, -472, -456, -472, -472, -472,
1272 3, -472, 395, 339, 6, -49, -472, 0, -472
1275 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
1276 positive, shift that token. If negative, reduce the rule which
1277 number is the opposite. If zero, do what YYDEFACT says.
1278 If YYTABLE_NINF, syntax error. */
1279 #define YYTABLE_NINF -217
1280 static const yytype_int16 yytable
[] =
1282 46, 60, 71, 209, 47, 183, 326, 366, 68, 355,
1283 351, 327, 39, 544, 330, 370, 332, 535, 216, 335,
1284 286, 541, 340, 375, 427, 38, 210, 91, 281, 282,
1285 360, 356, 407, 181, -216, 201, 202, 223, 3, 431,
1286 443, 198, 198, 198, 226, 295, 185, 198, 178, 428,
1287 225, 550, 184, 51, 11, 373, 556, 199, 200, 594,
1288 201, 202, 218, 536, 432, 444, 538, 201, 202, 203,
1289 254, 595, 321, 9, 9, 321, -216, 443, 72, 73,
1290 566, 551, 333, 569, 553, 338, 227, 74, 338, 342,
1291 24, 148, 255, 15, 203, 152, 204, 179, 581, 457,
1292 371, 203, 447, 544, 574, 38, 9, 362, 455, 82,
1293 468, 587, 578, 24, 80, 20, 38, 201, 202, 163,
1294 209, 204, 385, 592, 321, 338, 567, 575, 204, 88,
1295 389, 393, 273, 571, 38, 95, 38, 345, 205, 346,
1296 390, 579, 462, 210, 284, 209, 209, 285, 26, 584,
1297 86, 203, 397, 398, 399, 400, 401, 402, 403, 31,
1298 483, 206, 209, 205, 405, 406, 407, 38, 210, 210,
1299 205, 46, 46, 71, 71, 47, 47, 275, 204, 68,
1300 68, 292, 524, 258, 258, 210, 206, 425, 426, 300,
1301 38, 474, 601, 206, 198, 531, 90, 172, 94, 596,
1302 343, 344, 284, 521, 350, 475, -29, 407, 486, 287,
1303 532, 284, 494, 194, 542, 400, 474, 209, 284, 186,
1304 205, 558, 525, 207, 187, 85, 220, 284, 87, 188,
1305 475, 75, 76, 405, 406, 407, 190, 208, 410, 411,
1306 210, 77, 78, 206, 381, 189, 499, 500, 407, 502,
1307 503, 504, 505, 506, 507, 508, 509, 510, 511, 512,
1308 513, 514, 515, 516, 517, 518, 357, 520, 83, 84,
1309 563, 370, 196, 207, 89, 78, 404, 369, 191, 71,
1310 528, 47, 193, 380, 338, 68, 370, 208, 386, 543,
1311 93, 78, 203, 268, 269, -30, 391, 9, 494, 276,
1312 277, -216, 370, 494, 203, 219, 559, -31, 586, 420,
1313 421, 422, 423, 424, 370, 201, 202, 221, 222, 204,
1314 460, 425, 426, 224, 228, 209, 229, 230, 183, 231,
1315 232, 204, 233, 234, 235, 236, 237, 267, 238, 473,
1316 239, 495, 240, 292, 589, 484, 241, 242, 210, 564,
1317 420, 421, 422, 423, 424, 490, 458, 463, 243, 494,
1318 244, 205, 425, 426, 369, 245, 71, 246, 47, 185,
1319 598, 178, 68, 205, 247, 184, 418, 419, 420, 421,
1320 422, 423, 424, 248, 206, 249, 485, 250, 251, 252,
1321 425, 426, 253, 422, 423, 424, 206, 209, 583, 270,
1322 278, 585, -32, 425, 426, -33, 283, -34, 299, 323,
1323 288, 293, 539, 321, 492, 297, 334, 324, 328, 329,
1324 210, 331, 529, 348, 352, 284, 492, 495, 493, 4,
1325 554, 381, 495, 353, 381, 354, 359, 284, 364, 365,
1326 493, 383, 372, 388, 394, 382, 7, 549, 395, 384,
1327 396, 441, 381, 429, 430, 5, 433, 6, 434, 446,
1328 435, 456, 436, 7, 8, 437, 209, 9, 452, 438,
1329 380, 439, 10, 380, 442, 445, 449, 450, 11, 451,
1330 12, 453, 18, 454, 13, 14, 459, 15, 495, 210,
1331 16, 380, 17, 461, 21, 22, 23, 19, 465, 18,
1332 470, 381, 25, 472, 471, 19, 257, 487, 488, 20,
1333 489, 21, 22, 23, 24, 501, 519, 381, 522, 25,
1334 523, 526, 527, 530, 4, 547, 557, 572, 599, 369,
1335 28, 71, 562, 47, 30, 568, 570, 68, 576, 577,
1336 380, 580, 26, 582, 588, 593, 27, 28, 29, 600,
1337 5, 30, 6, 31, 605, 174, 380, 32, 7, 45,
1338 466, 534, 9, 33, 34, 482, 35, 10, 604, 53,
1339 341, 36, 37, 180, 59, 12, 62, 590, 271, 13,
1340 14, 0, 15, 0, 339, 16, 0, 17, 0, 0,
1341 0, 0, 0, 0, 18, 38, 0, 0, 0, 0,
1342 19, 266, 0, 0, 20, 0, 21, 22, 23, 0,
1343 0, 0, 0, 0, 25, 0, 0, 0, 0, 4,
1344 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1345 0, 0, 0, 0, 0, 0, 0, 26, 0, 0,
1346 0, 27, 28, 29, 0, 5, 30, 6, 31, 0,
1347 0, 0, 32, 7, 0, 0, 0, 9, 33, 34,
1348 0, 35, 10, 0, 0, 0, 36, 37, 0, 0,
1349 12, 0, 0, 0, 13, 14, 0, 15, 0, 0,
1350 16, 0, 17, 0, 0, 0, 0, 0, 0, 18,
1351 38, 0, 0, 0, 0, 19, 367, 0, 0, 20,
1352 0, 21, 22, 23, 0, 0, 0, 0, 0, 25,
1353 0, 0, 0, 0, 4, 0, 0, 0, 0, 0,
1354 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1355 0, 0, 26, 0, 0, 0, 27, 28, 29, 0,
1356 5, 30, 6, 31, 0, 0, 0, 32, 7, 0,
1357 0, 0, 9, 33, 34, 0, 35, 10, 0, 0,
1358 0, 36, 37, 0, 0, 12, 0, 0, 0, 13,
1359 14, 0, 15, 0, 0, 16, 0, 17, 0, 0,
1360 0, 0, 0, 0, 18, 38, 0, 0, 0, 0,
1361 19, 467, 0, 0, 20, 0, 21, 22, 23, 0,
1362 0, 0, 0, 0, 25, 0, 0, 0, 301, 4,
1363 302, 303, 304, 305, 306, 0, 0, 0, 0, 0,
1364 0, 0, 0, 0, 0, 0, 0, 26, 0, 0,
1365 0, 27, 28, 29, 0, 5, 30, 6, 31, 0,
1366 0, 0, 32, 7, 0, 0, 0, 9, 33, 34,
1367 0, 35, 0, 0, 0, 0, 36, 37, 0, 0,
1368 12, 0, 0, 0, 13, 14, 0, 15, 307, 0,
1369 16, 0, 17, 0, 0, 0, 0, 0, 0, 18,
1370 38, 0, 0, 0, 0, 0, 565, 0, 0, 20,
1371 0, 21, 22, 23, 0, 0, 0, 0, 301, 25,
1372 302, 303, 304, 305, 306, 308, 0, 0, 0, 0,
1373 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1374 0, 0, 26, 0, 0, 0, 27, 28, 29, 0,
1375 309, 30, 0, 31, 0, 0, 0, 32, 0, 0,
1376 0, 0, 310, 0, 34, 0, 35, 0, 0, 0,
1377 0, 36, 37, 0, 0, 0, 0, 0, 307, 311,
1378 0, 0, 312, 313, 314, 0, 0, 315, 316, 0,
1379 301, 0, 302, 303, 304, 305, 306, 301, 317, 302,
1380 303, 304, 305, 306, 0, 0, 0, 0, 0, 0,
1381 0, 0, 0, 0, 0, 308, 0, 0, 0, 0,
1382 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1383 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1384 309, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1385 307, 0, 310, 0, 0, 0, 0, 307, 0, 0,
1386 0, 0, 0, 0, 0, 0, 0, 0, 0, 311,
1387 0, 0, 312, 313, 314, 0, 0, 315, 316, 0,
1388 0, 0, 0, 0, 0, 0, 469, 308, 317, 0,
1389 0, 0, 0, 0, 308, 0, 0, 0, 0, 0,
1390 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1391 0, 0, 309, 0, 0, 0, 0, 0, 0, 309,
1392 0, 0, 0, 0, 310, 0, 0, 0, 0, 0,
1393 0, 310, 0, 0, 0, 4, 0, 0, 0, 0,
1394 0, 311, 256, 0, 312, 313, 314, 0, 311, 315,
1395 316, 312, 313, 374, 0, 0, 315, 316, 0, 0,
1396 317, 5, 0, 6, 0, 0, 0, 317, 0, 7,
1397 8, 0, 0, 9, 0, 0, 0, 0, 10, 0,
1398 0, 0, 0, 0, 11, 0, 12, 0, 0, 0,
1399 13, 14, 0, 15, 0, 0, 16, 0, 17, 0,
1400 0, 0, 0, 0, 0, 18, 0, 0, 0, 0,
1401 0, 19, 257, 0, 0, 20, 0, 21, 22, 23,
1402 24, 0, 0, 0, 0, 25, 0, 0, 0, 0,
1403 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1404 0, 0, 0, 0, 0, 0, 0, 0, 26, 0,
1405 0, 0, 27, 28, 29, 0, 5, 30, 6, 31,
1406 0, 0, 0, 32, 7, 8, 0, 0, 9, 33,
1407 34, 0, 35, 10, 0, 0, 0, 36, 37, 11,
1408 0, 12, 0, 0, 0, 13, 14, 0, 15, 0,
1409 0, 16, 0, 17, 0, 0, 0, 0, 0, 0,
1410 18, 38, 0, 0, 0, 0, 19, 0, 0, 0,
1411 20, 0, 21, 22, 23, 24, 0, 0, 0, 0,
1412 25, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1413 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1414 0, 0, 4, 26, 0, 0, 0, 27, 28, 29,
1415 0, 0, 30, 0, 31, 0, 0, 0, 32, 0,
1416 0, 0, 0, 0, 33, 34, 0, 35, 5, 0,
1417 6, 0, 36, 37, 0, 203, 7, 0, 0, 0,
1418 9, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1419 0, 0, 0, 12, 0, 0, 38, 13, 14, 0,
1420 15, 0, 204, 16, 0, 17, 0, 0, 0, 0,
1421 0, 0, 18, 0, 0, 0, 0, 0, 0, 0,
1422 4, 0, 20, 0, 21, 22, 23, 0, 0, 0,
1423 0, 0, 25, 0, 0, 0, 0, 0, 0, 0,
1424 0, 0, 0, 0, 205, 0, 5, 0, 6, 0,
1425 0, 0, 0, 203, 7, 26, 0, 0, 9, 27,
1426 28, 29, 0, 0, 30, 0, 31, 206, 0, 0,
1427 32, 12, 0, 0, 0, 13, 14, 34, 15, 35,
1428 204, 16, 0, 17, 36, 37, 0, 0, 0, 0,
1429 18, 0, 0, 0, 0, 0, 0, 537, 4, 0,
1430 20, 0, 21, 22, 23, 0, 0, 0, 38, 0,
1431 25, 0, 0, 0, 0, 533, 0, 0, 0, 0,
1432 0, 0, 205, 0, 5, 0, 6, 0, 0, 0,
1433 0, 0, 7, 26, 0, 0, 9, 27, 28, 29,
1434 0, 0, 30, 0, 31, 206, 0, 0, 32, 12,
1435 0, 0, 0, 13, 14, 34, 15, 35, 0, 16,
1436 0, 17, 36, 37, 0, 0, 0, 0, 18, 0,
1437 0, 0, 0, 0, 0, 552, 4, 0, 20, 0,
1438 21, 22, 23, 0, 0, 0, 38, 0, 25, 405,
1439 406, 407, 408, 409, 410, 411, 412, 413, 0, 0,
1440 0, 0, 5, 0, 6, 0, 0, 0, 0, 0,
1441 7, 26, 0, 0, 9, 27, 28, 29, 0, 0,
1442 30, 0, 31, 0, 0, 0, 32, 12, 0, 0,
1443 0, 13, 14, 34, 15, 35, 0, 16, 0, 17,
1444 36, 37, 0, 0, 0, 0, 18, 405, 406, 407,
1445 408, 409, 410, 411, 412, 413, 20, 0, 21, 22,
1446 23, 0, 0, 0, 38, 0, 25, 0, 0, 0,
1447 405, 406, 407, 408, 409, 410, 411, 412, 413, 0,
1448 0, 0, 0, 0, 0, 0, 0, 0, 0, 26,
1449 0, 0, 0, 27, 28, 29, 0, 0, 30, 0,
1450 31, 0, 0, 0, 32, 0, 0, 0, 0, 0,
1451 0, 34, 0, 35, 0, 0, 0, 0, 36, 37,
1452 405, 406, 407, 408, 409, 410, 411, 414, 413, 415,
1453 416, 417, 418, 419, 420, 421, 422, 423, 424, 0,
1454 0, 0, 38, 0, 0, 0, 425, 426, 0, 0,
1455 0, 440, 405, 406, 407, 408, 409, 410, 411, 412,
1456 413, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1457 0, 0, 0, 0, 405, 406, 407, 408, 409, 410,
1458 411, 412, 413, 0, 0, 414, 0, 415, 416, 417,
1459 418, 419, 420, 421, 422, 423, 424, 405, 406, 407,
1460 408, 409, 410, 411, 425, 426, 0, 0, 414, 448,
1461 415, 416, 417, 418, 419, 420, 421, 422, 423, 424,
1462 0, 0, 0, 0, 0, 0, 0, 425, 426, 0,
1463 0, 0, 491, 405, 406, 407, 408, 409, 410, 411,
1464 412, 413, 0, 0, 0, 0, 0, 0, 0, 0,
1465 0, 405, 406, 407, 408, 409, 410, 411, 0, 0,
1466 415, 416, 417, 418, 419, 420, 421, 422, 423, 424,
1467 405, 406, 407, 408, 409, 410, 411, 425, 426, 0,
1468 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1469 414, 0, 415, 416, 417, 418, 419, 420, 421, 422,
1470 423, 424, 405, 406, 407, 408, 409, 410, 411, 425,
1471 426, 561, 414, 560, 415, 416, 417, 418, 419, 420,
1472 421, 422, 423, 424, 0, 0, 0, 0, 0, 0,
1473 0, 425, 426, 0, 0, 0, 0, 415, 416, 417,
1474 418, 419, 420, 421, 422, 423, 424, 0, 0, 0,
1475 0, 0, 0, 0, 425, 426, 0, 0, 0, 0,
1476 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1477 0, 414, 0, 415, 416, 417, 418, 419, 420, 421,
1478 422, 423, 424, 0, 0, 0, 0, 0, 0, 0,
1479 425, 426, 416, 417, 418, 419, 420, 421, 422, 423,
1480 424, 0, 0, 0, 0, 0, 4, 0, 425, 426,
1481 0, 0, 417, 418, 419, 420, 421, 422, 423, 424,
1482 0, 0, 0, 0, 0, 0, 0, 425, 426, 0,
1483 0, 0, 5, 0, 6, 0, 0, 0, 0, 0,
1484 7, 8, 0, 0, 9, 418, 419, 420, 421, 422,
1485 423, 424, 0, 0, 0, 11, 0, 12, 0, 425,
1486 426, 13, 14, 0, 15, 0, 0, 16, 0, 17,
1487 0, 0, 0, 0, 0, 0, 18, 0, 0, 0,
1488 0, 0, 0, 0, 4, 0, 20, 0, 21, 22,
1489 23, 24, 0, 0, 175, 0, 25, 0, 176, 0,
1490 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1491 5, 0, 6, 0, 0, 0, 0, 0, 7, 26,
1492 0, 0, 9, 27, 28, 29, 0, 0, 30, 0,
1493 31, 0, 0, 0, 32, 12, 0, 0, 0, 13,
1494 14, 34, 15, 35, 0, 16, 0, 17, 36, 37,
1495 0, 0, 0, 0, 18, 0, 0, 0, 0, 4,
1496 0, 0, 0, 0, 20, 0, 21, 22, 23, 0,
1497 0, 0, 0, 0, 25, 0, 0, 0, 0, 0,
1498 0, 0, 0, 0, 0, 5, 0, 6, 0, 0,
1499 0, 0, 0, 7, 0, 0, 0, 26, 0, 0,
1500 0, 27, 28, 29, 0, 0, 30, 0, 31, 0,
1501 12, 0, 32, 0, 13, 14, 0, 0, 0, 34,
1502 16, 35, 17, 0, 0, 0, 36, 37, 0, 18,
1503 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1504 0, 21, 22, 23, 0, 0, 0, 0, 0, 25,
1505 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1506 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1507 0, 0, 0, 0, 0, 0, 27, 28, 29, 0,
1508 0, 30, 0, 0, 0, 0, 96, 32, 97, 98,
1509 99, 0, 100, 101, 34, 102, 35, 0, 103, 0,
1510 104, 36, 37, 0, 0, 0, 0, 105, 106, 107,
1511 108, 0, 109, 110, 111, 112, 113, 0, 114, 0,
1512 115, 116, 117, 0, 0, 118, 0, 0, 0, 0,
1513 119, 0, 120, 121, 122, 123, 124, 125, 0, 126,
1514 127, 128, 129, 130, 0, 0, 131, 0, 0, 132,
1515 0, 0, 0, 0, 133, 134, 0, 135, 0, 0,
1516 0, 136, 137, 138, 0, 139, 140, 141, 142, 143,
1517 0, 144, 0, 145, 146, 147, 148, 149, 150, 151,
1518 152, 0, 153, 154, 155, 0, 0, 0, 156, 0,
1519 0, 157, 0, 0, 158, 159, 0, 0, 160, 161,
1520 162, 0, 0, 0, 163, 0, 164, 165, 166, 167,
1524 static const yytype_int16 yycheck
[] =
1526 2, 2, 2, 66, 2, 46, 234, 278, 2, 266,
1527 254, 235, 2, 484, 238, 280, 240, 473, 67, 243,
1528 212, 477, 246, 284, 149, 170, 66, 33, 208, 209,
1529 95, 176, 14, 46, 133, 3, 4, 86, 0, 149,
1530 149, 63, 64, 65, 133, 225, 46, 69, 46, 174,
1531 91, 490, 46, 2, 53, 283, 495, 64, 65, 36,
1532 3, 4, 69, 474, 174, 174, 475, 3, 4, 37,
1533 149, 48, 231, 42, 42, 234, 175, 149, 3, 4,
1534 536, 492, 241, 539, 493, 244, 175, 173, 247, 248,
1535 89, 112, 171, 62, 37, 116, 64, 46, 554, 356,
1536 280, 37, 174, 574, 149, 170, 42, 274, 352, 8,
1537 367, 567, 551, 89, 86, 84, 170, 3, 4, 140,
1538 183, 64, 176, 579, 283, 284, 537, 172, 64, 29,
1539 297, 298, 108, 542, 170, 35, 170, 8, 106, 10,
1540 176, 552, 176, 183, 170, 208, 209, 173, 117, 558,
1541 173, 37, 311, 312, 313, 314, 315, 316, 317, 128,
1542 384, 129, 225, 106, 12, 13, 14, 170, 208, 209,
1543 106, 173, 174, 173, 174, 173, 174, 190, 64, 173,
1544 174, 221, 443, 173, 174, 225, 129, 169, 170, 229,
1545 170, 159, 172, 129, 216, 466, 32, 172, 34, 176,
1546 249, 250, 170, 427, 253, 173, 172, 14, 388, 216,
1547 467, 170, 404, 151, 173, 374, 159, 280, 170, 172,
1548 106, 173, 446, 159, 172, 25, 8, 170, 28, 175,
1549 173, 3, 4, 12, 13, 14, 175, 173, 17, 18,
1550 280, 3, 4, 129, 285, 172, 405, 406, 14, 408,
1551 409, 410, 411, 412, 413, 414, 415, 416, 417, 418,
1552 419, 420, 421, 422, 423, 424, 272, 426, 3, 4,
1553 527, 536, 175, 159, 3, 4, 317, 279, 172, 279,
1554 460, 279, 172, 285, 443, 279, 551, 173, 294, 481,
1555 3, 4, 37, 3, 4, 172, 298, 42, 490, 3,
1556 4, 175, 567, 495, 37, 172, 498, 172, 565, 157,
1557 158, 159, 160, 161, 579, 3, 4, 175, 172, 64,
1558 361, 169, 170, 175, 173, 388, 173, 173, 369, 173,
1559 173, 64, 173, 173, 173, 173, 173, 3, 173, 380,
1560 173, 404, 173, 383, 572, 386, 173, 173, 388, 529,
1561 157, 158, 159, 160, 161, 396, 357, 363, 173, 551,
1562 173, 106, 169, 170, 366, 173, 366, 173, 366, 369,
1563 594, 369, 366, 106, 173, 369, 155, 156, 157, 158,
1564 159, 160, 161, 173, 129, 173, 386, 173, 173, 173,
1565 169, 170, 173, 159, 160, 161, 129, 460, 557, 175,
1566 175, 560, 172, 169, 170, 172, 177, 172, 8, 8,
1567 174, 174, 475, 572, 159, 173, 67, 8, 8, 8,
1568 460, 8, 463, 5, 170, 170, 159, 490, 173, 4,
1569 493, 472, 495, 173, 475, 172, 151, 170, 172, 175,
1570 173, 149, 174, 149, 174, 176, 38, 487, 174, 177,
1571 173, 3, 493, 174, 174, 30, 174, 32, 174, 149,
1572 174, 8, 174, 38, 39, 174, 529, 42, 169, 174,
1573 472, 174, 47, 475, 174, 174, 174, 174, 53, 174,
1574 55, 174, 74, 174, 59, 60, 151, 62, 551, 529,
1575 65, 493, 67, 172, 86, 87, 88, 80, 176, 74,
1576 171, 542, 94, 149, 174, 80, 81, 174, 172, 84,
1577 172, 86, 87, 88, 89, 3, 3, 558, 8, 94,
1578 174, 5, 174, 172, 4, 172, 174, 151, 151, 531,
1579 122, 531, 174, 531, 126, 174, 174, 531, 175, 174,
1580 542, 174, 117, 174, 174, 174, 121, 122, 123, 151,
1581 30, 126, 32, 128, 172, 44, 558, 132, 38, 2,
1582 365, 472, 42, 138, 139, 383, 141, 47, 600, 2,
1583 247, 146, 147, 46, 2, 55, 2, 574, 183, 59,
1584 60, -1, 62, -1, 245, 65, -1, 67, -1, -1,
1585 -1, -1, -1, -1, 74, 170, -1, -1, -1, -1,
1586 80, 176, -1, -1, 84, -1, 86, 87, 88, -1,
1587 -1, -1, -1, -1, 94, -1, -1, -1, -1, 4,
1588 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1589 -1, -1, -1, -1, -1, -1, -1, 117, -1, -1,
1590 -1, 121, 122, 123, -1, 30, 126, 32, 128, -1,
1591 -1, -1, 132, 38, -1, -1, -1, 42, 138, 139,
1592 -1, 141, 47, -1, -1, -1, 146, 147, -1, -1,
1593 55, -1, -1, -1, 59, 60, -1, 62, -1, -1,
1594 65, -1, 67, -1, -1, -1, -1, -1, -1, 74,
1595 170, -1, -1, -1, -1, 80, 176, -1, -1, 84,
1596 -1, 86, 87, 88, -1, -1, -1, -1, -1, 94,
1597 -1, -1, -1, -1, 4, -1, -1, -1, -1, -1,
1598 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1599 -1, -1, 117, -1, -1, -1, 121, 122, 123, -1,
1600 30, 126, 32, 128, -1, -1, -1, 132, 38, -1,
1601 -1, -1, 42, 138, 139, -1, 141, 47, -1, -1,
1602 -1, 146, 147, -1, -1, 55, -1, -1, -1, 59,
1603 60, -1, 62, -1, -1, 65, -1, 67, -1, -1,
1604 -1, -1, -1, -1, 74, 170, -1, -1, -1, -1,
1605 80, 176, -1, -1, 84, -1, 86, 87, 88, -1,
1606 -1, -1, -1, -1, 94, -1, -1, -1, 3, 4,
1607 5, 6, 7, 8, 9, -1, -1, -1, -1, -1,
1608 -1, -1, -1, -1, -1, -1, -1, 117, -1, -1,
1609 -1, 121, 122, 123, -1, 30, 126, 32, 128, -1,
1610 -1, -1, 132, 38, -1, -1, -1, 42, 138, 139,
1611 -1, 141, -1, -1, -1, -1, 146, 147, -1, -1,
1612 55, -1, -1, -1, 59, 60, -1, 62, 63, -1,
1613 65, -1, 67, -1, -1, -1, -1, -1, -1, 74,
1614 170, -1, -1, -1, -1, -1, 176, -1, -1, 84,
1615 -1, 86, 87, 88, -1, -1, -1, -1, 3, 94,
1616 5, 6, 7, 8, 9, 100, -1, -1, -1, -1,
1617 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1618 -1, -1, 117, -1, -1, -1, 121, 122, 123, -1,
1619 125, 126, -1, 128, -1, -1, -1, 132, -1, -1,
1620 -1, -1, 137, -1, 139, -1, 141, -1, -1, -1,
1621 -1, 146, 147, -1, -1, -1, -1, -1, 63, 154,
1622 -1, -1, 157, 158, 159, -1, -1, 162, 163, -1,
1623 3, -1, 5, 6, 7, 8, 9, 3, 173, 5,
1624 6, 7, 8, 9, -1, -1, -1, -1, -1, -1,
1625 -1, -1, -1, -1, -1, 100, -1, -1, -1, -1,
1626 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1627 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1628 125, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1629 63, -1, 137, -1, -1, -1, -1, 63, -1, -1,
1630 -1, -1, -1, -1, -1, -1, -1, -1, -1, 154,
1631 -1, -1, 157, 158, 159, -1, -1, 162, 163, -1,
1632 -1, -1, -1, -1, -1, -1, 171, 100, 173, -1,
1633 -1, -1, -1, -1, 100, -1, -1, -1, -1, -1,
1634 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1635 -1, -1, 125, -1, -1, -1, -1, -1, -1, 125,
1636 -1, -1, -1, -1, 137, -1, -1, -1, -1, -1,
1637 -1, 137, -1, -1, -1, 4, -1, -1, -1, -1,
1638 -1, 154, 11, -1, 157, 158, 159, -1, 154, 162,
1639 163, 157, 158, 159, -1, -1, 162, 163, -1, -1,
1640 173, 30, -1, 32, -1, -1, -1, 173, -1, 38,
1641 39, -1, -1, 42, -1, -1, -1, -1, 47, -1,
1642 -1, -1, -1, -1, 53, -1, 55, -1, -1, -1,
1643 59, 60, -1, 62, -1, -1, 65, -1, 67, -1,
1644 -1, -1, -1, -1, -1, 74, -1, -1, -1, -1,
1645 -1, 80, 81, -1, -1, 84, -1, 86, 87, 88,
1646 89, -1, -1, -1, -1, 94, -1, -1, -1, -1,
1647 4, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1648 -1, -1, -1, -1, -1, -1, -1, -1, 117, -1,
1649 -1, -1, 121, 122, 123, -1, 30, 126, 32, 128,
1650 -1, -1, -1, 132, 38, 39, -1, -1, 42, 138,
1651 139, -1, 141, 47, -1, -1, -1, 146, 147, 53,
1652 -1, 55, -1, -1, -1, 59, 60, -1, 62, -1,
1653 -1, 65, -1, 67, -1, -1, -1, -1, -1, -1,
1654 74, 170, -1, -1, -1, -1, 80, -1, -1, -1,
1655 84, -1, 86, 87, 88, 89, -1, -1, -1, -1,
1656 94, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1657 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1658 -1, -1, 4, 117, -1, -1, -1, 121, 122, 123,
1659 -1, -1, 126, -1, 128, -1, -1, -1, 132, -1,
1660 -1, -1, -1, -1, 138, 139, -1, 141, 30, -1,
1661 32, -1, 146, 147, -1, 37, 38, -1, -1, -1,
1662 42, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1663 -1, -1, -1, 55, -1, -1, 170, 59, 60, -1,
1664 62, -1, 64, 65, -1, 67, -1, -1, -1, -1,
1665 -1, -1, 74, -1, -1, -1, -1, -1, -1, -1,
1666 4, -1, 84, -1, 86, 87, 88, -1, -1, -1,
1667 -1, -1, 94, -1, -1, -1, -1, -1, -1, -1,
1668 -1, -1, -1, -1, 106, -1, 30, -1, 32, -1,
1669 -1, -1, -1, 37, 38, 117, -1, -1, 42, 121,
1670 122, 123, -1, -1, 126, -1, 128, 129, -1, -1,
1671 132, 55, -1, -1, -1, 59, 60, 139, 62, 141,
1672 64, 65, -1, 67, 146, 147, -1, -1, -1, -1,
1673 74, -1, -1, -1, -1, -1, -1, 159, 4, -1,
1674 84, -1, 86, 87, 88, -1, -1, -1, 170, -1,
1675 94, -1, -1, -1, -1, 21, -1, -1, -1, -1,
1676 -1, -1, 106, -1, 30, -1, 32, -1, -1, -1,
1677 -1, -1, 38, 117, -1, -1, 42, 121, 122, 123,
1678 -1, -1, 126, -1, 128, 129, -1, -1, 132, 55,
1679 -1, -1, -1, 59, 60, 139, 62, 141, -1, 65,
1680 -1, 67, 146, 147, -1, -1, -1, -1, 74, -1,
1681 -1, -1, -1, -1, -1, 159, 4, -1, 84, -1,
1682 86, 87, 88, -1, -1, -1, 170, -1, 94, 12,
1683 13, 14, 15, 16, 17, 18, 19, 20, -1, -1,
1684 -1, -1, 30, -1, 32, -1, -1, -1, -1, -1,
1685 38, 117, -1, -1, 42, 121, 122, 123, -1, -1,
1686 126, -1, 128, -1, -1, -1, 132, 55, -1, -1,
1687 -1, 59, 60, 139, 62, 141, -1, 65, -1, 67,
1688 146, 147, -1, -1, -1, -1, 74, 12, 13, 14,
1689 15, 16, 17, 18, 19, 20, 84, -1, 86, 87,
1690 88, -1, -1, -1, 170, -1, 94, -1, -1, -1,
1691 12, 13, 14, 15, 16, 17, 18, 19, 20, -1,
1692 -1, -1, -1, -1, -1, -1, -1, -1, -1, 117,
1693 -1, -1, -1, 121, 122, 123, -1, -1, 126, -1,
1694 128, -1, -1, -1, 132, -1, -1, -1, -1, -1,
1695 -1, 139, -1, 141, -1, -1, -1, -1, 146, 147,
1696 12, 13, 14, 15, 16, 17, 18, 150, 20, 152,
1697 153, 154, 155, 156, 157, 158, 159, 160, 161, -1,
1698 -1, -1, 170, -1, -1, -1, 169, 170, -1, -1,
1699 -1, 174, 12, 13, 14, 15, 16, 17, 18, 19,
1700 20, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1701 -1, -1, -1, -1, 12, 13, 14, 15, 16, 17,
1702 18, 19, 20, -1, -1, 150, -1, 152, 153, 154,
1703 155, 156, 157, 158, 159, 160, 161, 12, 13, 14,
1704 15, 16, 17, 18, 169, 170, -1, -1, 150, 174,
1705 152, 153, 154, 155, 156, 157, 158, 159, 160, 161,
1706 -1, -1, -1, -1, -1, -1, -1, 169, 170, -1,
1707 -1, -1, 174, 12, 13, 14, 15, 16, 17, 18,
1708 19, 20, -1, -1, -1, -1, -1, -1, -1, -1,
1709 -1, 12, 13, 14, 15, 16, 17, 18, -1, -1,
1710 152, 153, 154, 155, 156, 157, 158, 159, 160, 161,
1711 12, 13, 14, 15, 16, 17, 18, 169, 170, -1,
1712 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1713 150, -1, 152, 153, 154, 155, 156, 157, 158, 159,
1714 160, 161, 12, 13, 14, 15, 16, 17, 18, 169,
1715 170, 171, 150, 151, 152, 153, 154, 155, 156, 157,
1716 158, 159, 160, 161, -1, -1, -1, -1, -1, -1,
1717 -1, 169, 170, -1, -1, -1, -1, 152, 153, 154,
1718 155, 156, 157, 158, 159, 160, 161, -1, -1, -1,
1719 -1, -1, -1, -1, 169, 170, -1, -1, -1, -1,
1720 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1721 -1, 150, -1, 152, 153, 154, 155, 156, 157, 158,
1722 159, 160, 161, -1, -1, -1, -1, -1, -1, -1,
1723 169, 170, 153, 154, 155, 156, 157, 158, 159, 160,
1724 161, -1, -1, -1, -1, -1, 4, -1, 169, 170,
1725 -1, -1, 154, 155, 156, 157, 158, 159, 160, 161,
1726 -1, -1, -1, -1, -1, -1, -1, 169, 170, -1,
1727 -1, -1, 30, -1, 32, -1, -1, -1, -1, -1,
1728 38, 39, -1, -1, 42, 155, 156, 157, 158, 159,
1729 160, 161, -1, -1, -1, 53, -1, 55, -1, 169,
1730 170, 59, 60, -1, 62, -1, -1, 65, -1, 67,
1731 -1, -1, -1, -1, -1, -1, 74, -1, -1, -1,
1732 -1, -1, -1, -1, 4, -1, 84, -1, 86, 87,
1733 88, 89, -1, -1, 92, -1, 94, -1, 96, -1,
1734 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1735 30, -1, 32, -1, -1, -1, -1, -1, 38, 117,
1736 -1, -1, 42, 121, 122, 123, -1, -1, 126, -1,
1737 128, -1, -1, -1, 132, 55, -1, -1, -1, 59,
1738 60, 139, 62, 141, -1, 65, -1, 67, 146, 147,
1739 -1, -1, -1, -1, 74, -1, -1, -1, -1, 4,
1740 -1, -1, -1, -1, 84, -1, 86, 87, 88, -1,
1741 -1, -1, -1, -1, 94, -1, -1, -1, -1, -1,
1742 -1, -1, -1, -1, -1, 30, -1, 32, -1, -1,
1743 -1, -1, -1, 38, -1, -1, -1, 117, -1, -1,
1744 -1, 121, 122, 123, -1, -1, 126, -1, 128, -1,
1745 55, -1, 132, -1, 59, 60, -1, -1, -1, 139,
1746 65, 141, 67, -1, -1, -1, 146, 147, -1, 74,
1747 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1748 -1, 86, 87, 88, -1, -1, -1, -1, -1, 94,
1749 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1750 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1751 -1, -1, -1, -1, -1, -1, 121, 122, 123, -1,
1752 -1, 126, -1, -1, -1, -1, 22, 132, 24, 25,
1753 26, -1, 28, 29, 139, 31, 141, -1, 34, -1,
1754 36, 146, 147, -1, -1, -1, -1, 43, 44, 45,
1755 46, -1, 48, 49, 50, 51, 52, -1, 54, -1,
1756 56, 57, 58, -1, -1, 61, -1, -1, -1, -1,
1757 66, -1, 68, 69, 70, 71, 72, 73, -1, 75,
1758 76, 77, 78, 79, -1, -1, 82, -1, -1, 85,
1759 -1, -1, -1, -1, 90, 91, -1, 93, -1, -1,
1760 -1, 97, 98, 99, -1, 101, 102, 103, 104, 105,
1761 -1, 107, -1, 109, 110, 111, 112, 113, 114, 115,
1762 116, -1, 118, 119, 120, -1, -1, -1, 124, -1,
1763 -1, 127, -1, -1, 130, 131, -1, -1, 134, 135,
1764 136, -1, -1, -1, 140, -1, 142, 143, 144, 145,
1768 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1769 symbol of state STATE-NUM. */
1770 static const yytype_uint16 yystos
[] =
1772 0, 179, 180, 0, 4, 30, 32, 38, 39, 42,
1773 47, 53, 55, 59, 60, 62, 65, 67, 74, 80,
1774 84, 86, 87, 88, 89, 94, 117, 121, 122, 123,
1775 126, 128, 132, 138, 139, 141, 146, 147, 170, 184,
1776 185, 186, 187, 188, 191, 192, 199, 210, 224, 228,
1777 230, 231, 232, 233, 236, 237, 240, 242, 243, 244,
1778 245, 247, 248, 249, 250, 251, 253, 255, 272, 273,
1779 274, 275, 3, 4, 173, 3, 4, 3, 4, 226,
1780 86, 229, 8, 3, 4, 229, 173, 229, 230, 3,
1781 226, 198, 199, 3, 226, 230, 22, 24, 25, 26,
1782 28, 29, 31, 34, 36, 43, 44, 45, 46, 48,
1783 49, 50, 51, 52, 54, 56, 57, 58, 61, 66,
1784 68, 69, 70, 71, 72, 73, 75, 76, 77, 78,
1785 79, 82, 85, 90, 91, 93, 97, 98, 99, 101,
1786 102, 103, 104, 105, 107, 109, 110, 111, 112, 113,
1787 114, 115, 116, 118, 119, 120, 124, 127, 130, 131,
1788 134, 135, 136, 140, 142, 143, 144, 145, 148, 200,
1789 202, 271, 172, 181, 181, 92, 96, 190, 210, 231,
1790 236, 242, 246, 253, 272, 275, 172, 172, 175, 172,
1791 175, 172, 183, 172, 151, 241, 175, 254, 255, 254,
1792 254, 3, 4, 37, 64, 106, 129, 159, 173, 204,
1793 227, 256, 257, 270, 210, 272, 273, 275, 254, 172,
1794 8, 175, 172, 273, 175, 253, 133, 175, 173, 173,
1795 173, 173, 173, 173, 173, 173, 173, 173, 173, 173,
1796 173, 173, 173, 173, 173, 173, 173, 173, 173, 173,
1797 173, 173, 173, 173, 149, 171, 11, 81, 184, 189,
1798 192, 231, 233, 244, 245, 248, 176, 3, 3, 4,
1799 175, 270, 234, 108, 238, 242, 3, 4, 175, 182,
1800 252, 256, 256, 177, 170, 173, 197, 254, 174, 207,
1801 208, 209, 227, 174, 217, 256, 266, 173, 220, 8,
1802 227, 3, 5, 6, 7, 8, 9, 63, 100, 125,
1803 137, 154, 157, 158, 159, 162, 163, 173, 213, 214,
1804 215, 213, 216, 8, 8, 201, 216, 215, 8, 8,
1805 215, 8, 215, 213, 67, 215, 211, 212, 213, 271,
1806 215, 211, 213, 273, 273, 8, 10, 203, 5, 276,
1807 273, 202, 170, 173, 172, 183, 176, 198, 235, 151,
1808 95, 198, 222, 239, 172, 175, 182, 176, 184, 199,
1809 251, 256, 174, 216, 159, 212, 193, 194, 195, 196,
1810 199, 253, 176, 149, 177, 176, 198, 218, 149, 222,
1811 176, 199, 219, 222, 174, 174, 173, 213, 213, 213,
1812 213, 213, 213, 213, 253, 12, 13, 14, 15, 16,
1813 17, 18, 19, 20, 150, 152, 153, 154, 155, 156,
1814 157, 158, 159, 160, 161, 169, 170, 149, 174, 174,
1815 174, 149, 174, 174, 174, 174, 174, 174, 174, 174,
1816 174, 3, 174, 149, 174, 174, 149, 174, 174, 174,
1817 174, 174, 169, 174, 174, 202, 8, 183, 245, 151,
1818 253, 172, 176, 198, 223, 176, 188, 176, 183, 171,
1819 171, 174, 149, 253, 159, 173, 197, 204, 227, 262,
1820 264, 265, 209, 215, 253, 275, 256, 174, 172, 172,
1821 253, 174, 159, 173, 197, 204, 258, 260, 261, 213,
1822 213, 3, 213, 213, 213, 213, 213, 213, 213, 213,
1823 213, 213, 213, 213, 213, 213, 213, 213, 213, 3,
1824 213, 215, 8, 174, 212, 215, 5, 174, 256, 253,
1825 172, 182, 183, 21, 196, 264, 252, 159, 193, 204,
1826 263, 264, 173, 197, 262, 268, 269, 172, 225, 227,
1827 260, 252, 159, 193, 204, 259, 260, 174, 173, 197,
1828 151, 171, 174, 183, 256, 176, 264, 252, 174, 264,
1829 174, 193, 151, 267, 149, 172, 175, 174, 260, 252,
1830 174, 264, 174, 213, 193, 213, 183, 264, 174, 216,
1831 268, 205, 264, 174, 36, 48, 176, 206, 215, 151,
1832 151, 172, 221, 222, 221, 172
1835 #define yyerrok (yyerrstatus = 0)
1836 #define yyclearin (yychar = YYEMPTY)
1837 #define YYEMPTY (-2)
1840 #define YYACCEPT goto yyacceptlab
1841 #define YYABORT goto yyabortlab
1842 #define YYERROR goto yyerrorlab
1845 /* Like YYERROR except do call yyerror. This remains here temporarily
1846 to ease the transition to the new meaning of YYERROR, for GCC.
1847 Once GCC version 2 has supplanted version 1, this can go. */
1849 #define YYFAIL goto yyerrlab
1851 #define YYRECOVERING() (!!yyerrstatus)
1853 #define YYBACKUP(Token, Value) \
1855 if (yychar == YYEMPTY && yylen == 1) \
1859 yytoken = YYTRANSLATE (yychar); \
1865 yyerror (YY_("syntax error: cannot back up")); \
1872 #define YYERRCODE 256
1875 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1876 If N is 0, then set CURRENT to the empty location which ends
1877 the previous symbol: RHS[0] (always defined). */
1879 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
1880 #ifndef YYLLOC_DEFAULT
1881 # define YYLLOC_DEFAULT(Current, Rhs, N) \
1885 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1886 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1887 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1888 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1892 (Current).first_line = (Current).last_line = \
1893 YYRHSLOC (Rhs, 0).last_line; \
1894 (Current).first_column = (Current).last_column = \
1895 YYRHSLOC (Rhs, 0).last_column; \
1901 /* YY_LOCATION_PRINT -- Print the location on the stream.
1902 This macro was not mandated originally: define only if we know
1903 we won't break user code: when these are the locations we know. */
1905 #ifndef YY_LOCATION_PRINT
1906 # if YYLTYPE_IS_TRIVIAL
1907 # define YY_LOCATION_PRINT(File, Loc) \
1908 fprintf (File, "%d.%d-%d.%d", \
1909 (Loc).first_line, (Loc).first_column, \
1910 (Loc).last_line, (Loc).last_column)
1912 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1917 /* YYLEX -- calling `yylex' with the right arguments. */
1920 # define YYLEX yylex (YYLEX_PARAM)
1922 # define YYLEX yylex ()
1925 /* Enable debugging if requested. */
1929 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1930 # define YYFPRINTF fprintf
1933 # define YYDPRINTF(Args) \
1939 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1943 YYFPRINTF (stderr, "%s ", Title); \
1944 yy_symbol_print (stderr, \
1946 YYFPRINTF (stderr, "\n"); \
1951 /*--------------------------------.
1952 | Print this symbol on YYOUTPUT. |
1953 `--------------------------------*/
1956 #if (defined __STDC__ || defined __C99__FUNC__ \
1957 || defined __cplusplus || defined _MSC_VER)
1959 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
)
1962 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
)
1965 YYSTYPE
const * const yyvaluep
;
1971 if (yytype
< YYNTOKENS
)
1972 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1984 /*--------------------------------.
1985 | Print this symbol on YYOUTPUT. |
1986 `--------------------------------*/
1988 #if (defined __STDC__ || defined __C99__FUNC__ \
1989 || defined __cplusplus || defined _MSC_VER)
1991 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
)
1994 yy_symbol_print (yyoutput
, yytype
, yyvaluep
)
1997 YYSTYPE
const * const yyvaluep
;
2000 if (yytype
< YYNTOKENS
)
2001 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
2003 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
2005 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
);
2006 YYFPRINTF (yyoutput
, ")");
2009 /*------------------------------------------------------------------.
2010 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
2012 `------------------------------------------------------------------*/
2014 #if (defined __STDC__ || defined __C99__FUNC__ \
2015 || defined __cplusplus || defined _MSC_VER)
2017 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
2020 yy_stack_print (yybottom
, yytop
)
2021 yytype_int16
*yybottom
;
2022 yytype_int16
*yytop
;
2025 YYFPRINTF (stderr
, "Stack now");
2026 for (; yybottom
<= yytop
; yybottom
++)
2028 int yybot
= *yybottom
;
2029 YYFPRINTF (stderr
, " %d", yybot
);
2031 YYFPRINTF (stderr
, "\n");
2034 # define YY_STACK_PRINT(Bottom, Top) \
2037 yy_stack_print ((Bottom), (Top)); \
2041 /*------------------------------------------------.
2042 | Report that the YYRULE is going to be reduced. |
2043 `------------------------------------------------*/
2045 #if (defined __STDC__ || defined __C99__FUNC__ \
2046 || defined __cplusplus || defined _MSC_VER)
2048 yy_reduce_print (YYSTYPE
*yyvsp
, int yyrule
)
2051 yy_reduce_print (yyvsp
, yyrule
)
2056 int yynrhs
= yyr2
[yyrule
];
2058 unsigned long int yylno
= yyrline
[yyrule
];
2059 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
2061 /* The symbols being reduced. */
2062 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
2064 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
2065 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
2066 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
2068 YYFPRINTF (stderr
, "\n");
2072 # define YY_REDUCE_PRINT(Rule) \
2075 yy_reduce_print (yyvsp, Rule); \
2078 /* Nonzero means print parse trace. It is left uninitialized so that
2079 multiple parsers can coexist. */
2081 #else /* !YYDEBUG */
2082 # define YYDPRINTF(Args)
2083 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
2084 # define YY_STACK_PRINT(Bottom, Top)
2085 # define YY_REDUCE_PRINT(Rule)
2086 #endif /* !YYDEBUG */
2089 /* YYINITDEPTH -- initial size of the parser's stacks. */
2091 # define YYINITDEPTH 200
2094 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
2095 if the built-in stack extension method is used).
2097 Do not make this value too large; the results are undefined if
2098 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
2099 evaluated with infinite-precision integer arithmetic. */
2102 # define YYMAXDEPTH 10000
2110 # if defined __GLIBC__ && defined _STRING_H
2111 # define yystrlen strlen
2113 /* Return the length of YYSTR. */
2114 #if (defined __STDC__ || defined __C99__FUNC__ \
2115 || defined __cplusplus || defined _MSC_VER)
2117 yystrlen (const char *yystr
)
2125 for (yylen
= 0; yystr
[yylen
]; yylen
++)
2133 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
2134 # define yystpcpy stpcpy
2136 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
2138 #if (defined __STDC__ || defined __C99__FUNC__ \
2139 || defined __cplusplus || defined _MSC_VER)
2141 yystpcpy (char *yydest
, const char *yysrc
)
2144 yystpcpy (yydest
, yysrc
)
2150 const char *yys
= yysrc
;
2152 while ((*yyd
++ = *yys
++) != '\0')
2161 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
2162 quotes and backslashes, so that it's suitable for yyerror. The
2163 heuristic is that double-quoting is unnecessary unless the string
2164 contains an apostrophe, a comma, or backslash (other than
2165 backslash-backslash). YYSTR is taken from yytname. If YYRES is
2166 null, do not copy; instead, return the length of what the result
2169 yytnamerr (char *yyres
, const char *yystr
)
2174 char const *yyp
= yystr
;
2181 goto do_not_strip_quotes
;
2185 goto do_not_strip_quotes
;
2198 do_not_strip_quotes
: ;
2202 return yystrlen (yystr
);
2204 return yystpcpy (yyres
, yystr
) - yyres
;
2208 /* Copy into YYRESULT an error message about the unexpected token
2209 YYCHAR while in state YYSTATE. Return the number of bytes copied,
2210 including the terminating null byte. If YYRESULT is null, do not
2211 copy anything; just return the number of bytes that would be
2212 copied. As a special case, return 0 if an ordinary "syntax error"
2213 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
2214 size calculation. */
2216 yysyntax_error (char *yyresult
, int yystate
, int yychar
)
2218 int yyn
= yypact
[yystate
];
2220 if (! (YYPACT_NINF
< yyn
&& yyn
<= YYLAST
))
2224 int yytype
= YYTRANSLATE (yychar
);
2225 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytype
]);
2226 YYSIZE_T yysize
= yysize0
;
2228 int yysize_overflow
= 0;
2229 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
2230 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
2234 /* This is so xgettext sees the translatable formats that are
2235 constructed on the fly. */
2236 YY_("syntax error, unexpected %s");
2237 YY_("syntax error, unexpected %s, expecting %s");
2238 YY_("syntax error, unexpected %s, expecting %s or %s");
2239 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
2240 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
2244 static char const yyunexpected
[] = "syntax error, unexpected %s";
2245 static char const yyexpecting
[] = ", expecting %s";
2246 static char const yyor
[] = " or %s";
2247 char yyformat
[sizeof yyunexpected
2248 + sizeof yyexpecting
- 1
2249 + ((YYERROR_VERBOSE_ARGS_MAXIMUM
- 2)
2250 * (sizeof yyor
- 1))];
2251 char const *yyprefix
= yyexpecting
;
2253 /* Start YYX at -YYN if negative to avoid negative indexes in
2255 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
2257 /* Stay within bounds of both yycheck and yytname. */
2258 int yychecklim
= YYLAST
- yyn
+ 1;
2259 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
2262 yyarg
[0] = yytname
[yytype
];
2263 yyfmt
= yystpcpy (yyformat
, yyunexpected
);
2265 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
2266 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
2268 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
2272 yyformat
[sizeof yyunexpected
- 1] = '\0';
2275 yyarg
[yycount
++] = yytname
[yyx
];
2276 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
2277 yysize_overflow
|= (yysize1
< yysize
);
2279 yyfmt
= yystpcpy (yyfmt
, yyprefix
);
2283 yyf
= YY_(yyformat
);
2284 yysize1
= yysize
+ yystrlen (yyf
);
2285 yysize_overflow
|= (yysize1
< yysize
);
2288 if (yysize_overflow
)
2289 return YYSIZE_MAXIMUM
;
2293 /* Avoid sprintf, as that infringes on the user's name space.
2294 Don't have undefined behavior even if the translation
2295 produced a string with the wrong number of "%s"s. */
2296 char *yyp
= yyresult
;
2298 while ((*yyp
= *yyf
) != '\0')
2300 if (*yyp
== '%' && yyf
[1] == 's' && yyi
< yycount
)
2302 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
2315 #endif /* YYERROR_VERBOSE */
2318 /*-----------------------------------------------.
2319 | Release the memory associated to this symbol. |
2320 `-----------------------------------------------*/
2323 #if (defined __STDC__ || defined __C99__FUNC__ \
2324 || defined __cplusplus || defined _MSC_VER)
2326 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
)
2329 yydestruct (yymsg
, yytype
, yyvaluep
)
2339 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
2349 /* Prevent warnings from -Wmissing-prototypes. */
2350 #ifdef YYPARSE_PARAM
2351 #if defined __STDC__ || defined __cplusplus
2352 int yyparse (void *YYPARSE_PARAM
);
2356 #else /* ! YYPARSE_PARAM */
2357 #if defined __STDC__ || defined __cplusplus
2362 #endif /* ! YYPARSE_PARAM */
2365 /* The lookahead symbol. */
2368 /* The semantic value of the lookahead symbol. */
2371 /* Number of syntax errors so far. */
2376 /*-------------------------.
2377 | yyparse or yypush_parse. |
2378 `-------------------------*/
2380 #ifdef YYPARSE_PARAM
2381 #if (defined __STDC__ || defined __C99__FUNC__ \
2382 || defined __cplusplus || defined _MSC_VER)
2384 yyparse (void *YYPARSE_PARAM
)
2387 yyparse (YYPARSE_PARAM
)
2388 void *YYPARSE_PARAM
;
2390 #else /* ! YYPARSE_PARAM */
2391 #if (defined __STDC__ || defined __C99__FUNC__ \
2392 || defined __cplusplus || defined _MSC_VER)
2405 /* Number of tokens to shift before error messages enabled. */
2408 /* The stacks and their tools:
2409 `yyss': related to states.
2410 `yyvs': related to semantic values.
2412 Refer to the stacks thru separate pointers, to allow yyoverflow
2413 to reallocate them elsewhere. */
2415 /* The state stack. */
2416 yytype_int16 yyssa
[YYINITDEPTH
];
2418 yytype_int16
*yyssp
;
2420 /* The semantic value stack. */
2421 YYSTYPE yyvsa
[YYINITDEPTH
];
2425 YYSIZE_T yystacksize
;
2429 /* Lookahead token as an internal (translated) token number. */
2431 /* The variables used to return semantic value and location from the
2436 /* Buffer for error messages, and its allocated size. */
2438 char *yymsg
= yymsgbuf
;
2439 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
2442 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
2444 /* The number of symbols on the RHS of the reduced rule.
2445 Keep to zero when no symbol should be popped. */
2451 yystacksize
= YYINITDEPTH
;
2453 YYDPRINTF ((stderr
, "Starting parse\n"));
2458 yychar
= YYEMPTY
; /* Cause a token to be read. */
2460 /* Initialize stack pointers.
2461 Waste one element of value and location stack
2462 so that they stay on the same level as the state stack.
2463 The wasted elements are never initialized. */
2469 /*------------------------------------------------------------.
2470 | yynewstate -- Push a new state, which is found in yystate. |
2471 `------------------------------------------------------------*/
2473 /* In all cases, when you get here, the value and location stacks
2474 have just been pushed. So pushing a state here evens the stacks. */
2480 if (yyss
+ yystacksize
- 1 <= yyssp
)
2482 /* Get the current used size of the three stacks, in elements. */
2483 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
2487 /* Give user a chance to reallocate the stack. Use copies of
2488 these so that the &'s don't force the real ones into
2490 YYSTYPE
*yyvs1
= yyvs
;
2491 yytype_int16
*yyss1
= yyss
;
2493 /* Each stack pointer address is followed by the size of the
2494 data in use in that stack, in bytes. This used to be a
2495 conditional around just the two extra args, but that might
2496 be undefined if yyoverflow is a macro. */
2497 yyoverflow (YY_("memory exhausted"),
2498 &yyss1
, yysize
* sizeof (*yyssp
),
2499 &yyvs1
, yysize
* sizeof (*yyvsp
),
2505 #else /* no yyoverflow */
2506 # ifndef YYSTACK_RELOCATE
2507 goto yyexhaustedlab
;
2509 /* Extend the stack our own way. */
2510 if (YYMAXDEPTH
<= yystacksize
)
2511 goto yyexhaustedlab
;
2513 if (YYMAXDEPTH
< yystacksize
)
2514 yystacksize
= YYMAXDEPTH
;
2517 yytype_int16
*yyss1
= yyss
;
2518 union yyalloc
*yyptr
=
2519 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
2521 goto yyexhaustedlab
;
2522 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
2523 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
2524 # undef YYSTACK_RELOCATE
2526 YYSTACK_FREE (yyss1
);
2529 #endif /* no yyoverflow */
2531 yyssp
= yyss
+ yysize
- 1;
2532 yyvsp
= yyvs
+ yysize
- 1;
2534 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
2535 (unsigned long int) yystacksize
));
2537 if (yyss
+ yystacksize
- 1 <= yyssp
)
2541 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
2543 if (yystate
== YYFINAL
)
2553 /* Do appropriate processing given the current state. Read a
2554 lookahead token if we need one and don't already have one. */
2556 /* First try to decide what to do without reference to lookahead token. */
2557 yyn
= yypact
[yystate
];
2558 if (yyn
== YYPACT_NINF
)
2561 /* Not known => get a lookahead token if don't already have one. */
2563 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
2564 if (yychar
== YYEMPTY
)
2566 YYDPRINTF ((stderr
, "Reading a token: "));
2570 if (yychar
<= YYEOF
)
2572 yychar
= yytoken
= YYEOF
;
2573 YYDPRINTF ((stderr
, "Now at end of input.\n"));
2577 yytoken
= YYTRANSLATE (yychar
);
2578 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
2581 /* If the proper action on seeing token YYTOKEN is to reduce or to
2582 detect an error, take that action. */
2584 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
2589 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
2595 /* Count tokens shifted since error; after three, turn off error
2600 /* Shift the lookahead token. */
2601 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
2603 /* Discard the shifted token. */
2612 /*-----------------------------------------------------------.
2613 | yydefault -- do the default action for the current state. |
2614 `-----------------------------------------------------------*/
2616 yyn
= yydefact
[yystate
];
2622 /*-----------------------------.
2623 | yyreduce -- Do a reduction. |
2624 `-----------------------------*/
2626 /* yyn is the number of a rule to reduce with. */
2629 /* If YYLEN is nonzero, implement the default value of the action:
2632 Otherwise, the following line sets YYVAL to garbage.
2633 This behavior is undocumented and Bison
2634 users should not rely upon it. Assigning to YYVAL
2635 unconditionally makes the parser a bit smaller, and it avoids a
2636 GCC warning that YYVAL may be used uninitialized. */
2637 yyval
= yyvsp
[1-yylen
];
2640 YY_REDUCE_PRINT (yyn
);
2645 /* Line 1455 of yacc.c */
2646 #line 330 "parser.y"
2648 check_statements((yyvsp
[(1) - (1)].stmt_list
), FALSE
);
2649 check_all_user_types((yyvsp
[(1) - (1)].stmt_list
));
2650 write_header((yyvsp
[(1) - (1)].stmt_list
));
2651 write_id_data((yyvsp
[(1) - (1)].stmt_list
));
2652 write_proxies((yyvsp
[(1) - (1)].stmt_list
));
2653 write_client((yyvsp
[(1) - (1)].stmt_list
));
2654 write_server((yyvsp
[(1) - (1)].stmt_list
));
2655 write_dlldata((yyvsp
[(1) - (1)].stmt_list
));
2656 write_local_stubs((yyvsp
[(1) - (1)].stmt_list
));
2662 /* Line 1455 of yacc.c */
2663 #line 343 "parser.y"
2664 { (yyval
.stmt_list
) = NULL
; ;}
2669 /* Line 1455 of yacc.c */
2670 #line 344 "parser.y"
2671 { (yyval
.stmt_list
) = append_statement((yyvsp
[(1) - (2)].stmt_list
), make_statement_reference((yyvsp
[(2) - (2)].type
))); ;}
2676 /* Line 1455 of yacc.c */
2677 #line 345 "parser.y"
2678 { (yyval
.stmt_list
) = append_statement((yyvsp
[(1) - (2)].stmt_list
), make_statement_type_decl((yyvsp
[(2) - (2)].type
))); ;}
2683 /* Line 1455 of yacc.c */
2684 #line 346 "parser.y"
2685 { (yyval
.stmt_list
) = (yyvsp
[(1) - (3)].stmt_list
);
2686 reg_type((yyvsp
[(2) - (3)].type
), (yyvsp
[(2) - (3)].type
)->name
, 0);
2692 /* Line 1455 of yacc.c */
2693 #line 349 "parser.y"
2694 { (yyval
.stmt_list
) = append_statement((yyvsp
[(1) - (2)].stmt_list
), make_statement_type_decl((yyvsp
[(2) - (2)].type
)));
2695 reg_type((yyvsp
[(2) - (2)].type
), (yyvsp
[(2) - (2)].type
)->name
, 0);
2701 /* Line 1455 of yacc.c */
2702 #line 352 "parser.y"
2703 { (yyval
.stmt_list
) = append_statement((yyvsp
[(1) - (2)].stmt_list
), make_statement_module((yyvsp
[(2) - (2)].type
))); ;}
2708 /* Line 1455 of yacc.c */
2709 #line 353 "parser.y"
2710 { (yyval
.stmt_list
) = append_statement((yyvsp
[(1) - (2)].stmt_list
), make_statement_library((yyvsp
[(2) - (2)].typelib
))); ;}
2715 /* Line 1455 of yacc.c */
2716 #line 354 "parser.y"
2717 { (yyval
.stmt_list
) = append_statement((yyvsp
[(1) - (2)].stmt_list
), (yyvsp
[(2) - (2)].statement
)); ;}
2722 /* Line 1455 of yacc.c */
2723 #line 357 "parser.y"
2724 { (yyval
.stmt_list
) = NULL
; ;}
2729 /* Line 1455 of yacc.c */
2730 #line 358 "parser.y"
2731 { (yyval
.stmt_list
) = append_statement((yyvsp
[(1) - (2)].stmt_list
), make_statement_reference((yyvsp
[(2) - (2)].type
))); ;}
2736 /* Line 1455 of yacc.c */
2737 #line 359 "parser.y"
2738 { (yyval
.stmt_list
) = append_statement((yyvsp
[(1) - (2)].stmt_list
), make_statement_type_decl((yyvsp
[(2) - (2)].type
))); ;}
2743 /* Line 1455 of yacc.c */
2744 #line 360 "parser.y"
2745 { (yyval
.stmt_list
) = (yyvsp
[(1) - (3)].stmt_list
); reg_type((yyvsp
[(2) - (3)].type
), (yyvsp
[(2) - (3)].type
)->name
, 0); ;}
2750 /* Line 1455 of yacc.c */
2751 #line 361 "parser.y"
2752 { (yyval
.stmt_list
) = append_statement((yyvsp
[(1) - (2)].stmt_list
), make_statement_type_decl((yyvsp
[(2) - (2)].type
)));
2753 reg_type((yyvsp
[(2) - (2)].type
), (yyvsp
[(2) - (2)].type
)->name
, 0);
2759 /* Line 1455 of yacc.c */
2760 #line 364 "parser.y"
2761 { (yyval
.stmt_list
) = append_statement((yyvsp
[(1) - (2)].stmt_list
), make_statement_module((yyvsp
[(2) - (2)].type
))); ;}
2766 /* Line 1455 of yacc.c */
2767 #line 365 "parser.y"
2768 { (yyval
.stmt_list
) = append_statement((yyvsp
[(1) - (2)].stmt_list
), (yyvsp
[(2) - (2)].statement
)); ;}
2773 /* Line 1455 of yacc.c */
2774 #line 366 "parser.y"
2775 { (yyval
.stmt_list
) = append_statement((yyvsp
[(1) - (2)].stmt_list
), make_statement_importlib((yyvsp
[(2) - (2)].str
))); ;}
2780 /* Line 1455 of yacc.c */
2781 #line 367 "parser.y"
2782 { (yyval
.stmt_list
) = append_statement((yyvsp
[(1) - (2)].stmt_list
), make_statement_library((yyvsp
[(2) - (2)].typelib
))); ;}
2787 /* Line 1455 of yacc.c */
2788 #line 370 "parser.y"
2789 { (yyval
.stmt_list
) = NULL
; ;}
2794 /* Line 1455 of yacc.c */
2795 #line 371 "parser.y"
2796 { (yyval
.stmt_list
) = append_statement((yyvsp
[(1) - (2)].stmt_list
), (yyvsp
[(2) - (2)].statement
)); ;}
2801 /* Line 1455 of yacc.c */
2802 #line 379 "parser.y"
2803 { (yyval
.statement
) = make_statement_cppquote((yyvsp
[(1) - (1)].str
)); ;}
2808 /* Line 1455 of yacc.c */
2809 #line 380 "parser.y"
2810 { (yyval
.statement
) = make_statement_type_decl((yyvsp
[(1) - (2)].type
)); ;}
2815 /* Line 1455 of yacc.c */
2816 #line 381 "parser.y"
2817 { (yyval
.statement
) = make_statement_declaration((yyvsp
[(1) - (2)].var
)); ;}
2822 /* Line 1455 of yacc.c */
2823 #line 382 "parser.y"
2824 { (yyval
.statement
) = make_statement_import((yyvsp
[(1) - (1)].str
)); ;}
2829 /* Line 1455 of yacc.c */
2830 #line 383 "parser.y"
2831 { (yyval
.statement
) = (yyvsp
[(1) - (2)].statement
); ;}
2836 /* Line 1455 of yacc.c */
2837 #line 390 "parser.y"
2838 { (yyval
.type
) = (yyvsp
[(2) - (2)].type
); (yyval
.type
)->attrs
= check_enum_attrs((yyvsp
[(1) - (2)].attr_list
)); ;}
2843 /* Line 1455 of yacc.c */
2844 #line 391 "parser.y"
2845 { (yyval
.type
) = (yyvsp
[(2) - (2)].type
); (yyval
.type
)->attrs
= check_struct_attrs((yyvsp
[(1) - (2)].attr_list
)); ;}
2850 /* Line 1455 of yacc.c */
2851 #line 392 "parser.y"
2852 { (yyval
.type
) = (yyvsp
[(2) - (2)].type
); (yyval
.type
)->attrs
= check_union_attrs((yyvsp
[(1) - (2)].attr_list
)); ;}
2857 /* Line 1455 of yacc.c */
2858 #line 395 "parser.y"
2859 { (yyval
.str
) = (yyvsp
[(3) - (4)].str
); ;}
2864 /* Line 1455 of yacc.c */
2865 #line 397 "parser.y"
2866 { assert(yychar
== YYEMPTY
);
2867 (yyval
.import
) = xmalloc(sizeof(struct _import_t
));
2868 (yyval
.import
)->name
= (yyvsp
[(2) - (3)].str
);
2869 (yyval
.import
)->import_performed
= do_import((yyvsp
[(2) - (3)].str
));
2870 if (!(yyval
.import
)->import_performed
) yychar
= aEOF
;
2876 /* Line 1455 of yacc.c */
2877 #line 405 "parser.y"
2878 { (yyval
.str
) = (yyvsp
[(1) - (3)].import
)->name
;
2879 if ((yyvsp
[(1) - (3)].import
)->import_performed
) pop_import();
2880 free((yyvsp
[(1) - (3)].import
));
2886 /* Line 1455 of yacc.c */
2887 #line 412 "parser.y"
2888 { (yyval
.str
) = (yyvsp
[(3) - (5)].str
); if(!parse_only
) add_importlib((yyvsp
[(3) - (5)].str
)); ;}
2893 /* Line 1455 of yacc.c */
2894 #line 415 "parser.y"
2895 { (yyval
.str
) = (yyvsp
[(2) - (2)].str
); ;}
2900 /* Line 1455 of yacc.c */
2901 #line 417 "parser.y"
2902 { (yyval
.typelib
) = make_library((yyvsp
[(2) - (3)].str
), check_library_attrs((yyvsp
[(2) - (3)].str
), (yyvsp
[(1) - (3)].attr_list
)));
2903 if (!parse_only
) start_typelib((yyval
.typelib
));
2909 /* Line 1455 of yacc.c */
2910 #line 422 "parser.y"
2911 { (yyval
.typelib
) = (yyvsp
[(1) - (4)].typelib
);
2912 (yyval
.typelib
)->stmts
= (yyvsp
[(2) - (4)].stmt_list
);
2913 if (!parse_only
) end_typelib();
2919 /* Line 1455 of yacc.c */
2920 #line 428 "parser.y"
2921 { (yyval
.var_list
) = NULL
; ;}
2926 /* Line 1455 of yacc.c */
2927 #line 432 "parser.y"
2928 { check_arg_attrs((yyvsp
[(1) - (1)].var
)); (yyval
.var_list
) = append_var( NULL
, (yyvsp
[(1) - (1)].var
) ); ;}
2933 /* Line 1455 of yacc.c */
2934 #line 433 "parser.y"
2935 { check_arg_attrs((yyvsp
[(3) - (3)].var
)); (yyval
.var_list
) = append_var( (yyvsp
[(1) - (3)].var_list
), (yyvsp
[(3) - (3)].var
) ); ;}
2940 /* Line 1455 of yacc.c */
2941 #line 437 "parser.y"
2942 { (yyval
.var_list
) = append_var( (yyvsp
[(1) - (3)].var_list
), make_var(strdup("...")) ); ;}
2947 /* Line 1455 of yacc.c */
2948 #line 441 "parser.y"
2949 { if ((yyvsp
[(2) - (3)].declspec
)->stgclass
!= STG_NONE
&& (yyvsp
[(2) - (3)].declspec
)->stgclass
!= STG_REGISTER
)
2950 error_loc("invalid storage class for function parameter\n");
2951 (yyval
.var
) = declare_var((yyvsp
[(1) - (3)].attr_list
), (yyvsp
[(2) - (3)].declspec
), (yyvsp
[(3) - (3)].declarator
), TRUE
);
2952 free((yyvsp
[(2) - (3)].declspec
)); free((yyvsp
[(3) - (3)].declarator
));
2958 /* Line 1455 of yacc.c */
2959 #line 446 "parser.y"
2960 { if ((yyvsp
[(1) - (2)].declspec
)->stgclass
!= STG_NONE
&& (yyvsp
[(1) - (2)].declspec
)->stgclass
!= STG_REGISTER
)
2961 error_loc("invalid storage class for function parameter\n");
2962 (yyval
.var
) = declare_var(NULL
, (yyvsp
[(1) - (2)].declspec
), (yyvsp
[(2) - (2)].declarator
), TRUE
);
2963 free((yyvsp
[(1) - (2)].declspec
)); free((yyvsp
[(2) - (2)].declarator
));
2969 /* Line 1455 of yacc.c */
2970 #line 453 "parser.y"
2971 { (yyval
.expr
) = (yyvsp
[(2) - (3)].expr
); ;}
2976 /* Line 1455 of yacc.c */
2977 #line 454 "parser.y"
2978 { (yyval
.expr
) = make_expr(EXPR_VOID
); ;}
2983 /* Line 1455 of yacc.c */
2984 #line 457 "parser.y"
2985 { (yyval
.attr_list
) = NULL
; ;}
2990 /* Line 1455 of yacc.c */
2991 #line 462 "parser.y"
2992 { (yyval
.attr_list
) = (yyvsp
[(2) - (3)].attr_list
); ;}
2997 /* Line 1455 of yacc.c */
2998 #line 465 "parser.y"
2999 { (yyval
.attr_list
) = append_attr( NULL
, (yyvsp
[(1) - (1)].attr
) ); ;}
3004 /* Line 1455 of yacc.c */
3005 #line 466 "parser.y"
3006 { (yyval
.attr_list
) = append_attr( (yyvsp
[(1) - (3)].attr_list
), (yyvsp
[(3) - (3)].attr
) ); ;}
3011 /* Line 1455 of yacc.c */
3012 #line 467 "parser.y"
3013 { (yyval
.attr_list
) = append_attr( (yyvsp
[(1) - (4)].attr_list
), (yyvsp
[(4) - (4)].attr
) ); ;}
3018 /* Line 1455 of yacc.c */
3019 #line 470 "parser.y"
3020 { (yyval
.str_list
) = append_str( NULL
, (yyvsp
[(1) - (1)].str
) ); ;}
3025 /* Line 1455 of yacc.c */
3026 #line 471 "parser.y"
3027 { (yyval
.str_list
) = append_str( (yyvsp
[(1) - (3)].str_list
), (yyvsp
[(3) - (3)].str
) ); ;}
3032 /* Line 1455 of yacc.c */
3033 #line 474 "parser.y"
3034 { (yyval
.attr
) = NULL
; ;}
3039 /* Line 1455 of yacc.c */
3040 #line 475 "parser.y"
3041 { (yyval
.attr
) = make_attr(ATTR_AGGREGATABLE
); ;}
3046 /* Line 1455 of yacc.c */
3047 #line 476 "parser.y"
3048 { (yyval
.attr
) = make_attrp(ATTR_ANNOTATION
, (yyvsp
[(3) - (4)].str
)); ;}
3053 /* Line 1455 of yacc.c */
3054 #line 477 "parser.y"
3055 { (yyval
.attr
) = make_attr(ATTR_APPOBJECT
); ;}
3060 /* Line 1455 of yacc.c */
3061 #line 478 "parser.y"
3062 { (yyval
.attr
) = make_attr(ATTR_ASYNC
); ;}
3067 /* Line 1455 of yacc.c */
3068 #line 479 "parser.y"
3069 { (yyval
.attr
) = make_attr(ATTR_AUTO_HANDLE
); ;}
3074 /* Line 1455 of yacc.c */
3075 #line 480 "parser.y"
3076 { (yyval
.attr
) = make_attr(ATTR_BINDABLE
); ;}
3081 /* Line 1455 of yacc.c */
3082 #line 481 "parser.y"
3083 { (yyval
.attr
) = make_attr(ATTR_BROADCAST
); ;}
3088 /* Line 1455 of yacc.c */
3089 #line 482 "parser.y"
3090 { (yyval
.attr
) = make_attrp(ATTR_CALLAS
, (yyvsp
[(3) - (4)].var
)); ;}
3095 /* Line 1455 of yacc.c */
3096 #line 483 "parser.y"
3097 { (yyval
.attr
) = make_attrp(ATTR_CASE
, (yyvsp
[(3) - (4)].expr_list
)); ;}
3102 /* Line 1455 of yacc.c */
3103 #line 484 "parser.y"
3104 { (yyval
.attr
) = make_attrv(ATTR_CONTEXTHANDLE
, 0); ;}
3109 /* Line 1455 of yacc.c */
3110 #line 485 "parser.y"
3111 { (yyval
.attr
) = make_attrv(ATTR_CONTEXTHANDLE
, 0); /* RPC_CONTEXT_HANDLE_DONT_SERIALIZE */ ;}
3116 /* Line 1455 of yacc.c */
3117 #line 486 "parser.y"
3118 { (yyval
.attr
) = make_attrv(ATTR_CONTEXTHANDLE
, 0); /* RPC_CONTEXT_HANDLE_SERIALIZE */ ;}
3123 /* Line 1455 of yacc.c */
3124 #line 487 "parser.y"
3125 { (yyval
.attr
) = make_attr(ATTR_CONTROL
); ;}
3130 /* Line 1455 of yacc.c */
3131 #line 488 "parser.y"
3132 { (yyval
.attr
) = make_attr(ATTR_DEFAULT
); ;}
3137 /* Line 1455 of yacc.c */
3138 #line 489 "parser.y"
3139 { (yyval
.attr
) = make_attr(ATTR_DEFAULTCOLLELEM
); ;}
3144 /* Line 1455 of yacc.c */
3145 #line 490 "parser.y"
3146 { (yyval
.attr
) = make_attrp(ATTR_DEFAULTVALUE
, (yyvsp
[(3) - (4)].expr
)); ;}
3151 /* Line 1455 of yacc.c */
3152 #line 491 "parser.y"
3153 { (yyval
.attr
) = make_attr(ATTR_DEFAULTVTABLE
); ;}
3158 /* Line 1455 of yacc.c */
3159 #line 492 "parser.y"
3160 { (yyval
.attr
) = make_attr(ATTR_DISPLAYBIND
); ;}
3165 /* Line 1455 of yacc.c */
3166 #line 493 "parser.y"
3167 { (yyval
.attr
) = make_attrp(ATTR_DLLNAME
, (yyvsp
[(3) - (4)].str
)); ;}
3172 /* Line 1455 of yacc.c */
3173 #line 494 "parser.y"
3174 { (yyval
.attr
) = make_attr(ATTR_DUAL
); ;}
3179 /* Line 1455 of yacc.c */
3180 #line 495 "parser.y"
3181 { (yyval
.attr
) = make_attrp(ATTR_ENDPOINT
, (yyvsp
[(3) - (4)].str_list
)); ;}
3186 /* Line 1455 of yacc.c */
3187 #line 496 "parser.y"
3188 { (yyval
.attr
) = make_attrp(ATTR_ENTRY
, (yyvsp
[(3) - (4)].expr
)); ;}
3193 /* Line 1455 of yacc.c */
3194 #line 497 "parser.y"
3195 { (yyval
.attr
) = make_attr(ATTR_EXPLICIT_HANDLE
); ;}
3200 /* Line 1455 of yacc.c */
3201 #line 498 "parser.y"
3202 { (yyval
.attr
) = make_attr(ATTR_HANDLE
); ;}
3207 /* Line 1455 of yacc.c */
3208 #line 499 "parser.y"
3209 { (yyval
.attr
) = make_attrp(ATTR_HELPCONTEXT
, (yyvsp
[(3) - (4)].expr
)); ;}
3214 /* Line 1455 of yacc.c */
3215 #line 500 "parser.y"
3216 { (yyval
.attr
) = make_attrp(ATTR_HELPFILE
, (yyvsp
[(3) - (4)].str
)); ;}
3221 /* Line 1455 of yacc.c */
3222 #line 501 "parser.y"
3223 { (yyval
.attr
) = make_attrp(ATTR_HELPSTRING
, (yyvsp
[(3) - (4)].str
)); ;}
3228 /* Line 1455 of yacc.c */
3229 #line 502 "parser.y"
3230 { (yyval
.attr
) = make_attrp(ATTR_HELPSTRINGCONTEXT
, (yyvsp
[(3) - (4)].expr
)); ;}
3235 /* Line 1455 of yacc.c */
3236 #line 503 "parser.y"
3237 { (yyval
.attr
) = make_attrp(ATTR_HELPSTRINGDLL
, (yyvsp
[(3) - (4)].str
)); ;}
3242 /* Line 1455 of yacc.c */
3243 #line 504 "parser.y"
3244 { (yyval
.attr
) = make_attr(ATTR_HIDDEN
); ;}
3249 /* Line 1455 of yacc.c */
3250 #line 505 "parser.y"
3251 { (yyval
.attr
) = make_attrp(ATTR_ID
, (yyvsp
[(3) - (4)].expr
)); ;}
3256 /* Line 1455 of yacc.c */
3257 #line 506 "parser.y"
3258 { (yyval
.attr
) = make_attr(ATTR_IDEMPOTENT
); ;}
3263 /* Line 1455 of yacc.c */
3264 #line 507 "parser.y"
3265 { (yyval
.attr
) = make_attrp(ATTR_IIDIS
, (yyvsp
[(3) - (4)].expr
)); ;}
3270 /* Line 1455 of yacc.c */
3271 #line 508 "parser.y"
3272 { (yyval
.attr
) = make_attr(ATTR_IMMEDIATEBIND
); ;}
3277 /* Line 1455 of yacc.c */
3278 #line 509 "parser.y"
3279 { (yyval
.attr
) = make_attrp(ATTR_IMPLICIT_HANDLE
, (yyvsp
[(4) - (5)].str
)); ;}
3284 /* Line 1455 of yacc.c */
3285 #line 510 "parser.y"
3286 { (yyval
.attr
) = make_attr(ATTR_IN
); ;}
3291 /* Line 1455 of yacc.c */
3292 #line 511 "parser.y"
3293 { (yyval
.attr
) = make_attr(ATTR_INPUTSYNC
); ;}
3298 /* Line 1455 of yacc.c */
3299 #line 512 "parser.y"
3300 { (yyval
.attr
) = make_attrp(ATTR_LENGTHIS
, (yyvsp
[(3) - (4)].expr_list
)); ;}
3305 /* Line 1455 of yacc.c */
3306 #line 513 "parser.y"
3307 { (yyval
.attr
) = make_attrp(ATTR_LIBLCID
, (yyvsp
[(3) - (4)].expr
)); ;}
3312 /* Line 1455 of yacc.c */
3313 #line 514 "parser.y"
3314 { (yyval
.attr
) = make_attr(ATTR_PARAMLCID
); ;}
3319 /* Line 1455 of yacc.c */
3320 #line 515 "parser.y"
3321 { (yyval
.attr
) = make_attr(ATTR_LOCAL
); ;}
3326 /* Line 1455 of yacc.c */
3327 #line 516 "parser.y"
3328 { (yyval
.attr
) = make_attr(ATTR_NONBROWSABLE
); ;}
3333 /* Line 1455 of yacc.c */
3334 #line 517 "parser.y"
3335 { (yyval
.attr
) = make_attr(ATTR_NONCREATABLE
); ;}
3340 /* Line 1455 of yacc.c */
3341 #line 518 "parser.y"
3342 { (yyval
.attr
) = make_attr(ATTR_NONEXTENSIBLE
); ;}
3347 /* Line 1455 of yacc.c */
3348 #line 519 "parser.y"
3349 { (yyval
.attr
) = make_attr(ATTR_OBJECT
); ;}
3354 /* Line 1455 of yacc.c */
3355 #line 520 "parser.y"
3356 { (yyval
.attr
) = make_attr(ATTR_ODL
); ;}
3361 /* Line 1455 of yacc.c */
3362 #line 521 "parser.y"
3363 { (yyval
.attr
) = make_attr(ATTR_OLEAUTOMATION
); ;}
3368 /* Line 1455 of yacc.c */
3369 #line 522 "parser.y"
3370 { (yyval
.attr
) = make_attr(ATTR_OPTIONAL
); ;}
3375 /* Line 1455 of yacc.c */
3376 #line 523 "parser.y"
3377 { (yyval
.attr
) = make_attr(ATTR_OUT
); ;}
3382 /* Line 1455 of yacc.c */
3383 #line 524 "parser.y"
3384 { (yyval
.attr
) = make_attrv(ATTR_POINTERDEFAULT
, (yyvsp
[(3) - (4)].num
)); ;}
3389 /* Line 1455 of yacc.c */
3390 #line 525 "parser.y"
3391 { (yyval
.attr
) = make_attr(ATTR_PROPGET
); ;}
3396 /* Line 1455 of yacc.c */
3397 #line 526 "parser.y"
3398 { (yyval
.attr
) = make_attr(ATTR_PROPPUT
); ;}
3403 /* Line 1455 of yacc.c */
3404 #line 527 "parser.y"
3405 { (yyval
.attr
) = make_attr(ATTR_PROPPUTREF
); ;}
3410 /* Line 1455 of yacc.c */
3411 #line 528 "parser.y"
3412 { (yyval
.attr
) = make_attr(ATTR_PUBLIC
); ;}
3417 /* Line 1455 of yacc.c */
3418 #line 530 "parser.y"
3419 { expr_list_t
*list
= append_expr( NULL
, (yyvsp
[(3) - (6)].expr
) );
3420 list
= append_expr( list
, (yyvsp
[(5) - (6)].expr
) );
3421 (yyval
.attr
) = make_attrp(ATTR_RANGE
, list
); ;}
3426 /* Line 1455 of yacc.c */
3427 #line 533 "parser.y"
3428 { (yyval
.attr
) = make_attr(ATTR_READONLY
); ;}
3433 /* Line 1455 of yacc.c */
3434 #line 534 "parser.y"
3435 { (yyval
.attr
) = make_attr(ATTR_REQUESTEDIT
); ;}
3440 /* Line 1455 of yacc.c */
3441 #line 535 "parser.y"
3442 { (yyval
.attr
) = make_attr(ATTR_RESTRICTED
); ;}
3447 /* Line 1455 of yacc.c */
3448 #line 536 "parser.y"
3449 { (yyval
.attr
) = make_attr(ATTR_RETVAL
); ;}
3454 /* Line 1455 of yacc.c */
3455 #line 537 "parser.y"
3456 { (yyval
.attr
) = make_attrp(ATTR_SIZEIS
, (yyvsp
[(3) - (4)].expr_list
)); ;}
3461 /* Line 1455 of yacc.c */
3462 #line 538 "parser.y"
3463 { (yyval
.attr
) = make_attr(ATTR_SOURCE
); ;}
3468 /* Line 1455 of yacc.c */
3469 #line 539 "parser.y"
3470 { (yyval
.attr
) = make_attr(ATTR_STRICTCONTEXTHANDLE
); ;}
3475 /* Line 1455 of yacc.c */
3476 #line 540 "parser.y"
3477 { (yyval
.attr
) = make_attr(ATTR_STRING
); ;}
3482 /* Line 1455 of yacc.c */
3483 #line 541 "parser.y"
3484 { (yyval
.attr
) = make_attrp(ATTR_SWITCHIS
, (yyvsp
[(3) - (4)].expr
)); ;}
3489 /* Line 1455 of yacc.c */
3490 #line 542 "parser.y"
3491 { (yyval
.attr
) = make_attrp(ATTR_SWITCHTYPE
, (yyvsp
[(3) - (4)].type
)); ;}
3496 /* Line 1455 of yacc.c */
3497 #line 543 "parser.y"
3498 { (yyval
.attr
) = make_attrp(ATTR_TRANSMITAS
, (yyvsp
[(3) - (4)].type
)); ;}
3503 /* Line 1455 of yacc.c */
3504 #line 544 "parser.y"
3505 { (yyval
.attr
) = make_attrp(ATTR_UUID
, (yyvsp
[(3) - (4)].uuid
)); ;}
3510 /* Line 1455 of yacc.c */
3511 #line 545 "parser.y"
3512 { (yyval
.attr
) = make_attr(ATTR_V1ENUM
); ;}
3517 /* Line 1455 of yacc.c */
3518 #line 546 "parser.y"
3519 { (yyval
.attr
) = make_attr(ATTR_VARARG
); ;}
3524 /* Line 1455 of yacc.c */
3525 #line 547 "parser.y"
3526 { (yyval
.attr
) = make_attrv(ATTR_VERSION
, (yyvsp
[(3) - (4)].num
)); ;}
3531 /* Line 1455 of yacc.c */
3532 #line 548 "parser.y"
3533 { (yyval
.attr
) = make_attrp(ATTR_WIREMARSHAL
, (yyvsp
[(3) - (4)].type
)); ;}
3538 /* Line 1455 of yacc.c */
3539 #line 549 "parser.y"
3540 { (yyval
.attr
) = make_attrv(ATTR_POINTERTYPE
, (yyvsp
[(1) - (1)].num
)); ;}
3545 /* Line 1455 of yacc.c */
3546 #line 554 "parser.y"
3547 { if (!is_valid_uuid((yyvsp
[(1) - (1)].str
)))
3548 error_loc("invalid UUID: %s\n", (yyvsp
[(1) - (1)].str
));
3549 (yyval
.uuid
) = parse_uuid((yyvsp
[(1) - (1)].str
)); ;}
3554 /* Line 1455 of yacc.c */
3555 #line 559 "parser.y"
3556 { (yyval
.str
) = (yyvsp
[(1) - (1)].str
); ;}
3561 /* Line 1455 of yacc.c */
3562 #line 560 "parser.y"
3563 { (yyval
.str
) = (yyvsp
[(1) - (1)].str
); ;}
3568 /* Line 1455 of yacc.c */
3569 #line 561 "parser.y"
3570 { (yyval
.str
) = (yyvsp
[(1) - (1)].str
); ;}
3575 /* Line 1455 of yacc.c */
3576 #line 562 "parser.y"
3577 { (yyval
.str
) = (yyvsp
[(1) - (1)].str
); ;}
3582 /* Line 1455 of yacc.c */
3583 #line 565 "parser.y"
3584 { (yyval
.var_list
) = NULL
; ;}
3589 /* Line 1455 of yacc.c */
3590 #line 566 "parser.y"
3591 { (yyval
.var_list
) = append_var( (yyvsp
[(1) - (2)].var_list
), (yyvsp
[(2) - (2)].var
) ); ;}
3596 /* Line 1455 of yacc.c */
3597 #line 569 "parser.y"
3598 { attr_t
*a
= make_attrp(ATTR_CASE
, append_expr( NULL
, (yyvsp
[(2) - (4)].expr
) ));
3599 (yyval
.var
) = (yyvsp
[(4) - (4)].var
); if (!(yyval
.var
)) (yyval
.var
) = make_var(NULL
);
3600 (yyval
.var
)->attrs
= append_attr( (yyval
.var
)->attrs
, a
);
3606 /* Line 1455 of yacc.c */
3607 #line 573 "parser.y"
3608 { attr_t
*a
= make_attr(ATTR_DEFAULT
);
3609 (yyval
.var
) = (yyvsp
[(3) - (3)].var
); if (!(yyval
.var
)) (yyval
.var
) = make_var(NULL
);
3610 (yyval
.var
)->attrs
= append_attr( (yyval
.var
)->attrs
, a
);
3616 /* Line 1455 of yacc.c */
3617 #line 579 "parser.y"
3618 { (yyval
.var_list
) = NULL
; ;}
3623 /* Line 1455 of yacc.c */
3624 #line 580 "parser.y"
3625 { (yyval
.var_list
) = (yyvsp
[(1) - (2)].var_list
); ;}
3630 /* Line 1455 of yacc.c */
3631 #line 584 "parser.y"
3632 { if (!(yyvsp
[(1) - (1)].var
)->eval
)
3633 (yyvsp
[(1) - (1)].var
)->eval
= make_exprl(EXPR_NUM
, 0 /* default for first enum entry */);
3634 (yyval
.var_list
) = append_var( NULL
, (yyvsp
[(1) - (1)].var
) );
3640 /* Line 1455 of yacc.c */
3641 #line 588 "parser.y"
3642 { if (!(yyvsp
[(3) - (3)].var
)->eval
)
3644 var_t
*last
= LIST_ENTRY( list_tail((yyval
.var_list
)), var_t
, entry
);
3645 (yyvsp
[(3) - (3)].var
)->eval
= make_exprl(EXPR_NUM
, last
->eval
->cval
+ 1);
3647 (yyval
.var_list
) = append_var( (yyvsp
[(1) - (3)].var_list
), (yyvsp
[(3) - (3)].var
) );
3653 /* Line 1455 of yacc.c */
3654 #line 597 "parser.y"
3655 { (yyval
.var
) = reg_const((yyvsp
[(1) - (3)].var
));
3656 (yyval
.var
)->eval
= (yyvsp
[(3) - (3)].expr
);
3657 (yyval
.var
)->type
= type_new_int(TYPE_BASIC_INT
, 0);
3663 /* Line 1455 of yacc.c */
3664 #line 601 "parser.y"
3665 { (yyval
.var
) = reg_const((yyvsp
[(1) - (1)].var
));
3666 (yyval
.var
)->type
= type_new_int(TYPE_BASIC_INT
, 0);
3672 /* Line 1455 of yacc.c */
3673 #line 606 "parser.y"
3674 { (yyval
.type
) = type_new_enum((yyvsp
[(2) - (5)].str
), TRUE
, (yyvsp
[(4) - (5)].var_list
)); ;}
3679 /* Line 1455 of yacc.c */
3680 #line 609 "parser.y"
3681 { (yyval
.expr_list
) = append_expr( NULL
, (yyvsp
[(1) - (1)].expr
) ); ;}
3686 /* Line 1455 of yacc.c */
3687 #line 610 "parser.y"
3688 { (yyval
.expr_list
) = append_expr( (yyvsp
[(1) - (3)].expr_list
), (yyvsp
[(3) - (3)].expr
) ); ;}
3693 /* Line 1455 of yacc.c */
3694 #line 623 "parser.y"
3695 { (yyval
.expr
) = make_expr(EXPR_VOID
); ;}
3700 /* Line 1455 of yacc.c */
3701 #line 627 "parser.y"
3702 { (yyval
.expr
) = make_exprl(EXPR_NUM
, (yyvsp
[(1) - (1)].num
)); ;}
3707 /* Line 1455 of yacc.c */
3708 #line 628 "parser.y"
3709 { (yyval
.expr
) = make_exprl(EXPR_HEXNUM
, (yyvsp
[(1) - (1)].num
)); ;}
3714 /* Line 1455 of yacc.c */
3715 #line 629 "parser.y"
3716 { (yyval
.expr
) = make_exprd(EXPR_DOUBLE
, (yyvsp
[(1) - (1)].dbl
)); ;}
3721 /* Line 1455 of yacc.c */
3722 #line 630 "parser.y"
3723 { (yyval
.expr
) = make_exprl(EXPR_TRUEFALSE
, 0); ;}
3728 /* Line 1455 of yacc.c */
3729 #line 631 "parser.y"
3730 { (yyval
.expr
) = make_exprl(EXPR_NUM
, 0); ;}
3735 /* Line 1455 of yacc.c */
3736 #line 632 "parser.y"
3737 { (yyval
.expr
) = make_exprl(EXPR_TRUEFALSE
, 1); ;}
3742 /* Line 1455 of yacc.c */
3743 #line 633 "parser.y"
3744 { (yyval
.expr
) = make_exprs(EXPR_STRLIT
, (yyvsp
[(1) - (1)].str
)); ;}
3749 /* Line 1455 of yacc.c */
3750 #line 634 "parser.y"
3751 { (yyval
.expr
) = make_exprs(EXPR_WSTRLIT
, (yyvsp
[(1) - (1)].str
)); ;}
3756 /* Line 1455 of yacc.c */
3757 #line 635 "parser.y"
3758 { (yyval
.expr
) = make_exprs(EXPR_IDENTIFIER
, (yyvsp
[(1) - (1)].str
)); ;}
3763 /* Line 1455 of yacc.c */
3764 #line 636 "parser.y"
3765 { (yyval
.expr
) = make_expr3(EXPR_COND
, (yyvsp
[(1) - (5)].expr
), (yyvsp
[(3) - (5)].expr
), (yyvsp
[(5) - (5)].expr
)); ;}
3770 /* Line 1455 of yacc.c */
3771 #line 637 "parser.y"
3772 { (yyval
.expr
) = make_expr2(EXPR_LOGOR
, (yyvsp
[(1) - (3)].expr
), (yyvsp
[(3) - (3)].expr
)); ;}
3777 /* Line 1455 of yacc.c */
3778 #line 638 "parser.y"
3779 { (yyval
.expr
) = make_expr2(EXPR_LOGAND
, (yyvsp
[(1) - (3)].expr
), (yyvsp
[(3) - (3)].expr
)); ;}
3784 /* Line 1455 of yacc.c */
3785 #line 639 "parser.y"
3786 { (yyval
.expr
) = make_expr2(EXPR_OR
, (yyvsp
[(1) - (3)].expr
), (yyvsp
[(3) - (3)].expr
)); ;}
3791 /* Line 1455 of yacc.c */
3792 #line 640 "parser.y"
3793 { (yyval
.expr
) = make_expr2(EXPR_XOR
, (yyvsp
[(1) - (3)].expr
), (yyvsp
[(3) - (3)].expr
)); ;}
3798 /* Line 1455 of yacc.c */
3799 #line 641 "parser.y"
3800 { (yyval
.expr
) = make_expr2(EXPR_AND
, (yyvsp
[(1) - (3)].expr
), (yyvsp
[(3) - (3)].expr
)); ;}
3805 /* Line 1455 of yacc.c */
3806 #line 642 "parser.y"
3807 { (yyval
.expr
) = make_expr2(EXPR_EQUALITY
, (yyvsp
[(1) - (3)].expr
), (yyvsp
[(3) - (3)].expr
)); ;}
3812 /* Line 1455 of yacc.c */
3813 #line 643 "parser.y"
3814 { (yyval
.expr
) = make_expr2(EXPR_INEQUALITY
, (yyvsp
[(1) - (3)].expr
), (yyvsp
[(3) - (3)].expr
)); ;}
3819 /* Line 1455 of yacc.c */
3820 #line 644 "parser.y"
3821 { (yyval
.expr
) = make_expr2(EXPR_GTR
, (yyvsp
[(1) - (3)].expr
), (yyvsp
[(3) - (3)].expr
)); ;}
3826 /* Line 1455 of yacc.c */
3827 #line 645 "parser.y"
3828 { (yyval
.expr
) = make_expr2(EXPR_LESS
, (yyvsp
[(1) - (3)].expr
), (yyvsp
[(3) - (3)].expr
)); ;}
3833 /* Line 1455 of yacc.c */
3834 #line 646 "parser.y"
3835 { (yyval
.expr
) = make_expr2(EXPR_GTREQL
, (yyvsp
[(1) - (3)].expr
), (yyvsp
[(3) - (3)].expr
)); ;}
3840 /* Line 1455 of yacc.c */
3841 #line 647 "parser.y"
3842 { (yyval
.expr
) = make_expr2(EXPR_LESSEQL
, (yyvsp
[(1) - (3)].expr
), (yyvsp
[(3) - (3)].expr
)); ;}
3847 /* Line 1455 of yacc.c */
3848 #line 648 "parser.y"
3849 { (yyval
.expr
) = make_expr2(EXPR_SHL
, (yyvsp
[(1) - (3)].expr
), (yyvsp
[(3) - (3)].expr
)); ;}
3854 /* Line 1455 of yacc.c */
3855 #line 649 "parser.y"
3856 { (yyval
.expr
) = make_expr2(EXPR_SHR
, (yyvsp
[(1) - (3)].expr
), (yyvsp
[(3) - (3)].expr
)); ;}
3861 /* Line 1455 of yacc.c */
3862 #line 650 "parser.y"
3863 { (yyval
.expr
) = make_expr2(EXPR_ADD
, (yyvsp
[(1) - (3)].expr
), (yyvsp
[(3) - (3)].expr
)); ;}
3868 /* Line 1455 of yacc.c */
3869 #line 651 "parser.y"
3870 { (yyval
.expr
) = make_expr2(EXPR_SUB
, (yyvsp
[(1) - (3)].expr
), (yyvsp
[(3) - (3)].expr
)); ;}
3875 /* Line 1455 of yacc.c */
3876 #line 652 "parser.y"
3877 { (yyval
.expr
) = make_expr2(EXPR_MOD
, (yyvsp
[(1) - (3)].expr
), (yyvsp
[(3) - (3)].expr
)); ;}
3882 /* Line 1455 of yacc.c */
3883 #line 653 "parser.y"
3884 { (yyval
.expr
) = make_expr2(EXPR_MUL
, (yyvsp
[(1) - (3)].expr
), (yyvsp
[(3) - (3)].expr
)); ;}
3889 /* Line 1455 of yacc.c */
3890 #line 654 "parser.y"
3891 { (yyval
.expr
) = make_expr2(EXPR_DIV
, (yyvsp
[(1) - (3)].expr
), (yyvsp
[(3) - (3)].expr
)); ;}
3896 /* Line 1455 of yacc.c */
3897 #line 655 "parser.y"
3898 { (yyval
.expr
) = make_expr1(EXPR_LOGNOT
, (yyvsp
[(2) - (2)].expr
)); ;}
3903 /* Line 1455 of yacc.c */
3904 #line 656 "parser.y"
3905 { (yyval
.expr
) = make_expr1(EXPR_NOT
, (yyvsp
[(2) - (2)].expr
)); ;}
3910 /* Line 1455 of yacc.c */
3911 #line 657 "parser.y"
3912 { (yyval
.expr
) = make_expr1(EXPR_POS
, (yyvsp
[(2) - (2)].expr
)); ;}
3917 /* Line 1455 of yacc.c */
3918 #line 658 "parser.y"
3919 { (yyval
.expr
) = make_expr1(EXPR_NEG
, (yyvsp
[(2) - (2)].expr
)); ;}
3924 /* Line 1455 of yacc.c */
3925 #line 659 "parser.y"
3926 { (yyval
.expr
) = make_expr1(EXPR_ADDRESSOF
, (yyvsp
[(2) - (2)].expr
)); ;}
3931 /* Line 1455 of yacc.c */
3932 #line 660 "parser.y"
3933 { (yyval
.expr
) = make_expr1(EXPR_PPTR
, (yyvsp
[(2) - (2)].expr
)); ;}
3938 /* Line 1455 of yacc.c */
3939 #line 661 "parser.y"
3940 { (yyval
.expr
) = make_expr2(EXPR_MEMBER
, make_expr1(EXPR_PPTR
, (yyvsp
[(1) - (3)].expr
)), make_exprs(EXPR_IDENTIFIER
, (yyvsp
[(3) - (3)].str
))); ;}
3945 /* Line 1455 of yacc.c */
3946 #line 662 "parser.y"
3947 { (yyval
.expr
) = make_expr2(EXPR_MEMBER
, (yyvsp
[(1) - (3)].expr
), make_exprs(EXPR_IDENTIFIER
, (yyvsp
[(3) - (3)].str
))); ;}
3952 /* Line 1455 of yacc.c */
3953 #line 664 "parser.y"
3954 { (yyval
.expr
) = make_exprt(EXPR_CAST
, declare_var(NULL
, (yyvsp
[(2) - (5)].declspec
), (yyvsp
[(3) - (5)].declarator
), 0), (yyvsp
[(5) - (5)].expr
)); free((yyvsp
[(2) - (5)].declspec
)); free((yyvsp
[(3) - (5)].declarator
)); ;}
3959 /* Line 1455 of yacc.c */
3960 #line 666 "parser.y"
3961 { (yyval
.expr
) = make_exprt(EXPR_SIZEOF
, declare_var(NULL
, (yyvsp
[(3) - (5)].declspec
), (yyvsp
[(4) - (5)].declarator
), 0), NULL
); free((yyvsp
[(3) - (5)].declspec
)); free((yyvsp
[(4) - (5)].declarator
)); ;}
3966 /* Line 1455 of yacc.c */
3967 #line 667 "parser.y"
3968 { (yyval
.expr
) = make_expr2(EXPR_ARRAY
, (yyvsp
[(1) - (4)].expr
), (yyvsp
[(3) - (4)].expr
)); ;}
3973 /* Line 1455 of yacc.c */
3974 #line 668 "parser.y"
3975 { (yyval
.expr
) = (yyvsp
[(2) - (3)].expr
); ;}
3980 /* Line 1455 of yacc.c */
3981 #line 671 "parser.y"
3982 { (yyval
.expr_list
) = append_expr( NULL
, (yyvsp
[(1) - (1)].expr
) ); ;}
3987 /* Line 1455 of yacc.c */
3988 #line 672 "parser.y"
3989 { (yyval
.expr_list
) = append_expr( (yyvsp
[(1) - (3)].expr_list
), (yyvsp
[(3) - (3)].expr
) ); ;}
3994 /* Line 1455 of yacc.c */
3995 #line 675 "parser.y"
3996 { (yyval
.expr
) = (yyvsp
[(1) - (1)].expr
);
3997 if (!(yyval
.expr
)->is_const
)
3998 error_loc("expression is not an integer constant\n");
4004 /* Line 1455 of yacc.c */
4005 #line 681 "parser.y"
4006 { (yyval
.expr
) = (yyvsp
[(1) - (1)].expr
);
4007 if (!(yyval
.expr
)->is_const
&& (yyval
.expr
)->type
!= EXPR_STRLIT
&& (yyval
.expr
)->type
!= EXPR_WSTRLIT
)
4008 error_loc("expression is not constant\n");
4014 /* Line 1455 of yacc.c */
4015 #line 687 "parser.y"
4016 { (yyval
.var_list
) = NULL
; ;}
4021 /* Line 1455 of yacc.c */
4022 #line 688 "parser.y"
4023 { (yyval
.var_list
) = append_var_list((yyvsp
[(1) - (2)].var_list
), (yyvsp
[(2) - (2)].var_list
)); ;}
4028 /* Line 1455 of yacc.c */
4029 #line 692 "parser.y"
4030 { const char *first
= LIST_ENTRY(list_head((yyvsp
[(3) - (4)].declarator_list
)), declarator_t
, entry
)->var
->name
;
4031 check_field_attrs(first
, (yyvsp
[(1) - (4)].attr_list
));
4032 (yyval
.var_list
) = set_var_types((yyvsp
[(1) - (4)].attr_list
), (yyvsp
[(2) - (4)].declspec
), (yyvsp
[(3) - (4)].declarator_list
));
4038 /* Line 1455 of yacc.c */
4039 #line 696 "parser.y"
4040 { var_t
*v
= make_var(NULL
);
4041 v
->type
= (yyvsp
[(2) - (3)].type
); v
->attrs
= (yyvsp
[(1) - (3)].attr_list
);
4042 (yyval
.var_list
) = append_var(NULL
, v
);
4048 /* Line 1455 of yacc.c */
4049 #line 703 "parser.y"
4050 { (yyval
.var
) = (yyvsp
[(1) - (2)].var
); ;}
4055 /* Line 1455 of yacc.c */
4056 #line 704 "parser.y"
4057 { (yyval
.var
) = make_var(NULL
); (yyval
.var
)->attrs
= (yyvsp
[(1) - (2)].attr_list
); ;}
4062 /* Line 1455 of yacc.c */
4063 #line 707 "parser.y"
4064 { (yyval
.var_list
) = NULL
; ;}
4069 /* Line 1455 of yacc.c */
4070 #line 708 "parser.y"
4071 { (yyval
.var_list
) = append_var( (yyvsp
[(1) - (2)].var_list
), (yyvsp
[(2) - (2)].var
) ); ;}
4076 /* Line 1455 of yacc.c */
4077 #line 712 "parser.y"
4078 { (yyval
.var
) = (yyvsp
[(1) - (2)].var
); ;}
4083 /* Line 1455 of yacc.c */
4084 #line 713 "parser.y"
4085 { (yyval
.var
) = NULL
; ;}
4090 /* Line 1455 of yacc.c */
4091 #line 716 "parser.y"
4092 { (yyval
.var
) = declare_var(check_field_attrs((yyvsp
[(3) - (3)].declarator
)->var
->name
, (yyvsp
[(1) - (3)].attr_list
)),
4093 (yyvsp
[(2) - (3)].declspec
), (yyvsp
[(3) - (3)].declarator
), FALSE
);
4094 free((yyvsp
[(3) - (3)].declarator
));
4100 /* Line 1455 of yacc.c */
4101 #line 723 "parser.y"
4103 v
= declare_var(check_function_attrs((yyvsp
[(3) - (3)].declarator
)->var
->name
, (yyvsp
[(1) - (3)].attr_list
)),
4104 (yyvsp
[(2) - (3)].declspec
), (yyvsp
[(3) - (3)].declarator
), FALSE
);
4105 free((yyvsp
[(3) - (3)].declarator
));
4106 (yyval
.func
) = make_func(v
);
4112 /* Line 1455 of yacc.c */
4113 #line 733 "parser.y"
4114 { (yyval
.var
) = declare_var((yyvsp
[(1) - (3)].attr_list
), (yyvsp
[(2) - (3)].declspec
), (yyvsp
[(3) - (3)].declarator
), FALSE
);
4115 free((yyvsp
[(3) - (3)].declarator
));
4121 /* Line 1455 of yacc.c */
4122 #line 736 "parser.y"
4123 { (yyval
.var
) = declare_var(NULL
, (yyvsp
[(1) - (2)].declspec
), (yyvsp
[(2) - (2)].declarator
), FALSE
);
4124 free((yyvsp
[(2) - (2)].declarator
));
4130 /* Line 1455 of yacc.c */
4131 #line 741 "parser.y"
4132 { (yyval
.var
) = NULL
; ;}
4137 /* Line 1455 of yacc.c */
4138 #line 745 "parser.y"
4139 { (yyval
.str
) = NULL
; ;}
4144 /* Line 1455 of yacc.c */
4145 #line 746 "parser.y"
4146 { (yyval
.str
) = (yyvsp
[(1) - (1)].str
); ;}
4151 /* Line 1455 of yacc.c */
4152 #line 747 "parser.y"
4153 { (yyval
.str
) = (yyvsp
[(1) - (1)].str
); ;}
4158 /* Line 1455 of yacc.c */
4159 #line 750 "parser.y"
4160 { (yyval
.var
) = make_var((yyvsp
[(1) - (1)].str
)); ;}
4165 /* Line 1455 of yacc.c */
4166 #line 752 "parser.y"
4167 { (yyval
.var
) = make_var((yyvsp
[(1) - (1)].str
)); ;}
4172 /* Line 1455 of yacc.c */
4173 #line 755 "parser.y"
4174 { (yyval
.type
) = find_type_or_error((yyvsp
[(1) - (1)].str
), 0); ;}
4179 /* Line 1455 of yacc.c */
4180 #line 756 "parser.y"
4181 { (yyval
.type
) = find_type_or_error((yyvsp
[(1) - (1)].str
), 0); ;}
4186 /* Line 1455 of yacc.c */
4187 #line 758 "parser.y"
4188 { (yyval
.type
) = type_new_int(type_basic_get_type((yyvsp
[(2) - (2)].type
)), -1); ;}
4193 /* Line 1455 of yacc.c */
4194 #line 759 "parser.y"
4195 { (yyval
.type
) = type_new_int(type_basic_get_type((yyvsp
[(2) - (2)].type
)), 1); ;}
4200 /* Line 1455 of yacc.c */
4201 #line 760 "parser.y"
4202 { (yyval
.type
) = type_new_int(TYPE_BASIC_INT
, 1); ;}
4207 /* Line 1455 of yacc.c */
4208 #line 761 "parser.y"
4209 { (yyval
.type
) = find_type_or_error((yyvsp
[(1) - (1)].str
), 0); ;}
4214 /* Line 1455 of yacc.c */
4215 #line 762 "parser.y"
4216 { (yyval
.type
) = find_type_or_error((yyvsp
[(1) - (1)].str
), 0); ;}
4221 /* Line 1455 of yacc.c */
4222 #line 763 "parser.y"
4223 { (yyval
.type
) = find_type_or_error((yyvsp
[(1) - (1)].str
), 0); ;}
4228 /* Line 1455 of yacc.c */
4229 #line 764 "parser.y"
4230 { (yyval
.type
) = find_type_or_error((yyvsp
[(1) - (1)].str
), 0); ;}
4235 /* Line 1455 of yacc.c */
4236 #line 765 "parser.y"
4237 { (yyval
.type
) = find_type_or_error((yyvsp
[(1) - (1)].str
), 0); ;}
4242 /* Line 1455 of yacc.c */
4243 #line 772 "parser.y"
4244 { (yyval
.type
) = type_new_int(TYPE_BASIC_INT
, 0); ;}
4249 /* Line 1455 of yacc.c */
4250 #line 773 "parser.y"
4251 { (yyval
.type
) = type_new_int(TYPE_BASIC_INT16
, 0); ;}
4256 /* Line 1455 of yacc.c */
4257 #line 774 "parser.y"
4258 { (yyval
.type
) = type_new_int(TYPE_BASIC_INT8
, 0); ;}
4263 /* Line 1455 of yacc.c */
4264 #line 775 "parser.y"
4265 { (yyval
.type
) = type_new_int(TYPE_BASIC_INT32
, 0); ;}
4270 /* Line 1455 of yacc.c */
4271 #line 776 "parser.y"
4272 { (yyval
.type
) = type_new_int(TYPE_BASIC_HYPER
, 0); ;}
4277 /* Line 1455 of yacc.c */
4278 #line 777 "parser.y"
4279 { (yyval
.type
) = type_new_int(TYPE_BASIC_INT64
, 0); ;}
4284 /* Line 1455 of yacc.c */
4285 #line 778 "parser.y"
4286 { (yyval
.type
) = type_new_int(TYPE_BASIC_CHAR
, 0); ;}
4291 /* Line 1455 of yacc.c */
4292 #line 779 "parser.y"
4293 { (yyval
.type
) = type_new_int(TYPE_BASIC_INT3264
, 0); ;}
4298 /* Line 1455 of yacc.c */
4299 #line 782 "parser.y"
4300 { (yyval
.type
) = type_new_coclass((yyvsp
[(2) - (2)].str
)); ;}
4305 /* Line 1455 of yacc.c */
4306 #line 783 "parser.y"
4307 { (yyval
.type
) = find_type((yyvsp
[(2) - (2)].str
), 0);
4308 if (type_get_type_detect_alias((yyval
.type
)) != TYPE_COCLASS
)
4309 error_loc("%s was not declared a coclass at %s:%d\n",
4310 (yyvsp
[(2) - (2)].str
), (yyval
.type
)->loc_info
.input_name
,
4311 (yyval
.type
)->loc_info
.line_number
);
4317 /* Line 1455 of yacc.c */
4318 #line 791 "parser.y"
4319 { (yyval
.type
) = (yyvsp
[(2) - (2)].type
);
4320 check_def((yyval
.type
));
4321 (yyval
.type
)->attrs
= check_coclass_attrs((yyvsp
[(2) - (2)].type
)->name
, (yyvsp
[(1) - (2)].attr_list
));
4327 /* Line 1455 of yacc.c */
4328 #line 798 "parser.y"
4329 { (yyval
.type
) = type_coclass_define((yyvsp
[(1) - (5)].type
), (yyvsp
[(3) - (5)].ifref_list
)); ;}
4334 /* Line 1455 of yacc.c */
4335 #line 801 "parser.y"
4336 { (yyval
.ifref_list
) = NULL
; ;}
4341 /* Line 1455 of yacc.c */
4342 #line 802 "parser.y"
4343 { (yyval
.ifref_list
) = append_ifref( (yyvsp
[(1) - (2)].ifref_list
), (yyvsp
[(2) - (2)].ifref
) ); ;}
4348 /* Line 1455 of yacc.c */
4349 #line 806 "parser.y"
4350 { (yyval
.ifref
) = make_ifref((yyvsp
[(2) - (2)].type
)); (yyval
.ifref
)->attrs
= (yyvsp
[(1) - (2)].attr_list
); ;}
4355 /* Line 1455 of yacc.c */
4356 #line 809 "parser.y"
4357 { (yyval
.type
) = get_type(TYPE_INTERFACE
, (yyvsp
[(2) - (2)].str
), 0); ;}
4362 /* Line 1455 of yacc.c */
4363 #line 810 "parser.y"
4364 { (yyval
.type
) = get_type(TYPE_INTERFACE
, (yyvsp
[(2) - (2)].str
), 0); ;}
4369 /* Line 1455 of yacc.c */
4370 #line 813 "parser.y"
4372 is_object_interface
= TRUE
;
4373 (yyval
.type
) = (yyvsp
[(2) - (2)].type
);
4374 check_def((yyval
.type
));
4375 attrs
= make_attr(ATTR_DISPINTERFACE
);
4376 (yyval
.type
)->attrs
= append_attr( check_dispiface_attrs((yyvsp
[(2) - (2)].type
)->name
, (yyvsp
[(1) - (2)].attr_list
)), attrs
);
4377 (yyval
.type
)->defined
= TRUE
;
4383 /* Line 1455 of yacc.c */
4384 #line 823 "parser.y"
4385 { (yyval
.var_list
) = NULL
; ;}
4390 /* Line 1455 of yacc.c */
4391 #line 824 "parser.y"
4392 { (yyval
.var_list
) = append_var( (yyvsp
[(1) - (3)].var_list
), (yyvsp
[(2) - (3)].var
) ); ;}
4397 /* Line 1455 of yacc.c */
4398 #line 827 "parser.y"
4399 { (yyval
.stmt_list
) = NULL
; ;}
4404 /* Line 1455 of yacc.c */
4405 #line 828 "parser.y"
4406 { (yyval
.stmt_list
) = append_func( (yyvsp
[(1) - (3)].stmt_list
), (yyvsp
[(2) - (3)].func
) ); ;}
4411 /* Line 1455 of yacc.c */
4412 #line 834 "parser.y"
4413 { (yyval
.type
) = (yyvsp
[(1) - (5)].type
);
4414 type_dispinterface_define((yyval
.type
), (yyvsp
[(3) - (5)].var_list
), (yyvsp
[(4) - (5)].stmt_list
));
4420 /* Line 1455 of yacc.c */
4421 #line 838 "parser.y"
4422 { (yyval
.type
) = (yyvsp
[(1) - (5)].type
);
4423 type_dispinterface_define_from_iface((yyval
.type
), (yyvsp
[(3) - (5)].type
));
4429 /* Line 1455 of yacc.c */
4430 #line 843 "parser.y"
4431 { (yyval
.type
) = NULL
; ;}
4436 /* Line 1455 of yacc.c */
4437 #line 844 "parser.y"
4438 { (yyval
.type
) = find_type_or_error2((yyvsp
[(2) - (2)].str
), 0); ;}
4443 /* Line 1455 of yacc.c */
4444 #line 847 "parser.y"
4445 { (yyval
.type
) = get_type(TYPE_INTERFACE
, (yyvsp
[(2) - (2)].str
), 0); ;}
4450 /* Line 1455 of yacc.c */
4451 #line 848 "parser.y"
4452 { (yyval
.type
) = get_type(TYPE_INTERFACE
, (yyvsp
[(2) - (2)].str
), 0); ;}
4457 /* Line 1455 of yacc.c */
4458 #line 851 "parser.y"
4459 { (yyval
.ifinfo
).interface
= (yyvsp
[(2) - (2)].type
);
4460 (yyval
.ifinfo
).old_pointer_default
= pointer_default
;
4461 if (is_attr((yyvsp
[(1) - (2)].attr_list
), ATTR_POINTERDEFAULT
))
4462 pointer_default
= get_attrv((yyvsp
[(1) - (2)].attr_list
), ATTR_POINTERDEFAULT
);
4463 is_object_interface
= is_object((yyvsp
[(1) - (2)].attr_list
));
4464 check_def((yyvsp
[(2) - (2)].type
));
4465 (yyvsp
[(2) - (2)].type
)->attrs
= check_iface_attrs((yyvsp
[(2) - (2)].type
)->name
, (yyvsp
[(1) - (2)].attr_list
));
4466 (yyvsp
[(2) - (2)].type
)->defined
= TRUE
;
4472 /* Line 1455 of yacc.c */
4473 #line 863 "parser.y"
4474 { (yyval
.type
) = (yyvsp
[(1) - (6)].ifinfo
).interface
;
4475 type_interface_define((yyval
.type
), (yyvsp
[(2) - (6)].type
), (yyvsp
[(4) - (6)].stmt_list
));
4476 pointer_default
= (yyvsp
[(1) - (6)].ifinfo
).old_pointer_default
;
4482 /* Line 1455 of yacc.c */
4483 #line 871 "parser.y"
4484 { (yyval
.type
) = (yyvsp
[(1) - (8)].ifinfo
).interface
;
4485 type_interface_define((yyval
.type
), find_type_or_error2((yyvsp
[(3) - (8)].str
), 0), (yyvsp
[(6) - (8)].stmt_list
));
4486 pointer_default
= (yyvsp
[(1) - (8)].ifinfo
).old_pointer_default
;
4492 /* Line 1455 of yacc.c */
4493 #line 875 "parser.y"
4494 { (yyval
.type
) = (yyvsp
[(1) - (2)].type
); ;}
4499 /* Line 1455 of yacc.c */
4500 #line 879 "parser.y"
4501 { (yyval
.type
) = (yyvsp
[(1) - (2)].type
); ;}
4506 /* Line 1455 of yacc.c */
4507 #line 880 "parser.y"
4508 { (yyval
.type
) = (yyvsp
[(1) - (2)].type
); ;}
4513 /* Line 1455 of yacc.c */
4514 #line 883 "parser.y"
4515 { (yyval
.type
) = type_new_module((yyvsp
[(2) - (2)].str
)); ;}
4520 /* Line 1455 of yacc.c */
4521 #line 884 "parser.y"
4522 { (yyval
.type
) = type_new_module((yyvsp
[(2) - (2)].str
)); ;}
4527 /* Line 1455 of yacc.c */
4528 #line 887 "parser.y"
4529 { (yyval
.type
) = (yyvsp
[(2) - (2)].type
);
4530 (yyval
.type
)->attrs
= check_module_attrs((yyvsp
[(2) - (2)].type
)->name
, (yyvsp
[(1) - (2)].attr_list
));
4536 /* Line 1455 of yacc.c */
4537 #line 893 "parser.y"
4538 { (yyval
.type
) = (yyvsp
[(1) - (5)].type
);
4539 type_module_define((yyval
.type
), (yyvsp
[(3) - (5)].stmt_list
));
4545 /* Line 1455 of yacc.c */
4546 #line 899 "parser.y"
4547 { (yyval
.stgclass
) = STG_EXTERN
; ;}
4552 /* Line 1455 of yacc.c */
4553 #line 900 "parser.y"
4554 { (yyval
.stgclass
) = STG_STATIC
; ;}
4559 /* Line 1455 of yacc.c */
4560 #line 901 "parser.y"
4561 { (yyval
.stgclass
) = STG_REGISTER
; ;}
4566 /* Line 1455 of yacc.c */
4567 #line 905 "parser.y"
4568 { (yyval
.attr
) = make_attr(ATTR_INLINE
); ;}
4573 /* Line 1455 of yacc.c */
4574 #line 909 "parser.y"
4575 { (yyval
.attr
) = make_attr(ATTR_CONST
); ;}
4580 /* Line 1455 of yacc.c */
4581 #line 912 "parser.y"
4582 { (yyval
.attr_list
) = NULL
; ;}
4587 /* Line 1455 of yacc.c */
4588 #line 913 "parser.y"
4589 { (yyval
.attr_list
) = append_attr((yyvsp
[(1) - (2)].attr_list
), (yyvsp
[(2) - (2)].attr
)); ;}
4594 /* Line 1455 of yacc.c */
4595 #line 916 "parser.y"
4596 { (yyval
.declspec
) = make_decl_spec((yyvsp
[(1) - (2)].type
), (yyvsp
[(2) - (2)].declspec
), NULL
, NULL
, STG_NONE
); ;}
4601 /* Line 1455 of yacc.c */
4602 #line 918 "parser.y"
4603 { (yyval
.declspec
) = make_decl_spec((yyvsp
[(2) - (3)].type
), (yyvsp
[(1) - (3)].declspec
), (yyvsp
[(3) - (3)].declspec
), NULL
, STG_NONE
); ;}
4608 /* Line 1455 of yacc.c */
4609 #line 921 "parser.y"
4610 { (yyval
.declspec
) = NULL
; ;}
4615 /* Line 1455 of yacc.c */
4616 #line 926 "parser.y"
4617 { (yyval
.declspec
) = make_decl_spec(NULL
, (yyvsp
[(2) - (2)].declspec
), NULL
, (yyvsp
[(1) - (2)].attr
), STG_NONE
); ;}
4622 /* Line 1455 of yacc.c */
4623 #line 927 "parser.y"
4624 { (yyval
.declspec
) = make_decl_spec(NULL
, (yyvsp
[(2) - (2)].declspec
), NULL
, (yyvsp
[(1) - (2)].attr
), STG_NONE
); ;}
4629 /* Line 1455 of yacc.c */
4630 #line 928 "parser.y"
4631 { (yyval
.declspec
) = make_decl_spec(NULL
, (yyvsp
[(2) - (2)].declspec
), NULL
, NULL
, (yyvsp
[(1) - (2)].stgclass
)); ;}
4636 /* Line 1455 of yacc.c */
4637 #line 933 "parser.y"
4638 { (yyval
.declarator
) = (yyvsp
[(3) - (3)].declarator
); (yyval
.declarator
)->type
= append_ptrchain_type((yyval
.declarator
)->type
, type_new_pointer(pointer_default
, NULL
, (yyvsp
[(2) - (3)].attr_list
))); ;}
4643 /* Line 1455 of yacc.c */
4644 #line 934 "parser.y"
4645 { (yyval
.declarator
) = (yyvsp
[(2) - (2)].declarator
); (yyval
.declarator
)->type
->attrs
= append_attr((yyval
.declarator
)->type
->attrs
, make_attrp(ATTR_CALLCONV
, (yyvsp
[(1) - (2)].str
))); ;}
4650 /* Line 1455 of yacc.c */
4651 #line 939 "parser.y"
4652 { (yyval
.declarator
) = make_declarator((yyvsp
[(1) - (1)].var
)); ;}
4657 /* Line 1455 of yacc.c */
4658 #line 940 "parser.y"
4659 { (yyval
.declarator
) = (yyvsp
[(2) - (3)].declarator
); ;}
4664 /* Line 1455 of yacc.c */
4665 #line 941 "parser.y"
4666 { (yyval
.declarator
) = (yyvsp
[(1) - (2)].declarator
); (yyval
.declarator
)->array
= append_array((yyval
.declarator
)->array
, (yyvsp
[(2) - (2)].expr
)); ;}
4671 /* Line 1455 of yacc.c */
4672 #line 942 "parser.y"
4673 { (yyval
.declarator
) = (yyvsp
[(1) - (4)].declarator
);
4674 (yyval
.declarator
)->func_type
= append_ptrchain_type((yyval
.declarator
)->type
, type_new_function((yyvsp
[(3) - (4)].var_list
)));
4675 (yyval
.declarator
)->type
= NULL
;
4681 /* Line 1455 of yacc.c */
4682 #line 951 "parser.y"
4683 { (yyval
.declarator
) = (yyvsp
[(3) - (3)].declarator
); (yyval
.declarator
)->type
= append_ptrchain_type((yyval
.declarator
)->type
, type_new_pointer(pointer_default
, NULL
, (yyvsp
[(2) - (3)].attr_list
))); ;}
4688 /* Line 1455 of yacc.c */
4689 #line 952 "parser.y"
4690 { (yyval
.declarator
) = (yyvsp
[(2) - (2)].declarator
); (yyval
.declarator
)->type
->attrs
= append_attr((yyval
.declarator
)->type
->attrs
, make_attrp(ATTR_CALLCONV
, (yyvsp
[(1) - (2)].str
))); ;}
4695 /* Line 1455 of yacc.c */
4696 #line 959 "parser.y"
4697 { (yyval
.declarator
) = (yyvsp
[(3) - (3)].declarator
); (yyval
.declarator
)->type
= append_ptrchain_type((yyval
.declarator
)->type
, type_new_pointer(pointer_default
, NULL
, (yyvsp
[(2) - (3)].attr_list
))); ;}
4702 /* Line 1455 of yacc.c */
4703 #line 960 "parser.y"
4704 { (yyval
.declarator
) = (yyvsp
[(2) - (2)].declarator
); (yyval
.declarator
)->type
->attrs
= append_attr((yyval
.declarator
)->type
->attrs
, make_attrp(ATTR_CALLCONV
, (yyvsp
[(1) - (2)].str
))); ;}
4709 /* Line 1455 of yacc.c */
4710 #line 964 "parser.y"
4711 { (yyval
.declarator
) = make_declarator(NULL
); ;}
4716 /* Line 1455 of yacc.c */
4717 #line 970 "parser.y"
4718 { (yyval
.declarator
) = (yyvsp
[(2) - (3)].declarator
); ;}
4723 /* Line 1455 of yacc.c */
4724 #line 971 "parser.y"
4725 { (yyval
.declarator
) = (yyvsp
[(1) - (2)].declarator
); (yyval
.declarator
)->array
= append_array((yyval
.declarator
)->array
, (yyvsp
[(2) - (2)].expr
)); ;}
4730 /* Line 1455 of yacc.c */
4731 #line 972 "parser.y"
4732 { (yyval
.declarator
) = make_declarator(NULL
); (yyval
.declarator
)->array
= append_array((yyval
.declarator
)->array
, (yyvsp
[(1) - (1)].expr
)); ;}
4737 /* Line 1455 of yacc.c */
4738 #line 974 "parser.y"
4739 { (yyval
.declarator
) = make_declarator(NULL
);
4740 (yyval
.declarator
)->func_type
= append_ptrchain_type((yyval
.declarator
)->type
, type_new_function((yyvsp
[(2) - (3)].var_list
)));
4741 (yyval
.declarator
)->type
= NULL
;
4747 /* Line 1455 of yacc.c */
4748 #line 979 "parser.y"
4749 { (yyval
.declarator
) = (yyvsp
[(1) - (4)].declarator
);
4750 (yyval
.declarator
)->func_type
= append_ptrchain_type((yyval
.declarator
)->type
, type_new_function((yyvsp
[(3) - (4)].var_list
)));
4751 (yyval
.declarator
)->type
= NULL
;
4757 /* Line 1455 of yacc.c */
4758 #line 988 "parser.y"
4759 { (yyval
.declarator
) = (yyvsp
[(3) - (3)].declarator
); (yyval
.declarator
)->type
= append_ptrchain_type((yyval
.declarator
)->type
, type_new_pointer(pointer_default
, NULL
, (yyvsp
[(2) - (3)].attr_list
))); ;}
4764 /* Line 1455 of yacc.c */
4765 #line 989 "parser.y"
4766 { (yyval
.declarator
) = (yyvsp
[(2) - (2)].declarator
); (yyval
.declarator
)->type
->attrs
= append_attr((yyval
.declarator
)->type
->attrs
, make_attrp(ATTR_CALLCONV
, (yyvsp
[(1) - (2)].str
))); ;}
4771 /* Line 1455 of yacc.c */
4772 #line 996 "parser.y"
4773 { (yyval
.declarator
) = (yyvsp
[(3) - (3)].declarator
); (yyval
.declarator
)->type
= append_ptrchain_type((yyval
.declarator
)->type
, type_new_pointer(pointer_default
, NULL
, (yyvsp
[(2) - (3)].attr_list
))); ;}
4778 /* Line 1455 of yacc.c */
4779 #line 997 "parser.y"
4780 { (yyval
.declarator
) = (yyvsp
[(2) - (2)].declarator
); (yyval
.declarator
)->type
->attrs
= append_attr((yyval
.declarator
)->type
->attrs
, make_attrp(ATTR_CALLCONV
, (yyvsp
[(1) - (2)].str
))); ;}
4785 /* Line 1455 of yacc.c */
4786 #line 1001 "parser.y"
4787 { (yyval
.declarator
) = make_declarator(NULL
); ;}
4792 /* Line 1455 of yacc.c */
4793 #line 1009 "parser.y"
4794 { (yyval
.declarator
) = make_declarator((yyvsp
[(1) - (1)].var
)); ;}
4799 /* Line 1455 of yacc.c */
4800 #line 1010 "parser.y"
4801 { (yyval
.declarator
) = (yyvsp
[(2) - (3)].declarator
); ;}
4806 /* Line 1455 of yacc.c */
4807 #line 1011 "parser.y"
4808 { (yyval
.declarator
) = (yyvsp
[(1) - (2)].declarator
); (yyval
.declarator
)->array
= append_array((yyval
.declarator
)->array
, (yyvsp
[(2) - (2)].expr
)); ;}
4813 /* Line 1455 of yacc.c */
4814 #line 1012 "parser.y"
4815 { (yyval
.declarator
) = make_declarator(NULL
); (yyval
.declarator
)->array
= append_array((yyval
.declarator
)->array
, (yyvsp
[(1) - (1)].expr
)); ;}
4820 /* Line 1455 of yacc.c */
4821 #line 1014 "parser.y"
4822 { (yyval
.declarator
) = make_declarator(NULL
);
4823 (yyval
.declarator
)->func_type
= append_ptrchain_type((yyval
.declarator
)->type
, type_new_function((yyvsp
[(2) - (3)].var_list
)));
4824 (yyval
.declarator
)->type
= NULL
;
4830 /* Line 1455 of yacc.c */
4831 #line 1019 "parser.y"
4832 { (yyval
.declarator
) = (yyvsp
[(1) - (4)].declarator
);
4833 (yyval
.declarator
)->func_type
= append_ptrchain_type((yyval
.declarator
)->type
, type_new_function((yyvsp
[(3) - (4)].var_list
)));
4834 (yyval
.declarator
)->type
= NULL
;
4840 /* Line 1455 of yacc.c */
4841 #line 1026 "parser.y"
4842 { (yyval
.declarator_list
) = append_declarator( NULL
, (yyvsp
[(1) - (1)].declarator
) ); ;}
4847 /* Line 1455 of yacc.c */
4848 #line 1027 "parser.y"
4849 { (yyval
.declarator_list
) = append_declarator( (yyvsp
[(1) - (3)].declarator_list
), (yyvsp
[(3) - (3)].declarator
) ); ;}
4854 /* Line 1455 of yacc.c */
4855 #line 1030 "parser.y"
4856 { (yyval
.expr
) = NULL
; ;}
4861 /* Line 1455 of yacc.c */
4862 #line 1031 "parser.y"
4863 { (yyval
.expr
) = (yyvsp
[(2) - (2)].expr
); ;}
4868 /* Line 1455 of yacc.c */
4869 #line 1034 "parser.y"
4870 { (yyval
.declarator
) = (yyvsp
[(1) - (2)].declarator
); (yyval
.declarator
)->bits
= (yyvsp
[(2) - (2)].expr
);
4871 if (!(yyval
.declarator
)->bits
&& !(yyval
.declarator
)->var
->name
)
4872 error_loc("unnamed fields are not allowed");
4878 /* Line 1455 of yacc.c */
4879 #line 1041 "parser.y"
4880 { (yyval
.declarator_list
) = append_declarator( NULL
, (yyvsp
[(1) - (1)].declarator
) ); ;}
4885 /* Line 1455 of yacc.c */
4886 #line 1043 "parser.y"
4887 { (yyval
.declarator_list
) = append_declarator( (yyvsp
[(1) - (3)].declarator_list
), (yyvsp
[(3) - (3)].declarator
) ); ;}
4892 /* Line 1455 of yacc.c */
4893 #line 1047 "parser.y"
4894 { (yyval
.declarator
) = (yyvsp
[(1) - (1)].declarator
); ;}
4899 /* Line 1455 of yacc.c */
4900 #line 1048 "parser.y"
4901 { (yyval
.declarator
) = (yyvsp
[(1) - (3)].declarator
); (yyvsp
[(1) - (3)].declarator
)->var
->eval
= (yyvsp
[(3) - (3)].expr
); ;}
4906 /* Line 1455 of yacc.c */
4907 #line 1052 "parser.y"
4908 { (yyval
.num
) = RPC_FC_RP
; ;}
4913 /* Line 1455 of yacc.c */
4914 #line 1053 "parser.y"
4915 { (yyval
.num
) = RPC_FC_UP
; ;}
4920 /* Line 1455 of yacc.c */
4921 #line 1054 "parser.y"
4922 { (yyval
.num
) = RPC_FC_FP
; ;}
4927 /* Line 1455 of yacc.c */
4928 #line 1057 "parser.y"
4929 { (yyval
.type
) = type_new_struct((yyvsp
[(2) - (5)].str
), TRUE
, (yyvsp
[(4) - (5)].var_list
)); ;}
4934 /* Line 1455 of yacc.c */
4935 #line 1060 "parser.y"
4936 { (yyval
.type
) = type_new_void(); ;}
4941 /* Line 1455 of yacc.c */
4942 #line 1061 "parser.y"
4943 { (yyval
.type
) = find_type_or_error((yyvsp
[(1) - (1)].str
), 0); ;}
4948 /* Line 1455 of yacc.c */
4949 #line 1062 "parser.y"
4950 { (yyval
.type
) = (yyvsp
[(1) - (1)].type
); ;}
4955 /* Line 1455 of yacc.c */
4956 #line 1063 "parser.y"
4957 { (yyval
.type
) = (yyvsp
[(1) - (1)].type
); ;}
4962 /* Line 1455 of yacc.c */
4963 #line 1064 "parser.y"
4964 { (yyval
.type
) = type_new_enum((yyvsp
[(2) - (2)].str
), FALSE
, NULL
); ;}
4969 /* Line 1455 of yacc.c */
4970 #line 1065 "parser.y"
4971 { (yyval
.type
) = (yyvsp
[(1) - (1)].type
); ;}
4976 /* Line 1455 of yacc.c */
4977 #line 1066 "parser.y"
4978 { (yyval
.type
) = type_new_struct((yyvsp
[(2) - (2)].str
), FALSE
, NULL
); ;}
4983 /* Line 1455 of yacc.c */
4984 #line 1067 "parser.y"
4985 { (yyval
.type
) = (yyvsp
[(1) - (1)].type
); ;}
4990 /* Line 1455 of yacc.c */
4991 #line 1068 "parser.y"
4992 { (yyval
.type
) = type_new_nonencapsulated_union((yyvsp
[(2) - (2)].str
), FALSE
, NULL
); ;}
4997 /* Line 1455 of yacc.c */
4998 #line 1069 "parser.y"
4999 { (yyval
.type
) = make_safearray((yyvsp
[(3) - (4)].type
)); ;}
5004 /* Line 1455 of yacc.c */
5005 #line 1073 "parser.y"
5006 { reg_typedefs((yyvsp
[(3) - (4)].declspec
), (yyvsp
[(4) - (4)].declarator_list
), check_typedef_attrs((yyvsp
[(2) - (4)].attr_list
)));
5007 (yyval
.statement
) = make_statement_typedef((yyvsp
[(4) - (4)].declarator_list
));
5013 /* Line 1455 of yacc.c */
5014 #line 1079 "parser.y"
5015 { (yyval
.type
) = type_new_nonencapsulated_union((yyvsp
[(2) - (5)].str
), TRUE
, (yyvsp
[(4) - (5)].var_list
)); ;}
5020 /* Line 1455 of yacc.c */
5021 #line 1082 "parser.y"
5022 { (yyval
.type
) = type_new_encapsulated_union((yyvsp
[(2) - (10)].str
), (yyvsp
[(5) - (10)].var
), (yyvsp
[(7) - (10)].var
), (yyvsp
[(9) - (10)].var_list
)); ;}
5027 /* Line 1455 of yacc.c */
5028 #line 1086 "parser.y"
5029 { (yyval
.num
) = MAKEVERSION((yyvsp
[(1) - (1)].num
), 0); ;}
5034 /* Line 1455 of yacc.c */
5035 #line 1087 "parser.y"
5036 { (yyval
.num
) = MAKEVERSION((yyvsp
[(1) - (3)].num
), (yyvsp
[(3) - (3)].num
)); ;}
5041 /* Line 1455 of yacc.c */
5042 #line 5043 "parser.tab.c"
5045 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
5049 YY_STACK_PRINT (yyss
, yyssp
);
5053 /* Now `shift' the result of the reduction. Determine what state
5054 that goes to, based on the state we popped back to and the rule
5055 number reduced by. */
5059 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
5060 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
5061 yystate
= yytable
[yystate
];
5063 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
5068 /*------------------------------------.
5069 | yyerrlab -- here on detecting error |
5070 `------------------------------------*/
5072 /* If not already recovering from an error, report this error. */
5076 #if ! YYERROR_VERBOSE
5077 yyerror (YY_("syntax error"));
5080 YYSIZE_T yysize
= yysyntax_error (0, yystate
, yychar
);
5081 if (yymsg_alloc
< yysize
&& yymsg_alloc
< YYSTACK_ALLOC_MAXIMUM
)
5083 YYSIZE_T yyalloc
= 2 * yysize
;
5084 if (! (yysize
<= yyalloc
&& yyalloc
<= YYSTACK_ALLOC_MAXIMUM
))
5085 yyalloc
= YYSTACK_ALLOC_MAXIMUM
;
5086 if (yymsg
!= yymsgbuf
)
5087 YYSTACK_FREE (yymsg
);
5088 yymsg
= (char *) YYSTACK_ALLOC (yyalloc
);
5090 yymsg_alloc
= yyalloc
;
5094 yymsg_alloc
= sizeof yymsgbuf
;
5098 if (0 < yysize
&& yysize
<= yymsg_alloc
)
5100 (void) yysyntax_error (yymsg
, yystate
, yychar
);
5105 yyerror (YY_("syntax error"));
5107 goto yyexhaustedlab
;
5115 if (yyerrstatus
== 3)
5117 /* If just tried and failed to reuse lookahead token after an
5118 error, discard it. */
5120 if (yychar
<= YYEOF
)
5122 /* Return failure if at end of input. */
5123 if (yychar
== YYEOF
)
5128 yydestruct ("Error: discarding",
5134 /* Else will try to reuse lookahead token after shifting the error
5139 /*---------------------------------------------------.
5140 | yyerrorlab -- error raised explicitly by YYERROR. |
5141 `---------------------------------------------------*/
5144 /* Pacify compilers like GCC when the user code never invokes
5145 YYERROR and the label yyerrorlab therefore never appears in user
5147 if (/*CONSTCOND*/ 0)
5150 /* Do not reclaim the symbols of the rule which action triggered
5154 YY_STACK_PRINT (yyss
, yyssp
);
5159 /*-------------------------------------------------------------.
5160 | yyerrlab1 -- common code for both syntax error and YYERROR. |
5161 `-------------------------------------------------------------*/
5163 yyerrstatus
= 3; /* Each real token shifted decrements this. */
5167 yyn
= yypact
[yystate
];
5168 if (yyn
!= YYPACT_NINF
)
5171 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
5179 /* Pop the current state because it cannot handle the error token. */
5184 yydestruct ("Error: popping",
5185 yystos
[yystate
], yyvsp
);
5188 YY_STACK_PRINT (yyss
, yyssp
);
5194 /* Shift the error token. */
5195 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
5201 /*-------------------------------------.
5202 | yyacceptlab -- YYACCEPT comes here. |
5203 `-------------------------------------*/
5208 /*-----------------------------------.
5209 | yyabortlab -- YYABORT comes here. |
5210 `-----------------------------------*/
5215 #if !defined(yyoverflow) || YYERROR_VERBOSE
5216 /*-------------------------------------------------.
5217 | yyexhaustedlab -- memory exhaustion comes here. |
5218 `-------------------------------------------------*/
5220 yyerror (YY_("memory exhausted"));
5226 if (yychar
!= YYEMPTY
)
5227 yydestruct ("Cleanup: discarding lookahead",
5229 /* Do not reclaim the symbols of the rule which action triggered
5230 this YYABORT or YYACCEPT. */
5232 YY_STACK_PRINT (yyss
, yyssp
);
5233 while (yyssp
!= yyss
)
5235 yydestruct ("Cleanup: popping",
5236 yystos
[*yyssp
], yyvsp
);
5241 YYSTACK_FREE (yyss
);
5244 if (yymsg
!= yymsgbuf
)
5245 YYSTACK_FREE (yymsg
);
5247 /* Make sure YYID is used. */
5248 return YYID (yyresult
);
5253 /* Line 1675 of yacc.c */
5254 #line 1090 "parser.y"
5257 static void decl_builtin_basic(const char *name
, enum type_basic_type type
)
5259 type_t
*t
= type_new_basic(type
);
5260 reg_type(t
, name
, 0);
5263 static void decl_builtin_alias(const char *name
, type_t
*t
)
5265 reg_type(type_new_alias(t
, name
), name
, 0);
5268 void init_types(void)
5270 decl_builtin_basic("byte", TYPE_BASIC_BYTE
);
5271 decl_builtin_basic("wchar_t", TYPE_BASIC_WCHAR
);
5272 decl_builtin_basic("float", TYPE_BASIC_FLOAT
);
5273 decl_builtin_basic("double", TYPE_BASIC_DOUBLE
);
5274 decl_builtin_basic("error_status_t", TYPE_BASIC_ERROR_STATUS_T
);
5275 decl_builtin_basic("handle_t", TYPE_BASIC_HANDLE
);
5276 decl_builtin_alias("boolean", type_new_basic(TYPE_BASIC_BYTE
));
5279 static str_list_t
*append_str(str_list_t
*list
, char *str
)
5281 struct str_list_entry_t
*entry
;
5283 if (!str
) return list
;
5286 list
= xmalloc( sizeof(*list
) );
5289 entry
= xmalloc( sizeof(*entry
) );
5291 list_add_tail( list
, &entry
->entry
);
5295 static attr_list_t
*append_attr(attr_list_t
*list
, attr_t
*attr
)
5297 attr_t
*attr_existing
;
5298 if (!attr
) return list
;
5301 list
= xmalloc( sizeof(*list
) );
5304 LIST_FOR_EACH_ENTRY(attr_existing
, list
, attr_t
, entry
)
5305 if (attr_existing
->type
== attr
->type
)
5307 parser_warning("duplicate attribute %s\n", get_attr_display_name(attr
->type
));
5308 /* use the last attribute, like MIDL does */
5309 list_remove(&attr_existing
->entry
);
5312 list_add_tail( list
, &attr
->entry
);
5316 static attr_list_t
*move_attr(attr_list_t
*dst
, attr_list_t
*src
, enum attr_type type
)
5319 if (!src
) return dst
;
5320 LIST_FOR_EACH_ENTRY(attr
, src
, attr_t
, entry
)
5321 if (attr
->type
== type
)
5323 list_remove(&attr
->entry
);
5324 return append_attr(dst
, attr
);
5329 static attr_list_t
*append_attr_list(attr_list_t
*new_list
, attr_list_t
*old_list
)
5333 if (!old_list
) return new_list
;
5335 while ((entry
= list_head(old_list
)))
5337 attr_t
*attr
= LIST_ENTRY(entry
, attr_t
, entry
);
5339 new_list
= append_attr(new_list
, attr
);
5344 static attr_list_t
*dupattrs(const attr_list_t
*list
)
5346 attr_list_t
*new_list
;
5349 if (!list
) return NULL
;
5351 new_list
= xmalloc( sizeof(*list
) );
5352 list_init( new_list
);
5353 LIST_FOR_EACH_ENTRY(attr
, list
, const attr_t
, entry
)
5355 attr_t
*new_attr
= xmalloc(sizeof(*new_attr
));
5357 list_add_tail(new_list
, &new_attr
->entry
);
5362 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
)
5364 decl_spec_t
*declspec
= left
? left
: right
;
5367 declspec
= xmalloc(sizeof(*declspec
));
5368 declspec
->type
= NULL
;
5369 declspec
->attrs
= NULL
;
5370 declspec
->stgclass
= STG_NONE
;
5372 declspec
->type
= type
;
5373 if (left
&& declspec
!= left
)
5375 declspec
->attrs
= append_attr_list(declspec
->attrs
, left
->attrs
);
5376 if (declspec
->stgclass
== STG_NONE
)
5377 declspec
->stgclass
= left
->stgclass
;
5378 else if (left
->stgclass
!= STG_NONE
)
5379 error_loc("only one storage class can be specified\n");
5380 assert(!left
->type
);
5383 if (right
&& declspec
!= right
)
5385 declspec
->attrs
= append_attr_list(declspec
->attrs
, right
->attrs
);
5386 if (declspec
->stgclass
== STG_NONE
)
5387 declspec
->stgclass
= right
->stgclass
;
5388 else if (right
->stgclass
!= STG_NONE
)
5389 error_loc("only one storage class can be specified\n");
5390 assert(!right
->type
);
5394 declspec
->attrs
= append_attr(declspec
->attrs
, attr
);
5395 if (declspec
->stgclass
== STG_NONE
)
5396 declspec
->stgclass
= stgclass
;
5397 else if (stgclass
!= STG_NONE
)
5398 error_loc("only one storage class can be specified\n");
5400 /* apply attributes to type */
5401 if (type
&& declspec
->attrs
)
5404 declspec
->type
= duptype(type
, 1);
5405 attrs
= dupattrs(type
->attrs
);
5406 declspec
->type
->attrs
= append_attr_list(attrs
, declspec
->attrs
);
5407 declspec
->attrs
= NULL
;
5413 static attr_t
*make_attr(enum attr_type type
)
5415 attr_t
*a
= xmalloc(sizeof(attr_t
));
5421 static attr_t
*make_attrv(enum attr_type type
, unsigned long val
)
5423 attr_t
*a
= xmalloc(sizeof(attr_t
));
5429 static attr_t
*make_attrp(enum attr_type type
, void *val
)
5431 attr_t
*a
= xmalloc(sizeof(attr_t
));
5437 static expr_list_t
*append_expr(expr_list_t
*list
, expr_t
*expr
)
5439 if (!expr
) return list
;
5442 list
= xmalloc( sizeof(*list
) );
5445 list_add_tail( list
, &expr
->entry
);
5449 static array_dims_t
*append_array(array_dims_t
*list
, expr_t
*expr
)
5451 if (!expr
) return list
;
5454 list
= xmalloc( sizeof(*list
) );
5457 list_add_tail( list
, &expr
->entry
);
5461 static struct list type_pool
= LIST_INIT(type_pool
);
5468 type_t
*alloc_type(void)
5470 type_pool_node_t
*node
= xmalloc(sizeof *node
);
5471 list_add_tail(&type_pool
, &node
->link
);
5475 void set_all_tfswrite(int val
)
5477 type_pool_node_t
*node
;
5478 LIST_FOR_EACH_ENTRY(node
, &type_pool
, type_pool_node_t
, link
)
5479 node
->data
.tfswrite
= val
;
5482 void clear_all_offsets(void)
5484 type_pool_node_t
*node
;
5485 LIST_FOR_EACH_ENTRY(node
, &type_pool
, type_pool_node_t
, link
)
5486 node
->data
.typestring_offset
= node
->data
.ptrdesc
= 0;
5489 static void type_function_add_head_arg(type_t
*type
, var_t
*arg
)
5491 if (!type
->details
.function
->args
)
5493 type
->details
.function
->args
= xmalloc( sizeof(*type
->details
.function
->args
) );
5494 list_init( type
->details
.function
->args
);
5496 list_add_head( type
->details
.function
->args
, &arg
->entry
);
5499 static int is_allowed_range_type(const type_t
*type
)
5501 switch (type_get_type(type
))
5506 switch (type_basic_get_type(type
))
5508 case TYPE_BASIC_INT8
:
5509 case TYPE_BASIC_INT16
:
5510 case TYPE_BASIC_INT32
:
5511 case TYPE_BASIC_INT64
:
5512 case TYPE_BASIC_INT
:
5513 case TYPE_BASIC_INT3264
:
5514 case TYPE_BASIC_BYTE
:
5515 case TYPE_BASIC_CHAR
:
5516 case TYPE_BASIC_WCHAR
:
5517 case TYPE_BASIC_HYPER
:
5519 case TYPE_BASIC_FLOAT
:
5520 case TYPE_BASIC_DOUBLE
:
5521 case TYPE_BASIC_ERROR_STATUS_T
:
5522 case TYPE_BASIC_HANDLE
:
5531 static type_t
*append_ptrchain_type(type_t
*ptrchain
, type_t
*type
)
5533 type_t
*ptrchain_type
;
5536 for (ptrchain_type
= ptrchain
; type_pointer_get_ref(ptrchain_type
); ptrchain_type
= type_pointer_get_ref(ptrchain_type
))
5538 assert(ptrchain_type
->type_type
== TYPE_POINTER
);
5539 ptrchain_type
->details
.pointer
.ref
= type
;
5543 static var_t
*declare_var(attr_list_t
*attrs
, decl_spec_t
*decl_spec
, const declarator_t
*decl
,
5546 var_t
*v
= decl
->var
;
5547 expr_list_t
*sizes
= get_attrp(attrs
, ATTR_SIZEIS
);
5548 expr_list_t
*lengs
= get_attrp(attrs
, ATTR_LENGTHIS
);
5552 array_dims_t
*arr
= decl
? decl
->array
: NULL
;
5553 type_t
*func_type
= decl
? decl
->func_type
: NULL
;
5554 type_t
*type
= decl_spec
->type
;
5556 if (is_attr(type
->attrs
, ATTR_INLINE
))
5559 error_loc("inline attribute applied to non-function type\n");
5563 /* move inline attribute from return type node to function node */
5564 for (t
= func_type
; is_ptr(t
); t
= type_pointer_get_ref(t
))
5566 t
->attrs
= move_attr(t
->attrs
, type
->attrs
, ATTR_INLINE
);
5570 /* add type onto the end of the pointers in pident->type */
5571 v
->type
= append_ptrchain_type(decl
? decl
->type
: NULL
, type
);
5572 v
->stgclass
= decl_spec
->stgclass
;
5575 /* check for pointer attribute being applied to non-pointer, non-array
5579 int ptr_attr
= get_attrv(v
->attrs
, ATTR_POINTERTYPE
);
5580 const type_t
*ptr
= NULL
;
5581 /* pointer attributes on the left side of the type belong to the function
5582 * pointer, if one is being declared */
5583 type_t
**pt
= func_type
? &func_type
: &v
->type
;
5584 for (ptr
= *pt
; ptr
&& !ptr_attr
; )
5586 ptr_attr
= get_attrv(ptr
->attrs
, ATTR_POINTERTYPE
);
5587 if (!ptr_attr
&& type_is_alias(ptr
))
5588 ptr
= type_alias_get_aliasee(ptr
);
5594 if (ptr_attr
&& ptr_attr
!= RPC_FC_UP
&&
5595 type_get_type(type_pointer_get_ref(ptr
)) == TYPE_INTERFACE
)
5596 warning_loc_info(&v
->loc_info
,
5597 "%s: pointer attribute applied to interface "
5598 "pointer type has no effect\n", v
->name
);
5599 if (!ptr_attr
&& top
&& (*pt
)->details
.pointer
.def_fc
!= RPC_FC_RP
)
5601 /* FIXME: this is a horrible hack to cope with the issue that we
5602 * store an offset to the typeformat string in the type object, but
5603 * two typeformat strings may be written depending on whether the
5604 * pointer is a toplevel parameter or not */
5605 *pt
= duptype(*pt
, 1);
5609 error_loc("%s: pointer attribute applied to non-pointer type\n", v
->name
);
5612 if (is_attr(v
->attrs
, ATTR_STRING
))
5616 if (!is_ptr(v
->type
) && !arr
)
5617 error_loc("'%s': [string] attribute applied to non-pointer, non-array type\n",
5621 t
= type_pointer_get_ref(t
);
5623 if (type_get_type(t
) != TYPE_BASIC
&&
5624 (get_basic_fc(t
) != RPC_FC_CHAR
&&
5625 get_basic_fc(t
) != RPC_FC_BYTE
&&
5626 get_basic_fc(t
) != RPC_FC_WCHAR
))
5628 error_loc("'%s': [string] attribute is only valid on 'char', 'byte', or 'wchar_t' pointers and arrays\n",
5633 if (is_attr(v
->attrs
, ATTR_V1ENUM
))
5635 if (type_get_type_detect_alias(v
->type
) != TYPE_ENUM
)
5636 error_loc("'%s': [v1_enum] attribute applied to non-enum type\n", v
->name
);
5639 if (is_attr(v
->attrs
, ATTR_RANGE
) && !is_allowed_range_type(v
->type
))
5640 error_loc("'%s': [range] attribute applied to non-integer type\n",
5645 if (arr
) LIST_FOR_EACH_ENTRY_REV(dim
, arr
, expr_t
, entry
)
5648 error_loc("%s: only the first array dimension can be unspecified\n", v
->name
);
5653 error_loc("%s: array dimension must be positive\n", v
->name
);
5655 /* FIXME: should use a type_memsize that allows us to pass in a pointer size */
5658 unsigned int align
= 0;
5659 unsigned int size
= type_memsize(v
->type
, &align
);
5661 if (0xffffffffu
/ size
< dim
->cval
)
5662 error_loc("%s: total array size is too large\n", v
->name
);
5668 *ptype
= type_new_array(NULL
, *ptype
, FALSE
,
5669 dim
->is_const
? dim
->cval
: 0,
5670 dim
->is_const
? NULL
: dim
, NULL
,
5675 if (sizes
) LIST_FOR_EACH_ENTRY(dim
, sizes
, expr_t
, entry
)
5677 if (dim
->type
!= EXPR_VOID
)
5679 if (is_array(*ptype
))
5681 if (type_array_get_conformance(*ptype
)->is_const
)
5682 error_loc("%s: cannot specify size_is for a fixed sized array\n", v
->name
);
5684 *ptype
= type_new_array((*ptype
)->name
,
5685 type_array_get_element(*ptype
), FALSE
,
5688 else if (is_ptr(*ptype
))
5689 *ptype
= type_new_array((*ptype
)->name
, type_pointer_get_ref(*ptype
), TRUE
,
5690 0, dim
, NULL
, pointer_default
);
5692 error_loc("%s: size_is attribute applied to illegal type\n", v
->name
);
5696 ptype
= &(*ptype
)->details
.pointer
.ref
;
5697 else if (is_array(*ptype
))
5698 ptype
= &(*ptype
)->details
.array
.elem
;
5700 error_loc("%s: too many expressions in size_is attribute\n", v
->name
);
5704 if (lengs
) LIST_FOR_EACH_ENTRY(dim
, lengs
, expr_t
, entry
)
5706 if (dim
->type
!= EXPR_VOID
)
5708 if (is_array(*ptype
))
5710 *ptype
= type_new_array((*ptype
)->name
,
5711 type_array_get_element(*ptype
),
5712 type_array_is_decl_as_ptr(*ptype
),
5713 type_array_get_dim(*ptype
),
5714 type_array_get_conformance(*ptype
),
5715 dim
, type_array_get_ptr_default_fc(*ptype
));
5718 error_loc("%s: length_is attribute applied to illegal type\n", v
->name
);
5722 ptype
= &(*ptype
)->details
.pointer
.ref
;
5723 else if (is_array(*ptype
))
5724 ptype
= &(*ptype
)->details
.array
.elem
;
5726 error_loc("%s: too many expressions in length_is attribute\n", v
->name
);
5729 /* v->type is currently pointing to the type on the left-side of the
5730 * declaration, so we need to fix this up so that it is the return type of the
5731 * function and make v->type point to the function side of the declaration */
5735 type_t
*return_type
= v
->type
;
5736 v
->type
= func_type
;
5737 for (ft
= v
->type
; is_ptr(ft
); ft
= type_pointer_get_ref(ft
))
5739 assert(type_get_type_detect_alias(ft
) == TYPE_FUNCTION
);
5740 ft
->details
.function
->rettype
= return_type
;
5741 /* move calling convention attribute, if present, from pointer nodes to
5743 for (t
= v
->type
; is_ptr(t
); t
= type_pointer_get_ref(t
))
5744 ft
->attrs
= move_attr(ft
->attrs
, t
->attrs
, ATTR_CALLCONV
);
5745 if (is_object_interface
&& !is_attr(ft
->attrs
, ATTR_CALLCONV
))
5747 static char *stdmethodcalltype
;
5748 if (!stdmethodcalltype
) stdmethodcalltype
= strdup("STDMETHODCALLTYPE");
5749 ft
->attrs
= append_attr(NULL
, make_attrp(ATTR_CALLCONV
, stdmethodcalltype
));
5755 for (t
= v
->type
; is_ptr(t
); t
= type_pointer_get_ref(t
))
5756 if (is_attr(t
->attrs
, ATTR_CALLCONV
))
5757 error_loc("calling convention applied to non-function-pointer type\n");
5761 v
->type
= type_new_bitfield(v
->type
, decl
->bits
);
5766 static var_list_t
*set_var_types(attr_list_t
*attrs
, decl_spec_t
*decl_spec
, declarator_list_t
*decls
)
5768 declarator_t
*decl
, *next
;
5769 var_list_t
*var_list
= NULL
;
5771 LIST_FOR_EACH_ENTRY_SAFE( decl
, next
, decls
, declarator_t
, entry
)
5773 var_t
*var
= declare_var(attrs
, decl_spec
, decl
, 0);
5774 var_list
= append_var(var_list
, var
);
5781 static ifref_list_t
*append_ifref(ifref_list_t
*list
, ifref_t
*iface
)
5783 if (!iface
) return list
;
5786 list
= xmalloc( sizeof(*list
) );
5789 list_add_tail( list
, &iface
->entry
);
5793 static ifref_t
*make_ifref(type_t
*iface
)
5795 ifref_t
*l
= xmalloc(sizeof(ifref_t
));
5801 var_list_t
*append_var(var_list_t
*list
, var_t
*var
)
5803 if (!var
) return list
;
5806 list
= xmalloc( sizeof(*list
) );
5809 list_add_tail( list
, &var
->entry
);
5813 static var_list_t
*append_var_list(var_list_t
*list
, var_list_t
*vars
)
5815 if (!vars
) return list
;
5818 list
= xmalloc( sizeof(*list
) );
5821 list_move_tail( list
, vars
);
5825 var_t
*make_var(char *name
)
5827 var_t
*v
= xmalloc(sizeof(var_t
));
5832 v
->stgclass
= STG_NONE
;
5833 init_loc_info(&v
->loc_info
);
5837 static declarator_list_t
*append_declarator(declarator_list_t
*list
, declarator_t
*d
)
5839 if (!d
) return list
;
5841 list
= xmalloc(sizeof(*list
));
5844 list_add_tail(list
, &d
->entry
);
5848 static declarator_t
*make_declarator(var_t
*var
)
5850 declarator_t
*d
= xmalloc(sizeof(*d
));
5851 d
->var
= var
? var
: make_var(NULL
);
5853 d
->func_type
= NULL
;
5859 static func_list_t
*append_func(func_list_t
*list
, func_t
*func
)
5861 if (!func
) return list
;
5864 list
= xmalloc( sizeof(*list
) );
5867 list_add_tail( list
, &func
->entry
);
5871 static func_t
*make_func(var_t
*def
)
5873 func_t
*f
= xmalloc(sizeof(func_t
));
5878 static type_t
*make_safearray(type_t
*type
)
5880 return type_new_array(NULL
, type_new_alias(type
, "SAFEARRAY"), TRUE
, 0,
5881 NULL
, NULL
, RPC_FC_RP
);
5884 static typelib_t
*make_library(const char *name
, const attr_list_t
*attrs
)
5886 typelib_t
*typelib
= xmalloc(sizeof(*typelib
));
5887 typelib
->name
= xstrdup(name
);
5888 typelib
->filename
= NULL
;
5889 typelib
->attrs
= attrs
;
5890 list_init( &typelib
->importlibs
);
5896 static int hash_ident(const char *name
)
5898 const char *p
= name
;
5900 /* a simple sum hash is probably good enough */
5905 return sum
& (HASHMAX
-1);
5908 /***** type repository *****/
5917 struct rtype
*type_hash
[HASHMAX
];
5919 type_t
*reg_type(type_t
*type
, const char *name
, int t
)
5924 error_loc("registering named type without name\n");
5927 hash
= hash_ident(name
);
5928 nt
= xmalloc(sizeof(struct rtype
));
5932 nt
->next
= type_hash
[hash
];
5933 type_hash
[hash
] = nt
;
5934 if ((t
== tsSTRUCT
|| t
== tsUNION
))
5935 fix_incomplete_types(type
);
5939 static int is_incomplete(const type_t
*t
)
5941 return !t
->defined
&&
5942 (type_get_type_detect_alias(t
) == TYPE_STRUCT
||
5943 type_get_type_detect_alias(t
) == TYPE_UNION
||
5944 type_get_type_detect_alias(t
) == TYPE_ENCAPSULATED_UNION
);
5947 void add_incomplete(type_t
*t
)
5949 struct typenode
*tn
= xmalloc(sizeof *tn
);
5951 list_add_tail(&incomplete_types
, &tn
->entry
);
5954 static void fix_type(type_t
*t
)
5956 if (type_is_alias(t
) && is_incomplete(t
)) {
5957 type_t
*ot
= type_alias_get_aliasee(t
);
5959 if (type_get_type_detect_alias(ot
) == TYPE_STRUCT
||
5960 type_get_type_detect_alias(ot
) == TYPE_UNION
||
5961 type_get_type_detect_alias(ot
) == TYPE_ENCAPSULATED_UNION
)
5962 t
->details
.structure
= ot
->details
.structure
;
5963 t
->defined
= ot
->defined
;
5967 static void fix_incomplete(void)
5969 struct typenode
*tn
, *next
;
5971 LIST_FOR_EACH_ENTRY_SAFE(tn
, next
, &incomplete_types
, struct typenode
, entry
) {
5973 list_remove(&tn
->entry
);
5978 static void fix_incomplete_types(type_t
*complete_type
)
5980 struct typenode
*tn
, *next
;
5982 LIST_FOR_EACH_ENTRY_SAFE(tn
, next
, &incomplete_types
, struct typenode
, entry
)
5984 if (type_is_equal(complete_type
, tn
->type
))
5986 tn
->type
->details
.structure
= complete_type
->details
.structure
;
5987 list_remove(&tn
->entry
);
5993 static type_t
*reg_typedefs(decl_spec_t
*decl_spec
, declarator_list_t
*decls
, attr_list_t
*attrs
)
5995 const declarator_t
*decl
;
5996 type_t
*type
= decl_spec
->type
;
5998 /* We must generate names for tagless enum, struct or union.
5999 Typedef-ing a tagless enum, struct or union means we want the typedef
6000 to be included in a library hence the public attribute. */
6001 if ((type_get_type_detect_alias(type
) == TYPE_ENUM
||
6002 type_get_type_detect_alias(type
) == TYPE_STRUCT
||
6003 type_get_type_detect_alias(type
) == TYPE_UNION
||
6004 type_get_type_detect_alias(type
) == TYPE_ENCAPSULATED_UNION
) &&
6005 !type
->name
&& !parse_only
)
6007 if (! is_attr(attrs
, ATTR_PUBLIC
))
6008 attrs
= append_attr( attrs
, make_attr(ATTR_PUBLIC
) );
6009 type
->name
= gen_name();
6011 else if (is_attr(attrs
, ATTR_UUID
) && !is_attr(attrs
, ATTR_PUBLIC
))
6012 attrs
= append_attr( attrs
, make_attr(ATTR_PUBLIC
) );
6014 LIST_FOR_EACH_ENTRY( decl
, decls
, const declarator_t
, entry
)
6017 if (decl
->var
->name
) {
6021 cur
= find_type(decl
->var
->name
, 0);
6023 error_loc("%s: redefinition error; original definition was at %s:%d\n",
6024 cur
->name
, cur
->loc_info
.input_name
,
6025 cur
->loc_info
.line_number
);
6027 name
= declare_var(attrs
, decl_spec
, decl
, 0);
6028 cur
= type_new_alias(name
->type
, name
->name
);
6031 if (is_incomplete(cur
))
6032 add_incomplete(cur
);
6033 reg_type(cur
, cur
->name
, 0);
6039 type_t
*find_type(const char *name
, int t
)
6041 struct rtype
*cur
= type_hash
[hash_ident(name
)];
6042 while (cur
&& (cur
->t
!= t
|| strcmp(cur
->name
, name
)))
6044 return cur
? cur
->type
: NULL
;
6047 static type_t
*find_type_or_error(const char *name
, int t
)
6049 type_t
*type
= find_type(name
, t
);
6051 error_loc("type '%s' not found\n", name
);
6057 static type_t
*find_type_or_error2(char *name
, int t
)
6059 type_t
*tp
= find_type_or_error(name
, t
);
6064 int is_type(const char *name
)
6066 return find_type(name
, 0) != NULL
;
6069 type_t
*get_type(enum type_type type
, char *name
, int t
)
6073 tp
= find_type(name
, t
);
6079 tp
= make_type(type
);
6081 if (!name
) return tp
;
6082 return reg_type(tp
, name
, t
);
6085 /***** constant repository *****/
6090 struct rconst
*next
;
6093 struct rconst
*const_hash
[HASHMAX
];
6095 static var_t
*reg_const(var_t
*var
)
6100 error_loc("registering constant without name\n");
6103 hash
= hash_ident(var
->name
);
6104 nc
= xmalloc(sizeof(struct rconst
));
6105 nc
->name
= var
->name
;
6107 nc
->next
= const_hash
[hash
];
6108 const_hash
[hash
] = nc
;
6112 var_t
*find_const(const char *name
, int f
)
6114 struct rconst
*cur
= const_hash
[hash_ident(name
)];
6115 while (cur
&& strcmp(cur
->name
, name
))
6118 if (f
) error_loc("constant '%s' not found\n", name
);
6124 static char *gen_name(void)
6126 static const char format
[] = "__WIDL_%s_generated_name_%08lX";
6127 static unsigned long n
= 0;
6128 static const char *file_id
;
6134 char *dst
= dup_basename(input_name
, ".idl");
6138 if (! isalnum((unsigned char) *dst
))
6141 size
= sizeof format
- 7 + strlen(file_id
) + 8;
6144 name
= xmalloc(size
);
6145 sprintf(name
, format
, file_id
, n
++);
6151 unsigned int dce_compatible
: 1;
6152 unsigned int acf
: 1;
6153 unsigned int on_interface
: 1;
6154 unsigned int on_function
: 1;
6155 unsigned int on_arg
: 1;
6156 unsigned int on_type
: 1;
6157 unsigned int on_enum
: 1;
6158 unsigned int on_struct
: 1;
6159 unsigned int on_union
: 1;
6160 unsigned int on_field
: 1;
6161 unsigned int on_library
: 1;
6162 unsigned int on_dispinterface
: 1;
6163 unsigned int on_module
: 1;
6164 unsigned int on_coclass
: 1;
6165 const char *display_name
;
6168 struct allowed_attr allowed_attr
[] =
6170 /* attr { D ACF I Fn ARG T En St Un Fi L DI M C <display name> } */
6171 /* ATTR_AGGREGATABLE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "aggregatable" },
6172 /* ATTR_ANNOTATION */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "annotation" },
6173 /* ATTR_APPOBJECT */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "appobject" },
6174 /* ATTR_ASYNC */ { 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "async" },
6175 /* ATTR_AUTO_HANDLE */ { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "auto_handle" },
6176 /* ATTR_BINDABLE */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "bindable" },
6177 /* ATTR_BROADCAST */ { 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "broadcast" },
6178 /* ATTR_CALLAS */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "call_as" },
6179 /* ATTR_CALLCONV */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL
},
6180 /* ATTR_CASE */ { 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, "case" },
6181 /* ATTR_CONST */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "const" },
6182 /* ATTR_CONTEXTHANDLE */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "context_handle" },
6183 /* ATTR_CONTROL */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, "control" },
6184 /* ATTR_DEFAULT */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, "default" },
6185 /* ATTR_DEFAULTCOLLELEM */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "defaultcollelem" },
6186 /* ATTR_DEFAULTVALUE */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "defaultvalue" },
6187 /* ATTR_DEFAULTVTABLE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "defaultvtable" },
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_ENDPOINT */ { 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "endpoint" },
6193 /* ATTR_ENTRY */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "entry" },
6194 /* ATTR_EXPLICIT_HANDLE */ { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "explicit_handle" },
6195 /* ATTR_HANDLE */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "handle" },
6196 /* ATTR_HELPCONTEXT */ { 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, "helpcontext" },
6197 /* ATTR_HELPFILE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, "helpfile" },
6198 /* ATTR_HELPSTRING */ { 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, "helpstring" },
6199 /* ATTR_HELPSTRINGCONTEXT */ { 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, "helpstringcontext" },
6200 /* ATTR_HELPSTRINGDLL */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, "helpstringdll" },
6201 /* ATTR_HIDDEN */ { 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, "hidden" },
6202 /* ATTR_ID */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, "id" },
6203 /* ATTR_IDEMPOTENT */ { 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "idempotent" },
6204 /* ATTR_IIDIS */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, "iid_is" },
6205 /* ATTR_IMMEDIATEBIND */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "immediatebind" },
6206 /* ATTR_IMPLICIT_HANDLE */ { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "implicit_handle" },
6207 /* ATTR_IN */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "in" },
6208 /* ATTR_INLINE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "inline" },
6209 /* ATTR_INPUTSYNC */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "inputsync" },
6210 /* ATTR_LENGTHIS */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, "length_is" },
6211 /* ATTR_LIBLCID */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, "lcid" },
6212 /* ATTR_LOCAL */ { 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "local" },
6213 /* ATTR_NONBROWSABLE */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "nonbrowsable" },
6214 /* ATTR_NONCREATABLE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "noncreatable" },
6215 /* ATTR_NONEXTENSIBLE */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "nonextensible" },
6216 /* ATTR_OBJECT */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "object" },
6217 /* ATTR_ODL */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, "odl" },
6218 /* ATTR_OLEAUTOMATION */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "oleautomation" },
6219 /* ATTR_OPTIONAL */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "optional" },
6220 /* ATTR_OUT */ { 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "out" },
6221 /* ATTR_PARAMLCID */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "lcid" },
6222 /* ATTR_POINTERDEFAULT */ { 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "pointer_default" },
6223 /* ATTR_POINTERTYPE */ { 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, "ref, unique or ptr" },
6224 /* ATTR_PROPGET */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "propget" },
6225 /* ATTR_PROPPUT */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "propput" },
6226 /* ATTR_PROPPUTREF */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "propputref" },
6227 /* ATTR_PUBLIC */ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "public" },
6228 /* ATTR_RANGE */ { 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, "range" },
6229 /* ATTR_READONLY */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, "readonly" },
6230 /* ATTR_REQUESTEDIT */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "requestedit" },
6231 /* ATTR_RESTRICTED */ { 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, "restricted" },
6232 /* ATTR_RETVAL */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "retval" },
6233 /* ATTR_SIZEIS */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, "size_is" },
6234 /* ATTR_SOURCE */ { 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, "source" },
6235 /* ATTR_STRICTCONTEXTHANDLE */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "strict_context_handle" },
6236 /* ATTR_STRING */ { 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, "string" },
6237 /* ATTR_SWITCHIS */ { 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, "switch_is" },
6238 /* ATTR_SWITCHTYPE */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, "switch_type" },
6239 /* ATTR_TRANSMITAS */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "transmit_as" },
6240 /* ATTR_UUID */ { 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, "uuid" },
6241 /* ATTR_V1ENUM */ { 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, "v1_enum" },
6242 /* ATTR_VARARG */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "vararg" },
6243 /* ATTR_VERSION */ { 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, "version" },
6244 /* ATTR_WIREMARSHAL */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "wire_marshal" },
6247 const char *get_attr_display_name(enum attr_type type
)
6249 return allowed_attr
[type
].display_name
;
6252 static attr_list_t
*check_iface_attrs(const char *name
, attr_list_t
*attrs
)
6255 if (!attrs
) return attrs
;
6256 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
6258 if (!allowed_attr
[attr
->type
].on_interface
)
6259 error_loc("inapplicable attribute %s for interface %s\n",
6260 allowed_attr
[attr
->type
].display_name
, name
);
6265 static attr_list_t
*check_function_attrs(const char *name
, attr_list_t
*attrs
)
6268 if (!attrs
) return attrs
;
6269 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
6271 if (!allowed_attr
[attr
->type
].on_function
)
6272 error_loc("inapplicable attribute %s for function %s\n",
6273 allowed_attr
[attr
->type
].display_name
, name
);
6278 static void check_arg_attrs(const var_t
*arg
)
6284 LIST_FOR_EACH_ENTRY(attr
, arg
->attrs
, const attr_t
, entry
)
6286 if (!allowed_attr
[attr
->type
].on_arg
)
6287 error_loc("inapplicable attribute %s for argument %s\n",
6288 allowed_attr
[attr
->type
].display_name
, arg
->name
);
6293 static attr_list_t
*check_typedef_attrs(attr_list_t
*attrs
)
6296 if (!attrs
) return attrs
;
6297 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
6299 if (!allowed_attr
[attr
->type
].on_type
)
6300 error_loc("inapplicable attribute %s for typedef\n",
6301 allowed_attr
[attr
->type
].display_name
);
6306 static attr_list_t
*check_enum_attrs(attr_list_t
*attrs
)
6309 if (!attrs
) return attrs
;
6310 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
6312 if (!allowed_attr
[attr
->type
].on_enum
)
6313 error_loc("inapplicable attribute %s for enum\n",
6314 allowed_attr
[attr
->type
].display_name
);
6319 static attr_list_t
*check_struct_attrs(attr_list_t
*attrs
)
6322 if (!attrs
) return attrs
;
6323 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
6325 if (!allowed_attr
[attr
->type
].on_struct
)
6326 error_loc("inapplicable attribute %s for struct\n",
6327 allowed_attr
[attr
->type
].display_name
);
6332 static attr_list_t
*check_union_attrs(attr_list_t
*attrs
)
6335 if (!attrs
) return attrs
;
6336 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
6338 if (!allowed_attr
[attr
->type
].on_union
)
6339 error_loc("inapplicable attribute %s for union\n",
6340 allowed_attr
[attr
->type
].display_name
);
6345 static attr_list_t
*check_field_attrs(const char *name
, attr_list_t
*attrs
)
6348 if (!attrs
) return attrs
;
6349 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
6351 if (!allowed_attr
[attr
->type
].on_field
)
6352 error_loc("inapplicable attribute %s for field %s\n",
6353 allowed_attr
[attr
->type
].display_name
, name
);
6358 static attr_list_t
*check_library_attrs(const char *name
, attr_list_t
*attrs
)
6361 if (!attrs
) return attrs
;
6362 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
6364 if (!allowed_attr
[attr
->type
].on_library
)
6365 error_loc("inapplicable attribute %s for library %s\n",
6366 allowed_attr
[attr
->type
].display_name
, name
);
6371 static attr_list_t
*check_dispiface_attrs(const char *name
, attr_list_t
*attrs
)
6374 if (!attrs
) return attrs
;
6375 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
6377 if (!allowed_attr
[attr
->type
].on_dispinterface
)
6378 error_loc("inapplicable attribute %s for dispinterface %s\n",
6379 allowed_attr
[attr
->type
].display_name
, name
);
6384 static attr_list_t
*check_module_attrs(const char *name
, attr_list_t
*attrs
)
6387 if (!attrs
) return attrs
;
6388 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
6390 if (!allowed_attr
[attr
->type
].on_module
)
6391 error_loc("inapplicable attribute %s for module %s\n",
6392 allowed_attr
[attr
->type
].display_name
, name
);
6397 static attr_list_t
*check_coclass_attrs(const char *name
, attr_list_t
*attrs
)
6400 if (!attrs
) return attrs
;
6401 LIST_FOR_EACH_ENTRY(attr
, attrs
, const attr_t
, entry
)
6403 if (!allowed_attr
[attr
->type
].on_coclass
)
6404 error_loc("inapplicable attribute %s for coclass %s\n",
6405 allowed_attr
[attr
->type
].display_name
, name
);
6410 static int is_allowed_conf_type(const type_t
*type
)
6412 switch (type_get_type(type
))
6417 switch (type_basic_get_type(type
))
6419 case TYPE_BASIC_INT8
:
6420 case TYPE_BASIC_INT16
:
6421 case TYPE_BASIC_INT32
:
6422 case TYPE_BASIC_INT64
:
6423 case TYPE_BASIC_INT
:
6424 case TYPE_BASIC_CHAR
:
6425 case TYPE_BASIC_HYPER
:
6426 case TYPE_BASIC_BYTE
:
6427 case TYPE_BASIC_WCHAR
:
6428 case TYPE_BASIC_ERROR_STATUS_T
:
6434 /* shouldn't get here because of type_get_type call above */
6439 case TYPE_ENCAPSULATED_UNION
:
6446 case TYPE_INTERFACE
:
6453 static int is_ptr_guid_type(const type_t
*type
)
6455 unsigned int align
= 0;
6457 /* first, make sure it is a pointer to something */
6458 if (!is_ptr(type
)) return FALSE
;
6460 /* second, make sure it is a pointer to something of size sizeof(GUID),
6462 return (type_memsize(type_pointer_get_ref(type
), &align
) == 16);
6465 static void check_conformance_expr_list(const char *attr_name
, const var_t
*arg
, const type_t
*container_type
, expr_list_t
*expr_list
)
6468 struct expr_loc expr_loc
;
6470 expr_loc
.attr
= attr_name
;
6471 if (expr_list
) LIST_FOR_EACH_ENTRY(dim
, expr_list
, expr_t
, entry
)
6473 if (dim
->type
!= EXPR_VOID
)
6475 const type_t
*expr_type
= expr_resolve_type(&expr_loc
, container_type
, dim
);
6476 if (!is_allowed_conf_type(expr_type
))
6477 error_loc_info(&arg
->loc_info
, "expression must resolve to integral type <= 32bits for attribute %s\n",
6483 static void check_remoting_fields(const var_t
*var
, type_t
*type
);
6485 /* checks that properties common to fields and arguments are consistent */
6486 static void check_field_common(const type_t
*container_type
,
6487 const char *container_name
, const var_t
*arg
)
6489 type_t
*type
= arg
->type
;
6491 const char *container_type_name
;
6492 const char *var_type
;
6494 switch (type_get_type(container_type
))
6497 container_type_name
= "struct";
6501 container_type_name
= "union";
6504 case TYPE_ENCAPSULATED_UNION
:
6505 container_type_name
= "encapsulated union";
6509 container_type_name
= "function";
6510 var_type
= "parameter";
6513 /* should be no other container types */
6517 if (is_attr(arg
->attrs
, ATTR_LENGTHIS
) &&
6518 (is_attr(arg
->attrs
, ATTR_STRING
) || is_aliaschain_attr(arg
->type
, ATTR_STRING
)))
6519 error_loc_info(&arg
->loc_info
,
6520 "string and length_is specified for argument %s are mutually exclusive attributes\n",
6523 if (is_attr(arg
->attrs
, ATTR_SIZEIS
))
6525 expr_list_t
*size_is_exprs
= get_attrp(arg
->attrs
, ATTR_SIZEIS
);
6526 check_conformance_expr_list("size_is", arg
, container_type
, size_is_exprs
);
6528 if (is_attr(arg
->attrs
, ATTR_LENGTHIS
))
6530 expr_list_t
*length_is_exprs
= get_attrp(arg
->attrs
, ATTR_LENGTHIS
);
6531 check_conformance_expr_list("length_is", arg
, container_type
, length_is_exprs
);
6533 if (is_attr(arg
->attrs
, ATTR_IIDIS
))
6535 struct expr_loc expr_loc
;
6536 expr_t
*expr
= get_attrp(arg
->attrs
, ATTR_IIDIS
);
6537 if (expr
->type
!= EXPR_VOID
)
6539 const type_t
*expr_type
;
6541 expr_loc
.attr
= "iid_is";
6542 expr_type
= expr_resolve_type(&expr_loc
, container_type
, expr
);
6543 if (!expr_type
|| !is_ptr_guid_type(expr_type
))
6544 error_loc_info(&arg
->loc_info
, "expression must resolve to pointer to GUID type for attribute iid_is\n");
6547 if (is_attr(arg
->attrs
, ATTR_SWITCHIS
))
6549 struct expr_loc expr_loc
;
6550 expr_t
*expr
= get_attrp(arg
->attrs
, ATTR_SWITCHIS
);
6551 if (expr
->type
!= EXPR_VOID
)
6553 const type_t
*expr_type
;
6555 expr_loc
.attr
= "switch_is";
6556 expr_type
= expr_resolve_type(&expr_loc
, container_type
, expr
);
6557 if (!expr_type
|| !is_allowed_conf_type(expr_type
))
6558 error_loc_info(&arg
->loc_info
, "expression must resolve to integral type <= 32bits for attribute %s\n",
6567 switch (typegen_detect_type(type
, arg
->attrs
, TDT_IGNORE_STRINGS
))
6571 check_remoting_fields(arg
, type
);
6575 const char *reason
= "is invalid";
6576 switch (type_get_type(type
))
6579 reason
= "cannot derive from void *";
6582 reason
= "cannot be a function pointer";
6585 reason
= "cannot be a bit-field";
6588 reason
= "cannot be a class";
6590 case TYPE_INTERFACE
:
6591 reason
= "cannot be a non-pointer to an interface";
6594 reason
= "cannot be a module";
6599 error_loc_info(&arg
->loc_info
, "%s \'%s\' of %s \'%s\' %s\n",
6600 var_type
, arg
->name
, container_type_name
, container_name
, reason
);
6603 case TGT_CTXT_HANDLE
:
6604 case TGT_CTXT_HANDLE_POINTER
:
6609 const type_t
*t
= type
;
6611 t
= type_pointer_get_ref(t
);
6612 if (is_aliaschain_attr(t
, ATTR_RANGE
))
6613 warning_loc_info(&arg
->loc_info
, "%s: range not verified for a string of ranged types\n", arg
->name
);
6617 type
= type_pointer_get_ref(type
);
6621 type
= type_array_get_element(type
);
6625 case TGT_IFACE_POINTER
:
6632 } while (more_to_do
);
6635 static void check_remoting_fields(const var_t
*var
, type_t
*type
)
6638 const var_list_t
*fields
= NULL
;
6640 type
= type_get_real_type(type
);
6645 type
->checked
= TRUE
;
6647 if (type_get_type(type
) == TYPE_STRUCT
)
6649 if (type_is_complete(type
))
6650 fields
= type_struct_get_fields(type
);
6652 error_loc_info(&var
->loc_info
, "undefined type declaration %s\n", type
->name
);
6654 else if (type_get_type(type
) == TYPE_UNION
|| type_get_type(type
) == TYPE_ENCAPSULATED_UNION
)
6655 fields
= type_union_get_cases(type
);
6657 if (fields
) LIST_FOR_EACH_ENTRY( field
, fields
, const var_t
, entry
)
6658 if (field
->type
) check_field_common(type
, type
->name
, field
);
6661 /* checks that arguments for a function make sense for marshalling and unmarshalling */
6662 static void check_remoting_args(const var_t
*func
)
6664 const char *funcname
= func
->name
;
6667 if (func
->type
->details
.function
->args
) LIST_FOR_EACH_ENTRY( arg
, func
->type
->details
.function
->args
, const var_t
, entry
)
6669 const type_t
*type
= arg
->type
;
6671 /* check that [out] parameters have enough pointer levels */
6672 if (is_attr(arg
->attrs
, ATTR_OUT
))
6674 switch (typegen_detect_type(type
, arg
->attrs
, TDT_ALL_TYPES
))
6681 case TGT_CTXT_HANDLE
:
6683 error_loc_info(&arg
->loc_info
, "out parameter \'%s\' of function \'%s\' is not a pointer\n", arg
->name
, funcname
);
6685 case TGT_IFACE_POINTER
:
6686 error_loc_info(&arg
->loc_info
, "out interface pointer \'%s\' of function \'%s\' is not a double pointer\n", arg
->name
, funcname
);
6689 if (!is_array(type
))
6695 /* already error'd before we get here */
6696 case TGT_CTXT_HANDLE_POINTER
:
6704 check_field_common(func
->type
, funcname
, arg
);
6707 if (type_get_type(type_function_get_rettype(func
->type
)) != TYPE_VOID
)
6711 var
.type
= type_function_get_rettype(func
->type
);
6712 var
.name
= xstrdup("return value");
6713 check_field_common(func
->type
, funcname
, &var
);
6718 static void add_explicit_handle_if_necessary(var_t
*func
)
6720 const var_t
* explicit_handle_var
;
6721 const var_t
* explicit_generic_handle_var
= NULL
;
6722 const var_t
* context_handle_var
= NULL
;
6724 /* check for a defined binding handle */
6725 explicit_handle_var
= get_explicit_handle_var(func
);
6726 if (!explicit_handle_var
)
6728 explicit_generic_handle_var
= get_explicit_generic_handle_var(func
);
6729 if (!explicit_generic_handle_var
)
6731 context_handle_var
= get_context_handle_var(func
);
6732 if (!context_handle_var
)
6734 /* no explicit handle specified so add
6735 * "[in] handle_t IDL_handle" as the first parameter to the
6737 var_t
*idl_handle
= make_var(xstrdup("IDL_handle"));
6738 idl_handle
->attrs
= append_attr(NULL
, make_attr(ATTR_IN
));
6739 idl_handle
->type
= find_type_or_error("handle_t", 0);
6740 type_function_add_head_arg(func
->type
, idl_handle
);
6746 static void check_functions(const type_t
*iface
, int is_inside_library
)
6748 const statement_t
*stmt
;
6749 if (is_attr(iface
->attrs
, ATTR_EXPLICIT_HANDLE
))
6751 STATEMENTS_FOR_EACH_FUNC( stmt
, type_iface_get_stmts(iface
) )
6753 var_t
*func
= stmt
->u
.var
;
6754 add_explicit_handle_if_necessary(func
);
6757 if (!is_inside_library
&& !is_attr(iface
->attrs
, ATTR_LOCAL
))
6759 STATEMENTS_FOR_EACH_FUNC( stmt
, type_iface_get_stmts(iface
) )
6761 const var_t
*func
= stmt
->u
.var
;
6762 if (!is_attr(func
->attrs
, ATTR_LOCAL
))
6763 check_remoting_args(func
);
6768 static void check_statements(const statement_list_t
*stmts
, int is_inside_library
)
6770 const statement_t
*stmt
;
6772 if (stmts
) LIST_FOR_EACH_ENTRY(stmt
, stmts
, const statement_t
, entry
)
6774 if (stmt
->type
== STMT_LIBRARY
)
6775 check_statements(stmt
->u
.lib
->stmts
, TRUE
);
6776 else if (stmt
->type
== STMT_TYPE
&& type_get_type(stmt
->u
.type
) == TYPE_INTERFACE
)
6777 check_functions(stmt
->u
.type
, is_inside_library
);
6781 static void check_all_user_types(const statement_list_t
*stmts
)
6783 const statement_t
*stmt
;
6785 if (stmts
) LIST_FOR_EACH_ENTRY(stmt
, stmts
, const statement_t
, entry
)
6787 if (stmt
->type
== STMT_LIBRARY
)
6788 check_all_user_types(stmt
->u
.lib
->stmts
);
6789 else if (stmt
->type
== STMT_TYPE
&& type_get_type(stmt
->u
.type
) == TYPE_INTERFACE
&&
6790 !is_local(stmt
->u
.type
->attrs
))
6792 const statement_t
*stmt_func
;
6793 STATEMENTS_FOR_EACH_FUNC(stmt_func
, type_iface_get_stmts(stmt
->u
.type
)) {
6794 const var_t
*func
= stmt_func
->u
.var
;
6795 check_for_additional_prototype_types(func
->type
->details
.function
->args
);
6801 int is_valid_uuid(const char *s
)
6805 for (i
= 0; i
< 36; ++i
)
6806 if (i
== 8 || i
== 13 || i
== 18 || i
== 23)
6812 if (!isxdigit(s
[i
]))
6815 return s
[i
] == '\0';
6818 static statement_t
*make_statement(enum statement_type type
)
6820 statement_t
*stmt
= xmalloc(sizeof(*stmt
));
6825 static statement_t
*make_statement_type_decl(type_t
*type
)
6827 statement_t
*stmt
= make_statement(STMT_TYPE
);
6828 stmt
->u
.type
= type
;
6832 static statement_t
*make_statement_reference(type_t
*type
)
6834 statement_t
*stmt
= make_statement(STMT_TYPEREF
);
6835 stmt
->u
.type
= type
;
6839 static statement_t
*make_statement_declaration(var_t
*var
)
6841 statement_t
*stmt
= make_statement(STMT_DECLARATION
);
6843 if (var
->stgclass
== STG_EXTERN
&& var
->eval
)
6844 warning("'%s' initialised and declared extern\n", var
->name
);
6845 if (is_const_decl(var
))
6850 else if (type_get_type(var
->type
) == TYPE_FUNCTION
)
6851 check_function_attrs(var
->name
, var
->attrs
);
6852 else if (var
->stgclass
== STG_NONE
|| var
->stgclass
== STG_REGISTER
)
6853 error_loc("instantiation of data is illegal\n");
6857 static statement_t
*make_statement_library(typelib_t
*typelib
)
6859 statement_t
*stmt
= make_statement(STMT_LIBRARY
);
6860 stmt
->u
.lib
= typelib
;
6864 static statement_t
*make_statement_cppquote(const char *str
)
6866 statement_t
*stmt
= make_statement(STMT_CPPQUOTE
);
6871 static statement_t
*make_statement_importlib(const char *str
)
6873 statement_t
*stmt
= make_statement(STMT_IMPORTLIB
);
6878 static statement_t
*make_statement_import(const char *str
)
6880 statement_t
*stmt
= make_statement(STMT_IMPORT
);
6885 static statement_t
*make_statement_module(type_t
*type
)
6887 statement_t
*stmt
= make_statement(STMT_MODULE
);
6888 stmt
->u
.type
= type
;
6892 static statement_t
*make_statement_typedef(declarator_list_t
*decls
)
6894 declarator_t
*decl
, *next
;
6896 type_list_t
**type_list
;
6898 if (!decls
) return NULL
;
6900 stmt
= make_statement(STMT_TYPEDEF
);
6901 stmt
->u
.type_list
= NULL
;
6902 type_list
= &stmt
->u
.type_list
;
6904 LIST_FOR_EACH_ENTRY_SAFE( decl
, next
, decls
, declarator_t
, entry
)
6906 var_t
*var
= decl
->var
;
6907 type_t
*type
= find_type_or_error(var
->name
, 0);
6908 *type_list
= xmalloc(sizeof(type_list_t
));
6909 (*type_list
)->type
= type
;
6910 (*type_list
)->next
= NULL
;
6912 type_list
= &(*type_list
)->next
;
6920 static statement_list_t
*append_statement(statement_list_t
*list
, statement_t
*stmt
)
6922 if (!stmt
) return list
;
6925 list
= xmalloc( sizeof(*list
) );
6928 list_add_tail( list
, &stmt
->entry
);
6932 void init_loc_info(loc_info_t
*i
)
6934 i
->input_name
= input_name
? input_name
: "stdin";
6935 i
->line_number
= line_number
;
6936 i
->near_text
= parser_text
;
6939 static void check_def(const type_t
*t
)
6942 error_loc("%s: redefinition error; original definition was at %s:%d\n",
6943 t
->name
, t
->loc_info
.input_name
, t
->loc_info
.line_number
);