[MKHIVE] Minor improvements.
[reactos.git] / sdk / tools / widl / parser.tab.c
1 /* A Bison parser, made by GNU Bison 3.0. */
2
3 /* Bison implementation for Yacc-like parsers in C
4
5 Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
6
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
19
20 /* As a special exception, you may create a larger work that contains
21 part or all of the Bison parser skeleton and distribute that work
22 under terms of your choice, so long as that work isn't itself a
23 parser generator using the skeleton or a modified version thereof
24 as a parser skeleton. Alternatively, if you modify or redistribute
25 the parser skeleton itself, you may (at your option) remove this
26 special exception, which will cause the skeleton and the resulting
27 Bison output files to be licensed under the GNU General Public
28 License without this special exception.
29
30 This special exception was added by the Free Software Foundation in
31 version 2.2 of Bison. */
32
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34 simplifying the original so-called "semantic" parser. */
35
36 /* All symbols defined below should begin with yy or YY, to avoid
37 infringing on user name space. This should be done even for local
38 variables, as they might otherwise be expanded by user macros.
39 There are some unavoidable exceptions within include files to
40 define necessary library symbols; they are noted "INFRINGES ON
41 USER NAME SPACE" below. */
42
43 /* Identify Bison output. */
44 #define YYBISON 1
45
46 /* Bison version. */
47 #define YYBISON_VERSION "3.0"
48
49 /* Skeleton name. */
50 #define YYSKELETON_NAME "yacc.c"
51
52 /* Pure parsers. */
53 #define YYPURE 0
54
55 /* Push parsers. */
56 #define YYPUSH 0
57
58 /* Pull parsers. */
59 #define YYPULL 1
60
61
62 /* Substitute the variable and function names. */
63 #define yyparse parser_parse
64 #define yylex parser_lex
65 #define yyerror parser_error
66 #define yydebug parser_debug
67 #define yynerrs parser_nerrs
68
69 #define yylval parser_lval
70 #define yychar parser_char
71
72 /* Copy the first part of user declarations. */
73 #line 1 "parser.y" /* yacc.c:339 */
74
75 /*
76 * IDL Compiler
77 *
78 * Copyright 2002 Ove Kaaven
79 * Copyright 2006-2008 Robert Shearman
80 *
81 * This library is free software; you can redistribute it and/or
82 * modify it under the terms of the GNU Lesser General Public
83 * License as published by the Free Software Foundation; either
84 * version 2.1 of the License, or (at your option) any later version.
85 *
86 * This library is distributed in the hope that it will be useful,
87 * but WITHOUT ANY WARRANTY; without even the implied warranty of
88 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
89 * Lesser General Public License for more details.
90 *
91 * You should have received a copy of the GNU Lesser General Public
92 * License along with this library; if not, write to the Free Software
93 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
94 */
95
96 #include "config.h"
97
98 #include <stdio.h>
99 #include <stdlib.h>
100 #include <stdarg.h>
101 #include <assert.h>
102 #include <ctype.h>
103 #include <string.h>
104
105 #include "widl.h"
106 #include "utils.h"
107 #include "parser.h"
108 #include "header.h"
109 #include "typelib.h"
110 #include "typegen.h"
111 #include "expr.h"
112 #include "typetree.h"
113
114 static unsigned char pointer_default = RPC_FC_UP;
115
116 typedef struct list typelist_t;
117 struct typenode {
118 type_t *type;
119 struct list entry;
120 };
121
122 struct _import_t
123 {
124 char *name;
125 int import_performed;
126 };
127
128 typedef struct _decl_spec_t
129 {
130 type_t *type;
131 attr_list_t *attrs;
132 enum storage_class stgclass;
133 } decl_spec_t;
134
135 typelist_t incomplete_types = LIST_INIT(incomplete_types);
136
137 static void fix_incomplete(void);
138 static void fix_incomplete_types(type_t *complete_type);
139
140 static str_list_t *append_str(str_list_t *list, char *str);
141 static attr_list_t *append_attr(attr_list_t *list, attr_t *attr);
142 static attr_list_t *append_attr_list(attr_list_t *new_list, attr_list_t *old_list);
143 static decl_spec_t *make_decl_spec(type_t *type, decl_spec_t *left, decl_spec_t *right, attr_t *attr, enum storage_class stgclass);
144 static attr_t *make_attr(enum attr_type type);
145 static attr_t *make_attrv(enum attr_type type, unsigned int val);
146 static attr_t *make_attrp(enum attr_type type, void *val);
147 static expr_list_t *append_expr(expr_list_t *list, expr_t *expr);
148 static array_dims_t *append_array(array_dims_t *list, expr_t *expr);
149 static var_t *declare_var(attr_list_t *attrs, decl_spec_t *decl_spec, const declarator_t *decl, int top);
150 static var_list_t *set_var_types(attr_list_t *attrs, decl_spec_t *decl_spec, declarator_list_t *decls);
151 static ifref_list_t *append_ifref(ifref_list_t *list, ifref_t *iface);
152 static ifref_t *make_ifref(type_t *iface);
153 static var_list_t *append_var_list(var_list_t *list, var_list_t *vars);
154 static declarator_list_t *append_declarator(declarator_list_t *list, declarator_t *p);
155 static declarator_t *make_declarator(var_t *var);
156 static type_t *make_safearray(type_t *type);
157 static typelib_t *make_library(const char *name, const attr_list_t *attrs);
158 static type_t *append_ptrchain_type(type_t *ptrchain, type_t *type);
159 static warning_list_t *append_warning(warning_list_t *, int);
160
161 static type_t *reg_typedefs(decl_spec_t *decl_spec, var_list_t *names, attr_list_t *attrs);
162 static type_t *find_type_or_error(const char *name, int t);
163 static type_t *find_type_or_error2(char *name, int t);
164
165 static var_t *reg_const(var_t *var);
166
167 static void push_namespace(const char *name);
168 static void pop_namespace(const char *name);
169
170 static char *gen_name(void);
171 static void check_arg_attrs(const var_t *arg);
172 static void check_statements(const statement_list_t *stmts, int is_inside_library);
173 static void check_all_user_types(const statement_list_t *stmts);
174 static attr_list_t *check_iface_attrs(const char *name, attr_list_t *attrs);
175 static attr_list_t *check_function_attrs(const char *name, attr_list_t *attrs);
176 static attr_list_t *check_typedef_attrs(attr_list_t *attrs);
177 static attr_list_t *check_enum_attrs(attr_list_t *attrs);
178 static attr_list_t *check_struct_attrs(attr_list_t *attrs);
179 static attr_list_t *check_union_attrs(attr_list_t *attrs);
180 static attr_list_t *check_field_attrs(const char *name, attr_list_t *attrs);
181 static attr_list_t *check_library_attrs(const char *name, attr_list_t *attrs);
182 static attr_list_t *check_dispiface_attrs(const char *name, attr_list_t *attrs);
183 static attr_list_t *check_module_attrs(const char *name, attr_list_t *attrs);
184 static attr_list_t *check_coclass_attrs(const char *name, attr_list_t *attrs);
185 const char *get_attr_display_name(enum attr_type type);
186 static void add_explicit_handle_if_necessary(const type_t *iface, var_t *func);
187 static void check_def(const type_t *t);
188
189 static statement_t *make_statement(enum statement_type type);
190 static statement_t *make_statement_type_decl(type_t *type);
191 static statement_t *make_statement_reference(type_t *type);
192 static statement_t *make_statement_declaration(var_t *var);
193 static statement_t *make_statement_library(typelib_t *typelib);
194 static statement_t *make_statement_pragma(const char *str);
195 static statement_t *make_statement_cppquote(const char *str);
196 static statement_t *make_statement_importlib(const char *str);
197 static statement_t *make_statement_module(type_t *type);
198 static statement_t *make_statement_typedef(var_list_t *names);
199 static statement_t *make_statement_import(const char *str);
200 static statement_list_t *append_statement(statement_list_t *list, statement_t *stmt);
201 static statement_list_t *append_statements(statement_list_t *, statement_list_t *);
202 static attr_list_t *append_attribs(attr_list_t *, attr_list_t *);
203
204 static struct namespace global_namespace = {
205 NULL, NULL, LIST_INIT(global_namespace.entry), LIST_INIT(global_namespace.children)
206 };
207
208 static struct namespace *current_namespace = &global_namespace;
209
210
211 #line 212 "parser.tab.c" /* yacc.c:339 */
212
213 # ifndef YY_NULL
214 # if defined __cplusplus && 201103L <= __cplusplus
215 # define YY_NULL nullptr
216 # else
217 # define YY_NULL 0
218 # endif
219 # endif
220
221 /* Enabling verbose error messages. */
222 #ifdef YYERROR_VERBOSE
223 # undef YYERROR_VERBOSE
224 # define YYERROR_VERBOSE 1
225 #else
226 # define YYERROR_VERBOSE 1
227 #endif
228
229 /* In a future release of Bison, this section will be replaced
230 by #include "parser.tab.h". */
231 #ifndef YY_PARSER_E_REACTOSSYNC_GCC_HOST_TOOLS_SDK_TOOLS_WIDL_PARSER_TAB_H_INCLUDED
232 # define YY_PARSER_E_REACTOSSYNC_GCC_HOST_TOOLS_SDK_TOOLS_WIDL_PARSER_TAB_H_INCLUDED
233 /* Debug traces. */
234 #ifndef YYDEBUG
235 # define YYDEBUG 0
236 #endif
237 #if YYDEBUG
238 extern int parser_debug;
239 #endif
240
241 /* Token type. */
242 #ifndef YYTOKENTYPE
243 # define YYTOKENTYPE
244 enum yytokentype
245 {
246 aIDENTIFIER = 258,
247 aPRAGMA = 259,
248 aKNOWNTYPE = 260,
249 aNUM = 261,
250 aHEXNUM = 262,
251 aDOUBLE = 263,
252 aSTRING = 264,
253 aWSTRING = 265,
254 aSQSTRING = 266,
255 aUUID = 267,
256 aEOF = 268,
257 SHL = 269,
258 SHR = 270,
259 MEMBERPTR = 271,
260 EQUALITY = 272,
261 INEQUALITY = 273,
262 GREATEREQUAL = 274,
263 LESSEQUAL = 275,
264 LOGICALOR = 276,
265 LOGICALAND = 277,
266 ELLIPSIS = 278,
267 tAGGREGATABLE = 279,
268 tALLOCATE = 280,
269 tANNOTATION = 281,
270 tAPPOBJECT = 282,
271 tASYNC = 283,
272 tASYNCUUID = 284,
273 tAUTOHANDLE = 285,
274 tBINDABLE = 286,
275 tBOOLEAN = 287,
276 tBROADCAST = 288,
277 tBYTE = 289,
278 tBYTECOUNT = 290,
279 tCALLAS = 291,
280 tCALLBACK = 292,
281 tCASE = 293,
282 tCDECL = 294,
283 tCHAR = 295,
284 tCOCLASS = 296,
285 tCODE = 297,
286 tCOMMSTATUS = 298,
287 tCONST = 299,
288 tCONTEXTHANDLE = 300,
289 tCONTEXTHANDLENOSERIALIZE = 301,
290 tCONTEXTHANDLESERIALIZE = 302,
291 tCONTROL = 303,
292 tCPPQUOTE = 304,
293 tDECODE = 305,
294 tDEFAULT = 306,
295 tDEFAULTBIND = 307,
296 tDEFAULTCOLLELEM = 308,
297 tDEFAULTVALUE = 309,
298 tDEFAULTVTABLE = 310,
299 tDISABLECONSISTENCYCHECK = 311,
300 tDISPLAYBIND = 312,
301 tDISPINTERFACE = 313,
302 tDLLNAME = 314,
303 tDOUBLE = 315,
304 tDUAL = 316,
305 tENABLEALLOCATE = 317,
306 tENCODE = 318,
307 tENDPOINT = 319,
308 tENTRY = 320,
309 tENUM = 321,
310 tERRORSTATUST = 322,
311 tEXPLICITHANDLE = 323,
312 tEXTERN = 324,
313 tFALSE = 325,
314 tFASTCALL = 326,
315 tFAULTSTATUS = 327,
316 tFLOAT = 328,
317 tFORCEALLOCATE = 329,
318 tHANDLE = 330,
319 tHANDLET = 331,
320 tHELPCONTEXT = 332,
321 tHELPFILE = 333,
322 tHELPSTRING = 334,
323 tHELPSTRINGCONTEXT = 335,
324 tHELPSTRINGDLL = 336,
325 tHIDDEN = 337,
326 tHYPER = 338,
327 tID = 339,
328 tIDEMPOTENT = 340,
329 tIGNORE = 341,
330 tIIDIS = 342,
331 tIMMEDIATEBIND = 343,
332 tIMPLICITHANDLE = 344,
333 tIMPORT = 345,
334 tIMPORTLIB = 346,
335 tIN = 347,
336 tIN_LINE = 348,
337 tINLINE = 349,
338 tINPUTSYNC = 350,
339 tINT = 351,
340 tINT3264 = 352,
341 tINT64 = 353,
342 tINTERFACE = 354,
343 tLCID = 355,
344 tLENGTHIS = 356,
345 tLIBRARY = 357,
346 tLICENSED = 358,
347 tLOCAL = 359,
348 tLONG = 360,
349 tMAYBE = 361,
350 tMESSAGE = 362,
351 tMETHODS = 363,
352 tMODULE = 364,
353 tNAMESPACE = 365,
354 tNOCODE = 366,
355 tNONBROWSABLE = 367,
356 tNONCREATABLE = 368,
357 tNONEXTENSIBLE = 369,
358 tNOTIFY = 370,
359 tNOTIFYFLAG = 371,
360 tNULL = 372,
361 tOBJECT = 373,
362 tODL = 374,
363 tOLEAUTOMATION = 375,
364 tOPTIMIZE = 376,
365 tOPTIONAL = 377,
366 tOUT = 378,
367 tPARTIALIGNORE = 379,
368 tPASCAL = 380,
369 tPOINTERDEFAULT = 381,
370 tPRAGMA_WARNING = 382,
371 tPROGID = 383,
372 tPROPERTIES = 384,
373 tPROPGET = 385,
374 tPROPPUT = 386,
375 tPROPPUTREF = 387,
376 tPROXY = 388,
377 tPTR = 389,
378 tPUBLIC = 390,
379 tRANGE = 391,
380 tREADONLY = 392,
381 tREF = 393,
382 tREGISTER = 394,
383 tREPRESENTAS = 395,
384 tREQUESTEDIT = 396,
385 tRESTRICTED = 397,
386 tRETVAL = 398,
387 tSAFEARRAY = 399,
388 tSHORT = 400,
389 tSIGNED = 401,
390 tSIZEIS = 402,
391 tSIZEOF = 403,
392 tSMALL = 404,
393 tSOURCE = 405,
394 tSTATIC = 406,
395 tSTDCALL = 407,
396 tSTRICTCONTEXTHANDLE = 408,
397 tSTRING = 409,
398 tSTRUCT = 410,
399 tSWITCH = 411,
400 tSWITCHIS = 412,
401 tSWITCHTYPE = 413,
402 tTHREADING = 414,
403 tTRANSMITAS = 415,
404 tTRUE = 416,
405 tTYPEDEF = 417,
406 tUIDEFAULT = 418,
407 tUNION = 419,
408 tUNIQUE = 420,
409 tUNSIGNED = 421,
410 tUSESGETLASTERROR = 422,
411 tUSERMARSHAL = 423,
412 tUUID = 424,
413 tV1ENUM = 425,
414 tVARARG = 426,
415 tVERSION = 427,
416 tVIPROGID = 428,
417 tVOID = 429,
418 tWCHAR = 430,
419 tWIREMARSHAL = 431,
420 tAPARTMENT = 432,
421 tNEUTRAL = 433,
422 tSINGLE = 434,
423 tFREE = 435,
424 tBOTH = 436,
425 CAST = 437,
426 PPTR = 438,
427 POS = 439,
428 NEG = 440,
429 ADDRESSOF = 441
430 };
431 #endif
432
433 /* Value type. */
434 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
435 typedef union YYSTYPE YYSTYPE;
436 union YYSTYPE
437 {
438 #line 138 "parser.y" /* yacc.c:355 */
439
440 attr_t *attr;
441 attr_list_t *attr_list;
442 str_list_t *str_list;
443 expr_t *expr;
444 expr_list_t *expr_list;
445 array_dims_t *array_dims;
446 type_t *type;
447 var_t *var;
448 var_list_t *var_list;
449 declarator_t *declarator;
450 declarator_list_t *declarator_list;
451 statement_t *statement;
452 statement_list_t *stmt_list;
453 warning_t *warning;
454 warning_list_t *warning_list;
455 ifref_t *ifref;
456 ifref_list_t *ifref_list;
457 char *str;
458 UUID *uuid;
459 unsigned int num;
460 double dbl;
461 interface_info_t ifinfo;
462 typelib_t *typelib;
463 struct _import_t *import;
464 struct _decl_spec_t *declspec;
465 enum storage_class stgclass;
466
467 #line 468 "parser.tab.c" /* yacc.c:355 */
468 };
469 # define YYSTYPE_IS_TRIVIAL 1
470 # define YYSTYPE_IS_DECLARED 1
471 #endif
472
473
474 extern YYSTYPE parser_lval;
475
476 int parser_parse (void);
477
478 #endif /* !YY_PARSER_E_REACTOSSYNC_GCC_HOST_TOOLS_SDK_TOOLS_WIDL_PARSER_TAB_H_INCLUDED */
479
480 /* Copy the second part of user declarations. */
481
482 #line 483 "parser.tab.c" /* yacc.c:358 */
483
484 #ifdef short
485 # undef short
486 #endif
487
488 #ifdef YYTYPE_UINT8
489 typedef YYTYPE_UINT8 yytype_uint8;
490 #else
491 typedef unsigned char yytype_uint8;
492 #endif
493
494 #ifdef YYTYPE_INT8
495 typedef YYTYPE_INT8 yytype_int8;
496 #else
497 typedef signed char yytype_int8;
498 #endif
499
500 #ifdef YYTYPE_UINT16
501 typedef YYTYPE_UINT16 yytype_uint16;
502 #else
503 typedef unsigned short int yytype_uint16;
504 #endif
505
506 #ifdef YYTYPE_INT16
507 typedef YYTYPE_INT16 yytype_int16;
508 #else
509 typedef short int yytype_int16;
510 #endif
511
512 #ifndef YYSIZE_T
513 # ifdef __SIZE_TYPE__
514 # define YYSIZE_T __SIZE_TYPE__
515 # elif defined size_t
516 # define YYSIZE_T size_t
517 # elif ! defined YYSIZE_T
518 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
519 # define YYSIZE_T size_t
520 # else
521 # define YYSIZE_T unsigned int
522 # endif
523 #endif
524
525 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
526
527 #ifndef YY_
528 # if defined YYENABLE_NLS && YYENABLE_NLS
529 # if ENABLE_NLS
530 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
531 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
532 # endif
533 # endif
534 # ifndef YY_
535 # define YY_(Msgid) Msgid
536 # endif
537 #endif
538
539 #ifndef __attribute__
540 /* This feature is available in gcc versions 2.5 and later. */
541 # if (! defined __GNUC__ || __GNUC__ < 2 \
542 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5))
543 # define __attribute__(Spec) /* empty */
544 # endif
545 #endif
546
547 /* Suppress unused-variable warnings by "using" E. */
548 #if ! defined lint || defined __GNUC__
549 # define YYUSE(E) ((void) (E))
550 #else
551 # define YYUSE(E) /* empty */
552 #endif
553
554 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
555 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
556 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
557 _Pragma ("GCC diagnostic push") \
558 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
559 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
560 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
561 _Pragma ("GCC diagnostic pop")
562 #else
563 # define YY_INITIAL_VALUE(Value) Value
564 #endif
565 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
566 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
567 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
568 #endif
569 #ifndef YY_INITIAL_VALUE
570 # define YY_INITIAL_VALUE(Value) /* Nothing. */
571 #endif
572
573
574 #if ! defined yyoverflow || YYERROR_VERBOSE
575
576 /* The parser invokes alloca or malloc; define the necessary symbols. */
577
578 # ifdef YYSTACK_USE_ALLOCA
579 # if YYSTACK_USE_ALLOCA
580 # ifdef __GNUC__
581 # define YYSTACK_ALLOC __builtin_alloca
582 # elif defined __BUILTIN_VA_ARG_INCR
583 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
584 # elif defined _AIX
585 # define YYSTACK_ALLOC __alloca
586 # elif defined _MSC_VER
587 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
588 # define alloca _alloca
589 # else
590 # define YYSTACK_ALLOC alloca
591 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
592 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
593 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
594 # ifndef EXIT_SUCCESS
595 # define EXIT_SUCCESS 0
596 # endif
597 # endif
598 # endif
599 # endif
600 # endif
601
602 # ifdef YYSTACK_ALLOC
603 /* Pacify GCC's 'empty if-body' warning. */
604 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
605 # ifndef YYSTACK_ALLOC_MAXIMUM
606 /* The OS might guarantee only one guard page at the bottom of the stack,
607 and a page size can be as small as 4096 bytes. So we cannot safely
608 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
609 to allow for a few compiler-allocated temporary stack slots. */
610 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
611 # endif
612 # else
613 # define YYSTACK_ALLOC YYMALLOC
614 # define YYSTACK_FREE YYFREE
615 # ifndef YYSTACK_ALLOC_MAXIMUM
616 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
617 # endif
618 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
619 && ! ((defined YYMALLOC || defined malloc) \
620 && (defined YYFREE || defined free)))
621 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
622 # ifndef EXIT_SUCCESS
623 # define EXIT_SUCCESS 0
624 # endif
625 # endif
626 # ifndef YYMALLOC
627 # define YYMALLOC malloc
628 # if ! defined malloc && ! defined EXIT_SUCCESS
629 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
630 # endif
631 # endif
632 # ifndef YYFREE
633 # define YYFREE free
634 # if ! defined free && ! defined EXIT_SUCCESS
635 void free (void *); /* INFRINGES ON USER NAME SPACE */
636 # endif
637 # endif
638 # endif
639 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
640
641
642 #if (! defined yyoverflow \
643 && (! defined __cplusplus \
644 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
645
646 /* A type that is properly aligned for any stack member. */
647 union yyalloc
648 {
649 yytype_int16 yyss_alloc;
650 YYSTYPE yyvs_alloc;
651 };
652
653 /* The size of the maximum gap between one aligned stack and the next. */
654 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
655
656 /* The size of an array large to enough to hold all stacks, each with
657 N elements. */
658 # define YYSTACK_BYTES(N) \
659 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
660 + YYSTACK_GAP_MAXIMUM)
661
662 # define YYCOPY_NEEDED 1
663
664 /* Relocate STACK from its old location to the new one. The
665 local variables YYSIZE and YYSTACKSIZE give the old and new number of
666 elements in the stack, and YYPTR gives the new location of the
667 stack. Advance YYPTR to a properly aligned location for the next
668 stack. */
669 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
670 do \
671 { \
672 YYSIZE_T yynewbytes; \
673 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
674 Stack = &yyptr->Stack_alloc; \
675 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
676 yyptr += yynewbytes / sizeof (*yyptr); \
677 } \
678 while (0)
679
680 #endif
681
682 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
683 /* Copy COUNT objects from SRC to DST. The source and destination do
684 not overlap. */
685 # ifndef YYCOPY
686 # if defined __GNUC__ && 1 < __GNUC__
687 # define YYCOPY(Dst, Src, Count) \
688 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
689 # else
690 # define YYCOPY(Dst, Src, Count) \
691 do \
692 { \
693 YYSIZE_T yyi; \
694 for (yyi = 0; yyi < (Count); yyi++) \
695 (Dst)[yyi] = (Src)[yyi]; \
696 } \
697 while (0)
698 # endif
699 # endif
700 #endif /* !YYCOPY_NEEDED */
701
702 /* YYFINAL -- State number of the termination state. */
703 #define YYFINAL 3
704 /* YYLAST -- Last index in YYTABLE. */
705 #define YYLAST 2995
706
707 /* YYNTOKENS -- Number of terminals. */
708 #define YYNTOKENS 211
709 /* YYNNTS -- Number of nonterminals. */
710 #define YYNNTS 105
711 /* YYNRULES -- Number of rules. */
712 #define YYNRULES 394
713 /* YYNSTATES -- Number of states. */
714 #define YYNSTATES 691
715
716 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
717 by yylex, with out-of-bounds checking. */
718 #define YYUNDEFTOK 2
719 #define YYMAXUTOK 441
720
721 #define YYTRANSLATE(YYX) \
722 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
723
724 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
725 as returned by yylex, without out-of-bounds checking. */
726 static const yytype_uint8 yytranslate[] =
727 {
728 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
729 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
730 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
731 2, 2, 2, 195, 2, 2, 2, 194, 187, 2,
732 208, 209, 192, 191, 182, 190, 202, 193, 2, 2,
733 2, 2, 2, 2, 2, 2, 2, 2, 184, 207,
734 188, 210, 189, 183, 2, 2, 2, 2, 2, 2,
735 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
736 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
737 2, 203, 2, 204, 186, 2, 2, 2, 2, 2,
738 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
739 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
740 2, 2, 2, 205, 185, 206, 196, 2, 2, 2,
741 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
742 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
743 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
744 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
745 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
746 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
747 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
748 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
749 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
750 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
751 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
752 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
753 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
754 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
755 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
756 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
757 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
758 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
759 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
760 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
761 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
762 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
763 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
764 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
765 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
766 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
767 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
768 145, 146, 147, 148, 149, 150, 151, 152, 153, 154,
769 155, 156, 157, 158, 159, 160, 161, 162, 163, 164,
770 165, 166, 167, 168, 169, 170, 171, 172, 173, 174,
771 175, 176, 177, 178, 179, 180, 181, 197, 198, 199,
772 200, 201
773 };
774
775 #if YYDEBUG
776 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
777 static const yytype_uint16 yyrline[] =
778 {
779 0, 321, 321, 335, 336, 336, 338, 339, 340, 343,
780 346, 347, 348, 351, 352, 353, 353, 355, 356, 357,
781 360, 361, 362, 363, 366, 367, 370, 371, 375, 376,
782 377, 378, 379, 380, 381, 384, 395, 396, 400, 401,
783 402, 403, 404, 405, 406, 407, 408, 411, 413, 421,
784 427, 431, 432, 434, 438, 445, 446, 449, 450, 453,
785 454, 458, 463, 470, 474, 475, 478, 479, 483, 486,
786 487, 488, 491, 492, 495, 496, 497, 498, 499, 500,
787 501, 502, 503, 504, 505, 506, 507, 508, 509, 510,
788 511, 512, 513, 514, 515, 516, 517, 518, 519, 520,
789 521, 522, 523, 524, 525, 526, 527, 528, 529, 530,
790 531, 532, 533, 534, 535, 536, 537, 538, 539, 540,
791 541, 542, 543, 544, 545, 546, 547, 548, 549, 550,
792 551, 552, 553, 554, 555, 556, 557, 558, 559, 560,
793 561, 562, 563, 564, 565, 566, 567, 568, 569, 570,
794 574, 575, 576, 577, 578, 579, 580, 581, 582, 583,
795 584, 585, 586, 587, 588, 589, 590, 591, 592, 593,
796 594, 595, 596, 597, 601, 602, 607, 608, 609, 610,
797 613, 614, 617, 621, 627, 628, 629, 632, 636, 648,
798 652, 657, 660, 661, 664, 665, 668, 669, 670, 671,
799 672, 673, 674, 675, 676, 677, 678, 679, 680, 681,
800 682, 683, 684, 685, 686, 687, 688, 689, 690, 691,
801 692, 693, 694, 695, 696, 697, 698, 699, 700, 701,
802 702, 703, 704, 705, 707, 709, 710, 713, 714, 717,
803 723, 729, 730, 733, 738, 745, 746, 749, 750, 754,
804 755, 758, 762, 768, 776, 780, 785, 786, 789, 790,
805 791, 794, 796, 799, 800, 801, 802, 803, 804, 805,
806 806, 807, 808, 809, 812, 813, 816, 817, 818, 819,
807 820, 821, 822, 823, 826, 827, 835, 841, 845, 848,
808 849, 853, 856, 857, 860, 869, 870, 873, 874, 877,
809 883, 889, 890, 893, 894, 897, 907, 916, 922, 926,
810 927, 930, 931, 934, 939, 946, 947, 948, 952, 956,
811 959, 960, 963, 964, 968, 969, 973, 974, 975, 979,
812 981, 983, 987, 988, 989, 990, 998, 1000, 1002, 1007,
813 1009, 1014, 1015, 1020, 1021, 1022, 1023, 1028, 1037, 1039,
814 1040, 1045, 1047, 1051, 1052, 1059, 1060, 1061, 1062, 1063,
815 1068, 1076, 1077, 1080, 1081, 1084, 1091, 1092, 1097, 1098,
816 1102, 1103, 1104, 1105, 1106, 1110, 1111, 1112, 1115, 1118,
817 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1130,
818 1137, 1139, 1145, 1146, 1147
819 };
820 #endif
821
822 #if YYDEBUG || YYERROR_VERBOSE || 1
823 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
824 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
825 static const char *const yytname[] =
826 {
827 "$end", "error", "$undefined", "aIDENTIFIER", "aPRAGMA", "aKNOWNTYPE",
828 "aNUM", "aHEXNUM", "aDOUBLE", "aSTRING", "aWSTRING", "aSQSTRING",
829 "aUUID", "aEOF", "SHL", "SHR", "MEMBERPTR", "EQUALITY", "INEQUALITY",
830 "GREATEREQUAL", "LESSEQUAL", "LOGICALOR", "LOGICALAND", "ELLIPSIS",
831 "tAGGREGATABLE", "tALLOCATE", "tANNOTATION", "tAPPOBJECT", "tASYNC",
832 "tASYNCUUID", "tAUTOHANDLE", "tBINDABLE", "tBOOLEAN", "tBROADCAST",
833 "tBYTE", "tBYTECOUNT", "tCALLAS", "tCALLBACK", "tCASE", "tCDECL",
834 "tCHAR", "tCOCLASS", "tCODE", "tCOMMSTATUS", "tCONST", "tCONTEXTHANDLE",
835 "tCONTEXTHANDLENOSERIALIZE", "tCONTEXTHANDLESERIALIZE", "tCONTROL",
836 "tCPPQUOTE", "tDECODE", "tDEFAULT", "tDEFAULTBIND", "tDEFAULTCOLLELEM",
837 "tDEFAULTVALUE", "tDEFAULTVTABLE", "tDISABLECONSISTENCYCHECK",
838 "tDISPLAYBIND", "tDISPINTERFACE", "tDLLNAME", "tDOUBLE", "tDUAL",
839 "tENABLEALLOCATE", "tENCODE", "tENDPOINT", "tENTRY", "tENUM",
840 "tERRORSTATUST", "tEXPLICITHANDLE", "tEXTERN", "tFALSE", "tFASTCALL",
841 "tFAULTSTATUS", "tFLOAT", "tFORCEALLOCATE", "tHANDLE", "tHANDLET",
842 "tHELPCONTEXT", "tHELPFILE", "tHELPSTRING", "tHELPSTRINGCONTEXT",
843 "tHELPSTRINGDLL", "tHIDDEN", "tHYPER", "tID", "tIDEMPOTENT", "tIGNORE",
844 "tIIDIS", "tIMMEDIATEBIND", "tIMPLICITHANDLE", "tIMPORT", "tIMPORTLIB",
845 "tIN", "tIN_LINE", "tINLINE", "tINPUTSYNC", "tINT", "tINT3264", "tINT64",
846 "tINTERFACE", "tLCID", "tLENGTHIS", "tLIBRARY", "tLICENSED", "tLOCAL",
847 "tLONG", "tMAYBE", "tMESSAGE", "tMETHODS", "tMODULE", "tNAMESPACE",
848 "tNOCODE", "tNONBROWSABLE", "tNONCREATABLE", "tNONEXTENSIBLE", "tNOTIFY",
849 "tNOTIFYFLAG", "tNULL", "tOBJECT", "tODL", "tOLEAUTOMATION", "tOPTIMIZE",
850 "tOPTIONAL", "tOUT", "tPARTIALIGNORE", "tPASCAL", "tPOINTERDEFAULT",
851 "tPRAGMA_WARNING", "tPROGID", "tPROPERTIES", "tPROPGET", "tPROPPUT",
852 "tPROPPUTREF", "tPROXY", "tPTR", "tPUBLIC", "tRANGE", "tREADONLY",
853 "tREF", "tREGISTER", "tREPRESENTAS", "tREQUESTEDIT", "tRESTRICTED",
854 "tRETVAL", "tSAFEARRAY", "tSHORT", "tSIGNED", "tSIZEIS", "tSIZEOF",
855 "tSMALL", "tSOURCE", "tSTATIC", "tSTDCALL", "tSTRICTCONTEXTHANDLE",
856 "tSTRING", "tSTRUCT", "tSWITCH", "tSWITCHIS", "tSWITCHTYPE",
857 "tTHREADING", "tTRANSMITAS", "tTRUE", "tTYPEDEF", "tUIDEFAULT", "tUNION",
858 "tUNIQUE", "tUNSIGNED", "tUSESGETLASTERROR", "tUSERMARSHAL", "tUUID",
859 "tV1ENUM", "tVARARG", "tVERSION", "tVIPROGID", "tVOID", "tWCHAR",
860 "tWIREMARSHAL", "tAPARTMENT", "tNEUTRAL", "tSINGLE", "tFREE", "tBOTH",
861 "','", "'?'", "':'", "'|'", "'^'", "'&'", "'<'", "'>'", "'-'", "'+'",
862 "'*'", "'/'", "'%'", "'!'", "'~'", "CAST", "PPTR", "POS", "NEG",
863 "ADDRESSOF", "'.'", "'['", "']'", "'{'", "'}'", "';'", "'('", "')'",
864 "'='", "$accept", "input", "gbl_statements", "$@1", "imp_statements",
865 "$@2", "int_statements", "semicolon_opt", "statement", "pragma_warning",
866 "warnings", "typedecl", "cppquote", "import_start", "import",
867 "importlib", "libraryhdr", "library_start", "librarydef", "m_args",
868 "arg_list", "args", "arg", "array", "m_attributes", "attributes",
869 "attrib_list", "str_list", "attribute", "uuid_string", "callconv",
870 "cases", "case", "enums", "enum_list", "enum", "enumdef", "m_exprs",
871 "m_expr", "expr", "expr_list_int_const", "expr_int_const", "expr_const",
872 "fields", "field", "ne_union_field", "ne_union_fields", "union_field",
873 "s_field", "funcdef", "declaration", "m_ident", "t_ident", "ident",
874 "base_type", "m_int", "int_std", "coclass", "coclasshdr", "coclassdef",
875 "namespacedef", "coclass_ints", "coclass_int", "dispinterface",
876 "dispinterfacehdr", "dispint_props", "dispint_meths", "dispinterfacedef",
877 "inherit", "interface", "interfacehdr", "interfacedef", "interfacedec",
878 "module", "modulehdr", "moduledef", "storage_cls_spec",
879 "function_specifier", "type_qualifier", "m_type_qual_list", "decl_spec",
880 "m_decl_spec_no_type", "decl_spec_no_type", "declarator",
881 "direct_declarator", "abstract_declarator",
882 "abstract_declarator_no_direct", "m_abstract_declarator",
883 "abstract_direct_declarator", "any_declarator",
884 "any_declarator_no_direct", "m_any_declarator", "any_direct_declarator",
885 "declarator_list", "m_bitfield", "struct_declarator",
886 "struct_declarator_list", "init_declarator", "threading_type",
887 "pointer_type", "structdef", "type", "typedef", "uniondef", "version", YY_NULL
888 };
889 #endif
890
891 # ifdef YYPRINT
892 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
893 (internal) symbol number NUM (which must be that of a token). */
894 static const yytype_uint16 yytoknum[] =
895 {
896 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
897 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
898 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
899 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
900 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
901 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
902 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
903 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
904 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
905 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
906 355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
907 365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
908 375, 376, 377, 378, 379, 380, 381, 382, 383, 384,
909 385, 386, 387, 388, 389, 390, 391, 392, 393, 394,
910 395, 396, 397, 398, 399, 400, 401, 402, 403, 404,
911 405, 406, 407, 408, 409, 410, 411, 412, 413, 414,
912 415, 416, 417, 418, 419, 420, 421, 422, 423, 424,
913 425, 426, 427, 428, 429, 430, 431, 432, 433, 434,
914 435, 436, 44, 63, 58, 124, 94, 38, 60, 62,
915 45, 43, 42, 47, 37, 33, 126, 437, 438, 439,
916 440, 441, 46, 91, 93, 123, 125, 59, 40, 41,
917 61
918 };
919 # endif
920
921 #define YYPACT_NINF -521
922
923 #define yypact_value_is_default(Yystate) \
924 (!!((Yystate) == (-521)))
925
926 #define YYTABLE_NINF -260
927
928 #define yytable_value_is_error(Yytable_value) \
929 0
930
931 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
932 STATE-NUM. */
933 static const yytype_int16 yypact[] =
934 {
935 -521, 89, 1646, -521, -521, -521, -521, -521, -521, 156,
936 -521, -136, 172, -521, 181, -521, -521, -521, -521, -6,
937 87, -521, -521, -521, -521, 218, -6, 105, -99, -521,
938 -75, -6, 384, -521, -521, 223, 255, 384, -521, -521,
939 2819, -521, -521, -39, -521, -521, -521, -521, -521, 25,
940 2519, -19, -15, -521, -521, -11, 6, -521, 24, 3,
941 27, 15, 29, 21, -521, -521, 66, -521, 44, 44,
942 44, 162, 2667, 79, 44, 106, 109, -521, -521, 208,
943 -521, -521, 94, -521, 74, -521, -521, 119, -521, -521,
944 -521, -521, 279, 2667, -521, -521, 97, 107, -127, -120,
945 -521, -521, 122, -521, -521, 125, -521, -521, -521, 126,
946 131, -521, -521, -521, -521, -521, -521, -521, -521, -521,
947 -521, 155, -521, -521, -521, 160, -521, -521, -521, 161,
948 173, -521, -521, -521, -521, 179, 180, 183, 184, 192,
949 -521, 193, -521, -521, 195, -521, 196, -521, -521, 197,
950 205, -521, -521, -521, -521, -521, -521, -521, -521, -521,
951 -521, -521, -521, -521, 211, -521, -521, -521, 212, 213,
952 -521, -521, -521, -521, -521, -521, 214, -521, -521, 215,
953 -521, -521, -521, 217, -521, -521, -521, 222, 246, 247,
954 251, -521, -521, -521, 252, 260, -521, -521, 261, 263,
955 264, -121, -521, -521, -521, 1528, 791, 177, 319, 322,
956 337, 343, 347, 207, 182, -521, -521, -521, -521, 162,
957 209, 268, -521, -521, -521, -521, -521, -55, -521, -521,
958 -521, 350, 271, -521, -521, -521, -521, -521, -521, -521,
959 -521, -521, -521, -521, -521, 162, 162, -521, 267, -96,
960 -521, -521, -521, 44, -521, -521, -521, 269, 355, -521,
961 289, 270, -521, 276, -521, 477, 61, 355, 646, 646,
962 478, 479, 646, 646, 482, 491, 646, 493, 646, 646,
963 2080, 646, 646, 494, -78, 497, 646, 2667, 646, 646,
964 2667, 194, 2667, 2667, 61, 75, 501, 2667, 2819, 308,
965 -521, 309, -521, -521, -521, 311, -521, 314, -521, -521,
966 -521, 15, 2593, -521, 326, -521, -521, -521, -521, 326,
967 -102, -521, -521, -37, -521, 332, -66, 320, 329, -521,
968 -521, 1130, 72, 327, -521, 646, 266, 2080, -521, -521,
969 -521, 333, 353, -521, 328, 534, -521, -30, 177, -21,
970 335, -521, -521, 336, 341, -521, -521, -521, -521, -521,
971 -521, -521, -521, -521, 339, -521, 646, 646, 646, 646,
972 646, 646, 575, 2328, -143, -521, 2328, 342, 344, -521,
973 -123, 346, 348, 349, 351, 352, 354, 357, 1334, 358,
974 2593, 159, 359, -118, -521, 2328, 362, 363, 364, 367,
975 365, -114, 2001, 368, -521, -521, -521, -521, -521, 370,
976 378, 379, 380, 374, -521, 381, 382, 383, -521, 2819,
977 543, -521, -521, -521, 162, 15, -23, -521, 1027, -521,
978 375, 2593, 387, 1410, 389, 474, 1233, 15, -521, 2593,
979 -521, -521, -521, -521, 594, -521, 2242, 390, 414, -521,
980 -521, -521, 355, 646, -521, 18, -521, 2593, -521, 397,
981 -521, 391, -521, 401, -521, -521, -521, 2593, 12, 12,
982 12, 12, 12, 12, 2111, 338, 646, 646, 607, 646,
983 646, 646, 646, 646, 646, 646, 646, 646, 646, 646,
984 646, 646, 646, 646, 646, 646, 608, 646, 646, -521,
985 -521, -521, 604, -521, -521, -521, -521, -521, -521, -521,
986 -521, -521, -521, 159, -521, 1775, -521, 159, -521, -521,
987 -521, -93, -521, 646, -521, -521, -521, -521, 646, -521,
988 -521, -521, -521, -521, -521, -521, -521, 610, -521, -521,
989 -521, -521, 405, -521, -521, 435, -521, -521, -521, -521,
990 162, 169, -521, -521, 2593, 413, -521, -521, -521, 15,
991 -521, -521, -521, -521, 2006, -521, -521, -521, -521, 159,
992 419, 355, -521, -521, 338, -521, -521, 1903, -521, 338,
993 -521, 420, -58, 204, 204, -521, 718, 718, 305, 305,
994 2198, 2347, 2307, 103, 506, 2354, 305, 305, 115, 115,
995 12, 12, 12, -521, 2270, -521, -521, -521, 340, -521,
996 421, 159, 423, -521, 2080, -521, -521, 425, -521, 15,
997 909, 162, -521, -521, 1336, -521, -521, -521, 444, -521,
998 -115, -521, 431, -521, 429, 498, -521, 430, 159, 434,
999 -521, 646, 2080, -521, 646, -521, -521, 340, -521, -521,
1000 -521, 437, -521, -521, -521, -521, 15, 646, -521, 159,
1001 -521, -521, -521, -521, 340, -521, -521, -521, 12, 438,
1002 2328, -521, -521, -521, -521, -521, -13, -521, -521, 646,
1003 475, -521, -521, 476, -52, -52, -521, -521, 454, -521,
1004 -521
1005 };
1006
1007 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
1008 Performed when YYTABLE does not specify something else to do. Zero
1009 means the default is an error. */
1010 static const yytype_uint16 yydefact[] =
1011 {
1012 3, 0, 2, 1, 33, 380, 271, 263, 282, 0,
1013 319, 0, 0, 270, 258, 272, 315, 269, 273, 274,
1014 0, 318, 276, 283, 281, 0, 274, 0, 0, 317,
1015 0, 274, 0, 278, 316, 258, 258, 268, 379, 264,
1016 74, 12, 34, 0, 28, 13, 31, 13, 11, 0,
1017 67, 382, 0, 381, 265, 0, 0, 9, 0, 0,
1018 0, 26, 0, 301, 7, 6, 0, 10, 324, 324,
1019 324, 0, 0, 384, 324, 0, 386, 284, 285, 0,
1020 292, 293, 383, 260, 0, 275, 280, 0, 303, 304,
1021 279, 288, 0, 0, 277, 266, 385, 0, 387, 0,
1022 267, 75, 0, 77, 78, 0, 79, 80, 81, 0,
1023 0, 84, 85, 86, 87, 88, 89, 90, 91, 92,
1024 93, 0, 95, 96, 97, 0, 99, 100, 101, 0,
1025 0, 104, 105, 106, 107, 0, 0, 0, 0, 0,
1026 113, 0, 115, 116, 0, 118, 0, 120, 121, 124,
1027 0, 125, 126, 127, 128, 129, 130, 131, 132, 133,
1028 134, 135, 136, 137, 0, 139, 140, 141, 0, 0,
1029 144, 145, 146, 147, 377, 148, 0, 150, 375, 0,
1030 152, 153, 154, 0, 156, 157, 158, 0, 0, 0,
1031 0, 163, 376, 164, 0, 0, 168, 169, 0, 0,
1032 0, 0, 69, 173, 29, 66, 66, 66, 258, 0,
1033 0, 258, 258, 0, 382, 286, 294, 305, 313, 0,
1034 384, 386, 30, 8, 289, 4, 310, 0, 27, 308,
1035 309, 0, 0, 24, 328, 325, 327, 326, 261, 262,
1036 176, 177, 178, 179, 320, 0, 0, 332, 368, 331,
1037 255, 382, 384, 324, 386, 322, 32, 0, 184, 48,
1038 0, 0, 241, 0, 247, 0, 0, 0, 0, 0,
1039 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1040 0, 0, 194, 0, 0, 0, 0, 0, 194, 0,
1041 0, 0, 0, 0, 0, 0, 0, 0, 74, 68,
1042 49, 0, 21, 22, 23, 0, 19, 0, 17, 14,
1043 20, 26, 0, 67, 383, 51, 52, 311, 312, 385,
1044 387, 53, 254, 66, 3, 0, 66, 0, 0, 302,
1045 24, 66, 0, 0, 330, 0, 0, 55, 334, 323,
1046 47, 0, 186, 187, 190, 0, 388, 66, 66, 66,
1047 0, 175, 174, 0, 0, 205, 196, 197, 198, 202,
1048 203, 204, 199, 200, 0, 201, 0, 0, 0, 0,
1049 0, 0, 0, 239, 0, 237, 240, 0, 0, 72,
1050 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1051 0, 353, 0, 0, 192, 195, 0, 0, 0, 0,
1052 0, 0, 0, 0, 370, 371, 372, 373, 374, 0,
1053 0, 0, 0, 392, 394, 0, 0, 0, 70, 74,
1054 0, 18, 15, 54, 0, 26, 0, 290, 66, 295,
1055 0, 0, 0, 0, 0, 0, 66, 26, 25, 67,
1056 321, 329, 333, 369, 0, 65, 0, 0, 59, 56,
1057 57, 191, 185, 0, 36, 0, 378, 0, 242, 0,
1058 390, 67, 248, 0, 76, 167, 82, 0, 229, 228,
1059 227, 230, 225, 226, 0, 341, 0, 0, 0, 0,
1060 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1061 0, 0, 0, 0, 0, 0, 0, 0, 0, 83,
1062 94, 98, 0, 102, 103, 108, 109, 110, 111, 112,
1063 114, 117, 119, 353, 320, 55, 358, 353, 355, 354,
1064 62, 350, 123, 194, 122, 138, 142, 143, 0, 151,
1065 155, 159, 160, 162, 161, 165, 166, 0, 170, 171,
1066 172, 71, 0, 13, 361, 389, 287, 291, 5, 297,
1067 0, 384, 296, 299, 0, 0, 253, 300, 24, 26,
1068 314, 64, 63, 335, 0, 188, 189, 37, 35, 0,
1069 386, 256, 246, 245, 341, 236, 320, 55, 345, 341,
1070 342, 0, 338, 218, 219, 231, 212, 213, 216, 217,
1071 207, 208, 0, 209, 210, 211, 215, 214, 221, 220,
1072 223, 224, 222, 232, 0, 238, 73, 61, 353, 320,
1073 0, 353, 0, 349, 55, 357, 193, 0, 393, 26,
1074 66, 0, 251, 298, 66, 306, 60, 58, 363, 366,
1075 0, 244, 0, 257, 0, 341, 320, 0, 353, 0,
1076 337, 0, 55, 344, 0, 235, 348, 353, 359, 352,
1077 356, 0, 149, 50, 16, 362, 26, 0, 365, 0,
1078 243, 180, 234, 336, 353, 346, 340, 343, 233, 0,
1079 206, 351, 360, 307, 364, 367, 0, 339, 347, 0,
1080 0, 391, 181, 0, 66, 66, 250, 183, 0, 182,
1081 249
1082 };
1083
1084 /* YYPGOTO[NTERM-NUM]. */
1085 static const yytype_int16 yypgoto[] =
1086 {
1087 -521, -521, 360, -521, -42, -521, -304, -291, 0, -521,
1088 -521, -521, -521, -521, 227, -521, -521, -521, 10, -472,
1089 -521, -521, -266, -218, -191, -2, -521, -521, -275, 369,
1090 -65, -521, -521, -521, -521, 216, 13, 377, 143, -242,
1091 -521, -228, -264, -521, -521, -521, -521, -18, -177, -521,
1092 237, -521, -3, -67, -521, 110, 116, 5, -521, 11,
1093 17, -521, -521, 624, -521, -521, -521, -521, -521, -33,
1094 -521, 19, 16, -521, -521, 20, -521, -521, -298, -462,
1095 -49, 32, 30, -235, -521, -521, -521, -495, -521, -520,
1096 -521, -448, -521, -521, -521, 22, -521, 456, -521, 392,
1097 1, -31, -521, 7, -521
1098 };
1099
1100 /* YYDEFGOTO[NTERM-NUM]. */
1101 static const yytype_int16 yydefgoto[] =
1102 {
1103 -1, 1, 2, 324, 205, 543, 331, 229, 302, 42,
1104 455, 43, 44, 45, 46, 303, 213, 47, 304, 447,
1105 448, 449, 450, 516, 49, 313, 201, 380, 202, 353,
1106 517, 676, 682, 341, 342, 343, 251, 393, 394, 373,
1107 374, 375, 377, 347, 458, 462, 349, 687, 688, 555,
1108 52, 632, 84, 518, 53, 86, 54, 305, 56, 306,
1109 307, 323, 427, 59, 60, 326, 433, 61, 232, 62,
1110 63, 308, 309, 218, 66, 310, 68, 69, 70, 332,
1111 71, 234, 72, 248, 249, 580, 639, 581, 582, 519,
1112 612, 520, 521, 545, 658, 629, 630, 250, 409, 203,
1113 252, 74, 75, 254, 415
1114 };
1115
1116 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
1117 positive, shift that token. If negative, reduce the rule whose
1118 number is the opposite. If YYTABLE_NINF, syntax error. */
1119 static const yytype_int16 yytable[] =
1120 {
1121 50, 219, 41, 73, 247, 206, 246, 55, 381, 76,
1122 333, 334, 48, 57, 389, 51, 312, 217, 65, 58,
1123 423, 64, 67, 418, 567, 679, 436, 376, 478, -259,
1124 376, 338, 97, 99, 440, 12, 263, 388, 680, 498,
1125 395, 253, 430, 610, 25, 382, 395, 402, 385, 628,
1126 387, 220, 608, 392, -259, 215, 174, 221, 399, 502,
1127 178, 298, 261, 214, 523, 607, 499, 659, 523, 613,
1128 351, 443, 79, 352, 325, 238, 25, 239, -259, 634,
1129 -43, 413, 414, 299, 640, 264, 503, 192, 10, 3,
1130 85, 524, 660, 376, 446, 530, 87, 441, 235, 235,
1131 235, 236, 237, -259, 235, 637, 255, 336, 91, 92,
1132 336, 240, 337, 16, 635, 614, 10, 476, 477, 478,
1133 479, 480, 481, 482, 468, 469, 470, 471, 472, 473,
1134 474, 478, 426, 93, 546, 431, 90, 40, 21, 628,
1135 663, 94, 651, 241, 541, 336, 560, 647, 95, 432,
1136 642, 40, 247, 100, 246, 686, 457, 431, 431, 77,
1137 646, 78, 238, 649, 239, 238, 40, 239, 204, 425,
1138 669, 459, 463, 40, 664, 80, 456, 81, 247, 247,
1139 246, 246, 40, 29, 82, 460, 83, 207, -38, 544,
1140 666, 344, 222, 681, 327, 34, 223, 242, 240, 671,
1141 354, 240, 471, 50, 50, 231, 73, 73, 97, 99,
1142 226, 224, 76, 76, 496, 497, 677, 257, 51, 51,
1143 478, 88, 228, 89, 243, 566, 96, 568, 83, 225,
1144 241, 391, 227, 241, 583, 584, 230, 586, 587, 588,
1145 589, 590, 591, 592, 593, 594, 595, 596, 597, 598,
1146 599, 600, 601, 602, 624, 604, 400, 578, 98, 403,
1147 83, 410, 411, 424, 244, 247, 417, 246, 625, 355,
1148 605, 233, 356, 357, 358, 359, 360, 361, 390, 258,
1149 245, 395, 260, 235, 242, 339, -40, 242, 391, 487,
1150 488, 489, 490, 491, 492, 493, 494, 495, 627, -259,
1151 617, -39, -259, 615, -41, 496, 497, 493, 494, 495,
1152 440, 243, 262, 256, 243, 622, -42, 496, 497, 476,
1153 477, 478, 314, 475, 83, 315, 259, 316, 653, 439,
1154 265, 438, 73, 266, 267, 390, 362, 440, 76, 268,
1155 317, 513, 318, 238, 51, 239, 319, 461, 83, 440,
1156 320, 514, 83, 328, 244, 329, 578, 247, 238, 246,
1157 239, 578, 336, 269, 643, 673, 440, 515, 270, 271,
1158 245, 404, 405, 406, 407, 408, -252, 240, -252, 240,
1159 40, 272, 550, 363, 10, 344, 655, 273, 274, -44,
1160 219, 275, 276, 674, 491, 492, 493, 494, 495, 668,
1161 277, 278, 670, 279, 280, 281, 496, 497, 569, 241,
1162 579, 241, 321, 282, 364, 376, -45, 578, 574, 283,
1163 284, 285, 286, 287, 8, 288, 50, 365, 41, 73,
1164 289, 554, 551, 55, 439, 76, 438, 73, 48, 57,
1165 220, 51, 547, 76, 65, 58, 221, 64, 67, 51,
1166 611, 683, 214, 366, 290, 291, 367, 368, 444, 292,
1167 293, 370, 371, 242, 570, 242, 391, 19, 294, 295,
1168 445, 296, 297, 345, 372, -46, 330, 335, 340, 346,
1169 22, 23, 24, 247, 348, 246, 350, 378, 379, 26,
1170 243, 383, 243, 431, 431, 491, 492, 493, 494, 495,
1171 384, 620, 386, 396, 633, 219, 398, 496, 497, 579,
1172 416, 419, 638, 390, 579, 391, 429, 420, 421, 422,
1173 476, 477, 478, 479, 480, 481, 482, 434, 391, 31,
1174 576, -259, 514, 33, 435, 452, 442, 240, 453, 451,
1175 454, 336, 10, 336, 464, 465, 577, 467, 515, 528,
1176 466, 500, 542, 501, 247, 504, 246, 505, 506, 549,
1177 507, 508, 390, 509, 20, 391, 510, 512, 522, 241,
1178 579, 525, 526, 527, 529, 390, 537, 532, 355, 533,
1179 5, 356, 357, 358, 359, 360, 361, 534, 535, 536,
1180 538, 539, 540, 391, 552, 557, 564, 355, 572, 563,
1181 356, 357, 358, 359, 360, 361, 571, 6, 573, 7,
1182 585, 603, 390, 606, 619, 8, 618, 621, 50, 10,
1183 623, 73, 439, 242, 438, 73, 631, 76, 657, 641,
1184 648, 76, 650, 51, 652, 13, 661, 51, 662, 665,
1185 390, 208, 15, 667, 16, 362, 672, 678, 17, 355,
1186 243, 18, 356, 357, 358, 359, 360, 361, 19, 684,
1187 685, 690, 558, 412, 362, 401, 616, 689, 565, 21,
1188 556, 22, 23, 24, 216, 322, 397, 0, 0, 0,
1189 26, 675, 0, 0, 428, 0, 0, 0, 0, 0,
1190 576, 0, 363, 488, 489, 490, 491, 492, 493, 494,
1191 495, 336, 0, 0, 0, 0, 577, 0, 496, 497,
1192 0, 363, 0, 0, 29, 0, 362, 0, 0, 30,
1193 31, 32, 0, 364, 33, 0, 34, 0, 0, 0,
1194 211, 0, 476, 477, 478, 0, 365, 481, 482, 212,
1195 0, 37, 364, 0, 0, 0, 0, 0, 0, 38,
1196 39, 0, 0, 0, 0, 365, 0, 0, 0, 0,
1197 0, 0, 366, 363, 0, 367, 368, 369, 0, 0,
1198 370, 371, 0, 0, 0, 0, 0, 0, 0, 0,
1199 0, 366, 0, 372, 367, 368, 369, 0, 0, 370,
1200 371, 0, 0, 0, 364, 4, 5, 0, 561, 0,
1201 0, 0, 372, 0, 0, 0, 0, 365, 0, 0,
1202 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1203 0, 0, 0, 6, 0, 7, 0, 0, 0, 0,
1204 0, 8, 9, 366, 0, 10, 367, 368, 369, 0,
1205 11, 370, 371, 0, 0, 0, 0, 0, 0, 12,
1206 0, 13, 0, 0, 372, 0, 0, 14, 15, 0,
1207 16, 0, 0, 0, 17, 0, 0, 18, 0, 0,
1208 0, 0, 0, 0, 19, 0, 0, 0, 0, 0,
1209 0, 20, 301, 0, 0, 21, 0, 22, 23, 24,
1210 25, 0, 0, 0, 0, 0, 26, 0, 0, 0,
1211 0, 27, 0, 0, 0, 0, 489, 490, 491, 492,
1212 493, 494, 495, 4, 5, 0, 0, 0, 28, 0,
1213 496, 497, 0, 0, 0, 0, 0, 0, 0, 0,
1214 29, 0, 0, 0, 0, 30, 31, 32, 0, 0,
1215 33, 6, 34, 7, 0, 0, 35, 0, 0, 8,
1216 9, 0, 0, 10, 0, 36, 0, 37, 11, 0,
1217 0, 0, 0, 0, 0, 38, 39, 12, 0, 13,
1218 0, 0, 0, 0, 0, 14, 15, 0, 16, 0,
1219 0, 0, 17, 0, 0, 18, 0, 0, 0, 0,
1220 0, 0, 19, 0, 40, 0, 0, 311, 0, 20,
1221 301, 0, 0, 21, 0, 22, 23, 24, 25, 0,
1222 0, 0, 0, 0, 26, 0, 0, 0, 0, 27,
1223 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1224 0, 4, 5, 0, 0, 0, 28, 0, 0, 0,
1225 0, 0, 0, 0, 0, 0, 0, 0, 29, 0,
1226 0, 0, 0, 30, 31, 32, 0, 0, 33, 6,
1227 34, 7, 0, 0, 35, 0, 0, 8, 9, 0,
1228 0, 10, 0, 36, 0, 37, 11, 0, 0, 0,
1229 0, 0, 0, 38, 39, 12, 0, 13, 0, 0,
1230 0, 0, 0, 14, 15, 0, 16, 0, 0, 0,
1231 17, 0, 0, 18, 0, 0, 0, 0, 0, 0,
1232 19, 0, 40, 0, 0, 654, 0, 20, 0, 0,
1233 0, 21, 0, 22, 23, 24, 25, 0, 0, 0,
1234 0, 0, 26, 0, 4, 5, 0, 27, 0, 0,
1235 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1236 0, 0, 0, 0, 28, 0, 0, 0, 0, 0,
1237 0, 0, 6, 0, 7, 0, 29, 0, 0, 0,
1238 8, 30, 31, 32, 10, 0, 33, 0, 34, 11,
1239 0, 0, 35, 0, 0, 0, 0, 0, 0, 0,
1240 13, 36, 0, 37, 0, 0, 14, 15, 0, 16,
1241 0, 38, 39, 17, 0, 0, 18, 0, 0, 0,
1242 0, 0, 0, 19, 0, 0, 0, 0, 0, 0,
1243 20, 0, 0, 0, 21, 0, 22, 23, 24, 0,
1244 40, 0, 0, 548, 0, 26, 0, 4, 5, 0,
1245 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1246 0, 0, 0, 0, 0, 0, 0, 28, 0, 0,
1247 0, 0, 0, 0, 0, 6, 0, 7, 0, 29,
1248 0, 0, 0, 8, 30, 31, 32, 10, 0, 33,
1249 0, 34, 11, 0, 0, 35, 0, 0, 0, 0,
1250 0, 0, 0, 13, 36, 0, 37, 0, 0, 14,
1251 15, 0, 16, 0, 38, 39, 17, 0, 0, 18,
1252 0, 0, 0, 0, 0, 0, 19, 0, 0, 0,
1253 0, 0, 0, 20, 0, 0, 0, 21, 0, 22,
1254 23, 24, 0, 40, 0, 0, 437, 0, 26, 0,
1255 4, 5, 0, 0, 0, 0, 0, 0, 476, 477,
1256 478, 479, 480, 481, 482, 483, 484, 0, 0, 0,
1257 28, 0, 0, 0, 0, 0, 0, 0, 6, 0,
1258 7, 0, 29, 0, 0, 0, 8, 30, 31, 32,
1259 10, 0, 33, 0, 34, 11, 0, 0, 35, 0,
1260 0, 0, 0, 0, 0, 0, 13, 36, 0, 37,
1261 0, 0, 14, 15, 0, 16, 0, 38, 39, 17,
1262 0, 0, 18, 0, 0, 5, 0, 0, 0, 19,
1263 0, 0, 0, 0, 0, 0, 20, 0, 0, 0,
1264 21, 0, 22, 23, 24, 0, 40, 0, 0, 559,
1265 0, 26, 6, 0, 7, 0, 0, 0, 0, 0,
1266 8, 0, 0, 0, 10, 0, 0, 0, 0, 0,
1267 0, 0, 0, 28, 0, 0, 0, 0, 0, 0,
1268 13, 0, 0, 0, 0, 29, 208, 15, 0, 16,
1269 30, 31, 32, 17, 0, 33, 18, 34, 0, 0,
1270 0, 35, 0, 19, 0, 0, 0, 0, 0, 0,
1271 36, 0, 37, 0, 21, 0, 22, 23, 24, 0,
1272 38, 39, 0, 0, 0, 26, 0, 485, 0, 486,
1273 487, 488, 489, 490, 491, 492, 493, 494, 495, 0,
1274 0, 0, 4, 5, 0, 0, 496, 497, 0, 40,
1275 0, 300, 656, 511, 0, 0, 0, 0, 0, 29,
1276 0, 0, 0, 0, 30, 31, 32, 0, 0, 33,
1277 6, 34, 7, 0, 0, 211, 0, 0, 8, 9,
1278 0, 0, 10, 0, 212, 0, 37, 11, 0, 0,
1279 0, 0, 0, 0, 38, 39, 12, 0, 13, 0,
1280 0, 0, 0, 0, 14, 15, 0, 16, 0, 0,
1281 0, 17, 0, 0, 18, 0, 0, 0, 0, 0,
1282 0, 19, 0, 40, 0, 0, 553, 0, 20, 301,
1283 0, 0, 21, 0, 22, 23, 24, 25, 0, 0,
1284 0, 0, 0, 26, 0, 0, 0, 0, 27, 0,
1285 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1286 4, 5, 0, 0, 0, 28, 0, 0, 0, 0,
1287 0, 0, 0, 0, 0, 0, 0, 29, 0, 0,
1288 0, 0, 30, 31, 32, 0, 0, 33, 6, 34,
1289 7, 0, 0, 35, 0, 0, 8, 9, 0, 0,
1290 10, 0, 36, 0, 37, 11, 0, 0, 0, 0,
1291 0, 0, 38, 39, 12, 0, 13, 0, 0, 0,
1292 0, 0, 14, 15, 0, 16, 0, 0, 0, 17,
1293 0, 0, 18, 0, 0, 0, 0, 0, 0, 19,
1294 0, 40, 0, 0, 0, 0, 20, 0, 0, 0,
1295 21, 0, 22, 23, 24, 25, 0, 0, 0, 0,
1296 0, 26, 0, 0, 0, 0, 27, 0, 0, 0,
1297 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1298 0, 0, 0, 28, 0, 0, 0, 0, 0, 0,
1299 5, 0, 0, 0, 0, 29, 0, 0, 0, 0,
1300 30, 31, 32, 0, 0, 33, 0, 34, 0, 0,
1301 0, 35, 0, 0, 0, 0, 0, 6, -66, 7,
1302 36, 0, 37, 0, 240, 8, 0, 0, 0, 10,
1303 38, 39, 0, 0, 0, 0, 0, 0, 0, 0,
1304 0, 0, 0, 0, 0, 13, 0, 0, 0, 0,
1305 0, 208, 15, 0, 16, 0, 241, 0, 17, 40,
1306 0, 18, 0, 0, 0, 0, 0, 0, 19, 0,
1307 0, 0, 0, 0, 0, 0, 0, 0, 0, 21,
1308 0, 22, 23, 24, 0, 0, 0, 0, 0, 0,
1309 26, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1310 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1311 242, 0, 0, 0, 0, 0, 0, 0, 5, 0,
1312 0, 0, 0, 0, 29, 0, 0, 0, 0, 30,
1313 31, 32, 0, 0, 33, 0, 34, 243, 0, 0,
1314 211, 0, 0, 0, 0, 6, 0, 7, 0, 212,
1315 0, 37, 240, 8, 0, 0, 0, 10, 0, 38,
1316 39, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1317 0, 0, 0, 13, 0, 0, 0, 609, 0, 208,
1318 15, 0, 16, 0, 241, 0, 17, 0, 40, 18,
1319 0, 0, 0, 0, 0, 0, 19, 0, 0, 0,
1320 0, 0, 0, 0, 0, 0, 0, 21, 0, 22,
1321 23, 24, 0, 0, 0, 0, 0, 0, 26, 0,
1322 0, 5, 0, 0, 0, 476, 477, 478, 479, 480,
1323 481, 482, 483, 484, 0, 0, 0, 0, 242, 626,
1324 0, 0, 0, 0, 0, 0, 0, 0, 6, 0,
1325 7, 0, 29, 0, 0, 0, 8, 30, 31, 32,
1326 10, 0, 33, 0, 34, 243, 0, 0, 211, 0,
1327 0, 0, 0, 0, 0, 0, 13, 212, 0, 37,
1328 0, 0, 208, 15, 0, 16, 0, 38, 39, 17,
1329 0, 0, 18, 0, 0, 5, 0, 0, 0, 19,
1330 0, 0, 0, 0, 0, 636, 0, 0, 0, 0,
1331 21, 0, 22, 23, 24, 0, 40, 0, 0, 0,
1332 0, 26, 6, 0, 7, 0, 0, 0, 0, 0,
1333 8, 0, 0, 0, 10, 476, 477, 478, 479, 480,
1334 481, 482, 483, 484, 0, 0, 0, 0, 0, 0,
1335 13, 0, 0, 0, 0, 29, 208, 15, 0, 16,
1336 30, 31, 32, 17, 0, 33, 18, 34, 0, 0,
1337 0, 211, 0, 19, 0, 0, 0, 0, 0, 0,
1338 212, 0, 37, 0, 21, 0, 22, 23, 24, 0,
1339 38, 39, 0, 0, 485, 26, 486, 487, 488, 489,
1340 490, 491, 492, 493, 494, 495, 0, 0, 0, 0,
1341 0, 0, 0, 496, 497, 0, 0, 0, 0, 40,
1342 531, 0, 476, 477, 478, 479, 480, 481, 482, 29,
1343 484, 0, 0, 0, 30, 31, 32, 0, 0, 33,
1344 0, 34, 0, 0, 0, 211, 0, 0, 0, 0,
1345 0, 0, 0, 0, 212, 0, 37, 0, 0, 0,
1346 0, 0, 0, 0, 38, 39, 476, 477, 478, 479,
1347 480, 481, 482, 483, 484, 0, 0, 0, 0, 0,
1348 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1349 0, 0, 0, 40, 476, 477, 478, 479, 480, 481,
1350 482, 483, 484, 0, 485, 0, 486, 487, 488, 489,
1351 490, 491, 492, 493, 494, 495, 0, 0, 0, 0,
1352 0, 0, 0, 496, 497, 0, 0, 0, 0, 0,
1353 575, 476, 477, 478, 479, 480, 481, 482, 483, 484,
1354 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1355 0, 0, 476, 477, 478, 479, 480, 481, 482, 483,
1356 484, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1357 0, 476, 477, 478, 479, 480, 481, 482, 476, 477,
1358 478, 479, 480, 481, 482, 0, 0, 0, 0, 0,
1359 0, 0, 0, 486, 487, 488, 489, 490, 491, 492,
1360 493, 494, 495, 0, 0, 0, 0, 0, 0, 0,
1361 496, 497, 0, 0, 0, 0, 0, 0, 0, 0,
1362 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1363 0, 0, 0, 0, 0, 485, 0, 486, 487, 488,
1364 489, 490, 491, 492, 493, 494, 495, 0, 0, 0,
1365 0, 0, 0, 0, 496, 497, 562, 0, 0, 0,
1366 0, 0, 0, 485, 0, 486, 487, 488, 489, 490,
1367 491, 492, 493, 494, 495, 0, 0, 0, 0, 0,
1368 0, 0, 496, 497, 645, 0, 0, 0, 0, 0,
1369 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1370 485, 644, 486, 487, 488, 489, 490, 491, 492, 493,
1371 494, 495, 0, 0, 0, 0, 0, 0, 0, 496,
1372 497, 485, 0, 486, 487, 488, 489, 490, 491, 492,
1373 493, 494, 495, 0, 5, 0, 0, 0, 0, 0,
1374 496, 497, 486, 487, 488, 489, 490, 491, 492, 493,
1375 494, 495, 489, 490, 491, 492, 493, 494, 495, 496,
1376 497, 6, 0, 7, 0, 0, 496, 497, 0, 8,
1377 9, 0, 0, 10, 0, 0, 0, 0, 0, 0,
1378 0, 0, 0, 0, 0, 0, 0, 12, 0, 13,
1379 0, 0, 0, 0, 0, 208, 15, 0, 16, 0,
1380 0, 0, 17, 0, 0, 18, 0, 0, 5, 0,
1381 0, 0, 19, 0, 0, 0, 0, 0, 0, 0,
1382 0, 0, 0, 21, 0, 22, 23, 24, 25, 0,
1383 0, 209, 0, 0, 26, 6, 0, 7, 210, 0,
1384 0, 0, 0, 8, 0, 0, 0, 10, 0, 0,
1385 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1386 0, 0, 0, 13, 0, 0, 0, 0, 29, 208,
1387 15, 0, 16, 30, 31, 32, 17, 0, 33, 18,
1388 34, 0, 5, 0, 211, 0, 19, 0, 0, 0,
1389 0, 0, 0, 212, 0, 37, 0, 21, 0, 22,
1390 23, 24, 0, 38, 39, 0, 0, 0, 26, 6,
1391 0, 7, 0, 0, 0, 0, 0, 8, 0, 0,
1392 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1393 0, 0, 0, 0, 0, 0, 0, 13, 0, 0,
1394 0, 0, 29, 208, 15, 0, 0, 30, 31, 32,
1395 17, 0, 33, 18, 34, 0, 0, 0, 211, 0,
1396 19, 0, 0, 0, 0, 0, 0, 212, 0, 37,
1397 0, 0, 0, 22, 23, 24, 0, 38, 39, 0,
1398 0, 0, 26, 0, 0, 0, 0, 0, 0, 0,
1399 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1400 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1401 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1402 0, 30, 31, 32, 0, 0, 33, 0, 0, 0,
1403 0, 0, 211, 0, 0, 0, 0, 0, 0, 0,
1404 0, 212, 0, 37, 0, 0, 0, 0, 0, 0,
1405 0, 38, 39, 101, 0, 102, 103, 104, 105, 106,
1406 107, 0, 108, 0, 0, 109, 0, 110, 0, 0,
1407 0, 111, 112, 0, 113, 114, 115, 116, 0, 117,
1408 118, 119, 120, 121, 122, 123, 124, 0, 125, 0,
1409 126, 127, 128, 129, 130, 0, 0, 131, 0, 0,
1410 0, 132, 0, 133, 134, 0, 135, 136, 137, 138,
1411 139, 140, 0, 141, 142, 143, 144, 145, 146, 0,
1412 0, 147, 0, 0, 148, 0, 0, 0, 0, 149,
1413 150, 0, 151, 152, 0, 153, 154, 0, 0, 0,
1414 155, 156, 157, 158, 159, 160, 0, 161, 162, 163,
1415 164, 165, 166, 167, 0, 168, 0, 169, 0, 170,
1416 171, 172, 173, 174, 175, 176, 177, 178, 0, 179,
1417 180, 181, 182, 0, 0, 0, 183, 0, 0, 184,
1418 0, 0, 185, 186, 0, 0, 187, 188, 189, 190,
1419 0, 0, 191, 0, 192, 0, 193, 194, 195, 196,
1420 197, 198, 199, 0, 0, 200
1421 };
1422
1423 static const yytype_int16 yycheck[] =
1424 {
1425 2, 50, 2, 2, 71, 47, 71, 2, 272, 2,
1426 245, 246, 2, 2, 280, 2, 207, 50, 2, 2,
1427 311, 2, 2, 298, 6, 38, 330, 269, 16, 156,
1428 272, 249, 35, 36, 332, 58, 156, 279, 51, 182,
1429 282, 72, 108, 515, 99, 273, 288, 289, 276, 569,
1430 278, 50, 514, 281, 156, 50, 134, 50, 286, 182,
1431 138, 182, 93, 50, 182, 513, 209, 182, 182, 517,
1432 9, 335, 208, 12, 129, 3, 99, 5, 205, 574,
1433 207, 6, 7, 204, 579, 205, 209, 165, 44, 0,
1434 96, 209, 207, 335, 336, 209, 9, 332, 68, 69,
1435 70, 69, 70, 205, 74, 577, 74, 203, 3, 208,
1436 203, 39, 208, 69, 576, 208, 44, 14, 15, 16,
1437 17, 18, 19, 20, 366, 367, 368, 369, 370, 371,
1438 372, 16, 323, 208, 425, 326, 26, 203, 94, 659,
1439 635, 31, 614, 71, 419, 203, 437, 609, 32, 326,
1440 208, 203, 219, 37, 219, 207, 347, 348, 349, 3,
1441 608, 5, 3, 611, 5, 3, 203, 5, 207, 206,
1442 642, 348, 349, 203, 636, 3, 206, 5, 245, 246,
1443 245, 246, 203, 139, 3, 206, 5, 162, 207, 424,
1444 638, 258, 207, 206, 227, 151, 207, 125, 39, 647,
1445 267, 39, 444, 205, 206, 184, 205, 206, 211, 212,
1446 207, 205, 205, 206, 202, 203, 664, 9, 205, 206,
1447 16, 3, 207, 5, 152, 453, 3, 209, 5, 205,
1448 71, 280, 205, 71, 476, 477, 207, 479, 480, 481,
1449 482, 483, 484, 485, 486, 487, 488, 489, 490, 491,
1450 492, 493, 494, 495, 558, 497, 287, 475, 3, 290,
1451 5, 292, 293, 312, 192, 332, 297, 332, 559, 3,
1452 498, 205, 6, 7, 8, 9, 10, 11, 280, 205,
1453 208, 523, 3, 253, 125, 253, 207, 125, 337, 186,
1454 187, 188, 189, 190, 191, 192, 193, 194, 564, 205,
1455 528, 207, 205, 521, 207, 202, 203, 192, 193, 194,
1456 608, 152, 205, 207, 152, 550, 207, 202, 203, 14,
1457 15, 16, 3, 372, 5, 3, 207, 5, 619, 331,
1458 208, 331, 331, 208, 208, 337, 70, 635, 331, 208,
1459 3, 390, 5, 3, 331, 5, 3, 349, 5, 647,
1460 3, 192, 5, 3, 192, 5, 574, 424, 3, 424,
1461 5, 579, 203, 208, 582, 656, 664, 208, 208, 208,
1462 208, 177, 178, 179, 180, 181, 207, 39, 209, 39,
1463 203, 208, 431, 117, 44, 452, 621, 208, 208, 207,
1464 439, 208, 208, 657, 190, 191, 192, 193, 194, 641,
1465 208, 208, 644, 208, 208, 208, 202, 203, 457, 71,
1466 475, 71, 205, 208, 148, 657, 207, 635, 467, 208,
1467 208, 208, 208, 208, 40, 208, 428, 161, 428, 428,
1468 208, 433, 431, 428, 436, 428, 436, 436, 428, 428,
1469 439, 428, 426, 436, 428, 428, 439, 428, 428, 436,
1470 515, 679, 439, 187, 208, 208, 190, 191, 192, 208,
1471 208, 195, 196, 125, 457, 125, 515, 83, 208, 208,
1472 204, 208, 208, 184, 208, 207, 205, 210, 209, 209,
1473 96, 97, 98, 550, 208, 550, 9, 9, 9, 105,
1474 152, 9, 152, 684, 685, 190, 191, 192, 193, 194,
1475 9, 543, 9, 9, 571, 554, 9, 202, 203, 574,
1476 9, 203, 577, 515, 579, 564, 184, 208, 207, 205,
1477 14, 15, 16, 17, 18, 19, 20, 207, 577, 145,
1478 192, 205, 192, 149, 205, 182, 209, 39, 210, 206,
1479 6, 203, 44, 203, 209, 209, 208, 208, 208, 182,
1480 209, 209, 9, 209, 621, 209, 621, 209, 209, 184,
1481 209, 209, 564, 209, 90, 614, 209, 209, 209, 71,
1482 635, 209, 209, 209, 209, 577, 202, 209, 3, 209,
1483 5, 6, 7, 8, 9, 10, 11, 209, 209, 209,
1484 209, 209, 209, 642, 207, 206, 182, 3, 207, 209,
1485 6, 7, 8, 9, 10, 11, 209, 32, 207, 34,
1486 3, 3, 614, 9, 209, 40, 6, 182, 620, 44,
1487 207, 620, 624, 125, 624, 624, 207, 620, 184, 209,
1488 209, 624, 209, 620, 209, 60, 205, 624, 209, 209,
1489 642, 66, 67, 209, 69, 70, 209, 209, 73, 3,
1490 152, 76, 6, 7, 8, 9, 10, 11, 83, 184,
1491 184, 207, 435, 294, 70, 288, 523, 685, 452, 94,
1492 433, 96, 97, 98, 50, 219, 284, -1, -1, -1,
1493 105, 659, -1, -1, 324, -1, -1, -1, -1, -1,
1494 192, -1, 117, 187, 188, 189, 190, 191, 192, 193,
1495 194, 203, -1, -1, -1, -1, 208, -1, 202, 203,
1496 -1, 117, -1, -1, 139, -1, 70, -1, -1, 144,
1497 145, 146, -1, 148, 149, -1, 151, -1, -1, -1,
1498 155, -1, 14, 15, 16, -1, 161, 19, 20, 164,
1499 -1, 166, 148, -1, -1, -1, -1, -1, -1, 174,
1500 175, -1, -1, -1, -1, 161, -1, -1, -1, -1,
1501 -1, -1, 187, 117, -1, 190, 191, 192, -1, -1,
1502 195, 196, -1, -1, -1, -1, -1, -1, -1, -1,
1503 -1, 187, -1, 208, 190, 191, 192, -1, -1, 195,
1504 196, -1, -1, -1, 148, 4, 5, -1, 204, -1,
1505 -1, -1, 208, -1, -1, -1, -1, 161, -1, -1,
1506 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1507 -1, -1, -1, 32, -1, 34, -1, -1, -1, -1,
1508 -1, 40, 41, 187, -1, 44, 190, 191, 192, -1,
1509 49, 195, 196, -1, -1, -1, -1, -1, -1, 58,
1510 -1, 60, -1, -1, 208, -1, -1, 66, 67, -1,
1511 69, -1, -1, -1, 73, -1, -1, 76, -1, -1,
1512 -1, -1, -1, -1, 83, -1, -1, -1, -1, -1,
1513 -1, 90, 91, -1, -1, 94, -1, 96, 97, 98,
1514 99, -1, -1, -1, -1, -1, 105, -1, -1, -1,
1515 -1, 110, -1, -1, -1, -1, 188, 189, 190, 191,
1516 192, 193, 194, 4, 5, -1, -1, -1, 127, -1,
1517 202, 203, -1, -1, -1, -1, -1, -1, -1, -1,
1518 139, -1, -1, -1, -1, 144, 145, 146, -1, -1,
1519 149, 32, 151, 34, -1, -1, 155, -1, -1, 40,
1520 41, -1, -1, 44, -1, 164, -1, 166, 49, -1,
1521 -1, -1, -1, -1, -1, 174, 175, 58, -1, 60,
1522 -1, -1, -1, -1, -1, 66, 67, -1, 69, -1,
1523 -1, -1, 73, -1, -1, 76, -1, -1, -1, -1,
1524 -1, -1, 83, -1, 203, -1, -1, 206, -1, 90,
1525 91, -1, -1, 94, -1, 96, 97, 98, 99, -1,
1526 -1, -1, -1, -1, 105, -1, -1, -1, -1, 110,
1527 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1528 -1, 4, 5, -1, -1, -1, 127, -1, -1, -1,
1529 -1, -1, -1, -1, -1, -1, -1, -1, 139, -1,
1530 -1, -1, -1, 144, 145, 146, -1, -1, 149, 32,
1531 151, 34, -1, -1, 155, -1, -1, 40, 41, -1,
1532 -1, 44, -1, 164, -1, 166, 49, -1, -1, -1,
1533 -1, -1, -1, 174, 175, 58, -1, 60, -1, -1,
1534 -1, -1, -1, 66, 67, -1, 69, -1, -1, -1,
1535 73, -1, -1, 76, -1, -1, -1, -1, -1, -1,
1536 83, -1, 203, -1, -1, 206, -1, 90, -1, -1,
1537 -1, 94, -1, 96, 97, 98, 99, -1, -1, -1,
1538 -1, -1, 105, -1, 4, 5, -1, 110, -1, -1,
1539 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1540 -1, -1, -1, -1, 127, -1, -1, -1, -1, -1,
1541 -1, -1, 32, -1, 34, -1, 139, -1, -1, -1,
1542 40, 144, 145, 146, 44, -1, 149, -1, 151, 49,
1543 -1, -1, 155, -1, -1, -1, -1, -1, -1, -1,
1544 60, 164, -1, 166, -1, -1, 66, 67, -1, 69,
1545 -1, 174, 175, 73, -1, -1, 76, -1, -1, -1,
1546 -1, -1, -1, 83, -1, -1, -1, -1, -1, -1,
1547 90, -1, -1, -1, 94, -1, 96, 97, 98, -1,
1548 203, -1, -1, 206, -1, 105, -1, 4, 5, -1,
1549 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1550 -1, -1, -1, -1, -1, -1, -1, 127, -1, -1,
1551 -1, -1, -1, -1, -1, 32, -1, 34, -1, 139,
1552 -1, -1, -1, 40, 144, 145, 146, 44, -1, 149,
1553 -1, 151, 49, -1, -1, 155, -1, -1, -1, -1,
1554 -1, -1, -1, 60, 164, -1, 166, -1, -1, 66,
1555 67, -1, 69, -1, 174, 175, 73, -1, -1, 76,
1556 -1, -1, -1, -1, -1, -1, 83, -1, -1, -1,
1557 -1, -1, -1, 90, -1, -1, -1, 94, -1, 96,
1558 97, 98, -1, 203, -1, -1, 206, -1, 105, -1,
1559 4, 5, -1, -1, -1, -1, -1, -1, 14, 15,
1560 16, 17, 18, 19, 20, 21, 22, -1, -1, -1,
1561 127, -1, -1, -1, -1, -1, -1, -1, 32, -1,
1562 34, -1, 139, -1, -1, -1, 40, 144, 145, 146,
1563 44, -1, 149, -1, 151, 49, -1, -1, 155, -1,
1564 -1, -1, -1, -1, -1, -1, 60, 164, -1, 166,
1565 -1, -1, 66, 67, -1, 69, -1, 174, 175, 73,
1566 -1, -1, 76, -1, -1, 5, -1, -1, -1, 83,
1567 -1, -1, -1, -1, -1, -1, 90, -1, -1, -1,
1568 94, -1, 96, 97, 98, -1, 203, -1, -1, 206,
1569 -1, 105, 32, -1, 34, -1, -1, -1, -1, -1,
1570 40, -1, -1, -1, 44, -1, -1, -1, -1, -1,
1571 -1, -1, -1, 127, -1, -1, -1, -1, -1, -1,
1572 60, -1, -1, -1, -1, 139, 66, 67, -1, 69,
1573 144, 145, 146, 73, -1, 149, 76, 151, -1, -1,
1574 -1, 155, -1, 83, -1, -1, -1, -1, -1, -1,
1575 164, -1, 166, -1, 94, -1, 96, 97, 98, -1,
1576 174, 175, -1, -1, -1, 105, -1, 183, -1, 185,
1577 186, 187, 188, 189, 190, 191, 192, 193, 194, -1,
1578 -1, -1, 4, 5, -1, -1, 202, 203, -1, 203,
1579 -1, 13, 206, 209, -1, -1, -1, -1, -1, 139,
1580 -1, -1, -1, -1, 144, 145, 146, -1, -1, 149,
1581 32, 151, 34, -1, -1, 155, -1, -1, 40, 41,
1582 -1, -1, 44, -1, 164, -1, 166, 49, -1, -1,
1583 -1, -1, -1, -1, 174, 175, 58, -1, 60, -1,
1584 -1, -1, -1, -1, 66, 67, -1, 69, -1, -1,
1585 -1, 73, -1, -1, 76, -1, -1, -1, -1, -1,
1586 -1, 83, -1, 203, -1, -1, 206, -1, 90, 91,
1587 -1, -1, 94, -1, 96, 97, 98, 99, -1, -1,
1588 -1, -1, -1, 105, -1, -1, -1, -1, 110, -1,
1589 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1590 4, 5, -1, -1, -1, 127, -1, -1, -1, -1,
1591 -1, -1, -1, -1, -1, -1, -1, 139, -1, -1,
1592 -1, -1, 144, 145, 146, -1, -1, 149, 32, 151,
1593 34, -1, -1, 155, -1, -1, 40, 41, -1, -1,
1594 44, -1, 164, -1, 166, 49, -1, -1, -1, -1,
1595 -1, -1, 174, 175, 58, -1, 60, -1, -1, -1,
1596 -1, -1, 66, 67, -1, 69, -1, -1, -1, 73,
1597 -1, -1, 76, -1, -1, -1, -1, -1, -1, 83,
1598 -1, 203, -1, -1, -1, -1, 90, -1, -1, -1,
1599 94, -1, 96, 97, 98, 99, -1, -1, -1, -1,
1600 -1, 105, -1, -1, -1, -1, 110, -1, -1, -1,
1601 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1602 -1, -1, -1, 127, -1, -1, -1, -1, -1, -1,
1603 5, -1, -1, -1, -1, 139, -1, -1, -1, -1,
1604 144, 145, 146, -1, -1, 149, -1, 151, -1, -1,
1605 -1, 155, -1, -1, -1, -1, -1, 32, 162, 34,
1606 164, -1, 166, -1, 39, 40, -1, -1, -1, 44,
1607 174, 175, -1, -1, -1, -1, -1, -1, -1, -1,
1608 -1, -1, -1, -1, -1, 60, -1, -1, -1, -1,
1609 -1, 66, 67, -1, 69, -1, 71, -1, 73, 203,
1610 -1, 76, -1, -1, -1, -1, -1, -1, 83, -1,
1611 -1, -1, -1, -1, -1, -1, -1, -1, -1, 94,
1612 -1, 96, 97, 98, -1, -1, -1, -1, -1, -1,
1613 105, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1614 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1615 125, -1, -1, -1, -1, -1, -1, -1, 5, -1,
1616 -1, -1, -1, -1, 139, -1, -1, -1, -1, 144,
1617 145, 146, -1, -1, 149, -1, 151, 152, -1, -1,
1618 155, -1, -1, -1, -1, 32, -1, 34, -1, 164,
1619 -1, 166, 39, 40, -1, -1, -1, 44, -1, 174,
1620 175, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1621 -1, -1, -1, 60, -1, -1, -1, 192, -1, 66,
1622 67, -1, 69, -1, 71, -1, 73, -1, 203, 76,
1623 -1, -1, -1, -1, -1, -1, 83, -1, -1, -1,
1624 -1, -1, -1, -1, -1, -1, -1, 94, -1, 96,
1625 97, 98, -1, -1, -1, -1, -1, -1, 105, -1,
1626 -1, 5, -1, -1, -1, 14, 15, 16, 17, 18,
1627 19, 20, 21, 22, -1, -1, -1, -1, 125, 23,
1628 -1, -1, -1, -1, -1, -1, -1, -1, 32, -1,
1629 34, -1, 139, -1, -1, -1, 40, 144, 145, 146,
1630 44, -1, 149, -1, 151, 152, -1, -1, 155, -1,
1631 -1, -1, -1, -1, -1, -1, 60, 164, -1, 166,
1632 -1, -1, 66, 67, -1, 69, -1, 174, 175, 73,
1633 -1, -1, 76, -1, -1, 5, -1, -1, -1, 83,
1634 -1, -1, -1, -1, -1, 192, -1, -1, -1, -1,
1635 94, -1, 96, 97, 98, -1, 203, -1, -1, -1,
1636 -1, 105, 32, -1, 34, -1, -1, -1, -1, -1,
1637 40, -1, -1, -1, 44, 14, 15, 16, 17, 18,
1638 19, 20, 21, 22, -1, -1, -1, -1, -1, -1,
1639 60, -1, -1, -1, -1, 139, 66, 67, -1, 69,
1640 144, 145, 146, 73, -1, 149, 76, 151, -1, -1,
1641 -1, 155, -1, 83, -1, -1, -1, -1, -1, -1,
1642 164, -1, 166, -1, 94, -1, 96, 97, 98, -1,
1643 174, 175, -1, -1, 183, 105, 185, 186, 187, 188,
1644 189, 190, 191, 192, 193, 194, -1, -1, -1, -1,
1645 -1, -1, -1, 202, 203, -1, -1, -1, -1, 203,
1646 209, -1, 14, 15, 16, 17, 18, 19, 20, 139,
1647 22, -1, -1, -1, 144, 145, 146, -1, -1, 149,
1648 -1, 151, -1, -1, -1, 155, -1, -1, -1, -1,
1649 -1, -1, -1, -1, 164, -1, 166, -1, -1, -1,
1650 -1, -1, -1, -1, 174, 175, 14, 15, 16, 17,
1651 18, 19, 20, 21, 22, -1, -1, -1, -1, -1,
1652 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1653 -1, -1, -1, 203, 14, 15, 16, 17, 18, 19,
1654 20, 21, 22, -1, 183, -1, 185, 186, 187, 188,
1655 189, 190, 191, 192, 193, 194, -1, -1, -1, -1,
1656 -1, -1, -1, 202, 203, -1, -1, -1, -1, -1,
1657 209, 14, 15, 16, 17, 18, 19, 20, 21, 22,
1658 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1659 -1, -1, 14, 15, 16, 17, 18, 19, 20, 21,
1660 22, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1661 -1, 14, 15, 16, 17, 18, 19, 20, 14, 15,
1662 16, 17, 18, 19, 20, -1, -1, -1, -1, -1,
1663 -1, -1, -1, 185, 186, 187, 188, 189, 190, 191,
1664 192, 193, 194, -1, -1, -1, -1, -1, -1, -1,
1665 202, 203, -1, -1, -1, -1, -1, -1, -1, -1,
1666 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1667 -1, -1, -1, -1, -1, 183, -1, 185, 186, 187,
1668 188, 189, 190, 191, 192, 193, 194, -1, -1, -1,
1669 -1, -1, -1, -1, 202, 203, 204, -1, -1, -1,
1670 -1, -1, -1, 183, -1, 185, 186, 187, 188, 189,
1671 190, 191, 192, 193, 194, -1, -1, -1, -1, -1,
1672 -1, -1, 202, 203, 204, -1, -1, -1, -1, -1,
1673 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1674 183, 184, 185, 186, 187, 188, 189, 190, 191, 192,
1675 193, 194, -1, -1, -1, -1, -1, -1, -1, 202,
1676 203, 183, -1, 185, 186, 187, 188, 189, 190, 191,
1677 192, 193, 194, -1, 5, -1, -1, -1, -1, -1,
1678 202, 203, 185, 186, 187, 188, 189, 190, 191, 192,
1679 193, 194, 188, 189, 190, 191, 192, 193, 194, 202,
1680 203, 32, -1, 34, -1, -1, 202, 203, -1, 40,
1681 41, -1, -1, 44, -1, -1, -1, -1, -1, -1,
1682 -1, -1, -1, -1, -1, -1, -1, 58, -1, 60,
1683 -1, -1, -1, -1, -1, 66, 67, -1, 69, -1,
1684 -1, -1, 73, -1, -1, 76, -1, -1, 5, -1,
1685 -1, -1, 83, -1, -1, -1, -1, -1, -1, -1,
1686 -1, -1, -1, 94, -1, 96, 97, 98, 99, -1,
1687 -1, 102, -1, -1, 105, 32, -1, 34, 109, -1,
1688 -1, -1, -1, 40, -1, -1, -1, 44, -1, -1,
1689 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1690 -1, -1, -1, 60, -1, -1, -1, -1, 139, 66,
1691 67, -1, 69, 144, 145, 146, 73, -1, 149, 76,
1692 151, -1, 5, -1, 155, -1, 83, -1, -1, -1,
1693 -1, -1, -1, 164, -1, 166, -1, 94, -1, 96,
1694 97, 98, -1, 174, 175, -1, -1, -1, 105, 32,
1695 -1, 34, -1, -1, -1, -1, -1, 40, -1, -1,
1696 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1697 -1, -1, -1, -1, -1, -1, -1, 60, -1, -1,
1698 -1, -1, 139, 66, 67, -1, -1, 144, 145, 146,
1699 73, -1, 149, 76, 151, -1, -1, -1, 155, -1,
1700 83, -1, -1, -1, -1, -1, -1, 164, -1, 166,
1701 -1, -1, -1, 96, 97, 98, -1, 174, 175, -1,
1702 -1, -1, 105, -1, -1, -1, -1, -1, -1, -1,
1703 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1704 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1705 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1706 -1, 144, 145, 146, -1, -1, 149, -1, -1, -1,
1707 -1, -1, 155, -1, -1, -1, -1, -1, -1, -1,
1708 -1, 164, -1, 166, -1, -1, -1, -1, -1, -1,
1709 -1, 174, 175, 24, -1, 26, 27, 28, 29, 30,
1710 31, -1, 33, -1, -1, 36, -1, 38, -1, -1,
1711 -1, 42, 43, -1, 45, 46, 47, 48, -1, 50,
1712 51, 52, 53, 54, 55, 56, 57, -1, 59, -1,
1713 61, 62, 63, 64, 65, -1, -1, 68, -1, -1,
1714 -1, 72, -1, 74, 75, -1, 77, 78, 79, 80,
1715 81, 82, -1, 84, 85, 86, 87, 88, 89, -1,
1716 -1, 92, -1, -1, 95, -1, -1, -1, -1, 100,
1717 101, -1, 103, 104, -1, 106, 107, -1, -1, -1,
1718 111, 112, 113, 114, 115, 116, -1, 118, 119, 120,
1719 121, 122, 123, 124, -1, 126, -1, 128, -1, 130,
1720 131, 132, 133, 134, 135, 136, 137, 138, -1, 140,
1721 141, 142, 143, -1, -1, -1, 147, -1, -1, 150,
1722 -1, -1, 153, 154, -1, -1, 157, 158, 159, 160,
1723 -1, -1, 163, -1, 165, -1, 167, 168, 169, 170,
1724 171, 172, 173, -1, -1, 176
1725 };
1726
1727 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1728 symbol of state STATE-NUM. */
1729 static const yytype_uint16 yystos[] =
1730 {
1731 0, 212, 213, 0, 4, 5, 32, 34, 40, 41,
1732 44, 49, 58, 60, 66, 67, 69, 73, 76, 83,
1733 90, 94, 96, 97, 98, 99, 105, 110, 127, 139,
1734 144, 145, 146, 149, 151, 155, 164, 166, 174, 175,
1735 203, 219, 220, 222, 223, 224, 225, 228, 229, 235,
1736 236, 247, 261, 265, 267, 268, 269, 270, 271, 274,
1737 275, 278, 280, 281, 282, 283, 285, 286, 287, 288,
1738 289, 291, 293, 311, 312, 313, 314, 3, 5, 208,
1739 3, 5, 3, 5, 263, 96, 266, 9, 3, 5,
1740 266, 3, 208, 208, 266, 267, 3, 263, 3, 263,
1741 267, 24, 26, 27, 28, 29, 30, 31, 33, 36,
1742 38, 42, 43, 45, 46, 47, 48, 50, 51, 52,
1743 53, 54, 55, 56, 57, 59, 61, 62, 63, 64,
1744 65, 68, 72, 74, 75, 77, 78, 79, 80, 81,
1745 82, 84, 85, 86, 87, 88, 89, 92, 95, 100,
1746 101, 103, 104, 106, 107, 111, 112, 113, 114, 115,
1747 116, 118, 119, 120, 121, 122, 123, 124, 126, 128,
1748 130, 131, 132, 133, 134, 135, 136, 137, 138, 140,
1749 141, 142, 143, 147, 150, 153, 154, 157, 158, 159,
1750 160, 163, 165, 167, 168, 169, 170, 171, 172, 173,
1751 176, 237, 239, 310, 207, 215, 215, 162, 66, 102,
1752 109, 155, 164, 227, 247, 268, 274, 280, 284, 291,
1753 311, 314, 207, 207, 205, 205, 207, 205, 207, 218,
1754 207, 184, 279, 205, 292, 293, 292, 292, 3, 5,
1755 39, 71, 125, 152, 192, 208, 241, 264, 294, 295,
1756 308, 247, 311, 312, 314, 292, 207, 9, 205, 207,
1757 3, 312, 205, 156, 205, 208, 208, 208, 208, 208,
1758 208, 208, 208, 208, 208, 208, 208, 208, 208, 208,
1759 208, 208, 208, 208, 208, 208, 208, 208, 208, 208,
1760 208, 208, 208, 208, 208, 208, 208, 208, 182, 204,
1761 13, 91, 219, 226, 229, 268, 270, 271, 282, 283,
1762 286, 206, 235, 236, 3, 3, 5, 3, 5, 3,
1763 3, 205, 308, 272, 214, 129, 276, 280, 3, 5,
1764 205, 217, 290, 294, 294, 210, 203, 208, 234, 292,
1765 209, 244, 245, 246, 264, 184, 209, 254, 208, 257,
1766 9, 9, 12, 240, 264, 3, 6, 7, 8, 9,
1767 10, 11, 70, 117, 148, 161, 187, 190, 191, 192,
1768 195, 196, 208, 250, 251, 252, 250, 253, 9, 9,
1769 238, 253, 252, 9, 9, 252, 9, 252, 250, 233,
1770 236, 291, 252, 248, 249, 250, 9, 310, 9, 252,
1771 312, 248, 250, 312, 177, 178, 179, 180, 181, 309,
1772 312, 312, 240, 6, 7, 315, 9, 312, 239, 203,
1773 208, 207, 205, 218, 291, 206, 235, 273, 213, 184,
1774 108, 235, 259, 277, 207, 205, 217, 206, 219, 236,
1775 289, 294, 209, 253, 192, 204, 250, 230, 231, 232,
1776 233, 206, 182, 210, 6, 221, 206, 235, 255, 259,
1777 206, 236, 256, 259, 209, 209, 209, 208, 250, 250,
1778 250, 250, 250, 250, 250, 291, 14, 15, 16, 17,
1779 18, 19, 20, 21, 22, 183, 185, 186, 187, 188,
1780 189, 190, 191, 192, 193, 194, 202, 203, 182, 209,
1781 209, 209, 182, 209, 209, 209, 209, 209, 209, 209,
1782 209, 209, 209, 291, 192, 208, 234, 241, 264, 300,
1783 302, 303, 209, 182, 209, 209, 209, 209, 182, 209,
1784 209, 209, 209, 209, 209, 209, 209, 202, 209, 209,
1785 209, 239, 9, 216, 294, 304, 218, 283, 206, 184,
1786 291, 311, 207, 206, 236, 260, 261, 206, 225, 206,
1787 218, 204, 204, 209, 182, 246, 252, 6, 209, 291,
1788 314, 209, 207, 207, 291, 209, 192, 208, 234, 241,
1789 296, 298, 299, 250, 250, 3, 250, 250, 250, 250,
1790 250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
1791 250, 250, 250, 3, 250, 252, 9, 302, 290, 192,
1792 230, 241, 301, 302, 208, 234, 249, 252, 6, 209,
1793 215, 182, 294, 207, 217, 218, 23, 233, 300, 306,
1794 307, 207, 262, 264, 298, 290, 192, 230, 241, 297,
1795 298, 209, 208, 234, 184, 204, 302, 290, 209, 302,
1796 209, 230, 209, 218, 206, 294, 206, 184, 305, 182,
1797 207, 205, 209, 298, 290, 209, 302, 209, 250, 230,
1798 250, 302, 209, 218, 253, 306, 242, 302, 209, 38,
1799 51, 206, 243, 252, 184, 184, 207, 258, 259, 258,
1800 207
1801 };
1802
1803 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
1804 static const yytype_uint16 yyr1[] =
1805 {
1806 0, 211, 212, 213, 214, 213, 213, 213, 213, 213,
1807 213, 213, 213, 215, 215, 216, 215, 215, 215, 215,
1808 215, 215, 215, 215, 217, 217, 218, 218, 219, 219,
1809 219, 219, 219, 219, 219, 220, 221, 221, 222, 222,
1810 222, 222, 222, 222, 222, 222, 222, 223, 224, 225,
1811 226, 227, 227, 228, 229, 230, 230, 231, 231, 232,
1812 232, 233, 233, 234, 234, 234, 235, 235, 236, 237,
1813 237, 237, 238, 238, 239, 239, 239, 239, 239, 239,
1814 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
1815 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
1816 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
1817 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
1818 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
1819 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
1820 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
1821 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
1822 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
1823 239, 239, 239, 239, 240, 240, 241, 241, 241, 241,
1824 242, 242, 243, 243, 244, 244, 244, 245, 245, 246,
1825 246, 247, 248, 248, 249, 249, 250, 250, 250, 250,
1826 250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
1827 250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
1828 250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
1829 250, 250, 250, 250, 250, 250, 250, 251, 251, 252,
1830 253, 254, 254, 255, 255, 256, 256, 257, 257, 258,
1831 258, 259, 259, 260, 261, 261, 262, 262, 263, 263,
1832 263, 264, 264, 265, 265, 265, 265, 265, 265, 265,
1833 265, 265, 265, 265, 266, 266, 267, 267, 267, 267,
1834 267, 267, 267, 267, 268, 268, 269, 270, 271, 272,
1835 272, 273, 274, 274, 275, 276, 276, 277, 277, 278,
1836 278, 279, 279, 280, 280, 281, 282, 282, 282, 283,
1837 283, 284, 284, 285, 286, 287, 287, 287, 288, 289,
1838 290, 290, 291, 291, 292, 292, 293, 293, 293, 294,
1839 294, 294, 295, 295, 295, 295, 296, 296, 296, 297,
1840 297, 298, 298, 299, 299, 299, 299, 299, 300, 300,
1841 300, 301, 301, 302, 302, 303, 303, 303, 303, 303,
1842 303, 304, 304, 305, 305, 306, 307, 307, 308, 308,
1843 309, 309, 309, 309, 309, 310, 310, 310, 311, 312,
1844 312, 312, 312, 312, 312, 312, 312, 312, 312, 313,
1845 314, 314, 315, 315, 315
1846 };
1847
1848 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
1849 static const yytype_uint8 yyr2[] =
1850 {
1851 0, 2, 1, 0, 0, 6, 2, 2, 3, 2,
1852 2, 2, 2, 0, 2, 0, 6, 2, 3, 2,
1853 2, 2, 2, 2, 0, 2, 0, 1, 1, 2,
1854 2, 1, 2, 1, 1, 6, 1, 2, 1, 2,
1855 1, 2, 1, 2, 2, 2, 2, 4, 3, 3,
1856 5, 2, 2, 3, 4, 0, 1, 1, 3, 1,
1857 3, 3, 2, 3, 3, 2, 0, 1, 3, 1,
1858 3, 4, 1, 3, 0, 1, 4, 1, 1, 1,
1859 1, 1, 4, 4, 1, 1, 1, 1, 1, 1,
1860 1, 1, 1, 1, 4, 1, 1, 1, 4, 1,
1861 1, 1, 4, 4, 1, 1, 1, 1, 4, 4,
1862 4, 4, 4, 1, 4, 1, 1, 4, 1, 4,
1863 1, 1, 4, 4, 1, 1, 1, 1, 1, 1,
1864 1, 1, 1, 1, 1, 1, 1, 1, 4, 1,
1865 1, 1, 4, 4, 1, 1, 1, 1, 1, 6,
1866 1, 4, 1, 1, 1, 4, 1, 1, 1, 4,
1867 4, 4, 4, 1, 1, 4, 4, 4, 1, 1,
1868 4, 4, 4, 1, 1, 1, 1, 1, 1, 1,
1869 0, 2, 4, 3, 0, 2, 1, 1, 3, 3,
1870 1, 5, 1, 3, 0, 1, 1, 1, 1, 1,
1871 1, 1, 1, 1, 1, 1, 5, 3, 3, 3,
1872 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
1873 3, 3, 3, 3, 3, 2, 2, 2, 2, 2,
1874 2, 3, 3, 5, 5, 4, 3, 1, 3, 1,
1875 1, 0, 2, 4, 3, 2, 2, 0, 2, 2,
1876 1, 3, 2, 1, 3, 2, 0, 1, 0, 1,
1877 1, 1, 1, 1, 1, 1, 2, 2, 1, 1,
1878 1, 1, 1, 1, 0, 1, 1, 2, 1, 2,
1879 2, 1, 1, 1, 2, 2, 2, 5, 2, 0,
1880 2, 2, 2, 2, 2, 2, 3, 2, 3, 5,
1881 5, 0, 2, 2, 2, 2, 6, 8, 2, 2,
1882 2, 2, 2, 2, 5, 1, 1, 1, 1, 1,
1883 0, 2, 2, 3, 0, 1, 2, 2, 2, 3,
1884 2, 1, 1, 3, 2, 4, 3, 2, 1, 3,
1885 2, 0, 1, 3, 2, 1, 3, 4, 3, 2,
1886 1, 3, 2, 0, 1, 1, 3, 2, 1, 3,
1887 4, 1, 3, 0, 2, 2, 1, 3, 1, 3,
1888 1, 1, 1, 1, 1, 1, 1, 1, 5, 1,
1889 1, 1, 1, 2, 1, 2, 1, 2, 4, 5,
1890 5, 10, 1, 3, 1
1891 };
1892
1893
1894 #define yyerrok (yyerrstatus = 0)
1895 #define yyclearin (yychar = YYEMPTY)
1896 #define YYEMPTY (-2)
1897 #define YYEOF 0
1898
1899 #define YYACCEPT goto yyacceptlab
1900 #define YYABORT goto yyabortlab
1901 #define YYERROR goto yyerrorlab
1902
1903
1904 #define YYRECOVERING() (!!yyerrstatus)
1905
1906 #define YYBACKUP(Token, Value) \
1907 do \
1908 if (yychar == YYEMPTY) \
1909 { \
1910 yychar = (Token); \
1911 yylval = (Value); \
1912 YYPOPSTACK (yylen); \
1913 yystate = *yyssp; \
1914 goto yybackup; \
1915 } \
1916 else \
1917 { \
1918 yyerror (YY_("syntax error: cannot back up")); \
1919 YYERROR; \
1920 } \
1921 while (0)
1922
1923 /* Error token number */
1924 #define YYTERROR 1
1925 #define YYERRCODE 256
1926
1927
1928
1929 /* Enable debugging if requested. */
1930 #if YYDEBUG
1931
1932 # ifndef YYFPRINTF
1933 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1934 # define YYFPRINTF fprintf
1935 # endif
1936
1937 # define YYDPRINTF(Args) \
1938 do { \
1939 if (yydebug) \
1940 YYFPRINTF Args; \
1941 } while (0)
1942
1943 /* This macro is provided for backward compatibility. */
1944 #ifndef YY_LOCATION_PRINT
1945 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1946 #endif
1947
1948
1949 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1950 do { \
1951 if (yydebug) \
1952 { \
1953 YYFPRINTF (stderr, "%s ", Title); \
1954 yy_symbol_print (stderr, \
1955 Type, Value); \
1956 YYFPRINTF (stderr, "\n"); \
1957 } \
1958 } while (0)
1959
1960
1961 /*----------------------------------------.
1962 | Print this symbol's value on YYOUTPUT. |
1963 `----------------------------------------*/
1964
1965 static void
1966 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1967 {
1968 FILE *yyo = yyoutput;
1969 YYUSE (yyo);
1970 if (!yyvaluep)
1971 return;
1972 # ifdef YYPRINT
1973 if (yytype < YYNTOKENS)
1974 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1975 # endif
1976 YYUSE (yytype);
1977 }
1978
1979
1980 /*--------------------------------.
1981 | Print this symbol on YYOUTPUT. |
1982 `--------------------------------*/
1983
1984 static void
1985 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1986 {
1987 YYFPRINTF (yyoutput, "%s %s (",
1988 yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
1989
1990 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
1991 YYFPRINTF (yyoutput, ")");
1992 }
1993
1994 /*------------------------------------------------------------------.
1995 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1996 | TOP (included). |
1997 `------------------------------------------------------------------*/
1998
1999 static void
2000 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
2001 {
2002 YYFPRINTF (stderr, "Stack now");
2003 for (; yybottom <= yytop; yybottom++)
2004 {
2005 int yybot = *yybottom;
2006 YYFPRINTF (stderr, " %d", yybot);
2007 }
2008 YYFPRINTF (stderr, "\n");
2009 }
2010
2011 # define YY_STACK_PRINT(Bottom, Top) \
2012 do { \
2013 if (yydebug) \
2014 yy_stack_print ((Bottom), (Top)); \
2015 } while (0)
2016
2017
2018 /*------------------------------------------------.
2019 | Report that the YYRULE is going to be reduced. |
2020 `------------------------------------------------*/
2021
2022 static void
2023 yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
2024 {
2025 unsigned long int yylno = yyrline[yyrule];
2026 int yynrhs = yyr2[yyrule];
2027 int yyi;
2028 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
2029 yyrule - 1, yylno);
2030 /* The symbols being reduced. */
2031 for (yyi = 0; yyi < yynrhs; yyi++)
2032 {
2033 YYFPRINTF (stderr, " $%d = ", yyi + 1);
2034 yy_symbol_print (stderr,
2035 yystos[yyssp[yyi + 1 - yynrhs]],
2036 &(yyvsp[(yyi + 1) - (yynrhs)])
2037 );
2038 YYFPRINTF (stderr, "\n");
2039 }
2040 }
2041
2042 # define YY_REDUCE_PRINT(Rule) \
2043 do { \
2044 if (yydebug) \
2045 yy_reduce_print (yyssp, yyvsp, Rule); \
2046 } while (0)
2047
2048 /* Nonzero means print parse trace. It is left uninitialized so that
2049 multiple parsers can coexist. */
2050 int yydebug;
2051 #else /* !YYDEBUG */
2052 # define YYDPRINTF(Args)
2053 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
2054 # define YY_STACK_PRINT(Bottom, Top)
2055 # define YY_REDUCE_PRINT(Rule)
2056 #endif /* !YYDEBUG */
2057
2058
2059 /* YYINITDEPTH -- initial size of the parser's stacks. */
2060 #ifndef YYINITDEPTH
2061 # define YYINITDEPTH 200
2062 #endif
2063
2064 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
2065 if the built-in stack extension method is used).
2066
2067 Do not make this value too large; the results are undefined if
2068 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
2069 evaluated with infinite-precision integer arithmetic. */
2070
2071 #ifndef YYMAXDEPTH
2072 # define YYMAXDEPTH 10000
2073 #endif
2074
2075
2076 #if YYERROR_VERBOSE
2077
2078 # ifndef yystrlen
2079 # if defined __GLIBC__ && defined _STRING_H
2080 # define yystrlen strlen
2081 # else
2082 /* Return the length of YYSTR. */
2083 static YYSIZE_T
2084 yystrlen (const char *yystr)
2085 {
2086 YYSIZE_T yylen;
2087 for (yylen = 0; yystr[yylen]; yylen++)
2088 continue;
2089 return yylen;
2090 }
2091 # endif
2092 # endif
2093
2094 # ifndef yystpcpy
2095 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
2096 # define yystpcpy stpcpy
2097 # else
2098 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
2099 YYDEST. */
2100 static char *
2101 yystpcpy (char *yydest, const char *yysrc)
2102 {
2103 char *yyd = yydest;
2104 const char *yys = yysrc;
2105
2106 while ((*yyd++ = *yys++) != '\0')
2107 continue;
2108
2109 return yyd - 1;
2110 }
2111 # endif
2112 # endif
2113
2114 # ifndef yytnamerr
2115 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
2116 quotes and backslashes, so that it's suitable for yyerror. The
2117 heuristic is that double-quoting is unnecessary unless the string
2118 contains an apostrophe, a comma, or backslash (other than
2119 backslash-backslash). YYSTR is taken from yytname. If YYRES is
2120 null, do not copy; instead, return the length of what the result
2121 would have been. */
2122 static YYSIZE_T
2123 yytnamerr (char *yyres, const char *yystr)
2124 {
2125 if (*yystr == '"')
2126 {
2127 YYSIZE_T yyn = 0;
2128 char const *yyp = yystr;
2129
2130 for (;;)
2131 switch (*++yyp)
2132 {
2133 case '\'':
2134 case ',':
2135 goto do_not_strip_quotes;
2136
2137 case '\\':
2138 if (*++yyp != '\\')
2139 goto do_not_strip_quotes;
2140 /* Fall through. */
2141 default:
2142 if (yyres)
2143 yyres[yyn] = *yyp;
2144 yyn++;
2145 break;
2146
2147 case '"':
2148 if (yyres)
2149 yyres[yyn] = '\0';
2150 return yyn;
2151 }
2152 do_not_strip_quotes: ;
2153 }
2154
2155 if (! yyres)
2156 return yystrlen (yystr);
2157
2158 return yystpcpy (yyres, yystr) - yyres;
2159 }
2160 # endif
2161
2162 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
2163 about the unexpected token YYTOKEN for the state stack whose top is
2164 YYSSP.
2165
2166 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
2167 not large enough to hold the message. In that case, also set
2168 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
2169 required number of bytes is too large to store. */
2170 static int
2171 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
2172 yytype_int16 *yyssp, int yytoken)
2173 {
2174 YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
2175 YYSIZE_T yysize = yysize0;
2176 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
2177 /* Internationalized format string. */
2178 const char *yyformat = YY_NULL;
2179 /* Arguments of yyformat. */
2180 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
2181 /* Number of reported tokens (one for the "unexpected", one per
2182 "expected"). */
2183 int yycount = 0;
2184
2185 /* There are many possibilities here to consider:
2186 - If this state is a consistent state with a default action, then
2187 the only way this function was invoked is if the default action
2188 is an error action. In that case, don't check for expected
2189 tokens because there are none.
2190 - The only way there can be no lookahead present (in yychar) is if
2191 this state is a consistent state with a default action. Thus,
2192 detecting the absence of a lookahead is sufficient to determine
2193 that there is no unexpected or expected token to report. In that
2194 case, just report a simple "syntax error".
2195 - Don't assume there isn't a lookahead just because this state is a
2196 consistent state with a default action. There might have been a
2197 previous inconsistent state, consistent state with a non-default
2198 action, or user semantic action that manipulated yychar.
2199 - Of course, the expected token list depends on states to have
2200 correct lookahead information, and it depends on the parser not
2201 to perform extra reductions after fetching a lookahead from the
2202 scanner and before detecting a syntax error. Thus, state merging
2203 (from LALR or IELR) and default reductions corrupt the expected
2204 token list. However, the list is correct for canonical LR with
2205 one exception: it will still contain any token that will not be
2206 accepted due to an error action in a later state.
2207 */
2208 if (yytoken != YYEMPTY)
2209 {
2210 int yyn = yypact[*yyssp];
2211 yyarg[yycount++] = yytname[yytoken];
2212 if (!yypact_value_is_default (yyn))
2213 {
2214 /* Start YYX at -YYN if negative to avoid negative indexes in
2215 YYCHECK. In other words, skip the first -YYN actions for
2216 this state because they are default actions. */
2217 int yyxbegin = yyn < 0 ? -yyn : 0;
2218 /* Stay within bounds of both yycheck and yytname. */
2219 int yychecklim = YYLAST - yyn + 1;
2220 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
2221 int yyx;
2222
2223 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
2224 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
2225 && !yytable_value_is_error (yytable[yyx + yyn]))
2226 {
2227 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
2228 {
2229 yycount = 1;
2230 yysize = yysize0;
2231 break;
2232 }
2233 yyarg[yycount++] = yytname[yyx];
2234 {
2235 YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
2236 if (! (yysize <= yysize1
2237 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
2238 return 2;
2239 yysize = yysize1;
2240 }
2241 }
2242 }
2243 }
2244
2245 switch (yycount)
2246 {
2247 # define YYCASE_(N, S) \
2248 case N: \
2249 yyformat = S; \
2250 break
2251 YYCASE_(0, YY_("syntax error"));
2252 YYCASE_(1, YY_("syntax error, unexpected %s"));
2253 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
2254 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
2255 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
2256 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
2257 # undef YYCASE_
2258 }
2259
2260 {
2261 YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
2262 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
2263 return 2;
2264 yysize = yysize1;
2265 }
2266
2267 if (*yymsg_alloc < yysize)
2268 {
2269 *yymsg_alloc = 2 * yysize;
2270 if (! (yysize <= *yymsg_alloc
2271 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
2272 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
2273 return 1;
2274 }
2275
2276 /* Avoid sprintf, as that infringes on the user's name space.
2277 Don't have undefined behavior even if the translation
2278 produced a string with the wrong number of "%s"s. */
2279 {
2280 char *yyp = *yymsg;
2281 int yyi = 0;
2282 while ((*yyp = *yyformat) != '\0')
2283 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
2284 {
2285 yyp += yytnamerr (yyp, yyarg[yyi++]);
2286 yyformat += 2;
2287 }
2288 else
2289 {
2290 yyp++;
2291 yyformat++;
2292 }
2293 }
2294 return 0;
2295 }
2296 #endif /* YYERROR_VERBOSE */
2297
2298 /*-----------------------------------------------.
2299 | Release the memory associated to this symbol. |
2300 `-----------------------------------------------*/
2301
2302 static void
2303 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
2304 {
2305 YYUSE (yyvaluep);
2306 if (!yymsg)
2307 yymsg = "Deleting";
2308 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
2309
2310 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2311 YYUSE (yytype);
2312 YY_IGNORE_MAYBE_UNINITIALIZED_END
2313 }
2314
2315
2316
2317
2318 /* The lookahead symbol. */
2319 int yychar;
2320
2321 /* The semantic value of the lookahead symbol. */
2322 YYSTYPE yylval;
2323 /* Number of syntax errors so far. */
2324 int yynerrs;
2325
2326
2327 /*----------.
2328 | yyparse. |
2329 `----------*/
2330
2331 int
2332 yyparse (void)
2333 {
2334 int yystate;
2335 /* Number of tokens to shift before error messages enabled. */
2336 int yyerrstatus;
2337
2338 /* The stacks and their tools:
2339 'yyss': related to states.
2340 'yyvs': related to semantic values.
2341
2342 Refer to the stacks through separate pointers, to allow yyoverflow
2343 to reallocate them elsewhere. */
2344
2345 /* The state stack. */
2346 yytype_int16 yyssa[YYINITDEPTH];
2347 yytype_int16 *yyss;
2348 yytype_int16 *yyssp;
2349
2350 /* The semantic value stack. */
2351 YYSTYPE yyvsa[YYINITDEPTH];
2352 YYSTYPE *yyvs;
2353 YYSTYPE *yyvsp;
2354
2355 YYSIZE_T yystacksize;
2356
2357 int yyn;
2358 int yyresult;
2359 /* Lookahead token as an internal (translated) token number. */
2360 int yytoken = 0;
2361 /* The variables used to return semantic value and location from the
2362 action routines. */
2363 YYSTYPE yyval;
2364
2365 #if YYERROR_VERBOSE
2366 /* Buffer for error messages, and its allocated size. */
2367 char yymsgbuf[128];
2368 char *yymsg = yymsgbuf;
2369 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
2370 #endif
2371
2372 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
2373
2374 /* The number of symbols on the RHS of the reduced rule.
2375 Keep to zero when no symbol should be popped. */
2376 int yylen = 0;
2377
2378 yyssp = yyss = yyssa;
2379 yyvsp = yyvs = yyvsa;
2380 yystacksize = YYINITDEPTH;
2381
2382 YYDPRINTF ((stderr, "Starting parse\n"));
2383
2384 yystate = 0;
2385 yyerrstatus = 0;
2386 yynerrs = 0;
2387 yychar = YYEMPTY; /* Cause a token to be read. */
2388 goto yysetstate;
2389
2390 /*------------------------------------------------------------.
2391 | yynewstate -- Push a new state, which is found in yystate. |
2392 `------------------------------------------------------------*/
2393 yynewstate:
2394 /* In all cases, when you get here, the value and location stacks
2395 have just been pushed. So pushing a state here evens the stacks. */
2396 yyssp++;
2397
2398 yysetstate:
2399 *yyssp = yystate;
2400
2401 if (yyss + yystacksize - 1 <= yyssp)
2402 {
2403 /* Get the current used size of the three stacks, in elements. */
2404 YYSIZE_T yysize = yyssp - yyss + 1;
2405
2406 #ifdef yyoverflow
2407 {
2408 /* Give user a chance to reallocate the stack. Use copies of
2409 these so that the &'s don't force the real ones into
2410 memory. */
2411 YYSTYPE *yyvs1 = yyvs;
2412 yytype_int16 *yyss1 = yyss;
2413
2414 /* Each stack pointer address is followed by the size of the
2415 data in use in that stack, in bytes. This used to be a
2416 conditional around just the two extra args, but that might
2417 be undefined if yyoverflow is a macro. */
2418 yyoverflow (YY_("memory exhausted"),
2419 &yyss1, yysize * sizeof (*yyssp),
2420 &yyvs1, yysize * sizeof (*yyvsp),
2421 &yystacksize);
2422
2423 yyss = yyss1;
2424 yyvs = yyvs1;
2425 }
2426 #else /* no yyoverflow */
2427 # ifndef YYSTACK_RELOCATE
2428 goto yyexhaustedlab;
2429 # else
2430 /* Extend the stack our own way. */
2431 if (YYMAXDEPTH <= yystacksize)
2432 goto yyexhaustedlab;
2433 yystacksize *= 2;
2434 if (YYMAXDEPTH < yystacksize)
2435 yystacksize = YYMAXDEPTH;
2436
2437 {
2438 yytype_int16 *yyss1 = yyss;
2439 union yyalloc *yyptr =
2440 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
2441 if (! yyptr)
2442 goto yyexhaustedlab;
2443 YYSTACK_RELOCATE (yyss_alloc, yyss);
2444 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
2445 # undef YYSTACK_RELOCATE
2446 if (yyss1 != yyssa)
2447 YYSTACK_FREE (yyss1);
2448 }
2449 # endif
2450 #endif /* no yyoverflow */
2451
2452 yyssp = yyss + yysize - 1;
2453 yyvsp = yyvs + yysize - 1;
2454
2455 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
2456 (unsigned long int) yystacksize));
2457
2458 if (yyss + yystacksize - 1 <= yyssp)
2459 YYABORT;
2460 }
2461
2462 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
2463
2464 if (yystate == YYFINAL)
2465 YYACCEPT;
2466
2467 goto yybackup;
2468
2469 /*-----------.
2470 | yybackup. |
2471 `-----------*/
2472 yybackup:
2473
2474 /* Do appropriate processing given the current state. Read a
2475 lookahead token if we need one and don't already have one. */
2476
2477 /* First try to decide what to do without reference to lookahead token. */
2478 yyn = yypact[yystate];
2479 if (yypact_value_is_default (yyn))
2480 goto yydefault;
2481
2482 /* Not known => get a lookahead token if don't already have one. */
2483
2484 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
2485 if (yychar == YYEMPTY)
2486 {
2487 YYDPRINTF ((stderr, "Reading a token: "));
2488 yychar = yylex ();
2489 }
2490
2491 if (yychar <= YYEOF)
2492 {
2493 yychar = yytoken = YYEOF;
2494 YYDPRINTF ((stderr, "Now at end of input.\n"));
2495 }
2496 else
2497 {
2498 yytoken = YYTRANSLATE (yychar);
2499 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
2500 }
2501
2502 /* If the proper action on seeing token YYTOKEN is to reduce or to
2503 detect an error, take that action. */
2504 yyn += yytoken;
2505 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
2506 goto yydefault;
2507 yyn = yytable[yyn];
2508 if (yyn <= 0)
2509 {
2510 if (yytable_value_is_error (yyn))
2511 goto yyerrlab;
2512 yyn = -yyn;
2513 goto yyreduce;
2514 }
2515
2516 /* Count tokens shifted since error; after three, turn off error
2517 status. */
2518 if (yyerrstatus)
2519 yyerrstatus--;
2520
2521 /* Shift the lookahead token. */
2522 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
2523
2524 /* Discard the shifted token. */
2525 yychar = YYEMPTY;
2526
2527 yystate = yyn;
2528 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2529 *++yyvsp = yylval;
2530 YY_IGNORE_MAYBE_UNINITIALIZED_END
2531
2532 goto yynewstate;
2533
2534
2535 /*-----------------------------------------------------------.
2536 | yydefault -- do the default action for the current state. |
2537 `-----------------------------------------------------------*/
2538 yydefault:
2539 yyn = yydefact[yystate];
2540 if (yyn == 0)
2541 goto yyerrlab;
2542 goto yyreduce;
2543
2544
2545 /*-----------------------------.
2546 | yyreduce -- Do a reduction. |
2547 `-----------------------------*/
2548 yyreduce:
2549 /* yyn is the number of a rule to reduce with. */
2550 yylen = yyr2[yyn];
2551
2552 /* If YYLEN is nonzero, implement the default value of the action:
2553 '$$ = $1'.
2554
2555 Otherwise, the following line sets YYVAL to garbage.
2556 This behavior is undocumented and Bison
2557 users should not rely upon it. Assigning to YYVAL
2558 unconditionally makes the parser a bit smaller, and it avoids a
2559 GCC warning that YYVAL may be used uninitialized. */
2560 yyval = yyvsp[1-yylen];
2561
2562
2563 YY_REDUCE_PRINT (yyn);
2564 switch (yyn)
2565 {
2566 case 2:
2567 #line 321 "parser.y" /* yacc.c:1646 */
2568 { fix_incomplete();
2569 check_statements((yyvsp[0].stmt_list), FALSE);
2570 check_all_user_types((yyvsp[0].stmt_list));
2571 write_header((yyvsp[0].stmt_list));
2572 write_id_data((yyvsp[0].stmt_list));
2573 write_proxies((yyvsp[0].stmt_list));
2574 write_client((yyvsp[0].stmt_list));
2575 write_server((yyvsp[0].stmt_list));
2576 write_regscript((yyvsp[0].stmt_list));
2577 write_dlldata((yyvsp[0].stmt_list));
2578 write_local_stubs((yyvsp[0].stmt_list));
2579 }
2580 #line 2581 "parser.tab.c" /* yacc.c:1646 */
2581 break;
2582
2583 case 3:
2584 #line 335 "parser.y" /* yacc.c:1646 */
2585 { (yyval.stmt_list) = NULL; }
2586 #line 2587 "parser.tab.c" /* yacc.c:1646 */
2587 break;
2588
2589 case 4:
2590 #line 336 "parser.y" /* yacc.c:1646 */
2591 { push_namespace((yyvsp[-1].str)); }
2592 #line 2593 "parser.tab.c" /* yacc.c:1646 */
2593 break;
2594
2595 case 5:
2596 #line 337 "parser.y" /* yacc.c:1646 */
2597 { pop_namespace((yyvsp[-4].str)); (yyval.stmt_list) = append_statements((yyvsp[-5].stmt_list), (yyvsp[-1].stmt_list)); }
2598 #line 2599 "parser.tab.c" /* yacc.c:1646 */
2599 break;
2600
2601 case 6:
2602 #line 338 "parser.y" /* yacc.c:1646 */
2603 { (yyval.stmt_list) = append_statement((yyvsp[-1].stmt_list), make_statement_reference((yyvsp[0].type))); }
2604 #line 2605 "parser.tab.c" /* yacc.c:1646 */
2605 break;
2606
2607 case 7:
2608 #line 339 "parser.y" /* yacc.c:1646 */
2609 { (yyval.stmt_list) = append_statement((yyvsp[-1].stmt_list), make_statement_type_decl((yyvsp[0].type))); }
2610 #line 2611 "parser.tab.c" /* yacc.c:1646 */
2611 break;
2612
2613 case 8:
2614 #line 340 "parser.y" /* yacc.c:1646 */
2615 { (yyval.stmt_list) = (yyvsp[-2].stmt_list);
2616 reg_type((yyvsp[-1].type), (yyvsp[-1].type)->name, current_namespace, 0);
2617 }
2618 #line 2619 "parser.tab.c" /* yacc.c:1646 */
2619 break;
2620
2621 case 9:
2622 #line 343 "parser.y" /* yacc.c:1646 */
2623 { (yyval.stmt_list) = append_statement((yyvsp[-1].stmt_list), make_statement_type_decl((yyvsp[0].type)));
2624 reg_type((yyvsp[0].type), (yyvsp[0].type)->name, current_namespace, 0);
2625 }
2626 #line 2627 "parser.tab.c" /* yacc.c:1646 */
2627 break;
2628
2629 case 10:
2630 #line 346 "parser.y" /* yacc.c:1646 */
2631 { (yyval.stmt_list) = append_statement((yyvsp[-1].stmt_list), make_statement_module((yyvsp[0].type))); }
2632 #line 2633 "parser.tab.c" /* yacc.c:1646 */
2633 break;
2634
2635 case 11:
2636 #line 347 "parser.y" /* yacc.c:1646 */
2637 { (yyval.stmt_list) = append_statement((yyvsp[-1].stmt_list), make_statement_library((yyvsp[0].typelib))); }
2638 #line 2639 "parser.tab.c" /* yacc.c:1646 */
2639 break;
2640
2641 case 12:
2642 #line 348 "parser.y" /* yacc.c:1646 */
2643 { (yyval.stmt_list) = append_statement((yyvsp[-1].stmt_list), (yyvsp[0].statement)); }
2644 #line 2645 "parser.tab.c" /* yacc.c:1646 */
2645 break;
2646
2647 case 13:
2648 #line 351 "parser.y" /* yacc.c:1646 */
2649 { (yyval.stmt_list) = NULL; }
2650 #line 2651 "parser.tab.c" /* yacc.c:1646 */
2651 break;
2652
2653 case 14:
2654 #line 352 "parser.y" /* yacc.c:1646 */
2655 { (yyval.stmt_list) = append_statement((yyvsp[-1].stmt_list), make_statement_reference((yyvsp[0].type))); }
2656 #line 2657 "parser.tab.c" /* yacc.c:1646 */
2657 break;
2658
2659 case 15:
2660 #line 353 "parser.y" /* yacc.c:1646 */
2661 { push_namespace((yyvsp[-1].str)); }
2662 #line 2663 "parser.tab.c" /* yacc.c:1646 */
2663 break;
2664
2665 case 16:
2666 #line 354 "parser.y" /* yacc.c:1646 */
2667 { pop_namespace((yyvsp[-4].str)); (yyval.stmt_list) = append_statements((yyvsp[-5].stmt_list), (yyvsp[-1].stmt_list)); }
2668 #line 2669 "parser.tab.c" /* yacc.c:1646 */
2669 break;
2670
2671 case 17:
2672 #line 355 "parser.y" /* yacc.c:1646 */
2673 { (yyval.stmt_list) = append_statement((yyvsp[-1].stmt_list), make_statement_type_decl((yyvsp[0].type))); }
2674 #line 2675 "parser.tab.c" /* yacc.c:1646 */
2675 break;
2676
2677 case 18:
2678 #line 356 "parser.y" /* yacc.c:1646 */
2679 { (yyval.stmt_list) = (yyvsp[-2].stmt_list); reg_type((yyvsp[-1].type), (yyvsp[-1].type)->name, current_namespace, 0); }
2680 #line 2681 "parser.tab.c" /* yacc.c:1646 */
2681 break;
2682
2683 case 19:
2684 #line 357 "parser.y" /* yacc.c:1646 */
2685 { (yyval.stmt_list) = append_statement((yyvsp[-1].stmt_list), make_statement_type_decl((yyvsp[0].type)));
2686 reg_type((yyvsp[0].type), (yyvsp[0].type)->name, current_namespace, 0);
2687 }
2688 #line 2689 "parser.tab.c" /* yacc.c:1646 */
2689 break;
2690
2691 case 20:
2692 #line 360 "parser.y" /* yacc.c:1646 */
2693 { (yyval.stmt_list) = append_statement((yyvsp[-1].stmt_list), make_statement_module((yyvsp[0].type))); }
2694 #line 2695 "parser.tab.c" /* yacc.c:1646 */
2695 break;
2696
2697 case 21:
2698 #line 361 "parser.y" /* yacc.c:1646 */
2699 { (yyval.stmt_list) = append_statement((yyvsp[-1].stmt_list), (yyvsp[0].statement)); }
2700 #line 2701 "parser.tab.c" /* yacc.c:1646 */
2701 break;
2702
2703 case 22:
2704 #line 362 "parser.y" /* yacc.c:1646 */
2705 { (yyval.stmt_list) = append_statement((yyvsp[-1].stmt_list), make_statement_importlib((yyvsp[0].str))); }
2706 #line 2707 "parser.tab.c" /* yacc.c:1646 */
2707 break;
2708
2709 case 23:
2710 #line 363 "parser.y" /* yacc.c:1646 */
2711 { (yyval.stmt_list) = append_statement((yyvsp[-1].stmt_list), make_statement_library((yyvsp[0].typelib))); }
2712 #line 2713 "parser.tab.c" /* yacc.c:1646 */
2713 break;
2714
2715 case 24:
2716 #line 366 "parser.y" /* yacc.c:1646 */
2717 { (yyval.stmt_list) = NULL; }
2718 #line 2719 "parser.tab.c" /* yacc.c:1646 */
2719 break;
2720
2721 case 25:
2722 #line 367 "parser.y" /* yacc.c:1646 */
2723 { (yyval.stmt_list) = append_statement((yyvsp[-1].stmt_list), (yyvsp[0].statement)); }
2724 #line 2725 "parser.tab.c" /* yacc.c:1646 */
2725 break;
2726
2727 case 28:
2728 #line 375 "parser.y" /* yacc.c:1646 */
2729 { (yyval.statement) = make_statement_cppquote((yyvsp[0].str)); }
2730 #line 2731 "parser.tab.c" /* yacc.c:1646 */
2731 break;
2732
2733 case 29:
2734 #line 376 "parser.y" /* yacc.c:1646 */
2735 { (yyval.statement) = make_statement_type_decl((yyvsp[-1].type)); }
2736 #line 2737 "parser.tab.c" /* yacc.c:1646 */
2737 break;
2738
2739 case 30:
2740 #line 377 "parser.y" /* yacc.c:1646 */
2741 { (yyval.statement) = make_statement_declaration((yyvsp[-1].var)); }
2742 #line 2743 "parser.tab.c" /* yacc.c:1646 */
2743 break;
2744
2745 case 31:
2746 #line 378 "parser.y" /* yacc.c:1646 */
2747 { (yyval.statement) = make_statement_import((yyvsp[0].str)); }
2748 #line 2749 "parser.tab.c" /* yacc.c:1646 */
2749 break;
2750
2751 case 32:
2752 #line 379 "parser.y" /* yacc.c:1646 */
2753 { (yyval.statement) = (yyvsp[-1].statement); }
2754 #line 2755 "parser.tab.c" /* yacc.c:1646 */
2755 break;
2756
2757 case 33:
2758 #line 380 "parser.y" /* yacc.c:1646 */
2759 { (yyval.statement) = make_statement_pragma((yyvsp[0].str)); }
2760 #line 2761 "parser.tab.c" /* yacc.c:1646 */
2761 break;
2762
2763 case 34:
2764 #line 381 "parser.y" /* yacc.c:1646 */
2765 { (yyval.statement) = NULL; }
2766 #line 2767 "parser.tab.c" /* yacc.c:1646 */
2767 break;
2768
2769 case 35:
2770 #line 385 "parser.y" /* yacc.c:1646 */
2771 {
2772 int result;
2773 (yyval.statement) = NULL;
2774 result = do_warning((yyvsp[-3].str), (yyvsp[-1].warning_list));
2775 if(!result)
2776 error_loc("expected \"disable\" or \"enable\"\n");
2777 }
2778 #line 2779 "parser.tab.c" /* yacc.c:1646 */
2779 break;
2780
2781 case 36:
2782 #line 395 "parser.y" /* yacc.c:1646 */
2783 { (yyval.warning_list) = append_warning(NULL, (yyvsp[0].num)); }
2784 #line 2785 "parser.tab.c" /* yacc.c:1646 */
2785 break;
2786
2787 case 37:
2788 #line 396 "parser.y" /* yacc.c:1646 */
2789 { (yyval.warning_list) = append_warning((yyvsp[-1].warning_list), (yyvsp[0].num)); }
2790 #line 2791 "parser.tab.c" /* yacc.c:1646 */
2791 break;
2792
2793 case 39:
2794 #line 401 "parser.y" /* yacc.c:1646 */
2795 { (yyval.type) = type_new_enum((yyvsp[0].str), current_namespace, FALSE, NULL); }
2796 #line 2797 "parser.tab.c" /* yacc.c:1646 */
2797 break;
2798
2799 case 41:
2800 #line 403 "parser.y" /* yacc.c:1646 */
2801 { (yyval.type) = type_new_struct((yyvsp[0].str), current_namespace, FALSE, NULL); }
2802 #line 2803 "parser.tab.c" /* yacc.c:1646 */
2803 break;
2804
2805 case 43:
2806 #line 405 "parser.y" /* yacc.c:1646 */
2807 { (yyval.type) = type_new_nonencapsulated_union((yyvsp[0].str), FALSE, NULL); }
2808 #line 2809 "parser.tab.c" /* yacc.c:1646 */
2809 break;
2810
2811 case 44:
2812 #line 406 "parser.y" /* yacc.c:1646 */
2813 { (yyval.type) = (yyvsp[0].type); (yyval.type)->attrs = check_enum_attrs((yyvsp[-1].attr_list)); }
2814 #line 2815 "parser.tab.c" /* yacc.c:1646 */
2815 break;
2816
2817 case 45:
2818 #line 407 "parser.y" /* yacc.c:1646 */
2819 { (yyval.type) = (yyvsp[0].type); (yyval.type)->attrs = check_struct_attrs((yyvsp[-1].attr_list)); }
2820 #line 2821 "parser.tab.c" /* yacc.c:1646 */
2821 break;
2822
2823 case 46:
2824 #line 408 "parser.y" /* yacc.c:1646 */
2825 { (yyval.type) = (yyvsp[0].type); (yyval.type)->attrs = check_union_attrs((yyvsp[-1].attr_list)); }
2826 #line 2827 "parser.tab.c" /* yacc.c:1646 */
2827 break;
2828
2829 case 47:
2830 #line 411 "parser.y" /* yacc.c:1646 */
2831 { (yyval.str) = (yyvsp[-1].str); }
2832 #line 2833 "parser.tab.c" /* yacc.c:1646 */
2833 break;
2834
2835 case 48:
2836 #line 413 "parser.y" /* yacc.c:1646 */
2837 { assert(yychar == YYEMPTY);
2838 (yyval.import) = xmalloc(sizeof(struct _import_t));
2839 (yyval.import)->name = (yyvsp[-1].str);
2840 (yyval.import)->import_performed = do_import((yyvsp[-1].str));
2841 if (!(yyval.import)->import_performed) yychar = aEOF;
2842 }
2843 #line 2844 "parser.tab.c" /* yacc.c:1646 */
2844 break;
2845
2846 case 49:
2847 #line 421 "parser.y" /* yacc.c:1646 */
2848 { (yyval.str) = (yyvsp[-2].import)->name;
2849 if ((yyvsp[-2].import)->import_performed) pop_import();
2850 free((yyvsp[-2].import));
2851 }
2852 #line 2853 "parser.tab.c" /* yacc.c:1646 */
2853 break;
2854
2855 case 50:
2856 #line 428 "parser.y" /* yacc.c:1646 */
2857 { (yyval.str) = (yyvsp[-2].str); if(!parse_only) add_importlib((yyvsp[-2].str)); }
2858 #line 2859 "parser.tab.c" /* yacc.c:1646 */
2859 break;
2860
2861 case 51:
2862 #line 431 "parser.y" /* yacc.c:1646 */
2863 { (yyval.str) = (yyvsp[0].str); }
2864 #line 2865 "parser.tab.c" /* yacc.c:1646 */
2865 break;
2866
2867 case 52:
2868 #line 432 "parser.y" /* yacc.c:1646 */
2869 { (yyval.str) = (yyvsp[0].str); }
2870 #line 2871 "parser.tab.c" /* yacc.c:1646 */
2871 break;
2872
2873 case 53:
2874 #line 434 "parser.y" /* yacc.c:1646 */
2875 { (yyval.typelib) = make_library((yyvsp[-1].str), check_library_attrs((yyvsp[-1].str), (yyvsp[-2].attr_list)));
2876 if (!parse_only) start_typelib((yyval.typelib));
2877 }
2878 #line 2879 "parser.tab.c" /* yacc.c:1646 */
2879 break;
2880
2881 case 54:
2882 #line 439 "parser.y" /* yacc.c:1646 */
2883 { (yyval.typelib) = (yyvsp[-3].typelib);
2884 (yyval.typelib)->stmts = (yyvsp[-2].stmt_list);
2885 if (!parse_only) end_typelib();
2886 }
2887 #line 2888 "parser.tab.c" /* yacc.c:1646 */
2888 break;
2889
2890 case 55:
2891 #line 445 "parser.y" /* yacc.c:1646 */
2892 { (yyval.var_list) = NULL; }
2893 #line 2894 "parser.tab.c" /* yacc.c:1646 */
2894 break;
2895
2896 case 57:
2897 #line 449 "parser.y" /* yacc.c:1646 */
2898 { check_arg_attrs((yyvsp[0].var)); (yyval.var_list) = append_var( NULL, (yyvsp[0].var) ); }
2899 #line 2900 "parser.tab.c" /* yacc.c:1646 */
2900 break;
2901
2902 case 58:
2903 #line 450 "parser.y" /* yacc.c:1646 */
2904 { check_arg_attrs((yyvsp[0].var)); (yyval.var_list) = append_var( (yyvsp[-2].var_list), (yyvsp[0].var) ); }
2905 #line 2906 "parser.tab.c" /* yacc.c:1646 */
2906 break;
2907
2908 case 60:
2909 #line 454 "parser.y" /* yacc.c:1646 */
2910 { (yyval.var_list) = append_var( (yyvsp[-2].var_list), make_var(strdup("...")) ); }
2911 #line 2912 "parser.tab.c" /* yacc.c:1646 */
2912 break;
2913
2914 case 61:
2915 #line 458 "parser.y" /* yacc.c:1646 */
2916 { if ((yyvsp[-1].declspec)->stgclass != STG_NONE && (yyvsp[-1].declspec)->stgclass != STG_REGISTER)
2917 error_loc("invalid storage class for function parameter\n");
2918 (yyval.var) = declare_var((yyvsp[-2].attr_list), (yyvsp[-1].declspec), (yyvsp[0].declarator), TRUE);
2919 free((yyvsp[-1].declspec)); free((yyvsp[0].declarator));
2920 }
2921 #line 2922 "parser.tab.c" /* yacc.c:1646 */
2922 break;
2923
2924 case 62:
2925 #line 463 "parser.y" /* yacc.c:1646 */
2926 { if ((yyvsp[-1].declspec)->stgclass != STG_NONE && (yyvsp[-1].declspec)->stgclass != STG_REGISTER)
2927 error_loc("invalid storage class for function parameter\n");
2928 (yyval.var) = declare_var(NULL, (yyvsp[-1].declspec), (yyvsp[0].declarator), TRUE);
2929 free((yyvsp[-1].declspec)); free((yyvsp[0].declarator));
2930 }
2931 #line 2932 "parser.tab.c" /* yacc.c:1646 */
2932 break;
2933
2934 case 63:
2935 #line 470 "parser.y" /* yacc.c:1646 */
2936 { (yyval.expr) = (yyvsp[-1].expr);
2937 if (!(yyval.expr)->is_const)
2938 error_loc("array dimension is not an integer constant\n");
2939 }
2940 #line 2941 "parser.tab.c" /* yacc.c:1646 */
2941 break;
2942
2943 case 64:
2944 #line 474 "parser.y" /* yacc.c:1646 */
2945 { (yyval.expr) = make_expr(EXPR_VOID); }
2946 #line 2947 "parser.tab.c" /* yacc.c:1646 */
2947 break;
2948
2949 case 65:
2950 #line 475 "parser.y" /* yacc.c:1646 */
2951 { (yyval.expr) = make_expr(EXPR_VOID); }
2952 #line 2953 "parser.tab.c" /* yacc.c:1646 */
2953 break;
2954
2955 case 66:
2956 #line 478 "parser.y" /* yacc.c:1646 */
2957 { (yyval.attr_list) = NULL; }
2958 #line 2959 "parser.tab.c" /* yacc.c:1646 */
2959 break;
2960
2961 case 68:
2962 #line 483 "parser.y" /* yacc.c:1646 */
2963 { (yyval.attr_list) = (yyvsp[-1].attr_list); }
2964 #line 2965 "parser.tab.c" /* yacc.c:1646 */
2965 break;
2966
2967 case 69:
2968 #line 486 "parser.y" /* yacc.c:1646 */
2969 { (yyval.attr_list) = append_attr( NULL, (yyvsp[0].attr) ); }
2970 #line 2971 "parser.tab.c" /* yacc.c:1646 */
2971 break;
2972
2973 case 70:
2974 #line 487 "parser.y" /* yacc.c:1646 */
2975 { (yyval.attr_list) = append_attr( (yyvsp[-2].attr_list), (yyvsp[0].attr) ); }
2976 #line 2977 "parser.tab.c" /* yacc.c:1646 */
2977 break;
2978
2979 case 71:
2980 #line 488 "parser.y" /* yacc.c:1646 */
2981 { (yyval.attr_list) = append_attr( (yyvsp[-3].attr_list), (yyvsp[0].attr) ); }
2982 #line 2983 "parser.tab.c" /* yacc.c:1646 */
2983 break;
2984
2985 case 72:
2986 #line 491 "parser.y" /* yacc.c:1646 */
2987 { (yyval.str_list) = append_str( NULL, (yyvsp[0].str) ); }
2988 #line 2989 "parser.tab.c" /* yacc.c:1646 */
2989 break;
2990
2991 case 73:
2992 #line 492 "parser.y" /* yacc.c:1646 */
2993 { (yyval.str_list) = append_str( (yyvsp[-2].str_list), (yyvsp[0].str) ); }
2994 #line 2995 "parser.tab.c" /* yacc.c:1646 */
2995 break;
2996
2997 case 74:
2998 #line 495 "parser.y" /* yacc.c:1646 */
2999 { (yyval.attr) = NULL; }
3000 #line 3001 "parser.tab.c" /* yacc.c:1646 */
3001 break;
3002
3003 case 75:
3004 #line 496 "parser.y" /* yacc.c:1646 */
3005 { (yyval.attr) = make_attr(ATTR_AGGREGATABLE); }
3006 #line 3007 "parser.tab.c" /* yacc.c:1646 */
3007 break;
3008
3009 case 76:
3010 #line 497 "parser.y" /* yacc.c:1646 */
3011 { (yyval.attr) = make_attrp(ATTR_ANNOTATION, (yyvsp[-1].str)); }
3012 #line 3013 "parser.tab.c" /* yacc.c:1646 */
3013 break;
3014
3015 case 77:
3016 #line 498 "parser.y" /* yacc.c:1646 */
3017 { (yyval.attr) = make_attr(ATTR_APPOBJECT); }
3018 #line 3019 "parser.tab.c" /* yacc.c:1646 */
3019 break;
3020
3021 case 78:
3022 #line 499 "parser.y" /* yacc.c:1646 */
3023 { (yyval.attr) = make_attr(ATTR_ASYNC); }
3024 #line 3025 "parser.tab.c" /* yacc.c:1646 */
3025 break;
3026
3027 case 79:
3028 #line 500 "parser.y" /* yacc.c:1646 */
3029 { (yyval.attr) = make_attr(ATTR_AUTO_HANDLE); }
3030 #line 3031 "parser.tab.c" /* yacc.c:1646 */
3031 break;
3032
3033 case 80:
3034 #line 501 "parser.y" /* yacc.c:1646 */
3035 { (yyval.attr) = make_attr(ATTR_BINDABLE); }
3036 #line 3037 "parser.tab.c" /* yacc.c:1646 */
3037 break;
3038
3039 case 81:
3040 #line 502 "parser.y" /* yacc.c:1646 */
3041 { (yyval.attr) = make_attr(ATTR_BROADCAST); }
3042 #line 3043 "parser.tab.c" /* yacc.c:1646 */
3043 break;
3044
3045 case 82:
3046 #line 503 "parser.y" /* yacc.c:1646 */
3047 { (yyval.attr) = make_attrp(ATTR_CALLAS, (yyvsp[-1].var)); }
3048 #line 3049 "parser.tab.c" /* yacc.c:1646 */
3049 break;
3050
3051 case 83:
3052 #line 504 "parser.y" /* yacc.c:1646 */
3053 { (yyval.attr) = make_attrp(ATTR_CASE, (yyvsp[-1].expr_list)); }
3054 #line 3055 "parser.tab.c" /* yacc.c:1646 */
3055 break;
3056
3057 case 84:
3058 #line 505 "parser.y" /* yacc.c:1646 */
3059 { (yyval.attr) = make_attr(ATTR_CODE); }
3060 #line 3061 "parser.tab.c" /* yacc.c:1646 */
3061 break;
3062
3063 case 85:
3064 #line 506 "parser.y" /* yacc.c:1646 */
3065 { (yyval.attr) = make_attr(ATTR_COMMSTATUS); }
3066 #line 3067 "parser.tab.c" /* yacc.c:1646 */
3067 break;
3068
3069 case 86:
3070 #line 507 "parser.y" /* yacc.c:1646 */
3071 { (yyval.attr) = make_attrv(ATTR_CONTEXTHANDLE, 0); }
3072 #line 3073 "parser.tab.c" /* yacc.c:1646 */
3073 break;
3074
3075 case 87:
3076 #line 508 "parser.y" /* yacc.c:1646 */
3077 { (yyval.attr) = make_attrv(ATTR_CONTEXTHANDLE, 0); /* RPC_CONTEXT_HANDLE_DONT_SERIALIZE */ }
3078 #line 3079 "parser.tab.c" /* yacc.c:1646 */
3079 break;
3080
3081 case 88:
3082 #line 509 "parser.y" /* yacc.c:1646 */
3083 { (yyval.attr) = make_attrv(ATTR_CONTEXTHANDLE, 0); /* RPC_CONTEXT_HANDLE_SERIALIZE */ }
3084 #line 3085 "parser.tab.c" /* yacc.c:1646 */
3085 break;
3086
3087 case 89:
3088 #line 510 "parser.y" /* yacc.c:1646 */
3089 { (yyval.attr) = make_attr(ATTR_CONTROL); }
3090 #line 3091 "parser.tab.c" /* yacc.c:1646 */
3091 break;
3092
3093 case 90:
3094 #line 511 "parser.y" /* yacc.c:1646 */
3095 { (yyval.attr) = make_attr(ATTR_DECODE); }
3096 #line 3097 "parser.tab.c" /* yacc.c:1646 */
3097 break;
3098
3099 case 91:
3100 #line 512 "parser.y" /* yacc.c:1646 */
3101 { (yyval.attr) = make_attr(ATTR_DEFAULT); }
3102 #line 3103 "parser.tab.c" /* yacc.c:1646 */
3103 break;
3104
3105 case 92:
3106 #line 513 "parser.y" /* yacc.c:1646 */
3107 { (yyval.attr) = make_attr(ATTR_DEFAULTBIND); }
3108 #line 3109 "parser.tab.c" /* yacc.c:1646 */
3109 break;
3110
3111 case 93:
3112 #line 514 "parser.y" /* yacc.c:1646 */
3113 { (yyval.attr) = make_attr(ATTR_DEFAULTCOLLELEM); }
3114 #line 3115 "parser.tab.c" /* yacc.c:1646 */
3115 break;
3116
3117 case 94:
3118 #line 515 "parser.y" /* yacc.c:1646 */
3119 { (yyval.attr) = make_attrp(ATTR_DEFAULTVALUE, (yyvsp[-1].expr)); }
3120 #line 3121 "parser.tab.c" /* yacc.c:1646 */
3121 break;
3122
3123 case 95:
3124 #line 516 "parser.y" /* yacc.c:1646 */
3125 { (yyval.attr) = make_attr(ATTR_DEFAULTVTABLE); }
3126 #line 3127 "parser.tab.c" /* yacc.c:1646 */
3127 break;
3128
3129 case 96:
3130 #line 517 "parser.y" /* yacc.c:1646 */
3131 { (yyval.attr) = make_attr(ATTR_DISABLECONSISTENCYCHECK); }
3132 #line 3133 "parser.tab.c" /* yacc.c:1646 */
3133 break;
3134
3135 case 97:
3136 #line 518 "parser.y" /* yacc.c:1646 */
3137 { (yyval.attr) = make_attr(ATTR_DISPLAYBIND); }
3138 #line 3139 "parser.tab.c" /* yacc.c:1646 */
3139 break;
3140
3141 case 98:
3142 #line 519 "parser.y" /* yacc.c:1646 */
3143 { (yyval.attr) = make_attrp(ATTR_DLLNAME, (yyvsp[-1].str)); }
3144 #line 3145 "parser.tab.c" /* yacc.c:1646 */
3145 break;
3146
3147 case 99:
3148 #line 520 "parser.y" /* yacc.c:1646 */
3149 { (yyval.attr) = make_attr(ATTR_DUAL); }
3150 #line 3151 "parser.tab.c" /* yacc.c:1646 */
3151 break;
3152
3153 case 100:
3154 #line 521 "parser.y" /* yacc.c:1646 */
3155 { (yyval.attr) = make_attr(ATTR_ENABLEALLOCATE); }
3156 #line 3157 "parser.tab.c" /* yacc.c:1646 */
3157 break;
3158
3159 case 101:
3160 #line 522 "parser.y" /* yacc.c:1646 */
3161 { (yyval.attr) = make_attr(ATTR_ENCODE); }
3162 #line 3163 "parser.tab.c" /* yacc.c:1646 */
3163 break;
3164
3165 case 102:
3166 #line 523 "parser.y" /* yacc.c:1646 */
3167 { (yyval.attr) = make_attrp(ATTR_ENDPOINT, (yyvsp[-1].str_list)); }
3168 #line 3169 "parser.tab.c" /* yacc.c:1646 */
3169 break;
3170
3171 case 103:
3172 #line 524 "parser.y" /* yacc.c:1646 */
3173 { (yyval.attr) = make_attrp(ATTR_ENTRY, (yyvsp[-1].expr)); }
3174 #line 3175 "parser.tab.c" /* yacc.c:1646 */
3175 break;
3176
3177 case 104:
3178 #line 525 "parser.y" /* yacc.c:1646 */
3179 { (yyval.attr) = make_attr(ATTR_EXPLICIT_HANDLE); }
3180 #line 3181 "parser.tab.c" /* yacc.c:1646 */
3181 break;
3182
3183 case 105:
3184 #line 526 "parser.y" /* yacc.c:1646 */
3185 { (yyval.attr) = make_attr(ATTR_FAULTSTATUS); }
3186 #line 3187 "parser.tab.c" /* yacc.c:1646 */
3187 break;
3188
3189 case 106:
3190 #line 527 "parser.y" /* yacc.c:1646 */
3191 { (yyval.attr) = make_attr(ATTR_FORCEALLOCATE); }
3192 #line 3193 "parser.tab.c" /* yacc.c:1646 */
3193 break;
3194
3195 case 107:
3196 #line 528 "parser.y" /* yacc.c:1646 */
3197 { (yyval.attr) = make_attr(ATTR_HANDLE); }
3198 #line 3199 "parser.tab.c" /* yacc.c:1646 */
3199 break;
3200
3201 case 108:
3202 #line 529 "parser.y" /* yacc.c:1646 */
3203 { (yyval.attr) = make_attrp(ATTR_HELPCONTEXT, (yyvsp[-1].expr)); }
3204 #line 3205 "parser.tab.c" /* yacc.c:1646 */
3205 break;
3206
3207 case 109:
3208 #line 530 "parser.y" /* yacc.c:1646 */
3209 { (yyval.attr) = make_attrp(ATTR_HELPFILE, (yyvsp[-1].str)); }
3210 #line 3211 "parser.tab.c" /* yacc.c:1646 */
3211 break;
3212
3213 case 110:
3214 #line 531 "parser.y" /* yacc.c:1646 */
3215 { (yyval.attr) = make_attrp(ATTR_HELPSTRING, (yyvsp[-1].str)); }
3216 #line 3217 "parser.tab.c" /* yacc.c:1646 */
3217 break;
3218
3219 case 111:
3220 #line 532 "parser.y" /* yacc.c:1646 */
3221 { (yyval.attr) = make_attrp(ATTR_HELPSTRINGCONTEXT, (yyvsp[-1].expr)); }
3222 #line 3223 "parser.tab.c" /* yacc.c:1646 */
3223 break;
3224
3225 case 112:
3226 #line 533 "parser.y" /* yacc.c:1646 */
3227 { (yyval.attr) = make_attrp(ATTR_HELPSTRINGDLL, (yyvsp[-1].str)); }
3228 #line 3229 "parser.tab.c" /* yacc.c:1646 */
3229 break;
3230
3231 case 113:
3232 #line 534 "parser.y" /* yacc.c:1646 */
3233 { (yyval.attr) = make_attr(ATTR_HIDDEN); }
3234 #line 3235 "parser.tab.c" /* yacc.c:1646 */
3235 break;
3236
3237 case 114:
3238 #line 535 "parser.y" /* yacc.c:1646 */
3239 { (yyval.attr) = make_attrp(ATTR_ID, (yyvsp[-1].expr)); }
3240 #line 3241 "parser.tab.c" /* yacc.c:1646 */
3241 break;
3242
3243 case 115:
3244 #line 536 "parser.y" /* yacc.c:1646 */
3245 { (yyval.attr) = make_attr(ATTR_IDEMPOTENT); }
3246 #line 3247 "parser.tab.c" /* yacc.c:1646 */
3247 break;
3248
3249 case 116:
3250 #line 537 "parser.y" /* yacc.c:1646 */
3251 { (yyval.attr) = make_attr(ATTR_IGNORE); }
3252 #line 3253 "parser.tab.c" /* yacc.c:1646 */
3253 break;
3254
3255 case 117:
3256 #line 538 "parser.y" /* yacc.c:1646 */
3257 { (yyval.attr) = make_attrp(ATTR_IIDIS, (yyvsp[-1].expr)); }
3258 #line 3259 "parser.tab.c" /* yacc.c:1646 */
3259 break;
3260
3261 case 118:
3262 #line 539 "parser.y" /* yacc.c:1646 */
3263 { (yyval.attr) = make_attr(ATTR_IMMEDIATEBIND); }
3264 #line 3265 "parser.tab.c" /* yacc.c:1646 */
3265 break;
3266
3267 case 119:
3268 #line 540 "parser.y" /* yacc.c:1646 */
3269 { (yyval.attr) = make_attrp(ATTR_IMPLICIT_HANDLE, (yyvsp[-1].var)); }
3270 #line 3271 "parser.tab.c" /* yacc.c:1646 */
3271 break;
3272
3273 case 120:
3274 #line 541 "parser.y" /* yacc.c:1646 */
3275 { (yyval.attr) = make_attr(ATTR_IN); }
3276 #line 3277 "parser.tab.c" /* yacc.c:1646 */
3277 break;
3278
3279 case 121:
3280 #line 542 "parser.y" /* yacc.c:1646 */
3281 { (yyval.attr) = make_attr(ATTR_INPUTSYNC); }
3282 #line 3283 "parser.tab.c" /* yacc.c:1646 */
3283 break;
3284
3285 case 122:
3286 #line 543 "parser.y" /* yacc.c:1646 */
3287 { (yyval.attr) = make_attrp(ATTR_LENGTHIS, (yyvsp[-1].expr_list)); }
3288 #line 3289 "parser.tab.c" /* yacc.c:1646 */
3289 break;
3290
3291 case 123:
3292 #line 544 "parser.y" /* yacc.c:1646 */
3293 { (yyval.attr) = make_attrp(ATTR_LIBLCID, (yyvsp[-1].expr)); }
3294 #line 3295 "parser.tab.c" /* yacc.c:1646 */
3295 break;
3296
3297 case 124:
3298 #line 545 "parser.y" /* yacc.c:1646 */
3299 { (yyval.attr) = make_attr(ATTR_PARAMLCID); }
3300 #line 3301 "parser.tab.c" /* yacc.c:1646 */
3301 break;
3302
3303 case 125:
3304 #line 546 "parser.y" /* yacc.c:1646 */
3305 { (yyval.attr) = make_attr(ATTR_LICENSED); }
3306 #line 3307 "parser.tab.c" /* yacc.c:1646 */
3307 break;
3308
3309 case 126:
3310 #line 547 "parser.y" /* yacc.c:1646 */
3311 { (yyval.attr) = make_attr(ATTR_LOCAL); }
3312 #line 3313 "parser.tab.c" /* yacc.c:1646 */
3313 break;
3314
3315 case 127:
3316 #line 548 "parser.y" /* yacc.c:1646 */
3317 { (yyval.attr) = make_attr(ATTR_MAYBE); }
3318 #line 3319 "parser.tab.c" /* yacc.c:1646 */
3319 break;
3320
3321 case 128:
3322 #line 549 "parser.y" /* yacc.c:1646 */
3323 { (yyval.attr) = make_attr(ATTR_MESSAGE); }
3324 #line 3325 "parser.tab.c" /* yacc.c:1646 */
3325 break;
3326
3327 case 129:
3328 #line 550 "parser.y" /* yacc.c:1646 */
3329 { (yyval.attr) = make_attr(ATTR_NOCODE); }
3330 #line 3331 "parser.tab.c" /* yacc.c:1646 */
3331 break;
3332
3333 case 130:
3334 #line 551 "parser.y" /* yacc.c:1646 */
3335 { (yyval.attr) = make_attr(ATTR_NONBROWSABLE); }
3336 #line 3337 "parser.tab.c" /* yacc.c:1646 */
3337 break;
3338
3339 case 131:
3340 #line 552 "parser.y" /* yacc.c:1646 */
3341 { (yyval.attr) = make_attr(ATTR_NONCREATABLE); }
3342 #line 3343 "parser.tab.c" /* yacc.c:1646 */
3343 break;
3344
3345 case 132:
3346 #line 553 "parser.y" /* yacc.c:1646 */
3347 { (yyval.attr) = make_attr(ATTR_NONEXTENSIBLE); }
3348 #line 3349 "parser.tab.c" /* yacc.c:1646 */
3349 break;
3350
3351 case 133:
3352 #line 554 "parser.y" /* yacc.c:1646 */
3353 { (yyval.attr) = make_attr(ATTR_NOTIFY); }
3354 #line 3355 "parser.tab.c" /* yacc.c:1646 */
3355 break;
3356
3357 case 134:
3358 #line 555 "parser.y" /* yacc.c:1646 */
3359 { (yyval.attr) = make_attr(ATTR_NOTIFYFLAG); }
3360 #line 3361 "parser.tab.c" /* yacc.c:1646 */
3361 break;
3362
3363 case 135:
3364 #line 556 "parser.y" /* yacc.c:1646 */
3365 { (yyval.attr) = make_attr(ATTR_OBJECT); }
3366 #line 3367 "parser.tab.c" /* yacc.c:1646 */
3367 break;
3368
3369 case 136:
3370 #line 557 "parser.y" /* yacc.c:1646 */
3371 { (yyval.attr) = make_attr(ATTR_ODL); }
3372 #line 3373 "parser.tab.c" /* yacc.c:1646 */
3373 break;
3374
3375 case 137:
3376 #line 558 "parser.y" /* yacc.c:1646 */
3377 { (yyval.attr) = make_attr(ATTR_OLEAUTOMATION); }
3378 #line 3379 "parser.tab.c" /* yacc.c:1646 */
3379 break;
3380
3381 case 138:
3382 #line 559 "parser.y" /* yacc.c:1646 */
3383 { (yyval.attr) = make_attrp(ATTR_OPTIMIZE, (yyvsp[-1].str)); }
3384 #line 3385 "parser.tab.c" /* yacc.c:1646 */
3385 break;
3386
3387 case 139:
3388 #line 560 "parser.y" /* yacc.c:1646 */
3389 { (yyval.attr) = make_attr(ATTR_OPTIONAL); }
3390 #line 3391 "parser.tab.c" /* yacc.c:1646 */
3391 break;
3392
3393 case 140:
3394 #line 561 "parser.y" /* yacc.c:1646 */
3395 { (yyval.attr) = make_attr(ATTR_OUT); }
3396 #line 3397 "parser.tab.c" /* yacc.c:1646 */
3397 break;
3398
3399 case 141:
3400 #line 562 "parser.y" /* yacc.c:1646 */
3401 { (yyval.attr) = make_attr(ATTR_PARTIALIGNORE); }
3402 #line 3403 "parser.tab.c" /* yacc.c:1646 */
3403 break;
3404
3405 case 142:
3406 #line 563 "parser.y" /* yacc.c:1646 */
3407 { (yyval.attr) = make_attrv(ATTR_POINTERDEFAULT, (yyvsp[-1].num)); }
3408 #line 3409 "parser.tab.c" /* yacc.c:1646 */
3409 break;
3410
3411 case 143:
3412 #line 564 "parser.y" /* yacc.c:1646 */
3413 { (yyval.attr) = make_attrp(ATTR_PROGID, (yyvsp[-1].str)); }
3414 #line 3415 "parser.tab.c" /* yacc.c:1646 */
3415 break;
3416
3417 case 144:
3418 #line 565 "parser.y" /* yacc.c:1646 */
3419 { (yyval.attr) = make_attr(ATTR_PROPGET); }
3420 #line 3421 "parser.tab.c" /* yacc.c:1646 */
3421 break;
3422
3423 case 145:
3424 #line 566 "parser.y" /* yacc.c:1646 */
3425 { (yyval.attr) = make_attr(ATTR_PROPPUT); }
3426 #line 3427 "parser.tab.c" /* yacc.c:1646 */
3427 break;
3428
3429 case 146:
3430 #line 567 "parser.y" /* yacc.c:1646 */
3431 { (yyval.attr) = make_attr(ATTR_PROPPUTREF); }
3432 #line 3433 "parser.tab.c" /* yacc.c:1646 */
3433 break;
3434
3435 case 147:
3436 #line 568 "parser.y" /* yacc.c:1646 */
3437 { (yyval.attr) = make_attr(ATTR_PROXY); }
3438 #line 3439 "parser.tab.c" /* yacc.c:1646 */
3439 break;
3440
3441 case 148:
3442 #line 569 "parser.y" /* yacc.c:1646 */
3443 { (yyval.attr) = make_attr(ATTR_PUBLIC); }
3444 #line 3445 "parser.tab.c" /* yacc.c:1646 */
3445 break;
3446
3447 case 149:
3448 #line 571 "parser.y" /* yacc.c:1646 */
3449 { expr_list_t *list = append_expr( NULL, (yyvsp[-3].expr) );
3450 list = append_expr( list, (yyvsp[-1].expr) );
3451 (yyval.attr) = make_attrp(ATTR_RANGE, list); }
3452 #line 3453 "parser.tab.c" /* yacc.c:1646 */
3453 break;
3454
3455 case 150:
3456 #line 574 "parser.y" /* yacc.c:1646 */
3457 { (yyval.attr) = make_attr(ATTR_READONLY); }
3458 #line 3459 "parser.tab.c" /* yacc.c:1646 */
3459 break;
3460
3461 case 151:
3462 #line 575 "parser.y" /* yacc.c:1646 */
3463 { (yyval.attr) = make_attrp(ATTR_REPRESENTAS, (yyvsp[-1].type)); }
3464 #line 3465 "parser.tab.c" /* yacc.c:1646 */
3465 break;
3466
3467 case 152:
3468 #line 576 "parser.y" /* yacc.c:1646 */
3469 { (yyval.attr) = make_attr(ATTR_REQUESTEDIT); }
3470 #line 3471 "parser.tab.c" /* yacc.c:1646 */
3471 break;
3472
3473 case 153:
3474 #line 577 "parser.y" /* yacc.c:1646 */
3475 { (yyval.attr) = make_attr(ATTR_RESTRICTED); }
3476 #line 3477 "parser.tab.c" /* yacc.c:1646 */
3477 break;
3478
3479 case 154:
3480 #line 578 "parser.y" /* yacc.c:1646 */
3481 { (yyval.attr) = make_attr(ATTR_RETVAL); }
3482 #line 3483 "parser.tab.c" /* yacc.c:1646 */
3483 break;
3484
3485 case 155:
3486 #line 579 "parser.y" /* yacc.c:1646 */
3487 { (yyval.attr) = make_attrp(ATTR_SIZEIS, (yyvsp[-1].expr_list)); }
3488 #line 3489 "parser.tab.c" /* yacc.c:1646 */
3489 break;
3490
3491 case 156:
3492 #line 580 "parser.y" /* yacc.c:1646 */
3493 { (yyval.attr) = make_attr(ATTR_SOURCE); }
3494 #line 3495 "parser.tab.c" /* yacc.c:1646 */
3495 break;
3496
3497 case 157:
3498 #line 581 "parser.y" /* yacc.c:1646 */
3499 { (yyval.attr) = make_attr(ATTR_STRICTCONTEXTHANDLE); }
3500 #line 3501 "parser.tab.c" /* yacc.c:1646 */
3501 break;
3502
3503 case 158:
3504 #line 582 "parser.y" /* yacc.c:1646 */
3505 { (yyval.attr) = make_attr(ATTR_STRING); }
3506 #line 3507 "parser.tab.c" /* yacc.c:1646 */
3507 break;
3508
3509 case 159:
3510 #line 583 "parser.y" /* yacc.c:1646 */
3511 { (yyval.attr) = make_attrp(ATTR_SWITCHIS, (yyvsp[-1].expr)); }
3512 #line 3513 "parser.tab.c" /* yacc.c:1646 */
3513 break;
3514
3515 case 160:
3516 #line 584 "parser.y" /* yacc.c:1646 */
3517 { (yyval.attr) = make_attrp(ATTR_SWITCHTYPE, (yyvsp[-1].type)); }
3518 #line 3519 "parser.tab.c" /* yacc.c:1646 */
3519 break;
3520
3521 case 161:
3522 #line 585 "parser.y" /* yacc.c:1646 */
3523 { (yyval.attr) = make_attrp(ATTR_TRANSMITAS, (yyvsp[-1].type)); }
3524 #line 3525 "parser.tab.c" /* yacc.c:1646 */
3525 break;
3526
3527 case 162:
3528 #line 586 "parser.y" /* yacc.c:1646 */
3529 { (yyval.attr) = make_attrv(ATTR_THREADING, (yyvsp[-1].num)); }
3530 #line 3531 "parser.tab.c" /* yacc.c:1646 */
3531 break;
3532
3533 case 163:
3534 #line 587 "parser.y" /* yacc.c:1646 */
3535 { (yyval.attr) = make_attr(ATTR_UIDEFAULT); }
3536 #line 3537 "parser.tab.c" /* yacc.c:1646 */
3537 break;
3538
3539 case 164:
3540 #line 588 "parser.y" /* yacc.c:1646 */
3541 { (yyval.attr) = make_attr(ATTR_USESGETLASTERROR); }
3542 #line 3543 "parser.tab.c" /* yacc.c:1646 */
3543 break;
3544
3545 case 165:
3546 #line 589 "parser.y" /* yacc.c:1646 */
3547 { (yyval.attr) = make_attrp(ATTR_USERMARSHAL, (yyvsp[-1].type)); }
3548 #line 3549 "parser.tab.c" /* yacc.c:1646 */
3549 break;
3550
3551 case 166:
3552 #line 590 "parser.y" /* yacc.c:1646 */
3553 { (yyval.attr) = make_attrp(ATTR_UUID, (yyvsp[-1].uuid)); }
3554 #line 3555 "parser.tab.c" /* yacc.c:1646 */
3555 break;
3556
3557 case 167:
3558 #line 591 "parser.y" /* yacc.c:1646 */
3559 { (yyval.attr) = make_attrp(ATTR_ASYNCUUID, (yyvsp[-1].uuid)); }
3560 #line 3561 "parser.tab.c" /* yacc.c:1646 */
3561 break;
3562
3563 case 168:
3564 #line 592 "parser.y" /* yacc.c:1646 */
3565 { (yyval.attr) = make_attr(ATTR_V1ENUM); }
3566 #line 3567 "parser.tab.c" /* yacc.c:1646 */
3567 break;
3568
3569 case 169:
3570 #line 593 "parser.y" /* yacc.c:1646 */
3571 { (yyval.attr) = make_attr(ATTR_VARARG); }
3572 #line 3573 "parser.tab.c" /* yacc.c:1646 */
3573 break;
3574
3575 case 170:
3576 #line 594 "parser.y" /* yacc.c:1646 */
3577 { (yyval.attr) = make_attrv(ATTR_VERSION, (yyvsp[-1].num)); }
3578 #line 3579 "parser.tab.c" /* yacc.c:1646 */
3579 break;
3580
3581 case 171:
3582 #line 595 "parser.y" /* yacc.c:1646 */
3583 { (yyval.attr) = make_attrp(ATTR_VIPROGID, (yyvsp[-1].str)); }
3584 #line 3585 "parser.tab.c" /* yacc.c:1646 */
3585 break;
3586
3587 case 172:
3588 #line 596 "parser.y" /* yacc.c:1646 */
3589 { (yyval.attr) = make_attrp(ATTR_WIREMARSHAL, (yyvsp[-1].type)); }
3590 #line 3591 "parser.tab.c" /* yacc.c:1646 */
3591 break;
3592
3593 case 173:
3594 #line 597 "parser.y" /* yacc.c:1646 */
3595 { (yyval.attr) = make_attrv(ATTR_POINTERTYPE, (yyvsp[0].num)); }
3596 #line 3597 "parser.tab.c" /* yacc.c:1646 */
3597 break;
3598
3599 case 175:
3600 #line 602 "parser.y" /* yacc.c:1646 */
3601 { if (!is_valid_uuid((yyvsp[0].str)))
3602 error_loc("invalid UUID: %s\n", (yyvsp[0].str));
3603 (yyval.uuid) = parse_uuid((yyvsp[0].str)); }
3604 #line 3605 "parser.tab.c" /* yacc.c:1646 */
3605 break;
3606
3607 case 176:
3608 #line 607 "parser.y" /* yacc.c:1646 */
3609 { (yyval.str) = xstrdup("__cdecl"); }
3610 #line 3611 "parser.tab.c" /* yacc.c:1646 */
3611 break;
3612
3613 case 177:
3614 #line 608 "parser.y" /* yacc.c:1646 */
3615 { (yyval.str) = xstrdup("__fastcall"); }
3616 #line 3617 "parser.tab.c" /* yacc.c:1646 */
3617 break;
3618
3619 case 178:
3620 #line 609 "parser.y" /* yacc.c:1646 */
3621 { (yyval.str) = xstrdup("__pascal"); }
3622 #line 3623 "parser.tab.c" /* yacc.c:1646 */
3623 break;
3624
3625 case 179:
3626 #line 610 "parser.y" /* yacc.c:1646 */
3627 { (yyval.str) = xstrdup("__stdcall"); }
3628 #line 3629 "parser.tab.c" /* yacc.c:1646 */
3629 break;
3630
3631 case 180:
3632 #line 613 "parser.y" /* yacc.c:1646 */
3633 { (yyval.var_list) = NULL; }
3634 #line 3635 "parser.tab.c" /* yacc.c:1646 */
3635 break;
3636
3637 case 181:
3638 #line 614 "parser.y" /* yacc.c:1646 */
3639 { (yyval.var_list) = append_var( (yyvsp[-1].var_list), (yyvsp[0].var) ); }
3640 #line 3641 "parser.tab.c" /* yacc.c:1646 */
3641 break;
3642
3643 case 182:
3644 #line 617 "parser.y" /* yacc.c:1646 */
3645 { attr_t *a = make_attrp(ATTR_CASE, append_expr( NULL, (yyvsp[-2].expr) ));
3646 (yyval.var) = (yyvsp[0].var); if (!(yyval.var)) (yyval.var) = make_var(NULL);
3647 (yyval.var)->attrs = append_attr( (yyval.var)->attrs, a );
3648 }
3649 #line 3650 "parser.tab.c" /* yacc.c:1646 */
3650 break;
3651
3652 case 183:
3653 #line 621 "parser.y" /* yacc.c:1646 */
3654 { attr_t *a = make_attr(ATTR_DEFAULT);
3655 (yyval.var) = (yyvsp[0].var); if (!(yyval.var)) (yyval.var) = make_var(NULL);
3656 (yyval.var)->attrs = append_attr( (yyval.var)->attrs, a );
3657 }
3658 #line 3659 "parser.tab.c" /* yacc.c:1646 */
3659 break;
3660
3661 case 184:
3662 #line 627 "parser.y" /* yacc.c:1646 */
3663 { (yyval.var_list) = NULL; }
3664 #line 3665 "parser.tab.c" /* yacc.c:1646 */
3665 break;
3666
3667 case 185:
3668 #line 628 "parser.y" /* yacc.c:1646 */
3669 { (yyval.var_list) = (yyvsp[-1].var_list); }
3670 #line 3671 "parser.tab.c" /* yacc.c:1646 */
3671 break;
3672
3673 case 187:
3674 #line 632 "parser.y" /* yacc.c:1646 */
3675 { if (!(yyvsp[0].var)->eval)
3676 (yyvsp[0].var)->eval = make_exprl(EXPR_NUM, 0 /* default for first enum entry */);
3677 (yyval.var_list) = append_var( NULL, (yyvsp[0].var) );
3678 }
3679 #line 3680 "parser.tab.c" /* yacc.c:1646 */
3680 break;
3681
3682 case 188:
3683 #line 636 "parser.y" /* yacc.c:1646 */
3684 { if (!(yyvsp[0].var)->eval)
3685 {
3686 var_t *last = LIST_ENTRY( list_tail((yyval.var_list)), var_t, entry );
3687 enum expr_type type = EXPR_NUM;
3688 if (last->eval->type == EXPR_HEXNUM) type = EXPR_HEXNUM;
3689 if (last->eval->cval + 1 < 0) type = EXPR_HEXNUM;
3690 (yyvsp[0].var)->eval = make_exprl(type, last->eval->cval + 1);
3691 }
3692 (yyval.var_list) = append_var( (yyvsp[-2].var_list), (yyvsp[0].var) );
3693 }
3694 #line 3695 "parser.tab.c" /* yacc.c:1646 */
3695 break;
3696
3697 case 189:
3698 #line 648 "parser.y" /* yacc.c:1646 */
3699 { (yyval.var) = reg_const((yyvsp[-2].var));
3700 (yyval.var)->eval = (yyvsp[0].expr);
3701 (yyval.var)->type = type_new_int(TYPE_BASIC_INT, 0);
3702 }
3703 #line 3704 "parser.tab.c" /* yacc.c:1646 */
3704 break;
3705
3706 case 190:
3707 #line 652 "parser.y" /* yacc.c:1646 */
3708 { (yyval.var) = reg_const((yyvsp[0].var));
3709 (yyval.var)->type = type_new_int(TYPE_BASIC_INT, 0);
3710 }
3711 #line 3712 "parser.tab.c" /* yacc.c:1646 */
3712 break;
3713
3714 case 191:
3715 #line 657 "parser.y" /* yacc.c:1646 */
3716 { (yyval.type) = type_new_enum((yyvsp[-3].str), current_namespace, TRUE, (yyvsp[-1].var_list)); }
3717 #line 3718 "parser.tab.c" /* yacc.c:1646 */
3718 break;
3719
3720 case 192:
3721 #line 660 "parser.y" /* yacc.c:1646 */
3722 { (yyval.expr_list) = append_expr( NULL, (yyvsp[0].expr) ); }
3723 #line 3724 "parser.tab.c" /* yacc.c:1646 */
3724 break;
3725
3726 case 193:
3727 #line 661 "parser.y" /* yacc.c:1646 */
3728 { (yyval.expr_list) = append_expr( (yyvsp[-2].expr_list), (yyvsp[0].expr) ); }
3729 #line 3730 "parser.tab.c" /* yacc.c:1646 */
3730 break;
3731
3732 case 194:
3733 #line 664 "parser.y" /* yacc.c:1646 */
3734 { (yyval.expr) = make_expr(EXPR_VOID); }
3735 #line 3736 "parser.tab.c" /* yacc.c:1646 */
3736 break;
3737
3738 case 196:
3739 #line 668 "parser.y" /* yacc.c:1646 */
3740 { (yyval.expr) = make_exprl(EXPR_NUM, (yyvsp[0].num)); }
3741 #line 3742 "parser.tab.c" /* yacc.c:1646 */
3742 break;
3743
3744 case 197:
3745 #line 669 "parser.y" /* yacc.c:1646 */
3746 { (yyval.expr) = make_exprl(EXPR_HEXNUM, (yyvsp[0].num)); }
3747 #line 3748 "parser.tab.c" /* yacc.c:1646 */
3748 break;
3749
3750 case 198:
3751 #line 670 "parser.y" /* yacc.c:1646 */
3752 { (yyval.expr) = make_exprd(EXPR_DOUBLE, (yyvsp[0].dbl)); }
3753 #line 3754 "parser.tab.c" /* yacc.c:1646 */
3754 break;
3755
3756 case 199:
3757 #line 671 "parser.y" /* yacc.c:1646 */
3758 { (yyval.expr) = make_exprl(EXPR_TRUEFALSE, 0); }
3759 #line 3760 "parser.tab.c" /* yacc.c:1646 */
3760 break;
3761
3762 case 200:
3763 #line 672 "parser.y" /* yacc.c:1646 */
3764 { (yyval.expr) = make_exprl(EXPR_NUM, 0); }
3765 #line 3766 "parser.tab.c" /* yacc.c:1646 */
3766 break;
3767
3768 case 201:
3769 #line 673 "parser.y" /* yacc.c:1646 */
3770 { (yyval.expr) = make_exprl(EXPR_TRUEFALSE, 1); }
3771 #line 3772 "parser.tab.c" /* yacc.c:1646 */
3772 break;
3773
3774 case 202:
3775 #line 674 "parser.y" /* yacc.c:1646 */
3776 { (yyval.expr) = make_exprs(EXPR_STRLIT, (yyvsp[0].str)); }
3777 #line 3778 "parser.tab.c" /* yacc.c:1646 */
3778 break;
3779
3780 case 203:
3781 #line 675 "parser.y" /* yacc.c:1646 */
3782 { (yyval.expr) = make_exprs(EXPR_WSTRLIT, (yyvsp[0].str)); }
3783 #line 3784 "parser.tab.c" /* yacc.c:1646 */
3784 break;
3785
3786 case 204:
3787 #line 676 "parser.y" /* yacc.c:1646 */
3788 { (yyval.expr) = make_exprs(EXPR_CHARCONST, (yyvsp[0].str)); }
3789 #line 3790 "parser.tab.c" /* yacc.c:1646 */
3790 break;
3791
3792 case 205:
3793 #line 677 "parser.y" /* yacc.c:1646 */
3794 { (yyval.expr) = make_exprs(EXPR_IDENTIFIER, (yyvsp[0].str)); }
3795 #line 3796 "parser.tab.c" /* yacc.c:1646 */
3796 break;
3797
3798 case 206:
3799 #line 678 "parser.y" /* yacc.c:1646 */
3800 { (yyval.expr) = make_expr3(EXPR_COND, (yyvsp[-4].expr), (yyvsp[-2].expr), (yyvsp[0].expr)); }
3801 #line 3802 "parser.tab.c" /* yacc.c:1646 */
3802 break;
3803
3804 case 207:
3805 #line 679 "parser.y" /* yacc.c:1646 */
3806 { (yyval.expr) = make_expr2(EXPR_LOGOR, (yyvsp[-2].expr), (yyvsp[0].expr)); }
3807 #line 3808 "parser.tab.c" /* yacc.c:1646 */
3808 break;
3809
3810 case 208:
3811 #line 680 "parser.y" /* yacc.c:1646 */
3812 { (yyval.expr) = make_expr2(EXPR_LOGAND, (yyvsp[-2].expr), (yyvsp[0].expr)); }
3813 #line 3814 "parser.tab.c" /* yacc.c:1646 */
3814 break;
3815
3816 case 209:
3817 #line 681 "parser.y" /* yacc.c:1646 */
3818 { (yyval.expr) = make_expr2(EXPR_OR , (yyvsp[-2].expr), (yyvsp[0].expr)); }
3819 #line 3820 "parser.tab.c" /* yacc.c:1646 */
3820 break;
3821
3822 case 210:
3823 #line 682 "parser.y" /* yacc.c:1646 */
3824 { (yyval.expr) = make_expr2(EXPR_XOR, (yyvsp[-2].expr), (yyvsp[0].expr)); }
3825 #line 3826 "parser.tab.c" /* yacc.c:1646 */
3826 break;
3827
3828 case 211:
3829 #line 683 "parser.y" /* yacc.c:1646 */
3830 { (yyval.expr) = make_expr2(EXPR_AND, (yyvsp[-2].expr), (yyvsp[0].expr)); }
3831 #line 3832 "parser.tab.c" /* yacc.c:1646 */
3832 break;
3833
3834 case 212:
3835 #line 684 "parser.y" /* yacc.c:1646 */
3836 { (yyval.expr) = make_expr2(EXPR_EQUALITY, (yyvsp[-2].expr), (yyvsp[0].expr)); }
3837 #line 3838 "parser.tab.c" /* yacc.c:1646 */
3838 break;
3839
3840 case 213:
3841 #line 685 "parser.y" /* yacc.c:1646 */
3842 { (yyval.expr) = make_expr2(EXPR_INEQUALITY, (yyvsp[-2].expr), (yyvsp[0].expr)); }
3843 #line 3844 "parser.tab.c" /* yacc.c:1646 */
3844 break;
3845
3846 case 214:
3847 #line 686 "parser.y" /* yacc.c:1646 */
3848 { (yyval.expr) = make_expr2(EXPR_GTR, (yyvsp[-2].expr), (yyvsp[0].expr)); }
3849 #line 3850 "parser.tab.c" /* yacc.c:1646 */
3850 break;
3851
3852 case 215:
3853 #line 687 "parser.y" /* yacc.c:1646 */
3854 { (yyval.expr) = make_expr2(EXPR_LESS, (yyvsp[-2].expr), (yyvsp[0].expr)); }
3855 #line 3856 "parser.tab.c" /* yacc.c:1646 */
3856 break;
3857
3858 case 216:
3859 #line 688 "parser.y" /* yacc.c:1646 */
3860 { (yyval.expr) = make_expr2(EXPR_GTREQL, (yyvsp[-2].expr), (yyvsp[0].expr)); }
3861 #line 3862 "parser.tab.c" /* yacc.c:1646 */
3862 break;
3863
3864 case 217:
3865 #line 689 "parser.y" /* yacc.c:1646 */
3866 { (yyval.expr) = make_expr2(EXPR_LESSEQL, (yyvsp[-2].expr), (yyvsp[0].expr)); }
3867 #line 3868 "parser.tab.c" /* yacc.c:1646 */
3868 break;
3869
3870 case 218:
3871 #line 690 "parser.y" /* yacc.c:1646 */
3872 { (yyval.expr) = make_expr2(EXPR_SHL, (yyvsp[-2].expr), (yyvsp[0].expr)); }
3873 #line 3874 "parser.tab.c" /* yacc.c:1646 */
3874 break;
3875
3876 case 219:
3877 #line 691 "parser.y" /* yacc.c:1646 */
3878 { (yyval.expr) = make_expr2(EXPR_SHR, (yyvsp[-2].expr), (yyvsp[0].expr)); }
3879 #line 3880 "parser.tab.c" /* yacc.c:1646 */
3880 break;
3881
3882 case 220:
3883 #line 692 "parser.y" /* yacc.c:1646 */
3884 { (yyval.expr) = make_expr2(EXPR_ADD, (yyvsp[-2].expr), (yyvsp[0].expr)); }
3885 #line 3886 "parser.tab.c" /* yacc.c:1646 */
3886 break;
3887
3888 case 221:
3889 #line 693 "parser.y" /* yacc.c:1646 */
3890 { (yyval.expr) = make_expr2(EXPR_SUB, (yyvsp[-2].expr), (yyvsp[0].expr)); }
3891 #line 3892 "parser.tab.c" /* yacc.c:1646 */
3892 break;
3893
3894 case 222:
3895 #line 694 "parser.y" /* yacc.c:1646 */
3896 { (yyval.expr) = make_expr2(EXPR_MOD, (yyvsp[-2].expr), (yyvsp[0].expr)); }
3897 #line 3898 "parser.tab.c" /* yacc.c:1646 */
3898 break;
3899
3900 case 223:
3901 #line 695 "parser.y" /* yacc.c:1646 */
3902 { (yyval.expr) = make_expr2(EXPR_MUL, (yyvsp[-2].expr), (yyvsp[0].expr)); }
3903 #line 3904 "parser.tab.c" /* yacc.c:1646 */
3904 break;
3905
3906 case 224:
3907 #line 696 "parser.y" /* yacc.c:1646 */
3908 { (yyval.expr) = make_expr2(EXPR_DIV, (yyvsp[-2].expr), (yyvsp[0].expr)); }
3909 #line 3910 "parser.tab.c" /* yacc.c:1646 */
3910 break;
3911
3912 case 225:
3913 #line 697 "parser.y" /* yacc.c:1646 */
3914 { (yyval.expr) = make_expr1(EXPR_LOGNOT, (yyvsp[0].expr)); }
3915 #line 3916 "parser.tab.c" /* yacc.c:1646 */
3916 break;
3917
3918 case 226:
3919 #line 698 "parser.y" /* yacc.c:1646 */
3920 { (yyval.expr) = make_expr1(EXPR_NOT, (yyvsp[0].expr)); }
3921 #line 3922 "parser.tab.c" /* yacc.c:1646 */
3922 break;
3923
3924 case 227:
3925 #line 699 "parser.y" /* yacc.c:1646 */
3926 { (yyval.expr) = make_expr1(EXPR_POS, (yyvsp[0].expr)); }
3927 #line 3928 "parser.tab.c" /* yacc.c:1646 */
3928 break;
3929
3930 case 228:
3931 #line 700 "parser.y" /* yacc.c:1646 */
3932 { (yyval.expr) = make_expr1(EXPR_NEG, (yyvsp[0].expr)); }
3933 #line 3934 "parser.tab.c" /* yacc.c:1646 */
3934 break;
3935
3936 case 229:
3937 #line 701 "parser.y" /* yacc.c:1646 */
3938 { (yyval.expr) = make_expr1(EXPR_ADDRESSOF, (yyvsp[0].expr)); }
3939 #line 3940 "parser.tab.c" /* yacc.c:1646 */
3940 break;
3941
3942 case 230:
3943 #line 702 "parser.y" /* yacc.c:1646 */
3944 { (yyval.expr) = make_expr1(EXPR_PPTR, (yyvsp[0].expr)); }
3945 #line 3946 "parser.tab.c" /* yacc.c:1646 */
3946 break;
3947
3948 case 231:
3949 #line 703 "parser.y" /* yacc.c:1646 */
3950 { (yyval.expr) = make_expr2(EXPR_MEMBER, make_expr1(EXPR_PPTR, (yyvsp[-2].expr)), make_exprs(EXPR_IDENTIFIER, (yyvsp[0].str))); }
3951 #line 3952 "parser.tab.c" /* yacc.c:1646 */
3952 break;
3953
3954 case 232:
3955 #line 704 "parser.y" /* yacc.c:1646 */
3956 { (yyval.expr) = make_expr2(EXPR_MEMBER, (yyvsp[-2].expr), make_exprs(EXPR_IDENTIFIER, (yyvsp[0].str))); }
3957 #line 3958 "parser.tab.c" /* yacc.c:1646 */
3958 break;
3959
3960 case 233:
3961 #line 706 "parser.y" /* yacc.c:1646 */
3962 { (yyval.expr) = make_exprt(EXPR_CAST, declare_var(NULL, (yyvsp[-3].declspec), (yyvsp[-2].declarator), 0), (yyvsp[0].expr)); free((yyvsp[-3].declspec)); free((yyvsp[-2].declarator)); }
3963 #line 3964 "parser.tab.c" /* yacc.c:1646 */
3964 break;
3965
3966 case 234:
3967 #line 708 "parser.y" /* yacc.c:1646 */
3968 { (yyval.expr) = make_exprt(EXPR_SIZEOF, declare_var(NULL, (yyvsp[-2].declspec), (yyvsp[-1].declarator), 0), NULL); free((yyvsp[-2].declspec)); free((yyvsp[-1].declarator)); }
3969 #line 3970 "parser.tab.c" /* yacc.c:1646 */
3970 break;
3971
3972 case 235:
3973 #line 709 "parser.y" /* yacc.c:1646 */
3974 { (yyval.expr) = make_expr2(EXPR_ARRAY, (yyvsp[-3].expr), (yyvsp[-1].expr)); }
3975 #line 3976 "parser.tab.c" /* yacc.c:1646 */
3976 break;
3977
3978 case 236:
3979 #line 710 "parser.y" /* yacc.c:1646 */
3980 { (yyval.expr) = (yyvsp[-1].expr); }
3981 #line 3982 "parser.tab.c" /* yacc.c:1646 */
3982 break;
3983
3984 case 237:
3985 #line 713 "parser.y" /* yacc.c:1646 */
3986 { (yyval.expr_list) = append_expr( NULL, (yyvsp[0].expr) ); }
3987 #line 3988 "parser.tab.c" /* yacc.c:1646 */
3988 break;
3989
3990 case 238:
3991 #line 714 "parser.y" /* yacc.c:1646 */
3992 { (yyval.expr_list) = append_expr( (yyvsp[-2].expr_list), (yyvsp[0].expr) ); }
3993 #line 3994 "parser.tab.c" /* yacc.c:1646 */
3994 break;
3995
3996 case 239:
3997 #line 717 "parser.y" /* yacc.c:1646 */
3998 { (yyval.expr) = (yyvsp[0].expr);
3999 if (!(yyval.expr)->is_const)
4000 error_loc("expression is not an integer constant\n");
4001 }
4002 #line 4003 "parser.tab.c" /* yacc.c:1646 */
4003 break;
4004
4005 case 240:
4006 #line 723 "parser.y" /* yacc.c:1646 */
4007 { (yyval.expr) = (yyvsp[0].expr);
4008 if (!(yyval.expr)->is_const && (yyval.expr)->type != EXPR_STRLIT && (yyval.expr)->type != EXPR_WSTRLIT)
4009 error_loc("expression is not constant\n");
4010 }
4011 #line 4012 "parser.tab.c" /* yacc.c:1646 */
4012 break;
4013
4014 case 241:
4015 #line 729 "parser.y" /* yacc.c:1646 */
4016 { (yyval.var_list) = NULL; }
4017 #line 4018 "parser.tab.c" /* yacc.c:1646 */
4018 break;
4019
4020 case 242:
4021 #line 730 "parser.y" /* yacc.c:1646 */
4022 { (yyval.var_list) = append_var_list((yyvsp[-1].var_list), (yyvsp[0].var_list)); }
4023 #line 4024 "parser.tab.c" /* yacc.c:1646 */
4024 break;
4025
4026 case 243:
4027 #line 734 "parser.y" /* yacc.c:1646 */
4028 { const char *first = LIST_ENTRY(list_head((yyvsp[-1].declarator_list)), declarator_t, entry)->var->name;
4029 check_field_attrs(first, (yyvsp[-3].attr_list));
4030 (yyval.var_list) = set_var_types((yyvsp[-3].attr_list), (yyvsp[-2].declspec), (yyvsp[-1].declarator_list));
4031 }
4032 #line 4033 "parser.tab.c" /* yacc.c:1646 */
4033 break;
4034
4035 case 244:
4036 #line 738 "parser.y" /* yacc.c:1646 */
4037 { var_t *v = make_var(NULL);
4038 v->type = (yyvsp[-1].type); v->attrs = (yyvsp[-2].attr_list);
4039 (yyval.var_list) = append_var(NULL, v);
4040 }
4041 #line 4042 "parser.tab.c" /* yacc.c:1646 */
4042 break;
4043
4044 case 245:
4045 #line 745 "parser.y" /* yacc.c:1646 */
4046 { (yyval.var) = (yyvsp[-1].var); }
4047 #line 4048 "parser.tab.c" /* yacc.c:1646 */
4048 break;
4049
4050 case 246:
4051 #line 746 "parser.y" /* yacc.c:1646 */
4052 { (yyval.var) = make_var(NULL); (yyval.var)->attrs = (yyvsp[-1].attr_list); }
4053 #line 4054 "parser.tab.c" /* yacc.c:1646 */
4054 break;
4055
4056 case 247:
4057 #line 749 "parser.y" /* yacc.c:1646 */
4058 { (yyval.var_list) = NULL; }
4059 #line 4060 "parser.tab.c" /* yacc.c:1646 */
4060 break;
4061
4062 case 248:
4063 #line 750 "parser.y" /* yacc.c:1646 */
4064 { (yyval.var_list) = append_var( (yyvsp[-1].var_list), (yyvsp[0].var) ); }
4065 #line 4066 "parser.tab.c" /* yacc.c:1646 */
4066 break;
4067
4068 case 249:
4069 #line 754 "parser.y" /* yacc.c:1646 */
4070 { (yyval.var) = (yyvsp[-1].var); }
4071 #line 4072 "parser.tab.c" /* yacc.c:1646 */
4072 break;
4073
4074 case 250:
4075 #line 755 "parser.y" /* yacc.c:1646 */
4076 { (yyval.var) = NULL; }
4077 #line 4078 "parser.tab.c" /* yacc.c:1646 */
4078 break;
4079
4080 case 251:
4081 #line 758 "parser.y" /* yacc.c:1646 */
4082 { (yyval.var) = declare_var(check_field_attrs((yyvsp[0].declarator)->var->name, (yyvsp[-2].attr_list)),
4083 (yyvsp[-1].declspec), (yyvsp[0].declarator), FALSE);
4084 free((yyvsp[0].declarator));
4085 }
4086 #line 4087 "parser.tab.c" /* yacc.c:1646 */
4087 break;
4088
4089 case 252:
4090 #line 762 "parser.y" /* yacc.c:1646 */
4091 { var_t *v = make_var(NULL);
4092 v->type = (yyvsp[0].type); v->attrs = (yyvsp[-1].attr_list);
4093 (yyval.var) = v;
4094 }
4095 #line 4096 "parser.tab.c" /* yacc.c:1646 */
4096 break;
4097
4098 case 253:
4099 #line 768 "parser.y" /* yacc.c:1646 */
4100 { (yyval.var) = (yyvsp[0].var);
4101 if (type_get_type((yyval.var)->type) != TYPE_FUNCTION)
4102 error_loc("only methods may be declared inside the methods section of a dispinterface\n");
4103 check_function_attrs((yyval.var)->name, (yyval.var)->attrs);
4104 }
4105 #line 4106 "parser.tab.c" /* yacc.c:1646 */
4106 break;
4107
4108 case 254:
4109 #line 777 "parser.y" /* yacc.c:1646 */
4110 { (yyval.var) = declare_var((yyvsp[-2].attr_list), (yyvsp[-1].declspec), (yyvsp[0].declarator), FALSE);
4111 free((yyvsp[0].declarator));
4112 }
4113 #line 4114 "parser.tab.c" /* yacc.c:1646 */
4114 break;
4115
4116 case 255:
4117 #line 780 "parser.y" /* yacc.c:1646 */
4118 { (yyval.var) = declare_var(NULL, (yyvsp[-1].declspec), (yyvsp[0].declarator), FALSE);
4119 free((yyvsp[0].declarator));
4120 }
4121 #line 4122 "parser.tab.c" /* yacc.c:1646 */
4122 break;
4123
4124 case 256:
4125 #line 785 "parser.y" /* yacc.c:1646 */
4126 { (yyval.var) = NULL; }
4127 #line 4128 "parser.tab.c" /* yacc.c:1646 */
4128 break;
4129
4130 case 258:
4131 #line 789 "parser.y" /* yacc.c:1646 */
4132 { (yyval.str) = NULL; }
4133 #line 4134 "parser.tab.c" /* yacc.c:1646 */
4134 break;
4135
4136 case 259:
4137 #line 790 "parser.y" /* yacc.c:1646 */
4138 { (yyval.str) = (yyvsp[0].str); }
4139 #line 4140 "parser.tab.c" /* yacc.c:1646 */
4140 break;
4141
4142 case 260:
4143 #line 791 "parser.y" /* yacc.c:1646 */
4144 { (yyval.str) = (yyvsp[0].str); }
4145 #line 4146 "parser.tab.c" /* yacc.c:1646 */
4146 break;
4147
4148 case 261:
4149 #line 794 "parser.y" /* yacc.c:1646 */
4150 { (yyval.var) = make_var((yyvsp[0].str)); }
4151 #line 4152 "parser.tab.c" /* yacc.c:1646 */
4152 break;
4153
4154 case 262:
4155 #line 796 "parser.y" /* yacc.c:1646 */
4156 { (yyval.var) = make_var((yyvsp[0].str)); }
4157 #line 4158 "parser.tab.c" /* yacc.c:1646 */
4158 break;
4159
4160 case 263:
4161 #line 799 "parser.y" /* yacc.c:1646 */
4162 { (yyval.type) = find_type_or_error((yyvsp[0].str), 0); }
4163 #line 4164 "parser.tab.c" /* yacc.c:1646 */
4164 break;
4165
4166 case 264:
4167 #line 800 "parser.y" /* yacc.c:1646 */
4168 { (yyval.type) = find_type_or_error((yyvsp[0].str), 0); }
4169 #line 4170 "parser.tab.c" /* yacc.c:1646 */
4170 break;
4171
4172 case 266:
4173 #line 802 "parser.y" /* yacc.c:1646 */
4174 { (yyval.type) = type_new_int(type_basic_get_type((yyvsp[0].type)), -1); }
4175 #line 4176 "parser.tab.c" /* yacc.c:1646 */
4176 break;
4177
4178 case 267:
4179 #line 803 "parser.y" /* yacc.c:1646 */
4180 { (yyval.type) = type_new_int(type_basic_get_type((yyvsp[0].type)), 1); }
4181 #line 4182 "parser.tab.c" /* yacc.c:1646 */
4182 break;
4183
4184 case 268:
4185 #line 804 "parser.y" /* yacc.c:1646 */
4186 { (yyval.type) = type_new_int(TYPE_BASIC_INT, 1); }
4187 #line 4188 "parser.tab.c" /* yacc.c:1646 */
4188 break;
4189
4190 case 269:
4191 #line 805 "parser.y" /* yacc.c:1646 */
4192 { (yyval.type) = find_type_or_error((yyvsp[0].str), 0); }
4193 #line 4194 "parser.tab.c" /* yacc.c:1646 */
4194 break;
4195
4196 case 270:
4197 #line 806 "parser.y" /* yacc.c:1646 */
4198 { (yyval.type) = find_type_or_error((yyvsp[0].str), 0); }
4199 #line 4200 "parser.tab.c" /* yacc.c:1646 */
4200 break;
4201
4202 case 271:
4203 #line 807 "parser.y" /* yacc.c:1646 */
4204 { (yyval.type) = find_type_or_error((yyvsp[0].str), 0); }
4205 #line 4206 "parser.tab.c" /* yacc.c:1646 */
4206 break;
4207
4208 case 272:
4209 #line 808 "parser.y" /* yacc.c:1646 */
4210 { (yyval.type) = find_type_or_error((yyvsp[0].str), 0); }
4211 #line 4212 "parser.tab.c" /* yacc.c:1646 */
4212 break;
4213
4214 case 273:
4215 #line 809 "parser.y" /* yacc.c:1646 */
4216 { (yyval.type) = find_type_or_error((yyvsp[0].str), 0); }
4217 #line 4218 "parser.tab.c" /* yacc.c:1646 */
4218 break;
4219
4220 case 276:
4221 #line 816 "parser.y" /* yacc.c:1646 */
4222 { (yyval.type) = type_new_int(TYPE_BASIC_INT, 0); }
4223 #line 4224 "parser.tab.c" /* yacc.c:1646 */
4224 break;
4225
4226 case 277:
4227 #line 817 "parser.y" /* yacc.c:1646 */
4228 { (yyval.type) = type_new_int(TYPE_BASIC_INT16, 0); }
4229 #line 4230 "parser.tab.c" /* yacc.c:1646 */
4230 break;
4231
4232 case 278:
4233 #line 818 "parser.y" /* yacc.c:1646 */
4234 { (yyval.type) = type_new_int(TYPE_BASIC_INT8, 0); }
4235 #line 4236 "parser.tab.c" /* yacc.c:1646 */
4236 break;
4237
4238 case 279:
4239 #line 819 "parser.y" /* yacc.c:1646 */
4240 { (yyval.type) = type_new_int(TYPE_BASIC_INT32, 0); }
4241 #line 4242 "parser.tab.c" /* yacc.c:1646 */
4242 break;
4243
4244 case 280:
4245 #line 820 "parser.y" /* yacc.c:1646 */
4246 { (yyval.type) = type_new_int(TYPE_BASIC_HYPER, 0); }
4247 #line 4248 "parser.tab.c" /* yacc.c:1646 */
4248 break;
4249
4250 case 281:
4251 #line 821 "parser.y" /* yacc.c:1646 */
4252 { (yyval.type) = type_new_int(TYPE_BASIC_INT64, 0); }
4253 #line 4254 "parser.tab.c" /* yacc.c:1646 */
4254 break;
4255
4256 case 282:
4257 #line 822 "parser.y" /* yacc.c:1646 */
4258 { (yyval.type) = type_new_int(TYPE_BASIC_CHAR, 0); }
4259 #line 4260 "parser.tab.c" /* yacc.c:1646 */
4260 break;
4261
4262 case 283:
4263 #line 823 "parser.y" /* yacc.c:1646 */
4264 { (yyval.type) = type_new_int(TYPE_BASIC_INT3264, 0); }
4265 #line 4266 "parser.tab.c" /* yacc.c:1646 */
4266 break;
4267
4268 case 284:
4269 #line 826 "parser.y" /* yacc.c:1646 */
4270 { (yyval.type) = type_new_coclass((yyvsp[0].str)); }
4271 #line 4272 "parser.tab.c" /* yacc.c:1646 */
4272 break;
4273
4274 case 285:
4275 #line 827 "parser.y" /* yacc.c:1646 */
4276 { (yyval.type) = find_type((yyvsp[0].str), NULL, 0);
4277 if (type_get_type_detect_alias((yyval.type)) != TYPE_COCLASS)
4278 error_loc("%s was not declared a coclass at %s:%d\n",
4279 (yyvsp[0].str), (yyval.type)->loc_info.input_name,
4280 (yyval.type)->loc_info.line_number);
4281 }
4282 #line 4283 "parser.tab.c" /* yacc.c:1646 */
4283 break;
4284
4285 case 286:
4286 #line 835 "parser.y" /* yacc.c:1646 */
4287 { (yyval.type) = (yyvsp[0].type);
4288 check_def((yyval.type));
4289 (yyval.type)->attrs = check_coclass_attrs((yyvsp[0].type)->name, (yyvsp[-1].attr_list));
4290 }
4291 #line 4292 "parser.tab.c" /* yacc.c:1646 */
4292 break;
4293
4294 case 287:
4295 #line 842 "parser.y" /* yacc.c:1646 */
4296 { (yyval.type) = type_coclass_define((yyvsp[-4].type), (yyvsp[-2].ifref_list)); }
4297 #line 4298 "parser.tab.c" /* yacc.c:1646 */
4298 break;
4299
4300 case 288:
4301 #line 845 "parser.y" /* yacc.c:1646 */
4302 { (yyval.str) = (yyvsp[0].str); }
4303 #line 4304 "parser.tab.c" /* yacc.c:1646 */
4304 break;
4305
4306 case 289:
4307 #line 848 "parser.y" /* yacc.c:1646 */
4308 { (yyval.ifref_list) = NULL; }
4309 #line 4310 "parser.tab.c" /* yacc.c:1646 */
4310 break;
4311
4312 case 290:
4313 #line 849 "parser.y" /* yacc.c:1646 */
4314 { (yyval.ifref_list) = append_ifref( (yyvsp[-1].ifref_list), (yyvsp[0].ifref) ); }
4315 #line 4316 "parser.tab.c" /* yacc.c:1646 */
4316 break;
4317
4318 case 291:
4319 #line 853 "parser.y" /* yacc.c:1646 */
4320 { (yyval.ifref) = make_ifref((yyvsp[0].type)); (yyval.ifref)->attrs = (yyvsp[-1].attr_list); }
4321 #line 4322 "parser.tab.c" /* yacc.c:1646 */
4322 break;
4323
4324 case 292:
4325 #line 856 "parser.y" /* yacc.c:1646 */
4326 { (yyval.type) = get_type(TYPE_INTERFACE, (yyvsp[0].str), current_namespace, 0); }
4327 #line 4328 "parser.tab.c" /* yacc.c:1646 */
4328 break;
4329
4330 case 293:
4331 #line 857 "parser.y" /* yacc.c:1646 */
4332 { (yyval.type) = get_type(TYPE_INTERFACE, (yyvsp[0].str), current_namespace, 0); }
4333 #line 4334 "parser.tab.c" /* yacc.c:1646 */
4334 break;
4335
4336 case 294:
4337 #line 860 "parser.y" /* yacc.c:1646 */
4338 { attr_t *attrs;
4339 (yyval.type) = (yyvsp[0].type);
4340 check_def((yyval.type));
4341 attrs = make_attr(ATTR_DISPINTERFACE);
4342 (yyval.type)->attrs = append_attr( check_dispiface_attrs((yyvsp[0].type)->name, (yyvsp[-1].attr_list)), attrs );
4343 (yyval.type)->defined = TRUE;
4344 }
4345 #line 4346 "parser.tab.c" /* yacc.c:1646 */
4346 break;
4347
4348 case 295:
4349 #line 869 "parser.y" /* yacc.c:1646 */
4350 { (yyval.var_list) = NULL; }
4351 #line 4352 "parser.tab.c" /* yacc.c:1646 */
4352 break;
4353
4354 case 296:
4355 #line 870 "parser.y" /* yacc.c:1646 */
4356 { (yyval.var_list) = append_var( (yyvsp[-2].var_list), (yyvsp[-1].var) ); }
4357 #line 4358 "parser.tab.c" /* yacc.c:1646 */
4358 break;
4359
4360 case 297:
4361 #line 873 "parser.y" /* yacc.c:1646 */
4362 { (yyval.var_list) = NULL; }
4363 #line 4364 "parser.tab.c" /* yacc.c:1646 */
4364 break;
4365
4366 case 298:
4367 #line 874 "parser.y" /* yacc.c:1646 */
4368 { (yyval.var_list) = append_var( (yyvsp[-2].var_list), (yyvsp[-1].var) ); }
4369 #line 4370 "parser.tab.c" /* yacc.c:1646 */
4370 break;
4371
4372 case 299:
4373 #line 880 "parser.y" /* yacc.c:1646 */
4374 { (yyval.type) = (yyvsp[-4].type);
4375 type_dispinterface_define((yyval.type), (yyvsp[-2].var_list), (yyvsp[-1].var_list));
4376 }
4377 #line 4378 "parser.tab.c" /* yacc.c:1646 */
4378 break;
4379
4380 case 300:
4381 #line 884 "parser.y" /* yacc.c:1646 */
4382 { (yyval.type) = (yyvsp[-4].type);
4383 type_dispinterface_define_from_iface((yyval.type), (yyvsp[-2].type));
4384 }
4385 #line 4386 "parser.tab.c" /* yacc.c:1646 */
4386 break;
4387
4388 case 301:
4389 #line 889 "parser.y" /* yacc.c:1646 */
4390 { (yyval.type) = NULL; }
4391 #line 4392 "parser.tab.c" /* yacc.c:1646 */
4392 break;
4393
4394 case 302:
4395 #line 890 "parser.y" /* yacc.c:1646 */
4396 { (yyval.type) = find_type_or_error2((yyvsp[0].str), 0); }
4397 #line 4398 "parser.tab.c" /* yacc.c:1646 */
4398 break;
4399
4400 case 303:
4401 #line 893 "parser.y" /* yacc.c:1646 */
4402 { (yyval.type) = get_type(TYPE_INTERFACE, (yyvsp[0].str), current_namespace, 0); }
4403 #line 4404 "parser.tab.c" /* yacc.c:1646 */
4404 break;
4405
4406 case 304:
4407 #line 894 "parser.y" /* yacc.c:1646 */
4408 { (yyval.type) = get_type(TYPE_INTERFACE, (yyvsp[0].str), current_namespace, 0); }
4409 #line 4410 "parser.tab.c" /* yacc.c:1646 */
4410 break;
4411
4412 case 305:
4413 #line 897 "parser.y" /* yacc.c:1646 */
4414 { (yyval.ifinfo).interface = (yyvsp[0].type);
4415 (yyval.ifinfo).old_pointer_default = pointer_default;
4416 if (is_attr((yyvsp[-1].attr_list), ATTR_POINTERDEFAULT))
4417 pointer_default = get_attrv((yyvsp[-1].attr_list), ATTR_POINTERDEFAULT);
4418 check_def((yyvsp[0].type));
4419 (yyvsp[0].type)->attrs = check_iface_attrs((yyvsp[0].type)->name, (yyvsp[-1].attr_list));
4420 (yyvsp[0].type)->defined = TRUE;
4421 }
4422 #line 4423 "parser.tab.c" /* yacc.c:1646 */
4423 break;
4424
4425 case 306:
4426 #line 908 "parser.y" /* yacc.c:1646 */
4427 { (yyval.type) = (yyvsp[-5].ifinfo).interface;
4428 if((yyval.type) == (yyvsp[-4].type))
4429 error_loc("Interface can't inherit from itself\n");
4430 type_interface_define((yyval.type), (yyvsp[-4].type), (yyvsp[-2].stmt_list));
4431 pointer_default = (yyvsp[-5].ifinfo).old_pointer_default;
4432 }
4433 #line 4434 "parser.tab.c" /* yacc.c:1646 */
4434 break;
4435
4436 case 307:
4437 #line 918 "parser.y" /* yacc.c:1646 */
4438 { (yyval.type) = (yyvsp[-7].ifinfo).interface;
4439 type_interface_define((yyval.type), find_type_or_error2((yyvsp[-5].str), 0), (yyvsp[-2].stmt_list));
4440 pointer_default = (yyvsp[-7].ifinfo).old_pointer_default;
4441 }
4442 #line 4443 "parser.tab.c" /* yacc.c:1646 */
4443 break;
4444
4445 case 308:
4446 #line 922 "parser.y" /* yacc.c:1646 */
4447 { (yyval.type) = (yyvsp[-1].type); }
4448 #line 4449 "parser.tab.c" /* yacc.c:1646 */
4449 break;
4450
4451 case 309:
4452 #line 926 "parser.y" /* yacc.c:1646 */
4453 { (yyval.type) = (yyvsp[-1].type); }
4454 #line 4455 "parser.tab.c" /* yacc.c:1646 */
4455 break;
4456
4457 case 310:
4458 #line 927 "parser.y" /* yacc.c:1646 */
4459 { (yyval.type) = (yyvsp[-1].type); }
4460 #line 4461 "parser.tab.c" /* yacc.c:1646 */
4461 break;
4462
4463 case 311:
4464 #line 930 "parser.y" /* yacc.c:1646 */
4465 { (yyval.type) = type_new_module((yyvsp[0].str)); }
4466 #line 4467 "parser.tab.c" /* yacc.c:1646 */
4467 break;
4468
4469 case 312:
4470 #line 931 "parser.y" /* yacc.c:1646 */
4471 { (yyval.type) = type_new_module((yyvsp[0].str)); }
4472 #line 4473 "parser.tab.c" /* yacc.c:1646 */
4473 break;
4474
4475 case 313:
4476 #line 934 "parser.y" /* yacc.c:1646 */
4477 { (yyval.type) = (yyvsp[0].type);
4478 (yyval.type)->attrs = check_module_attrs((yyvsp[0].type)->name, (yyvsp[-1].attr_list));
4479 }
4480 #line 4481 "parser.tab.c" /* yacc.c:1646 */
4481 break;
4482
4483 case 314:
4484 #line 940 "parser.y" /* yacc.c:1646 */
4485 { (yyval.type) = (yyvsp[-4].type);
4486 type_module_define((yyval.type), (yyvsp[-2].stmt_list));
4487 }
4488 #line 4489 "parser.tab.c" /* yacc.c:1646 */
4489 break;
4490
4491 case 315:
4492 #line 946 "parser.y" /* yacc.c:1646 */
4493 { (yyval.stgclass) = STG_EXTERN; }
4494 #line 4495 "parser.tab.c" /* yacc.c:1646 */
4495 break;
4496
4497 case 316:
4498 #line 947 "parser.y" /* yacc.c:1646 */
4499 { (yyval.stgclass) = STG_STATIC; }
4500 #line 4501 "parser.tab.c" /* yacc.c:1646 */
4501 break;
4502
4503 case 317:
4504 #line 948 "parser.y" /* yacc.c:1646 */
4505 { (yyval.stgclass) = STG_REGISTER; }
4506 #line 4507 "parser.tab.c" /* yacc.c:1646 */
4507 break;
4508
4509 case 318:
4510 #line 952 "parser.y" /* yacc.c:1646 */
4511 { (yyval.attr) = make_attr(ATTR_INLINE); }
4512 #line 4513 "parser.tab.c" /* yacc.c:1646 */
4513 break;
4514
4515 case 319:
4516 #line 956 "parser.y" /* yacc.c:1646 */
4517 { (yyval.attr) = make_attr(ATTR_CONST); }
4518 #line 4519 "parser.tab.c" /* yacc.c:1646 */
4519 break;
4520
4521 case 320:
4522 #line 959 "parser.y" /* yacc.c:1646 */
4523 { (yyval.attr_list) = NULL; }
4524 #line 4525 "parser.tab.c" /* yacc.c:1646 */
4525 break;
4526
4527 case 321:
4528 #line 960 "parser.y" /* yacc.c:1646 */
4529 { (yyval.attr_list) = append_attr((yyvsp[-1].attr_list), (yyvsp[0].attr)); }
4530 #line 4531 "parser.tab.c" /* yacc.c:1646 */
4531 break;
4532
4533 case 322:
4534 #line 963 "parser.y" /* yacc.c:1646 */
4535 { (yyval.declspec) = make_decl_spec((yyvsp[-1].type), (yyvsp[0].declspec), NULL, NULL, STG_NONE); }
4536 #line 4537 "parser.tab.c" /* yacc.c:1646 */
4537 break;
4538
4539 case 323:
4540 #line 965 "parser.y" /* yacc.c:1646 */
4541 { (yyval.declspec) = make_decl_spec((yyvsp[-1].type), (yyvsp[-2].declspec), (yyvsp[0].declspec), NULL, STG_NONE); }
4542 #line 4543 "parser.tab.c" /* yacc.c:1646 */
4543 break;
4544
4545 case 324:
4546 #line 968 "parser.y" /* yacc.c:1646 */
4547 { (yyval.declspec) = NULL; }
4548 #line 4549 "parser.tab.c" /* yacc.c:1646 */
4549 break;
4550
4551 case 326:
4552 #line 973 "parser.y" /* yacc.c:1646 */
4553 { (yyval.declspec) = make_decl_spec(NULL, (yyvsp[0].declspec), NULL, (yyvsp[-1].attr), STG_NONE); }
4554 #line 4555 "parser.tab.c" /* yacc.c:1646 */
4555 break;
4556
4557 case 327:
4558 #line 974 "parser.y" /* yacc.c:1646 */
4559 { (yyval.declspec) = make_decl_spec(NULL, (yyvsp[0].declspec), NULL, (yyvsp[-1].attr), STG_NONE); }
4560 #line 4561 "parser.tab.c" /* yacc.c:1646 */
4561 break;
4562
4563 case 328:
4564 #line 975 "parser.y" /* yacc.c:1646 */
4565 { (yyval.declspec) = make_decl_spec(NULL, (yyvsp[0].declspec), NULL, NULL, (yyvsp[-1].stgclass)); }
4566 #line 4567 "parser.tab.c" /* yacc.c:1646 */
4567 break;
4568
4569 case 329:
4570 #line 980 "parser.y" /* yacc.c:1646 */
4571 { (yyval.declarator) = (yyvsp[0].declarator); (yyval.declarator)->type = append_ptrchain_type((yyval.declarator)->type, type_new_pointer(pointer_default, NULL, (yyvsp[-1].attr_list))); }
4572 #line 4573 "parser.tab.c" /* yacc.c:1646 */
4573 break;
4574
4575 case 330:
4576 #line 981 "parser.y" /* yacc.c:1646 */
4577 { (yyval.declarator) = (yyvsp[0].declarator); if ((yyval.declarator)->func_type) (yyval.declarator)->func_type->attrs = append_attr((yyval.declarator)->func_type->attrs, make_attrp(ATTR_CALLCONV, (yyvsp[-1].str)));
4578 else if ((yyval.declarator)->type) (yyval.declarator)->type->attrs = append_attr((yyval.declarator)->type->attrs, make_attrp(ATTR_CALLCONV, (yyvsp[-1].str))); }
4579 #line 4580 "parser.tab.c" /* yacc.c:1646 */
4580 break;
4581
4582 case 332:
4583 #line 987 "parser.y" /* yacc.c:1646 */
4584 { (yyval.declarator) = make_declarator((yyvsp[0].var)); }
4585 #line 4586 "parser.tab.c" /* yacc.c:1646 */
4586 break;
4587
4588 case 333:
4589 #line 988 "parser.y" /* yacc.c:1646 */
4590 { (yyval.declarator) = (yyvsp[-1].declarator); }
4591 #line 4592 "parser.tab.c" /* yacc.c:1646 */
4592 break;
4593
4594 case 334:
4595 #line 989 "parser.y" /* yacc.c:1646 */
4596 { (yyval.declarator) = (yyvsp[-1].declarator); (yyval.declarator)->array = append_array((yyval.declarator)->array, (yyvsp[0].expr)); }
4597 #line 4598 "parser.tab.c" /* yacc.c:1646 */
4598 break;
4599
4600 case 335:
4601 #line 990 "parser.y" /* yacc.c:1646 */
4602 { (yyval.declarator) = (yyvsp[-3].declarator);
4603 (yyval.declarator)->func_type = append_ptrchain_type((yyval.declarator)->type, type_new_function((yyvsp[-1].var_list)));
4604 (yyval.declarator)->type = NULL;
4605 }
4606 #line 4607 "parser.tab.c" /* yacc.c:1646 */
4607 break;
4608
4609 case 336:
4610 #line 999 "parser.y" /* yacc.c:1646 */
4611 { (yyval.declarator) = (yyvsp[0].declarator); (yyval.declarator)->type = append_ptrchain_type((yyval.declarator)->type, type_new_pointer(pointer_default, NULL, (yyvsp[-1].attr_list))); }
4612 #line 4613 "parser.tab.c" /* yacc.c:1646 */
4613 break;
4614
4615 case 337:
4616 #line 1000 "parser.y" /* yacc.c:1646 */
4617 { (yyval.declarator) = (yyvsp[0].declarator); if ((yyval.declarator)->func_type) (yyval.declarator)->func_type->attrs = append_attr((yyval.declarator)->func_type->attrs, make_attrp(ATTR_CALLCONV, (yyvsp[-1].str)));
4618 else if ((yyval.declarator)->type) (yyval.declarator)->type->attrs = append_attr((yyval.declarator)->type->attrs, make_attrp(ATTR_CALLCONV, (yyvsp[-1].str))); }
4619 #line 4620 "parser.tab.c" /* yacc.c:1646 */
4620 break;
4621
4622 case 339:
4623 #line 1008 "parser.y" /* yacc.c:1646 */
4624 { (yyval.declarator) = (yyvsp[0].declarator); (yyval.declarator)->type = append_ptrchain_type((yyval.declarator)->type, type_new_pointer(pointer_default, NULL, (yyvsp[-1].attr_list))); }
4625 #line 4626 "parser.tab.c" /* yacc.c:1646 */
4626 break;
4627
4628 case 340:
4629 #line 1009 "parser.y" /* yacc.c:1646 */
4630 { (yyval.declarator) = (yyvsp[0].declarator); if ((yyval.declarator)->func_type) (yyval.declarator)->func_type->attrs = append_attr((yyval.declarator)->func_type->attrs, make_attrp(ATTR_CALLCONV, (yyvsp[-1].str)));
4631 else if ((yyval.declarator)->type) (yyval.declarator)->type->attrs = append_attr((yyval.declarator)->type->attrs, make_attrp(ATTR_CALLCONV, (yyvsp[-1].str))); }
4632 #line 4633 "parser.tab.c" /* yacc.c:1646 */
4633 break;
4634
4635 case 341:
4636 #line 1014 "parser.y" /* yacc.c:1646 */
4637 { (yyval.declarator) = make_declarator(NULL); }
4638 #line 4639 "parser.tab.c" /* yacc.c:1646 */
4639 break;
4640
4641 case 343:
4642 #line 1020 "parser.y" /* yacc.c:1646 */
4643 { (yyval.declarator) = (yyvsp[-1].declarator); }
4644 #line 4645 "parser.tab.c" /* yacc.c:1646 */
4645 break;
4646
4647 case 344:
4648 #line 1021 "parser.y" /* yacc.c:1646 */
4649 { (yyval.declarator) = (yyvsp[-1].declarator); (yyval.declarator)->array = append_array((yyval.declarator)->array, (yyvsp[0].expr)); }
4650 #line 4651 "parser.tab.c" /* yacc.c:1646 */
4651 break;
4652
4653 case 345:
4654 #line 1022 "parser.y" /* yacc.c:1646 */
4655 { (yyval.declarator) = make_declarator(NULL); (yyval.declarator)->array = append_array((yyval.declarator)->array, (yyvsp[0].expr)); }
4656 #line 4657 "parser.tab.c" /* yacc.c:1646 */
4657 break;
4658
4659 case 346:
4660 #line 1024 "parser.y" /* yacc.c:1646 */
4661 { (yyval.declarator) = make_declarator(NULL);
4662 (yyval.declarator)->func_type = append_ptrchain_type((yyval.declarator)->type, type_new_function((yyvsp[-1].var_list)));
4663 (yyval.declarator)->type = NULL;
4664 }
4665 #line 4666 "parser.tab.c" /* yacc.c:1646 */
4666 break;
4667
4668 case 347:
4669 #line 1029 "parser.y" /* yacc.c:1646 */
4670 { (yyval.declarator) = (yyvsp[-3].declarator);
4671 (yyval.declarator)->func_type = append_ptrchain_type((yyval.declarator)->type, type_new_function((yyvsp[-1].var_list)));
4672 (yyval.declarator)->type = NULL;
4673 }
4674 #line 4675 "parser.tab.c" /* yacc.c:1646 */
4675 break;
4676
4677 case 348:
4678 #line 1038 "parser.y" /* yacc.c:1646 */
4679 { (yyval.declarator) = (yyvsp[0].declarator); (yyval.declarator)->type = append_ptrchain_type((yyval.declarator)->type, type_new_pointer(pointer_default, NULL, (yyvsp[-1].attr_list))); }
4680 #line 4681 "parser.tab.c" /* yacc.c:1646 */
4681 break;
4682
4683 case 349:
4684 #line 1039 "parser.y" /* yacc.c:1646 */
4685 { (yyval.declarator) = (yyvsp[0].declarator); (yyval.declarator)->type->attrs = append_attr((yyval.declarator)->type->attrs, make_attrp(ATTR_CALLCONV, (yyvsp[-1].str))); }
4686 #line 4687 "parser.tab.c" /* yacc.c:1646 */
4687 break;
4688
4689 case 351:
4690 #line 1046 "parser.y" /* yacc.c:1646 */
4691 { (yyval.declarator) = (yyvsp[0].declarator); (yyval.declarator)->type = append_ptrchain_type((yyval.declarator)->type, type_new_pointer(pointer_default, NULL, (yyvsp[-1].attr_list))); }
4692 #line 4693 "parser.tab.c" /* yacc.c:1646 */
4693 break;
4694
4695 case 352:
4696 #line 1047 "parser.y" /* yacc.c:1646 */
4697 { (yyval.declarator) = (yyvsp[0].declarator); (yyval.declarator)->type->attrs = append_attr((yyval.declarator)->type->attrs, make_attrp(ATTR_CALLCONV, (yyvsp[-1].str))); }
4698 #line 4699 "parser.tab.c" /* yacc.c:1646 */
4699 break;
4700
4701 case 353:
4702 #line 1051 "parser.y" /* yacc.c:1646 */
4703 { (yyval.declarator) = make_declarator(NULL); }
4704 #line 4705 "parser.tab.c" /* yacc.c:1646 */
4705 break;
4706
4707 case 355:
4708 #line 1059 "parser.y" /* yacc.c:1646 */
4709 { (yyval.declarator) = make_declarator((yyvsp[0].var)); }
4710 #line 4711 "parser.tab.c" /* yacc.c:1646 */
4711 break;
4712
4713 case 356:
4714 #line 1060 "parser.y" /* yacc.c:1646 */
4715 { (yyval.declarator) = (yyvsp[-1].declarator); }
4716 #line 4717 "parser.tab.c" /* yacc.c:1646 */
4717 break;
4718
4719 case 357:
4720 #line 1061 "parser.y" /* yacc.c:1646 */
4721 { (yyval.declarator) = (yyvsp[-1].declarator); (yyval.declarator)->array = append_array((yyval.declarator)->array, (yyvsp[0].expr)); }
4722 #line 4723 "parser.tab.c" /* yacc.c:1646 */
4723 break;
4724
4725 case 358:
4726 #line 1062 "parser.y" /* yacc.c:1646 */
4727 { (yyval.declarator) = make_declarator(NULL); (yyval.declarator)->array = append_array((yyval.declarator)->array, (yyvsp[0].expr)); }
4728 #line 4729 "parser.tab.c" /* yacc.c:1646 */
4729 break;
4730
4731 case 359:
4732 #line 1064 "parser.y" /* yacc.c:1646 */
4733 { (yyval.declarator) = make_declarator(NULL);
4734 (yyval.declarator)->func_type = append_ptrchain_type((yyval.declarator)->type, type_new_function((yyvsp[-1].var_list)));
4735 (yyval.declarator)->type = NULL;
4736 }
4737 #line 4738 "parser.tab.c" /* yacc.c:1646 */
4738 break;
4739
4740 case 360:
4741 #line 1069 "parser.y" /* yacc.c:1646 */
4742 { (yyval.declarator) = (yyvsp[-3].declarator);
4743 (yyval.declarator)->func_type = append_ptrchain_type((yyval.declarator)->type, type_new_function((yyvsp[-1].var_list)));
4744 (yyval.declarator)->type = NULL;
4745 }
4746 #line 4747 "parser.tab.c" /* yacc.c:1646 */
4747 break;
4748
4749 case 361:
4750 #line 1076 "parser.y" /* yacc.c:1646 */
4751 { (yyval.declarator_list) = append_declarator( NULL, (yyvsp[0].declarator) ); }
4752 #line 4753 "parser.tab.c" /* yacc.c:1646 */
4753 break;
4754
4755 case 362:
4756 #line 1077 "parser.y" /* yacc.c:1646 */
4757 { (yyval.declarator_list) = append_declarator( (yyvsp[-2].declarator_list), (yyvsp[0].declarator) ); }
4758 #line 4759 "parser.tab.c" /* yacc.c:1646 */
4759 break;
4760
4761 case 363:
4762 #line 1080 "parser.y" /* yacc.c:1646 */
4763 { (yyval.expr) = NULL; }
4764 #line 4765 "parser.tab.c" /* yacc.c:1646 */
4765 break;
4766
4767 case 364:
4768 #line 1081 "parser.y" /* yacc.c:1646 */
4769 { (yyval.expr) = (yyvsp[0].expr); }
4770 #line 4771 "parser.tab.c" /* yacc.c:1646 */
4771 break;
4772
4773 case 365:
4774 #line 1084 "parser.y" /* yacc.c:1646 */
4775 { (yyval.declarator) = (yyvsp[-1].declarator); (yyval.declarator)->bits = (yyvsp[0].expr);
4776 if (!(yyval.declarator)->bits && !(yyval.declarator)->var->name)
4777 error_loc("unnamed fields are not allowed\n");
4778 }
4779 #line 4780 "parser.tab.c" /* yacc.c:1646 */
4780 break;
4781
4782 case 366:
4783 #line 1091 "parser.y" /* yacc.c:1646 */
4784 { (yyval.declarator_list) = append_declarator( NULL, (yyvsp[0].declarator) ); }
4785 #line 4786 "parser.tab.c" /* yacc.c:1646 */
4786 break;
4787
4788 case 367:
4789 #line 1093 "parser.y" /* yacc.c:1646 */
4790 { (yyval.declarator_list) = append_declarator( (yyvsp[-2].declarator_list), (yyvsp[0].declarator) ); }
4791 #line 4792 "parser.tab.c" /* yacc.c:1646 */
4792 break;
4793
4794 case 368:
4795 #line 1097 "parser.y" /* yacc.c:1646 */
4796 { (yyval.declarator) = (yyvsp[0].declarator); }
4797 #line 4798 "parser.tab.c" /* yacc.c:1646 */
4798 break;
4799
4800 case 369:
4801 #line 1098 "parser.y" /* yacc.c:1646 */
4802 { (yyval.declarator) = (yyvsp[-2].declarator); (yyvsp[-2].declarator)->var->eval = (yyvsp[0].expr); }
4803 #line 4804 "parser.tab.c" /* yacc.c:1646 */
4804 break;
4805
4806 case 370:
4807 #line 1102 "parser.y" /* yacc.c:1646 */
4808 { (yyval.num) = THREADING_APARTMENT; }
4809 #line 4810 "parser.tab.c" /* yacc.c:1646 */
4810 break;
4811
4812 case 371:
4813 #line 1103 "parser.y" /* yacc.c:1646 */
4814 { (yyval.num) = THREADING_NEUTRAL; }
4815 #line 4816 "parser.tab.c" /* yacc.c:1646 */
4816 break;
4817
4818 case 372:
4819 #line 1104 "parser.y" /* yacc.c:1646 */
4820 { (yyval.num) = THREADING_SINGLE; }
4821 #line 4822 "parser.tab.c" /* yacc.c:1646 */
4822 break;
4823
4824 case 373:
4825 #line 1105 "parser.y" /* yacc.c:1646 */
4826 { (yyval.num) = THREADING_FREE; }
4827 #line 4828 "parser.tab.c" /* yacc.c:1646 */
4828 break;
4829
4830 case 374:
4831 #line 1106 "parser.y" /* yacc.c:1646 */
4832 { (yyval.num) = THREADING_BOTH; }
4833 #line 4834 "parser.tab.c" /* yacc.c:1646 */
4834 break;
4835
4836 case 375:
4837 #line 1110 "parser.y" /* yacc.c:1646 */
4838 { (yyval.num) = RPC_FC_RP; }
4839 #line 4840 "parser.tab.c" /* yacc.c:1646 */
4840 break;
4841
4842 case 376:
4843 #line 1111 "parser.y" /* yacc.c:1646 */
4844 { (yyval.num) = RPC_FC_UP; }
4845 #line 4846 "parser.tab.c" /* yacc.c:1646 */
4846 break;
4847
4848 case 377:
4849 #line 1112 "parser.y" /* yacc.c:1646 */
4850 { (yyval.num) = RPC_FC_FP; }
4851 #line 4852 "parser.tab.c" /* yacc.c:1646 */
4852 break;
4853
4854 case 378:
4855 #line 1115 "parser.y" /* yacc.c:1646 */
4856 { (yyval.type) = type_new_struct((yyvsp[-3].str), current_namespace, TRUE, (yyvsp[-1].var_list)); }
4857 #line 4858 "parser.tab.c" /* yacc.c:1646 */
4858 break;
4859
4860 case 379:
4861 #line 1118 "parser.y" /* yacc.c:1646 */
4862 { (yyval.type) = type_new_void(); }
4863 #line 4864 "parser.tab.c" /* yacc.c:1646 */
4864 break;
4865
4866 case 380:
4867 #line 1119 "parser.y" /* yacc.c:1646 */
4868 { (yyval.type) = find_type_or_error((yyvsp[0].str), 0); }
4869 #line 4870 "parser.tab.c" /* yacc.c:1646 */
4870 break;
4871
4872 case 381:
4873 #line 1120 "parser.y" /* yacc.c:1646 */
4874 { (yyval.type) = (yyvsp[0].type); }
4875 #line 4876 "parser.tab.c" /* yacc.c:1646 */
4876 break;
4877
4878 case 382:
4879 #line 1121 "parser.y" /* yacc.c:1646 */
4880 { (yyval.type) = (yyvsp[0].type); }
4881 #line 4882 "parser.tab.c" /* yacc.c:1646 */
4882 break;
4883
4884 case 383:
4885 #line 1122 "parser.y" /* yacc.c:1646 */
4886 { (yyval.type) = type_new_enum((yyvsp[0].str), current_namespace, FALSE, NULL); }
4887 #line 4888 "parser.tab.c" /* yacc.c:1646 */
4888 break;
4889
4890 case 384:
4891 #line 1123 "parser.y" /* yacc.c:1646 */
4892 { (yyval.type) = (yyvsp[0].type); }
4893 #line 4894 "parser.tab.c" /* yacc.c:1646 */
4894 break;
4895
4896 case 385:
4897 #line 1124 "parser.y" /* yacc.c:1646 */
4898 { (yyval.type) = type_new_struct((yyvsp[0].str), current_namespace, FALSE, NULL); }
4899 #line 4900 "parser.tab.c" /* yacc.c:1646 */
4900 break;
4901
4902 case 386:
4903 #line 1125 "parser.y" /* yacc.c:1646 */
4904 { (yyval.type) = (yyvsp[0].type); }
4905 #line 4906 "parser.tab.c" /* yacc.c:1646 */
4906 break;
4907
4908 case 387:
4909 #line 1126 "parser.y" /* yacc.c:1646 */
4910 { (yyval.type) = type_new_nonencapsulated_union((yyvsp[0].str), FALSE, NULL); }
4911 #line 4912 "parser.tab.c" /* yacc.c:1646 */
4912 break;
4913
4914 case 388:
4915 #line 1127 "parser.y" /* yacc.c:1646 */
4916 { (yyval.type) = make_safearray((yyvsp[-1].type)); }
4917 #line 4918 "parser.tab.c" /* yacc.c:1646 */
4918 break;
4919
4920 case 389:
4921 #line 1131 "parser.y" /* yacc.c:1646 */
4922 { (yyvsp[-4].attr_list) = append_attribs((yyvsp[-4].attr_list), (yyvsp[-2].attr_list));
4923 reg_typedefs((yyvsp[-1].declspec), (yyvsp[0].declarator_list), check_typedef_attrs((yyvsp[-4].attr_list)));
4924 (yyval.statement) = make_statement_typedef((yyvsp[0].declarator_list));
4925 }
4926 #line 4927 "parser.tab.c" /* yacc.c:1646 */
4927 break;
4928
4929 case 390:
4930 #line 1138 "parser.y" /* yacc.c:1646 */
4931 { (yyval.type) = type_new_nonencapsulated_union((yyvsp[-3].str), TRUE, (yyvsp[-1].var_list)); }
4932 #line 4933 "parser.tab.c" /* yacc.c:1646 */
4933 break;
4934
4935 case 391:
4936 #line 1141 "parser.y" /* yacc.c:1646 */
4937 { (yyval.type) = type_new_encapsulated_union((yyvsp[-8].str), (yyvsp[-5].var), (yyvsp[-3].var), (yyvsp[-1].var_list)); }
4938 #line 4939 "parser.tab.c" /* yacc.c:1646 */
4939 break;
4940
4941 case 392:
4942 #line 1145 "parser.y" /* yacc.c:1646 */
4943 { (yyval.num) = MAKEVERSION((yyvsp[0].num), 0); }
4944 #line 4945 "parser.tab.c" /* yacc.c:1646 */
4945 break;
4946
4947 case 393:
4948 #line 1146 "parser.y" /* yacc.c:1646 */
4949 { (yyval.num) = MAKEVERSION((yyvsp[-2].num), (yyvsp[0].num)); }
4950 #line 4951 "parser.tab.c" /* yacc.c:1646 */
4951 break;
4952
4953 case 394:
4954 #line 1147 "parser.y" /* yacc.c:1646 */
4955 { (yyval.num) = (yyvsp[0].num); }
4956 #line 4957 "parser.tab.c" /* yacc.c:1646 */
4957 break;
4958
4959
4960 #line 4961 "parser.tab.c" /* yacc.c:1646 */
4961 default: break;
4962 }
4963 /* User semantic actions sometimes alter yychar, and that requires
4964 that yytoken be updated with the new translation. We take the
4965 approach of translating immediately before every use of yytoken.
4966 One alternative is translating here after every semantic action,
4967 but that translation would be missed if the semantic action invokes
4968 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
4969 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
4970 incorrect destructor might then be invoked immediately. In the
4971 case of YYERROR or YYBACKUP, subsequent parser actions might lead
4972 to an incorrect destructor call or verbose syntax error message
4973 before the lookahead is translated. */
4974 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
4975
4976 YYPOPSTACK (yylen);
4977 yylen = 0;
4978 YY_STACK_PRINT (yyss, yyssp);
4979
4980 *++yyvsp = yyval;
4981
4982 /* Now 'shift' the result of the reduction. Determine what state
4983 that goes to, based on the state we popped back to and the rule
4984 number reduced by. */
4985
4986 yyn = yyr1[yyn];
4987
4988 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
4989 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
4990 yystate = yytable[yystate];
4991 else
4992 yystate = yydefgoto[yyn - YYNTOKENS];
4993
4994 goto yynewstate;
4995
4996
4997 /*--------------------------------------.
4998 | yyerrlab -- here on detecting error. |
4999 `--------------------------------------*/
5000 yyerrlab:
5001 /* Make sure we have latest lookahead translation. See comments at
5002 user semantic actions for why this is necessary. */
5003 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
5004
5005 /* If not already recovering from an error, report this error. */
5006 if (!yyerrstatus)
5007 {
5008 ++yynerrs;
5009 #if ! YYERROR_VERBOSE
5010 yyerror (YY_("syntax error"));
5011 #else
5012 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
5013 yyssp, yytoken)
5014 {
5015 char const *yymsgp = YY_("syntax error");
5016 int yysyntax_error_status;
5017 yysyntax_error_status = YYSYNTAX_ERROR;
5018 if (yysyntax_error_status == 0)
5019 yymsgp = yymsg;
5020 else if (yysyntax_error_status == 1)
5021 {
5022 if (yymsg != yymsgbuf)
5023 YYSTACK_FREE (yymsg);
5024 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
5025 if (!yymsg)
5026 {
5027 yymsg = yymsgbuf;
5028 yymsg_alloc = sizeof yymsgbuf;
5029 yysyntax_error_status = 2;
5030 }
5031 else
5032 {
5033 yysyntax_error_status = YYSYNTAX_ERROR;
5034 yymsgp = yymsg;
5035 }
5036 }
5037 yyerror (yymsgp);
5038 if (yysyntax_error_status == 2)
5039 goto yyexhaustedlab;
5040 }
5041 # undef YYSYNTAX_ERROR
5042 #endif
5043 }
5044
5045
5046
5047 if (yyerrstatus == 3)
5048 {
5049 /* If just tried and failed to reuse lookahead token after an
5050 error, discard it. */
5051
5052 if (yychar <= YYEOF)
5053 {
5054 /* Return failure if at end of input. */
5055 if (yychar == YYEOF)
5056 YYABORT;
5057 }
5058 else
5059 {
5060 yydestruct ("Error: discarding",
5061 yytoken, &yylval);
5062 yychar = YYEMPTY;
5063 }
5064 }
5065
5066 /* Else will try to reuse lookahead token after shifting the error
5067 token. */
5068 goto yyerrlab1;
5069
5070
5071 /*---------------------------------------------------.
5072 | yyerrorlab -- error raised explicitly by YYERROR. |
5073 `---------------------------------------------------*/
5074 yyerrorlab:
5075
5076 /* Pacify compilers like GCC when the user code never invokes
5077 YYERROR and the label yyerrorlab therefore never appears in user
5078 code. */
5079 if (/*CONSTCOND*/ 0)
5080 goto yyerrorlab;
5081
5082 /* Do not reclaim the symbols of the rule whose action triggered
5083 this YYERROR. */
5084 YYPOPSTACK (yylen);
5085 yylen = 0;
5086 YY_STACK_PRINT (yyss, yyssp);
5087 yystate = *yyssp;
5088 goto yyerrlab1;
5089
5090
5091 /*-------------------------------------------------------------.
5092 | yyerrlab1 -- common code for both syntax error and YYERROR. |
5093 `-------------------------------------------------------------*/
5094 yyerrlab1:
5095 yyerrstatus = 3; /* Each real token shifted decrements this. */
5096
5097 for (;;)
5098 {
5099 yyn = yypact[yystate];
5100 if (!yypact_value_is_default (yyn))
5101 {
5102 yyn += YYTERROR;
5103 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
5104 {
5105 yyn = yytable[yyn];
5106 if (0 < yyn)
5107 break;
5108 }
5109 }
5110
5111 /* Pop the current state because it cannot handle the error token. */
5112 if (yyssp == yyss)
5113 YYABORT;
5114
5115
5116 yydestruct ("Error: popping",
5117 yystos[yystate], yyvsp);
5118 YYPOPSTACK (1);
5119 yystate = *yyssp;
5120 YY_STACK_PRINT (yyss, yyssp);
5121 }
5122
5123 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
5124 *++yyvsp = yylval;
5125 YY_IGNORE_MAYBE_UNINITIALIZED_END
5126
5127
5128 /* Shift the error token. */
5129 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
5130
5131 yystate = yyn;
5132 goto yynewstate;
5133
5134
5135 /*-------------------------------------.
5136 | yyacceptlab -- YYACCEPT comes here. |
5137 `-------------------------------------*/
5138 yyacceptlab:
5139 yyresult = 0;
5140 goto yyreturn;
5141
5142 /*-----------------------------------.
5143 | yyabortlab -- YYABORT comes here. |
5144 `-----------------------------------*/
5145 yyabortlab:
5146 yyresult = 1;
5147 goto yyreturn;
5148
5149 #if !defined yyoverflow || YYERROR_VERBOSE
5150 /*-------------------------------------------------.
5151 | yyexhaustedlab -- memory exhaustion comes here. |
5152 `-------------------------------------------------*/
5153 yyexhaustedlab:
5154 yyerror (YY_("memory exhausted"));
5155 yyresult = 2;
5156 /* Fall through. */
5157 #endif
5158
5159 yyreturn:
5160 if (yychar != YYEMPTY)
5161 {
5162 /* Make sure we have latest lookahead translation. See comments at
5163 user semantic actions for why this is necessary. */
5164 yytoken = YYTRANSLATE (yychar);
5165 yydestruct ("Cleanup: discarding lookahead",
5166 yytoken, &yylval);
5167 }
5168 /* Do not reclaim the symbols of the rule whose action triggered
5169 this YYABORT or YYACCEPT. */
5170 YYPOPSTACK (yylen);
5171 YY_STACK_PRINT (yyss, yyssp);
5172 while (yyssp != yyss)
5173 {
5174 yydestruct ("Cleanup: popping",
5175 yystos[*yyssp], yyvsp);
5176 YYPOPSTACK (1);
5177 }
5178 #ifndef yyoverflow
5179 if (yyss != yyssa)
5180 YYSTACK_FREE (yyss);
5181 #endif
5182 #if YYERROR_VERBOSE
5183 if (yymsg != yymsgbuf)
5184 YYSTACK_FREE (yymsg);
5185 #endif
5186 return yyresult;
5187 }
5188 #line 1150 "parser.y" /* yacc.c:1906 */
5189
5190
5191 static void decl_builtin_basic(const char *name, enum type_basic_type type)
5192 {
5193 type_t *t = type_new_basic(type);
5194 reg_type(t, name, NULL, 0);
5195 }
5196
5197 static void decl_builtin_alias(const char *name, type_t *t)
5198 {
5199 reg_type(type_new_alias(t, name), name, NULL, 0);
5200 }
5201
5202 void init_types(void)
5203 {
5204 decl_builtin_basic("byte", TYPE_BASIC_BYTE);
5205 decl_builtin_basic("wchar_t", TYPE_BASIC_WCHAR);
5206 decl_builtin_basic("float", TYPE_BASIC_FLOAT);
5207 decl_builtin_basic("double", TYPE_BASIC_DOUBLE);
5208 decl_builtin_basic("error_status_t", TYPE_BASIC_ERROR_STATUS_T);
5209 decl_builtin_basic("handle_t", TYPE_BASIC_HANDLE);
5210 decl_builtin_alias("boolean", type_new_basic(TYPE_BASIC_BYTE));
5211 }
5212
5213 static str_list_t *append_str(str_list_t *list, char *str)
5214 {
5215 struct str_list_entry_t *entry;
5216
5217 if (!str) return list;
5218 if (!list)
5219 {
5220 list = xmalloc( sizeof(*list) );
5221 list_init( list );
5222 }
5223 entry = xmalloc( sizeof(*entry) );
5224 entry->str = str;
5225 list_add_tail( list, &entry->entry );
5226 return list;
5227 }
5228
5229 static attr_list_t *append_attr(attr_list_t *list, attr_t *attr)
5230 {
5231 attr_t *attr_existing;
5232 if (!attr) return list;
5233 if (!list)
5234 {
5235 list = xmalloc( sizeof(*list) );
5236 list_init( list );
5237 }
5238 LIST_FOR_EACH_ENTRY(attr_existing, list, attr_t, entry)
5239 if (attr_existing->type == attr->type)
5240 {
5241 parser_warning("duplicate attribute %s\n", get_attr_display_name(attr->type));
5242 /* use the last attribute, like MIDL does */
5243 list_remove(&attr_existing->entry);
5244 break;
5245 }
5246 list_add_tail( list, &attr->entry );
5247 return list;
5248 }
5249
5250 static attr_list_t *move_attr(attr_list_t *dst, attr_list_t *src, enum attr_type type)
5251 {
5252 attr_t *attr;
5253 if (!src) return dst;
5254 LIST_FOR_EACH_ENTRY(attr, src, attr_t, entry)
5255 if (attr->type == type)
5256 {
5257 list_remove(&attr->entry);
5258 return append_attr(dst, attr);
5259 }
5260 return dst;
5261 }
5262
5263 static attr_list_t *append_attr_list(attr_list_t *new_list, attr_list_t *old_list)
5264 {
5265 struct list *entry;
5266
5267 if (!old_list) return new_list;
5268
5269 while ((entry = list_head(old_list)))
5270 {
5271 attr_t *attr = LIST_ENTRY(entry, attr_t, entry);
5272 list_remove(entry);
5273 new_list = append_attr(new_list, attr);
5274 }
5275 return new_list;
5276 }
5277
5278 static attr_list_t *dupattrs(const attr_list_t *list)
5279 {
5280 attr_list_t *new_list;
5281 const attr_t *attr;
5282
5283 if (!list) return NULL;
5284
5285 new_list = xmalloc( sizeof(*list) );
5286 list_init( new_list );
5287 LIST_FOR_EACH_ENTRY(attr, list, const attr_t, entry)
5288 {
5289 attr_t *new_attr = xmalloc(sizeof(*new_attr));
5290 *new_attr = *attr;
5291 list_add_tail(new_list, &new_attr->entry);
5292 }
5293 return new_list;
5294 }
5295
5296 static decl_spec_t *make_decl_spec(type_t *type, decl_spec_t *left, decl_spec_t *right, attr_t *attr, enum storage_class stgclass)
5297 {
5298 decl_spec_t *declspec = left ? left : right;
5299 if (!declspec)
5300 {
5301 declspec = xmalloc(sizeof(*declspec));
5302 declspec->type = NULL;
5303 declspec->attrs = NULL;
5304 declspec->stgclass = STG_NONE;
5305 }
5306 declspec->type = type;
5307 if (left && declspec != left)
5308 {
5309 declspec->attrs = append_attr_list(declspec->attrs, left->attrs);
5310 if (declspec->stgclass == STG_NONE)
5311 declspec->stgclass = left->stgclass;
5312 else if (left->stgclass != STG_NONE)
5313 error_loc("only one storage class can be specified\n");
5314 assert(!left->type);
5315 free(left);
5316 }
5317 if (right && declspec != right)
5318 {
5319 declspec->attrs = append_attr_list(declspec->attrs, right->attrs);
5320 if (declspec->stgclass == STG_NONE)
5321 declspec->stgclass = right->stgclass;
5322 else if (right->stgclass != STG_NONE)
5323 error_loc("only one storage class can be specified\n");
5324 assert(!right->type);
5325 free(right);
5326 }
5327
5328 declspec->attrs = append_attr(declspec->attrs, attr);
5329 if (declspec->stgclass == STG_NONE)
5330 declspec->stgclass = stgclass;
5331 else if (stgclass != STG_NONE)
5332 error_loc("only one storage class can be specified\n");
5333
5334 /* apply attributes to type */
5335 if (type && declspec->attrs)
5336 {
5337 attr_list_t *attrs;
5338 declspec->type = duptype(type, 1);
5339 attrs = dupattrs(type->attrs);
5340 declspec->type->attrs = append_attr_list(attrs, declspec->attrs);
5341 declspec->attrs = NULL;
5342 }
5343
5344 return declspec;
5345 }
5346
5347 static attr_t *make_attr(enum attr_type type)
5348 {
5349 attr_t *a = xmalloc(sizeof(attr_t));
5350 a->type = type;
5351 a->u.ival = 0;
5352 return a;
5353 }
5354
5355 static attr_t *make_attrv(enum attr_type type, unsigned int val)
5356 {
5357 attr_t *a = xmalloc(sizeof(attr_t));
5358 a->type = type;
5359 a->u.ival = val;
5360 return a;
5361 }
5362
5363 static attr_t *make_attrp(enum attr_type type, void *val)
5364 {
5365 attr_t *a = xmalloc(sizeof(attr_t));
5366 a->type = type;
5367 a->u.pval = val;
5368 return a;
5369 }
5370
5371 static expr_list_t *append_expr(expr_list_t *list, expr_t *expr)
5372 {
5373 if (!expr) return list;
5374 if (!list)
5375 {
5376 list = xmalloc( sizeof(*list) );
5377 list_init( list );
5378 }
5379 list_add_tail( list, &expr->entry );
5380 return list;
5381 }
5382
5383 static array_dims_t *append_array(array_dims_t *list, expr_t *expr)
5384 {
5385 if (!expr) return list;
5386 if (!list)
5387 {
5388 list = xmalloc( sizeof(*list) );
5389 list_init( list );
5390 }
5391 list_add_tail( list, &expr->entry );
5392 return list;
5393 }
5394
5395 static struct list type_pool = LIST_INIT(type_pool);
5396 typedef struct
5397 {
5398 type_t data;
5399 struct list link;
5400 } type_pool_node_t;
5401
5402 type_t *alloc_type(void)
5403 {
5404 type_pool_node_t *node = xmalloc(sizeof *node);
5405 list_add_tail(&type_pool, &node->link);
5406 return &node->data;
5407 }
5408
5409 void set_all_tfswrite(int val)
5410 {
5411 type_pool_node_t *node;
5412 LIST_FOR_EACH_ENTRY(node, &type_pool, type_pool_node_t, link)
5413 node->data.tfswrite = val;
5414 }
5415
5416 void clear_all_offsets(void)
5417 {
5418 type_pool_node_t *node;
5419 LIST_FOR_EACH_ENTRY(node, &type_pool, type_pool_node_t, link)
5420 node->data.typestring_offset = node->data.ptrdesc = 0;
5421 }
5422
5423 static void type_function_add_head_arg(type_t *type, var_t *arg)
5424 {
5425 if (!type->details.function->args)
5426 {
5427 type->details.function->args = xmalloc( sizeof(*type->details.function->args) );
5428 list_init( type->details.function->args );
5429 }
5430 list_add_head( type->details.function->args, &arg->entry );
5431 }
5432
5433 static int is_allowed_range_type(const type_t *type)
5434 {
5435 switch (type_get_type(type))
5436 {
5437 case TYPE_ENUM:
5438 return TRUE;
5439 case TYPE_BASIC:
5440 switch (type_basic_get_type(type))
5441 {
5442 case TYPE_BASIC_INT8:
5443 case TYPE_BASIC_INT16:
5444 case TYPE_BASIC_INT32:
5445 case TYPE_BASIC_INT64:
5446 case TYPE_BASIC_INT:
5447 case TYPE_BASIC_INT3264:
5448 case TYPE_BASIC_BYTE:
5449 case TYPE_BASIC_CHAR:
5450 case TYPE_BASIC_WCHAR:
5451 case TYPE_BASIC_HYPER:
5452 return TRUE;
5453 case TYPE_BASIC_FLOAT:
5454 case TYPE_BASIC_DOUBLE:
5455 case TYPE_BASIC_ERROR_STATUS_T:
5456 case TYPE_BASIC_HANDLE:
5457 return FALSE;
5458 }
5459 return FALSE;
5460 default:
5461 return FALSE;
5462 }
5463 }
5464
5465 static type_t *append_ptrchain_type(type_t *ptrchain, type_t *type)
5466 {
5467 type_t *ptrchain_type;
5468 if (!ptrchain)
5469 return type;
5470 for (ptrchain_type = ptrchain; type_pointer_get_ref(ptrchain_type); ptrchain_type = type_pointer_get_ref(ptrchain_type))
5471 ;
5472 assert(ptrchain_type->type_type == TYPE_POINTER);
5473 ptrchain_type->details.pointer.ref = type;
5474 return ptrchain;
5475 }
5476
5477 static warning_list_t *append_warning(warning_list_t *list, int num)
5478 {
5479 warning_t *entry;
5480
5481 if(!list)
5482 {
5483 list = xmalloc( sizeof(*list) );
5484 list_init( list );
5485 }
5486 entry = xmalloc( sizeof(*entry) );
5487 entry->num = num;
5488 list_add_tail( list, &entry->entry );
5489 return list;
5490 }
5491
5492 static var_t *declare_var(attr_list_t *attrs, decl_spec_t *decl_spec, const declarator_t *decl,
5493 int top)
5494 {
5495 var_t *v = decl->var;
5496 expr_list_t *sizes = get_attrp(attrs, ATTR_SIZEIS);
5497 expr_list_t *lengs = get_attrp(attrs, ATTR_LENGTHIS);
5498 int sizeless;
5499 expr_t *dim;
5500 type_t **ptype;
5501 array_dims_t *arr = decl ? decl->array : NULL;
5502 type_t *func_type = decl ? decl->func_type : NULL;
5503 type_t *type = decl_spec->type;
5504
5505 if (is_attr(type->attrs, ATTR_INLINE))
5506 {
5507 if (!func_type)
5508 error_loc("inline attribute applied to non-function type\n");
5509 else
5510 {
5511 type_t *t;
5512 /* move inline attribute from return type node to function node */
5513 for (t = func_type; is_ptr(t); t = type_pointer_get_ref(t))
5514 ;
5515 t->attrs = move_attr(t->attrs, type->attrs, ATTR_INLINE);
5516 }
5517 }
5518
5519 /* add type onto the end of the pointers in pident->type */
5520 v->type = append_ptrchain_type(decl ? decl->type : NULL, type);
5521 v->stgclass = decl_spec->stgclass;
5522 v->attrs = attrs;
5523
5524 /* check for pointer attribute being applied to non-pointer, non-array
5525 * type */
5526 if (!arr)
5527 {
5528 int ptr_attr = get_attrv(v->attrs, ATTR_POINTERTYPE);
5529 const type_t *ptr = NULL;
5530 /* pointer attributes on the left side of the type belong to the function
5531 * pointer, if one is being declared */
5532 type_t **pt = func_type ? &func_type : &v->type;
5533 for (ptr = *pt; ptr && !ptr_attr; )
5534 {
5535 ptr_attr = get_attrv(ptr->attrs, ATTR_POINTERTYPE);
5536 if (!ptr_attr && type_is_alias(ptr))
5537 ptr = type_alias_get_aliasee(ptr);
5538 else
5539 break;
5540 }
5541 if (is_ptr(ptr))
5542 {
5543 if (ptr_attr && ptr_attr != RPC_FC_UP &&
5544 type_get_type(type_pointer_get_ref(ptr)) == TYPE_INTERFACE)
5545 warning_loc_info(&v->loc_info,
5546 "%s: pointer attribute applied to interface "
5547 "pointer type has no effect\n", v->name);
5548 if (!ptr_attr && top && (*pt)->details.pointer.def_fc != RPC_FC_RP)
5549 {
5550 /* FIXME: this is a horrible hack to cope with the issue that we
5551 * store an offset to the typeformat string in the type object, but
5552 * two typeformat strings may be written depending on whether the
5553 * pointer is a toplevel parameter or not */
5554 *pt = duptype(*pt, 1);
5555 }
5556 }
5557 else if (ptr_attr)
5558 error_loc("%s: pointer attribute applied to non-pointer type\n", v->name);
5559 }
5560
5561 if (is_attr(v->attrs, ATTR_STRING))
5562 {
5563 type_t *t = type;
5564
5565 if (!is_ptr(v->type) && !arr)
5566 error_loc("'%s': [string] attribute applied to non-pointer, non-array type\n",
5567 v->name);
5568
5569 while (is_ptr(t))
5570 t = type_pointer_get_ref(t);
5571
5572 if (type_get_type(t) != TYPE_BASIC &&
5573 (get_basic_fc(t) != RPC_FC_CHAR &&
5574 get_basic_fc(t) != RPC_FC_BYTE &&
5575 get_basic_fc(t) != RPC_FC_WCHAR))
5576 {
5577 error_loc("'%s': [string] attribute is only valid on 'char', 'byte', or 'wchar_t' pointers and arrays\n",
5578 v->name);
5579 }
5580 }
5581
5582 if (is_attr(v->attrs, ATTR_V1ENUM))
5583 {
5584 if (type_get_type_detect_alias(v->type) != TYPE_ENUM)
5585 error_loc("'%s': [v1_enum] attribute applied to non-enum type\n", v->name);
5586 }
5587
5588 if (is_attr(v->attrs, ATTR_RANGE) && !is_allowed_range_type(v->type))
5589 error_loc("'%s': [range] attribute applied to non-integer type\n",
5590 v->name);
5591
5592 ptype = &v->type;
5593 sizeless = FALSE;
5594 if (arr) LIST_FOR_EACH_ENTRY_REV(dim, arr, expr_t, entry)
5595 {
5596 if (sizeless)
5597 error_loc("%s: only the first array dimension can be unspecified\n", v->name);
5598
5599 if (dim->is_const)
5600 {
5601 if (dim->cval <= 0)
5602 error_loc("%s: array dimension must be positive\n", v->name);
5603
5604 /* FIXME: should use a type_memsize that allows us to pass in a pointer size */
5605 if (0)
5606 {
5607 unsigned int size = type_memsize(v->type);
5608
5609 if (0xffffffffu / size < dim->cval)
5610 error_loc("%s: total array size is too large\n", v->name);
5611 }
5612 }
5613 else
5614 sizeless = TRUE;
5615
5616 *ptype = type_new_array(NULL, *ptype, FALSE,
5617 dim->is_const ? dim->cval : 0,
5618 dim->is_const ? NULL : dim, NULL,
5619 pointer_default);
5620 }
5621
5622 ptype = &v->type;
5623 if (sizes) LIST_FOR_EACH_ENTRY(dim, sizes, expr_t, entry)
5624 {
5625 if (dim->type != EXPR_VOID)
5626 {
5627 if (is_array(*ptype))
5628 {
5629 if (!type_array_get_conformance(*ptype) ||
5630 type_array_get_conformance(*ptype)->type != EXPR_VOID)
5631 error_loc("%s: cannot specify size_is for an already sized array\n", v->name);
5632 else
5633 *ptype = type_new_array((*ptype)->name,
5634 type_array_get_element(*ptype), FALSE,
5635 0, dim, NULL, 0);
5636 }
5637 else if (is_ptr(*ptype))
5638 *ptype = type_new_array((*ptype)->name, type_pointer_get_ref(*ptype), TRUE,
5639 0, dim, NULL, pointer_default);
5640 else
5641 error_loc("%s: size_is attribute applied to illegal type\n", v->name);
5642 }
5643
5644 if (is_ptr(*ptype))
5645 ptype = &(*ptype)->details.pointer.ref;
5646 else if (is_array(*ptype))
5647 ptype = &(*ptype)->details.array.elem;
5648 else
5649 error_loc("%s: too many expressions in size_is attribute\n", v->name);
5650 }
5651
5652 ptype = &v->type;
5653 if (lengs) LIST_FOR_EACH_ENTRY(dim, lengs, expr_t, entry)
5654 {
5655 if (dim->type != EXPR_VOID)
5656 {
5657 if (is_array(*ptype))
5658 {
5659 *ptype = type_new_array((*ptype)->name,
5660 type_array_get_element(*ptype),
5661 type_array_is_decl_as_ptr(*ptype),
5662 type_array_get_dim(*ptype),
5663 type_array_get_conformance(*ptype),
5664 dim, type_array_get_ptr_default_fc(*ptype));
5665 }
5666 else
5667 error_loc("%s: length_is attribute applied to illegal type\n", v->name);
5668 }
5669
5670 if (is_ptr(*ptype))
5671 ptype = &(*ptype)->details.pointer.ref;
5672 else if (is_array(*ptype))
5673 ptype = &(*ptype)->details.array.elem;
5674 else
5675 error_loc("%s: too many expressions in length_is attribute\n", v->name);
5676 }
5677
5678 /* v->type is currently pointing to the type on the left-side of the
5679 * declaration, so we need to fix this up so that it is the return type of the
5680 * function and make v->type point to the function side of the declaration */
5681 if (func_type)
5682 {
5683 type_t *ft, *t;
5684 type_t *return_type = v->type;
5685 v->type = func_type;
5686 for (ft = v->type; is_ptr(ft); ft = type_pointer_get_ref(ft))
5687 ;
5688 assert(type_get_type_detect_alias(ft) == TYPE_FUNCTION);
5689 ft->details.function->retval = make_var(xstrdup("_RetVal"));
5690 ft->details.function->retval->type = return_type;
5691 /* move calling convention attribute, if present, from pointer nodes to
5692 * function node */
5693 for (t = v->type; is_ptr(t); t = type_pointer_get_ref(t))
5694 ft->attrs = move_attr(ft->attrs, t->attrs, ATTR_CALLCONV);
5695 }
5696 else
5697 {
5698 type_t *t;
5699 for (t = v->type; is_ptr(t); t = type_pointer_get_ref(t))
5700 if (is_attr(t->attrs, ATTR_CALLCONV))
5701 error_loc("calling convention applied to non-function-pointer type\n");
5702 }
5703
5704 if (decl->bits)
5705 v->type = type_new_bitfield(v->type, decl->bits);
5706
5707 return v;
5708 }
5709
5710 static var_list_t *set_var_types(attr_list_t *attrs, decl_spec_t *decl_spec, declarator_list_t *decls)
5711 {
5712 declarator_t *decl, *next;
5713 var_list_t *var_list = NULL;
5714
5715 LIST_FOR_EACH_ENTRY_SAFE( decl, next, decls, declarator_t, entry )
5716 {
5717 var_t *var = declare_var(attrs, decl_spec, decl, 0);
5718 var_list = append_var(var_list, var);
5719 free(decl);
5720 }
5721 free(decl_spec);
5722 return var_list;
5723 }
5724
5725 static ifref_list_t *append_ifref(ifref_list_t *list, ifref_t *iface)
5726 {
5727 if (!iface) return list;
5728 if (!list)
5729 {
5730 list = xmalloc( sizeof(*list) );
5731 list_init( list );
5732 }
5733 list_add_tail( list, &iface->entry );
5734 return list;
5735 }
5736
5737 static ifref_t *make_ifref(type_t *iface)
5738 {
5739 ifref_t *l = xmalloc(sizeof(ifref_t));
5740 l->iface = iface;
5741 l->attrs = NULL;
5742 return l;
5743 }
5744
5745 var_list_t *append_var(var_list_t *list, var_t *var)
5746 {
5747 if (!var) return list;
5748 if (!list)
5749 {
5750 list = xmalloc( sizeof(*list) );
5751 list_init( list );
5752 }
5753 list_add_tail( list, &var->entry );
5754 return list;
5755 }
5756
5757 static var_list_t *append_var_list(var_list_t *list, var_list_t *vars)
5758 {
5759 if (!vars) return list;
5760 if (!list)
5761 {
5762 list = xmalloc( sizeof(*list) );
5763 list_init( list );
5764 }
5765 list_move_tail( list, vars );
5766 return list;
5767 }
5768
5769 var_t *make_var(char *name)
5770 {
5771 var_t *v = xmalloc(sizeof(var_t));
5772 v->name = name;
5773 v->type = NULL;
5774 v->attrs = NULL;
5775 v->eval = NULL;
5776 v->stgclass = STG_NONE;
5777 init_loc_info(&v->loc_info);
5778 return v;
5779 }
5780
5781 static declarator_list_t *append_declarator(declarator_list_t *list, declarator_t *d)
5782 {
5783 if (!d) return list;
5784 if (!list) {
5785 list = xmalloc(sizeof(*list));
5786 list_init(list);
5787 }
5788 list_add_tail(list, &d->entry);
5789 return list;
5790 }
5791
5792 static declarator_t *make_declarator(var_t *var)
5793 {
5794 declarator_t *d = xmalloc(sizeof(*d));
5795 d->var = var ? var : make_var(NULL);
5796 d->type = NULL;
5797 d->func_type = NULL;
5798 d->array = NULL;
5799 d->bits = NULL;
5800 return d;
5801 }
5802
5803 static type_t *make_safearray(type_t *type)
5804 {
5805 return type_new_array(NULL, type_new_alias(type, "SAFEARRAY"), TRUE, 0,
5806 NULL, NULL, RPC_FC_RP);
5807 }
5808
5809 static typelib_t *make_library(const char *name, const attr_list_t *attrs)
5810 {
5811 typelib_t *typelib = xmalloc(sizeof(*typelib));
5812 typelib->name = xstrdup(name);
5813 typelib->attrs = attrs;
5814 list_init( &typelib->importlibs );
5815 return typelib;
5816 }
5817
5818 static int hash_ident(const char *name)
5819 {
5820 const char *p = name;
5821 int sum = 0;
5822 /* a simple sum hash is probably good enough */
5823 while (*p) {
5824 sum += *p;
5825 p++;
5826 }
5827 return sum & (HASHMAX-1);
5828 }
5829
5830 /***** type repository *****/
5831
5832 static struct namespace *find_sub_namespace(struct namespace *namespace, const char *name)
5833 {
5834 struct namespace *cur;
5835
5836 LIST_FOR_EACH_ENTRY(cur, &namespace->children, struct namespace, entry) {
5837 if(!strcmp(cur->name, name))
5838 return cur;
5839 }
5840
5841 return NULL;
5842 }
5843
5844 static void push_namespace(const char *name)
5845 {
5846 struct namespace *namespace;
5847
5848 namespace = find_sub_namespace(current_namespace, name);
5849 if(!namespace) {
5850 namespace = xmalloc(sizeof(*namespace));
5851 namespace->name = xstrdup(name);
5852 namespace->parent = current_namespace;
5853 list_add_tail(&current_namespace->children, &namespace->entry);
5854 list_init(&namespace->children);
5855 memset(namespace->type_hash, 0, sizeof(namespace->type_hash));
5856 }
5857
5858 current_namespace = namespace;
5859 }
5860
5861 static void pop_namespace(const char *name)
5862 {
5863 assert(!strcmp(current_namespace->name, name) && current_namespace->parent);
5864 current_namespace = current_namespace->parent;
5865 }
5866
5867 struct rtype {
5868 const char *name;
5869 type_t *type;
5870 int t;
5871 struct rtype *next;
5872 };
5873
5874 type_t *reg_type(type_t *type, const char *name, struct namespace *namespace, int t)
5875 {
5876 struct rtype *nt;
5877 int hash;
5878 if (!name) {
5879 error_loc("registering named type without name\n");
5880 return type;
5881 }
5882 if (!namespace)
5883 namespace = &global_namespace;
5884 hash = hash_ident(name);
5885 nt = xmalloc(sizeof(struct rtype));
5886 nt->name = name;
5887 if (is_global_namespace(namespace))
5888 type->c_name = name;
5889 else
5890 type->c_name = format_namespace(namespace, "__x_", "_C", name);
5891 nt->type = type;
5892 nt->t = t;
5893 nt->next = namespace->type_hash[hash];
5894 namespace->type_hash[hash] = nt;
5895 if ((t == tsSTRUCT || t == tsUNION))
5896 fix_incomplete_types(type);
5897 return type;
5898 }
5899
5900 static int is_incomplete(const type_t *t)
5901 {
5902 return !t->defined &&
5903 (type_get_type_detect_alias(t) == TYPE_STRUCT ||
5904 type_get_type_detect_alias(t) == TYPE_UNION ||
5905 type_get_type_detect_alias(t) == TYPE_ENCAPSULATED_UNION);
5906 }
5907
5908 void add_incomplete(type_t *t)
5909 {
5910 struct typenode *tn = xmalloc(sizeof *tn);
5911 tn->type = t;
5912 list_add_tail(&incomplete_types, &tn->entry);
5913 }
5914
5915 static void fix_type(type_t *t)
5916 {
5917 if (type_is_alias(t) && is_incomplete(t)) {
5918 type_t *ot = type_alias_get_aliasee(t);
5919 fix_type(ot);
5920 if (type_get_type_detect_alias(ot) == TYPE_STRUCT ||
5921 type_get_type_detect_alias(ot) == TYPE_UNION ||
5922 type_get_type_detect_alias(ot) == TYPE_ENCAPSULATED_UNION)
5923 t->details.structure = ot->details.structure;
5924 t->defined = ot->defined;
5925 }
5926 }
5927
5928 static void fix_incomplete(void)
5929 {
5930 struct typenode *tn, *next;
5931
5932 LIST_FOR_EACH_ENTRY_SAFE(tn, next, &incomplete_types, struct typenode, entry) {
5933 fix_type(tn->type);
5934 list_remove(&tn->entry);
5935 free(tn);
5936 }
5937 }
5938
5939 static void fix_incomplete_types(type_t *complete_type)
5940 {
5941 struct typenode *tn, *next;
5942
5943 LIST_FOR_EACH_ENTRY_SAFE(tn, next, &incomplete_types, struct typenode, entry)
5944 {
5945 if (type_is_equal(complete_type, tn->type))
5946 {
5947 tn->type->details.structure = complete_type->details.structure;
5948 list_remove(&tn->entry);
5949 free(tn);
5950 }
5951 }
5952 }
5953
5954 static type_t *reg_typedefs(decl_spec_t *decl_spec, declarator_list_t *decls, attr_list_t *attrs)
5955 {
5956 const declarator_t *decl;
5957 type_t *type = decl_spec->type;
5958
5959 if (is_attr(attrs, ATTR_UUID) && !is_attr(attrs, ATTR_PUBLIC))
5960 attrs = append_attr( attrs, make_attr(ATTR_PUBLIC) );
5961
5962 /* We must generate names for tagless enum, struct or union.
5963 Typedef-ing a tagless enum, struct or union means we want the typedef
5964 to be included in a library hence the public attribute. */
5965 if (type_get_type_detect_alias(type) == TYPE_ENUM ||
5966 type_get_type_detect_alias(type) == TYPE_STRUCT ||
5967 type_get_type_detect_alias(type) == TYPE_UNION ||
5968 type_get_type_detect_alias(type) == TYPE_ENCAPSULATED_UNION)
5969 {
5970 if (!type->name)
5971 type->name = gen_name();
5972
5973 /* replace existing attributes when generating a typelib */
5974 if (do_typelib)
5975 type->attrs = attrs;
5976 }
5977
5978 #ifdef __REACTOS__ /* r53187 / 5bf224e */
5979 /* Append the SWITCHTYPE attribute to a non-encapsulated union if it does not already have it. */
5980 if (type_get_type_detect_alias(type) == TYPE_UNION &&
5981 is_attr(attrs, ATTR_SWITCHTYPE) &&
5982 !is_attr(type->attrs, ATTR_SWITCHTYPE))
5983 type->attrs = append_attr(type->attrs, make_attrp(ATTR_SWITCHTYPE, get_attrp(attrs, ATTR_SWITCHTYPE)));
5984 #endif
5985
5986 LIST_FOR_EACH_ENTRY( decl, decls, const declarator_t, entry )
5987 {
5988
5989 if (decl->var->name) {
5990 type_t *cur;
5991 var_t *name;
5992
5993 cur = find_type(decl->var->name, current_namespace, 0);
5994
5995 /*
5996 * MIDL allows shadowing types that are declared in imported files.
5997 * We don't throw an error in this case and instead add a new type
5998 * (which is earlier on the list in hash table, so it will be used
5999 * instead of shadowed type).
6000 *
6001 * FIXME: We may consider string separated type tables for each input
6002 * for cleaner solution.
6003 */
6004 if (cur && input_name == cur->loc_info.input_name)
6005 error_loc("%s: redefinition error; original definition was at %s:%d\n",
6006 cur->name, cur->loc_info.input_name,
6007 cur->loc_info.line_number);
6008
6009 name = declare_var(attrs, decl_spec, decl, 0);
6010 cur = type_new_alias(name->type, name->name);
6011 cur->attrs = attrs;
6012
6013 if (is_incomplete(cur))
6014 add_incomplete(cur);
6015 reg_type(cur, cur->name, current_namespace, 0);
6016 }
6017 }
6018 return type;
6019 }
6020
6021 type_t *find_type(const char *name, struct namespace *namespace, int t)
6022 {
6023 struct rtype *cur;
6024
6025 if(namespace && namespace != &global_namespace) {
6026 for(cur = namespace->type_hash[hash_ident(name)]; cur; cur = cur->next) {
6027 if(cur->t == t && !strcmp(cur->name, name))
6028 return cur->type;
6029 }
6030 }
6031 for(cur = global_namespace.type_hash[hash_ident(name)]; cur; cur = cur->next) {
6032 if(cur->t == t && !strcmp(cur->name, name))
6033 return cur->type;
6034 }
6035 return NULL;
6036 }
6037
6038 static type_t *find_type_or_error(const char *name, int t)
6039 {
6040 type_t *type = find_type(name, NULL, t);
6041 if (!type) {
6042 error_loc("type '%s' not found\n", name);
6043 return NULL;
6044 }
6045 return type;
6046 }
6047
6048 static type_t *find_type_or_error2(char *name, int t)
6049 {
6050 type_t *tp = find_type_or_error(name, t);
6051 free(name);
6052 return tp;
6053 }
6054
6055 int is_type(const char *name)
6056 {
6057 return find_type(name, current_namespace, 0) != NULL;
6058 }
6059
6060 type_t *get_type(enum type_type type, char *name, struct namespace *namespace, int t)
6061 {
6062 type_t *tp;
6063 if (!namespace)
6064 namespace = &global_namespace;
6065 if (name) {
6066 tp = find_type(name, namespace, t);
6067 if (tp) {
6068 free(name);
6069 return tp;
6070 }
6071 }
6072 tp = make_type(type);
6073 tp->name = name;
6074 tp->namespace = namespace;
6075 if (!name) return tp;
6076 return reg_type(tp, name, namespace, t);
6077 }
6078
6079 /***** constant repository *****/
6080
6081 struct rconst {
6082 char *name;
6083 var_t *var;
6084 struct rconst *next;
6085 };
6086
6087 struct rconst *const_hash[HASHMAX];
6088
6089 static var_t *reg_const(var_t *var)
6090 {
6091 struct rconst *nc;
6092 int hash;
6093 if (!var->name) {
6094 error_loc("registering constant without name\n");
6095 return var;
6096 }
6097 hash = hash_ident(var->name);
6098 nc = xmalloc(sizeof(struct rconst));
6099 nc->name = var->name;
6100 nc->var = var;
6101 nc->next = const_hash[hash];
6102 const_hash[hash] = nc;
6103 return var;
6104 }
6105
6106 var_t *find_const(const char *name, int f)
6107 {
6108 struct rconst *cur = const_hash[hash_ident(name)];
6109 while (cur && strcmp(cur->name, name))
6110 cur = cur->next;
6111 if (!cur) {
6112 if (f) error_loc("constant '%s' not found\n", name);
6113 return NULL;
6114 }
6115 return cur->var;
6116 }
6117
6118 static char *gen_name(void)
6119 {
6120 static const char format[] = "__WIDL_%s_generated_name_%08lX";
6121 static unsigned long n = 0;
6122 static const char *file_id;
6123 static size_t size;
6124 char *name;
6125
6126 if (! file_id)
6127 {
6128 char *dst = dup_basename(input_idl_name, ".idl");
6129 file_id = dst;
6130
6131 for (; *dst; ++dst)
6132 if (! isalnum((unsigned char) *dst))
6133 *dst = '_';
6134
6135 size = sizeof format - 7 + strlen(file_id) + 8;
6136 }
6137
6138 name = xmalloc(size);
6139 sprintf(name, format, file_id, n++);
6140 return name;
6141 }
6142
6143 struct allowed_attr
6144 {
6145 unsigned int dce_compatible : 1;
6146 unsigned int acf : 1;
6147 unsigned int on_interface : 1;
6148 unsigned int on_function : 1;
6149 unsigned int on_arg : 1;
6150 unsigned int on_type : 1;
6151 unsigned int on_enum : 1;
6152 unsigned int on_struct : 2;
6153 unsigned int on_union : 1;
6154 unsigned int on_field : 1;
6155 unsigned int on_library : 1;
6156 unsigned int on_dispinterface : 1;
6157 unsigned int on_module : 1;
6158 unsigned int on_coclass : 1;
6159 const char *display_name;
6160 };
6161
6162 struct allowed_attr allowed_attr[] =
6163 {
6164 /* attr { D ACF I Fn ARG T En St Un Fi L DI M C <display name> } */
6165 /* ATTR_AGGREGATABLE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "aggregatable" },
6166 /* ATTR_ANNOTATION */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "annotation" },
6167 /* ATTR_APPOBJECT */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "appobject" },
6168 /* ATTR_ASYNC */ { 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "async" },
6169 /* ATTR_ASYNCUUID */ { 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, "async_uuid" },
6170 /* ATTR_AUTO_HANDLE */ { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "auto_handle" },
6171 /* ATTR_BINDABLE */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "bindable" },
6172 /* ATTR_BROADCAST */ { 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "broadcast" },
6173 /* ATTR_CALLAS */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "call_as" },
6174 /* ATTR_CALLCONV */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL },
6175 /* ATTR_CASE */ { 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, "case" },
6176 /* ATTR_CODE */ { 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "code" },
6177 /* ATTR_COMMSTATUS */ { 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "comm_status" },
6178 /* ATTR_CONST */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "const" },
6179 /* ATTR_CONTEXTHANDLE */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "context_handle" },
6180 /* ATTR_CONTROL */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, "control" },
6181 /* ATTR_DECODE */ { 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "decode" },
6182 /* ATTR_DEFAULT */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, "default" },
6183 /* ATTR_DEFAULTBIND */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "defaultbind" },
6184 /* ATTR_DEFAULTCOLLELEM */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "defaultcollelem" },
6185 /* ATTR_DEFAULTVALUE */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "defaultvalue" },
6186 /* ATTR_DEFAULTVTABLE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "defaultvtable" },
6187 /* ATTR_DISABLECONSISTENCYCHECK */{ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "disable_consistency_check" },
6188 /* ATTR_DISPINTERFACE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL },
6189 /* ATTR_DISPLAYBIND */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "displaybind" },
6190 /* ATTR_DLLNAME */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, "dllname" },
6191 /* ATTR_DUAL */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "dual" },
6192 /* ATTR_ENABLEALLOCATE */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "enable_allocate" },
6193 /* ATTR_ENCODE */ { 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "encode" },
6194 /* ATTR_ENDPOINT */ { 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "endpoint" },
6195 /* ATTR_ENTRY */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "entry" },
6196 /* ATTR_EXPLICIT_HANDLE */ { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "explicit_handle" },
6197 /* ATTR_FAULTSTATUS */ { 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "fault_status" },
6198 /* ATTR_FORCEALLOCATE */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "force_allocate" },
6199 /* ATTR_HANDLE */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "handle" },
6200 /* ATTR_HELPCONTEXT */ { 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, "helpcontext" },
6201 /* ATTR_HELPFILE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, "helpfile" },
6202 /* ATTR_HELPSTRING */ { 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, "helpstring" },
6203 /* ATTR_HELPSTRINGCONTEXT */ { 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, "helpstringcontext" },
6204 /* ATTR_HELPSTRINGDLL */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, "helpstringdll" },
6205 /* ATTR_HIDDEN */ { 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, "hidden" },
6206 /* ATTR_ID */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, "id" },
6207 /* ATTR_IDEMPOTENT */ { 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "idempotent" },
6208 /* ATTR_IGNORE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, "ignore" },
6209 /* ATTR_IIDIS */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, "iid_is" },
6210 /* ATTR_IMMEDIATEBIND */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "immediatebind" },
6211 /* ATTR_IMPLICIT_HANDLE */ { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "implicit_handle" },
6212 /* ATTR_IN */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "in" },
6213 /* ATTR_INLINE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "inline" },
6214 /* ATTR_INPUTSYNC */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "inputsync" },
6215 /* ATTR_LENGTHIS */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, "length_is" },
6216 /* ATTR_LIBLCID */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, "lcid" },
6217 /* ATTR_LICENSED */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "licensed" },
6218 /* ATTR_LOCAL */ { 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "local" },
6219 /* ATTR_MAYBE */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "maybe" },
6220 /* ATTR_MESSAGE */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "message" },
6221 /* ATTR_NOCODE */ { 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "nocode" },
6222 /* ATTR_NONBROWSABLE */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "nonbrowsable" },
6223 /* ATTR_NONCREATABLE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "noncreatable" },
6224 /* ATTR_NONEXTENSIBLE */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "nonextensible" },
6225 /* ATTR_NOTIFY */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "notify" },
6226 /* ATTR_NOTIFYFLAG */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "notify_flag" },
6227 /* ATTR_OBJECT */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "object" },
6228 /* ATTR_ODL */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, "odl" },
6229 /* ATTR_OLEAUTOMATION */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "oleautomation" },
6230 /* ATTR_OPTIMIZE */ { 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "optimize" },
6231 /* ATTR_OPTIONAL */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "optional" },
6232 /* ATTR_OUT */ { 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "out" },
6233 /* ATTR_PARAMLCID */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "lcid" },
6234 /* ATTR_PARTIALIGNORE */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "partial_ignore" },
6235 /* ATTR_POINTERDEFAULT */ { 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "pointer_default" },
6236 /* ATTR_POINTERTYPE */ { 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, "ref, unique or ptr" },
6237 /* ATTR_PROGID */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "progid" },
6238 /* ATTR_PROPGET */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "propget" },
6239 /* ATTR_PROPPUT */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "propput" },
6240 /* ATTR_PROPPUTREF */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "propputref" },
6241 /* ATTR_PROXY */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "proxy" },
6242 /* ATTR_PUBLIC */ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "public" },
6243 /* ATTR_RANGE */ { 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, "range" },
6244 /* ATTR_READONLY */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, "readonly" },
6245 /* ATTR_REPRESENTAS */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "represent_as" },
6246 /* ATTR_REQUESTEDIT */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "requestedit" },
6247 /* ATTR_RESTRICTED */ { 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, "restricted" },
6248 /* ATTR_RETVAL */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "retval" },
6249 /* ATTR_SIZEIS */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, "size_is" },
6250 /* ATTR_SOURCE */ { 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, "source" },
6251 /* ATTR_STRICTCONTEXTHANDLE */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "strict_context_handle" },
6252 /* ATTR_STRING */ { 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, "string" },
6253 /* ATTR_SWITCHIS */ { 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, "switch_is" },
6254 /* ATTR_SWITCHTYPE */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, "switch_type" },
6255 /* ATTR_THREADING */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "threading" },
6256 /* ATTR_TRANSMITAS */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "transmit_as" },
6257 /* ATTR_UIDEFAULT */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "uidefault" },
6258 /* ATTR_USESGETLASTERROR */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "usesgetlasterror" },
6259 /* ATTR_USERMARSHAL */ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "user_marshal" },
6260 /* ATTR_UUID */ { 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, "uuid" },
6261 /* ATTR_V1ENUM */ { 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, "v1_enum" },
6262 /* ATTR_VARARG */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "vararg" },
6263 /* ATTR_VERSION */ { 1, 0, 1, 0, 0, 1, 1, 2, 0, 0, 1, 0, 0, 1, "version" },
6264 /* ATTR_VIPROGID */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "vi_progid" },
6265 /* ATTR_WIREMARSHAL */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "wire_marshal" },
6266 };
6267
6268 const char *get_attr_display_name(enum attr_type type)
6269 {
6270 return allowed_attr[type].display_name;
6271 }
6272
6273 static attr_list_t *check_iface_attrs(const char *name, attr_list_t *attrs)
6274 {
6275 const attr_t *attr;
6276 if (!attrs) return attrs;
6277 LIST_FOR_EACH_ENTRY(attr, attrs, const attr_t, entry)
6278 {
6279 if (!allowed_attr[attr->type].on_interface)
6280 error_loc("inapplicable attribute %s for interface %s\n",
6281 allowed_attr[attr->type].display_name, name);
6282 if (attr->type == ATTR_IMPLICIT_HANDLE)
6283 {
6284 const var_t *var = attr->u.pval;
6285 if (type_get_type( var->type) == TYPE_BASIC &&
6286 type_basic_get_type( var->type ) == TYPE_BASIC_HANDLE)
6287 continue;
6288 if (is_aliaschain_attr( var->type, ATTR_HANDLE ))
6289 continue;
6290 error_loc("attribute %s requires a handle type in interface %s\n",
6291 allowed_attr[attr->type].display_name, name);
6292 }
6293 }
6294 return attrs;
6295 }
6296
6297 static attr_list_t *check_function_attrs(const char *name, attr_list_t *attrs)
6298 {
6299 const attr_t *attr;
6300 if (!attrs) return attrs;
6301 LIST_FOR_EACH_ENTRY(attr, attrs, const attr_t, entry)
6302 {
6303 if (!allowed_attr[attr->type].on_function)
6304 error_loc("inapplicable attribute %s for function %s\n",
6305 allowed_attr[attr->type].display_name, name);
6306 }
6307 return attrs;
6308 }
6309
6310 static void check_arg_attrs(const var_t *arg)
6311 {
6312 const attr_t *attr;
6313
6314 if (arg->attrs)
6315 {
6316 LIST_FOR_EACH_ENTRY(attr, arg->attrs, const attr_t, entry)
6317 {
6318 if (!allowed_attr[attr->type].on_arg)
6319 error_loc("inapplicable attribute %s for argument %s\n",
6320 allowed_attr[attr->type].display_name, arg->name);
6321 }
6322 }
6323 }
6324
6325 static attr_list_t *check_typedef_attrs(attr_list_t *attrs)
6326 {
6327 const attr_t *attr;
6328 if (!attrs) return attrs;
6329 LIST_FOR_EACH_ENTRY(attr, attrs, const attr_t, entry)
6330 {
6331 if (!allowed_attr[attr->type].on_type)
6332 error_loc("inapplicable attribute %s for typedef\n",
6333 allowed_attr[attr->type].display_name);
6334 }
6335 return attrs;
6336 }
6337
6338 static attr_list_t *check_enum_attrs(attr_list_t *attrs)
6339 {
6340 const attr_t *attr;
6341 if (!attrs) return attrs;
6342 LIST_FOR_EACH_ENTRY(attr, attrs, const attr_t, entry)
6343 {
6344 if (!allowed_attr[attr->type].on_enum)
6345 error_loc("inapplicable attribute %s for enum\n",
6346 allowed_attr[attr->type].display_name);
6347 }
6348 return attrs;
6349 }
6350
6351 static attr_list_t *check_struct_attrs(attr_list_t *attrs)
6352 {
6353 int mask = winrt_mode ? 3 : 1;
6354 const attr_t *attr;
6355 if (!attrs) return attrs;
6356 LIST_FOR_EACH_ENTRY(attr, attrs, const attr_t, entry)
6357 {
6358 if (!(allowed_attr[attr->type].on_struct & mask))
6359 error_loc("inapplicable attribute %s for struct\n",
6360 allowed_attr[attr->type].display_name);
6361 }
6362 return attrs;
6363 }
6364
6365 static attr_list_t *check_union_attrs(attr_list_t *attrs)
6366 {
6367 const attr_t *attr;
6368 if (!attrs) return attrs;
6369 LIST_FOR_EACH_ENTRY(attr, attrs, const attr_t, entry)
6370 {
6371 if (!allowed_attr[attr->type].on_union)
6372 error_loc("inapplicable attribute %s for union\n",
6373 allowed_attr[attr->type].display_name);
6374 }
6375 return attrs;
6376 }
6377
6378 static attr_list_t *check_field_attrs(const char *name, attr_list_t *attrs)
6379 {
6380 const attr_t *attr;
6381 if (!attrs) return attrs;
6382 LIST_FOR_EACH_ENTRY(attr, attrs, const attr_t, entry)
6383 {
6384 if (!allowed_attr[attr->type].on_field)
6385 error_loc("inapplicable attribute %s for field %s\n",
6386 allowed_attr[attr->type].display_name, name);
6387 }
6388 return attrs;
6389 }
6390
6391 static attr_list_t *check_library_attrs(const char *name, attr_list_t *attrs)
6392 {
6393 const attr_t *attr;
6394 if (!attrs) return attrs;
6395 LIST_FOR_EACH_ENTRY(attr, attrs, const attr_t, entry)
6396 {
6397 if (!allowed_attr[attr->type].on_library)
6398 error_loc("inapplicable attribute %s for library %s\n",
6399 allowed_attr[attr->type].display_name, name);
6400 }
6401 return attrs;
6402 }
6403
6404 static attr_list_t *check_dispiface_attrs(const char *name, attr_list_t *attrs)
6405 {
6406 const attr_t *attr;
6407 if (!attrs) return attrs;
6408 LIST_FOR_EACH_ENTRY(attr, attrs, const attr_t, entry)
6409 {
6410 if (!allowed_attr[attr->type].on_dispinterface)
6411 error_loc("inapplicable attribute %s for dispinterface %s\n",
6412 allowed_attr[attr->type].display_name, name);
6413 }
6414 return attrs;
6415 }
6416
6417 static attr_list_t *check_module_attrs(const char *name, attr_list_t *attrs)
6418 {
6419 const attr_t *attr;
6420 if (!attrs) return attrs;
6421 LIST_FOR_EACH_ENTRY(attr, attrs, const attr_t, entry)
6422 {
6423 if (!allowed_attr[attr->type].on_module)
6424 error_loc("inapplicable attribute %s for module %s\n",
6425 allowed_attr[attr->type].display_name, name);
6426 }
6427 return attrs;
6428 }
6429
6430 static attr_list_t *check_coclass_attrs(const char *name, attr_list_t *attrs)
6431 {
6432 const attr_t *attr;
6433 if (!attrs) return attrs;
6434 LIST_FOR_EACH_ENTRY(attr, attrs, const attr_t, entry)
6435 {
6436 if (!allowed_attr[attr->type].on_coclass)
6437 error_loc("inapplicable attribute %s for coclass %s\n",
6438 allowed_attr[attr->type].display_name, name);
6439 }
6440 return attrs;
6441 }
6442
6443 static int is_allowed_conf_type(const type_t *type)
6444 {
6445 switch (type_get_type(type))
6446 {
6447 case TYPE_ENUM:
6448 return TRUE;
6449 case TYPE_BASIC:
6450 switch (type_basic_get_type(type))
6451 {
6452 case TYPE_BASIC_INT8:
6453 case TYPE_BASIC_INT16:
6454 case TYPE_BASIC_INT32:
6455 case TYPE_BASIC_INT64:
6456 case TYPE_BASIC_INT:
6457 case TYPE_BASIC_CHAR:
6458 case TYPE_BASIC_HYPER:
6459 case TYPE_BASIC_BYTE:
6460 case TYPE_BASIC_WCHAR:
6461 return TRUE;
6462 default:
6463 return FALSE;
6464 }
6465 case TYPE_ALIAS:
6466 /* shouldn't get here because of type_get_type call above */
6467 assert(0);
6468 /* fall through */
6469 case TYPE_STRUCT:
6470 case TYPE_UNION:
6471 case TYPE_ENCAPSULATED_UNION:
6472 case TYPE_ARRAY:
6473 case TYPE_POINTER:
6474 case TYPE_VOID:
6475 case TYPE_MODULE:
6476 case TYPE_COCLASS:
6477 case TYPE_FUNCTION:
6478 case TYPE_INTERFACE:
6479 case TYPE_BITFIELD:
6480 return FALSE;
6481 }
6482 return FALSE;
6483 }
6484
6485 static int is_ptr_guid_type(const type_t *type)
6486 {
6487 /* first, make sure it is a pointer to something */
6488 if (!is_ptr(type)) return FALSE;
6489
6490 /* second, make sure it is a pointer to something of size sizeof(GUID),
6491 * i.e. 16 bytes */
6492 return (type_memsize(type_pointer_get_ref(type)) == 16);
6493 }
6494
6495 static void check_conformance_expr_list(const char *attr_name, const var_t *arg, const type_t *container_type, expr_list_t *expr_list)
6496 {
6497 expr_t *dim;
6498 struct expr_loc expr_loc;
6499 expr_loc.v = arg;
6500 expr_loc.attr = attr_name;
6501 if (expr_list) LIST_FOR_EACH_ENTRY(dim, expr_list, expr_t, entry)
6502 {
6503 if (dim->type != EXPR_VOID)
6504 {
6505 const type_t *expr_type = expr_resolve_type(&expr_loc, container_type, dim);
6506 if (!is_allowed_conf_type(expr_type))
6507 error_loc_info(&arg->loc_info, "expression must resolve to integral type <= 32bits for attribute %s\n",
6508 attr_name);
6509 }
6510 }
6511 }
6512
6513 static void check_remoting_fields(const var_t *var, type_t *type);
6514
6515 /* checks that properties common to fields and arguments are consistent */
6516 static void check_field_common(const type_t *container_type,
6517 const char *container_name, const var_t *arg)
6518 {
6519 type_t *type = arg->type;
6520 int more_to_do;
6521 const char *container_type_name;
6522 const char *var_type;
6523
6524 switch (type_get_type(container_type))
6525 {
6526 case TYPE_STRUCT:
6527 container_type_name = "struct";
6528 var_type = "field";
6529 break;
6530 case TYPE_UNION:
6531 container_type_name = "union";
6532 var_type = "arm";
6533 break;
6534 case TYPE_ENCAPSULATED_UNION:
6535 container_type_name = "encapsulated union";
6536 var_type = "arm";
6537 break;
6538 case TYPE_FUNCTION:
6539 container_type_name = "function";
6540 var_type = "parameter";
6541 break;
6542 default:
6543 /* should be no other container types */
6544 assert(0);
6545 return;
6546 }
6547
6548 if (is_attr(arg->attrs, ATTR_LENGTHIS) &&
6549 (is_attr(arg->attrs, ATTR_STRING) || is_aliaschain_attr(arg->type, ATTR_STRING)))
6550 error_loc_info(&arg->loc_info,
6551 "string and length_is specified for argument %s are mutually exclusive attributes\n",
6552 arg->name);
6553
6554 if (is_attr(arg->attrs, ATTR_SIZEIS))
6555 {
6556 expr_list_t *size_is_exprs = get_attrp(arg->attrs, ATTR_SIZEIS);
6557 check_conformance_expr_list("size_is", arg, container_type, size_is_exprs);
6558 }
6559 if (is_attr(arg->attrs, ATTR_LENGTHIS))
6560 {
6561 expr_list_t *length_is_exprs = get_attrp(arg->attrs, ATTR_LENGTHIS);
6562 check_conformance_expr_list("length_is", arg, container_type, length_is_exprs);
6563 }
6564 if (is_attr(arg->attrs, ATTR_IIDIS))
6565 {
6566 struct expr_loc expr_loc;
6567 expr_t *expr = get_attrp(arg->attrs, ATTR_IIDIS);
6568 if (expr->type != EXPR_VOID)
6569 {
6570 const type_t *expr_type;
6571 expr_loc.v = arg;
6572 expr_loc.attr = "iid_is";
6573 expr_type = expr_resolve_type(&expr_loc, container_type, expr);
6574 if (!expr_type || !is_ptr_guid_type(expr_type))
6575 error_loc_info(&arg->loc_info, "expression must resolve to pointer to GUID type for attribute iid_is\n");
6576 }
6577 }
6578 if (is_attr(arg->attrs, ATTR_SWITCHIS))
6579 {
6580 struct expr_loc expr_loc;
6581 expr_t *expr = get_attrp(arg->attrs, ATTR_SWITCHIS);
6582 if (expr->type != EXPR_VOID)
6583 {
6584 const type_t *expr_type;
6585 expr_loc.v = arg;
6586 expr_loc.attr = "switch_is";
6587 expr_type = expr_resolve_type(&expr_loc, container_type, expr);
6588 if (!expr_type || !is_allowed_conf_type(expr_type))
6589 error_loc_info(&arg->loc_info, "expression must resolve to integral type <= 32bits for attribute %s\n",
6590 expr_loc.attr);
6591 }
6592 }
6593
6594 do
6595 {
6596 more_to_do = FALSE;
6597
6598 switch (typegen_detect_type(type, arg->attrs, TDT_IGNORE_STRINGS))
6599 {
6600 case TGT_STRUCT:
6601 case TGT_UNION:
6602 check_remoting_fields(arg, type);
6603 break;
6604 case TGT_INVALID:
6605 {
6606 const char *reason = "is invalid";
6607 switch (type_get_type(type))
6608 {
6609 case TYPE_VOID:
6610 reason = "cannot derive from void *";
6611 break;
6612 case TYPE_FUNCTION:
6613 reason = "cannot be a function pointer";
6614 break;
6615 case TYPE_BITFIELD:
6616 reason = "cannot be a bit-field";
6617 break;
6618 case TYPE_COCLASS:
6619 reason = "cannot be a class";
6620 break;
6621 case TYPE_INTERFACE:
6622 reason = "cannot be a non-pointer to an interface";
6623 break;
6624 case TYPE_MODULE:
6625 reason = "cannot be a module";
6626 break;
6627 default:
6628 break;
6629 }
6630 error_loc_info(&arg->loc_info, "%s \'%s\' of %s \'%s\' %s\n",
6631 var_type, arg->name, container_type_name, container_name, reason);
6632 break;
6633 }
6634 case TGT_CTXT_HANDLE:
6635 case TGT_CTXT_HANDLE_POINTER:
6636 if (type_get_type(container_type) != TYPE_FUNCTION)
6637 error_loc_info(&arg->loc_info,
6638 "%s \'%s\' of %s \'%s\' cannot be a context handle\n",
6639 var_type, arg->name, container_type_name,
6640 container_name);
6641 break;
6642 case TGT_STRING:
6643 {
6644 const type_t *t = type;
6645 while (is_ptr(t))
6646 t = type_pointer_get_ref(t);
6647 if (is_aliaschain_attr(t, ATTR_RANGE))
6648 warning_loc_info(&arg->loc_info, "%s: range not verified for a string of ranged types\n", arg->name);
6649 break;
6650 }
6651 case TGT_POINTER:
6652 type = type_pointer_get_ref(type);
6653 more_to_do = TRUE;
6654 break;
6655 case TGT_ARRAY:
6656 type = type_array_get_element(type);
6657 more_to_do = TRUE;
6658 break;
6659 case TGT_USER_TYPE:
6660 case TGT_IFACE_POINTER:
6661 case TGT_BASIC:
6662 case TGT_ENUM:
6663 case TGT_RANGE:
6664 /* nothing to do */
6665 break;
6666 }
6667 } while (more_to_do);
6668 }
6669
6670 static void check_remoting_fields(const var_t *var, type_t *type)
6671 {
6672 const var_t *field;
6673 const var_list_t *fields = NULL;
6674
6675 type = type_get_real_type(type);
6676
6677 if (type->checked)
6678 return;
6679
6680 type->checked = TRUE;
6681
6682 if (type_get_type(type) == TYPE_STRUCT)
6683 {
6684 if (type_is_complete(type))
6685 fields = type_struct_get_fields(type);
6686 else
6687 error_loc_info(&var->loc_info, "undefined type declaration %s\n", type->name);
6688 }
6689 else if (type_get_type(type) == TYPE_UNION || type_get_type(type) == TYPE_ENCAPSULATED_UNION)
6690 fields = type_union_get_cases(type);
6691
6692 if (fields) LIST_FOR_EACH_ENTRY( field, fields, const var_t, entry )
6693 if (field->type) check_field_common(type, type->name, field);
6694 }
6695
6696 /* checks that arguments for a function make sense for marshalling and unmarshalling */
6697 static void check_remoting_args(const var_t *func)
6698 {
6699 const char *funcname = func->name;
6700 const var_t *arg;
6701
6702 if (func->type->details.function->args) LIST_FOR_EACH_ENTRY( arg, func->type->details.function->args, const var_t, entry )
6703 {
6704 const type_t *type = arg->type;
6705
6706 /* check that [out] parameters have enough pointer levels */
6707 if (is_attr(arg->attrs, ATTR_OUT))
6708 {
6709 switch (typegen_detect_type(type, arg->attrs, TDT_ALL_TYPES))
6710 {
6711 case TGT_BASIC:
6712 case TGT_ENUM:
6713 case TGT_RANGE:
6714 case TGT_STRUCT:
6715 case TGT_UNION:
6716 case TGT_CTXT_HANDLE:
6717 case TGT_USER_TYPE:
6718 error_loc_info(&arg->loc_info, "out parameter \'%s\' of function \'%s\' is not a pointer\n", arg->name, funcname);
6719 break;
6720 case TGT_IFACE_POINTER:
6721 error_loc_info(&arg->loc_info, "out interface pointer \'%s\' of function \'%s\' is not a double pointer\n", arg->name, funcname);
6722 break;
6723 case TGT_STRING:
6724 if (is_array(type))
6725 {
6726 /* needs conformance or fixed dimension */
6727 if (type_array_has_conformance(type) &&
6728 type_array_get_conformance(type)->type != EXPR_VOID) break;
6729 if (!type_array_has_conformance(type) && type_array_get_dim(type)) break;
6730 }
6731 if (is_attr( arg->attrs, ATTR_IN )) break;
6732 error_loc_info(&arg->loc_info, "out parameter \'%s\' of function \'%s\' cannot be an unsized string\n", arg->name, funcname);
6733 break;
6734 case TGT_INVALID:
6735 /* already error'd before we get here */
6736 case TGT_CTXT_HANDLE_POINTER:
6737 case TGT_POINTER:
6738 case TGT_ARRAY:
6739 /* OK */
6740 break;
6741 }
6742 }
6743
6744 check_field_common(func->type, funcname, arg);
6745 }
6746
6747 if (type_get_type(type_function_get_rettype(func->type)) != TYPE_VOID)
6748 {
6749 var_t var;
6750 var = *func;
6751 var.type = type_function_get_rettype(func->type);
6752 var.name = xstrdup("return value");
6753 check_field_common(func->type, funcname, &var);
6754 free(var.name);
6755 }
6756 }
6757
6758 static void add_explicit_handle_if_necessary(const type_t *iface, var_t *func)
6759 {
6760 unsigned char explicit_fc, implicit_fc;
6761
6762 /* check for a defined binding handle */
6763 if (!get_func_handle_var( iface, func, &explicit_fc, &implicit_fc ) || !explicit_fc)
6764 {
6765 /* no explicit handle specified so add
6766 * "[in] handle_t IDL_handle" as the first parameter to the
6767 * function */
6768 var_t *idl_handle = make_var(xstrdup("IDL_handle"));
6769 idl_handle->attrs = append_attr(NULL, make_attr(ATTR_IN));
6770 idl_handle->type = find_type_or_error("handle_t", 0);
6771 type_function_add_head_arg(func->type, idl_handle);
6772 }
6773 }
6774
6775 static void check_functions(const type_t *iface, int is_inside_library)
6776 {
6777 const statement_t *stmt;
6778 if (is_attr(iface->attrs, ATTR_EXPLICIT_HANDLE))
6779 {
6780 STATEMENTS_FOR_EACH_FUNC( stmt, type_iface_get_stmts(iface) )
6781 {
6782 var_t *func = stmt->u.var;
6783 add_explicit_handle_if_necessary(iface, func);
6784 }
6785 }
6786 if (!is_inside_library && !is_attr(iface->attrs, ATTR_LOCAL))
6787 {
6788 STATEMENTS_FOR_EACH_FUNC( stmt, type_iface_get_stmts(iface) )
6789 {
6790 const var_t *func = stmt->u.var;
6791 if (!is_attr(func->attrs, ATTR_LOCAL))
6792 check_remoting_args(func);
6793 }
6794 }
6795 }
6796
6797 static void check_statements(const statement_list_t *stmts, int is_inside_library)
6798 {
6799 const statement_t *stmt;
6800
6801 if (stmts) LIST_FOR_EACH_ENTRY(stmt, stmts, const statement_t, entry)
6802 {
6803 switch(stmt->type) {
6804 case STMT_LIBRARY:
6805 check_statements(stmt->u.lib->stmts, TRUE);
6806 break;
6807 case STMT_TYPE:
6808 switch(type_get_type(stmt->u.type)) {
6809 case TYPE_INTERFACE:
6810 check_functions(stmt->u.type, is_inside_library);
6811 break;
6812 case TYPE_COCLASS:
6813 if(winrt_mode)
6814 error_loc("coclass is not allowed in Windows Runtime mode\n");
6815 break;
6816 default:
6817 break;
6818 }
6819 break;
6820 default:
6821 break;
6822 }
6823 }
6824 }
6825
6826 static void check_all_user_types(const statement_list_t *stmts)
6827 {
6828 const statement_t *stmt;
6829
6830 if (stmts) LIST_FOR_EACH_ENTRY(stmt, stmts, const statement_t, entry)
6831 {
6832 if (stmt->type == STMT_LIBRARY)
6833 check_all_user_types(stmt->u.lib->stmts);
6834 else if (stmt->type == STMT_TYPE && type_get_type(stmt->u.type) == TYPE_INTERFACE &&
6835 !is_local(stmt->u.type->attrs))
6836 {
6837 const statement_t *stmt_func;
6838 STATEMENTS_FOR_EACH_FUNC(stmt_func, type_iface_get_stmts(stmt->u.type)) {
6839 const var_t *func = stmt_func->u.var;
6840 check_for_additional_prototype_types(func->type->details.function->args);
6841 }
6842 }
6843 }
6844 }
6845
6846 int is_valid_uuid(const char *s)
6847 {
6848 int i;
6849
6850 for (i = 0; i < 36; ++i)
6851 if (i == 8 || i == 13 || i == 18 || i == 23)
6852 {
6853 if (s[i] != '-')
6854 return FALSE;
6855 }
6856 else
6857 if (!isxdigit(s[i]))
6858 return FALSE;
6859
6860 return s[i] == '\0';
6861 }
6862
6863 static statement_t *make_statement(enum statement_type type)
6864 {
6865 statement_t *stmt = xmalloc(sizeof(*stmt));
6866 stmt->type = type;
6867 return stmt;
6868 }
6869
6870 static statement_t *make_statement_type_decl(type_t *type)
6871 {
6872 statement_t *stmt = make_statement(STMT_TYPE);
6873 stmt->u.type = type;
6874 return stmt;
6875 }
6876
6877 static statement_t *make_statement_reference(type_t *type)
6878 {
6879 statement_t *stmt = make_statement(STMT_TYPEREF);
6880 stmt->u.type = type;
6881 return stmt;
6882 }
6883
6884 static statement_t *make_statement_declaration(var_t *var)
6885 {
6886 statement_t *stmt = make_statement(STMT_DECLARATION);
6887 stmt->u.var = var;
6888 if (var->stgclass == STG_EXTERN && var->eval)
6889 warning("'%s' initialised and declared extern\n", var->name);
6890 if (is_const_decl(var))
6891 {
6892 if (var->eval)
6893 reg_const(var);
6894 }
6895 else if (type_get_type(var->type) == TYPE_FUNCTION)
6896 check_function_attrs(var->name, var->attrs);
6897 else if (var->stgclass == STG_NONE || var->stgclass == STG_REGISTER)
6898 error_loc("instantiation of data is illegal\n");
6899 return stmt;
6900 }
6901
6902 static statement_t *make_statement_library(typelib_t *typelib)
6903 {
6904 statement_t *stmt = make_statement(STMT_LIBRARY);
6905 stmt->u.lib = typelib;
6906 return stmt;
6907 }
6908
6909 static statement_t *make_statement_pragma(const char *str)
6910 {
6911 statement_t *stmt = make_statement(STMT_PRAGMA);
6912 stmt->u.str = str;
6913 return stmt;
6914 }
6915
6916 static statement_t *make_statement_cppquote(const char *str)
6917 {
6918 statement_t *stmt = make_statement(STMT_CPPQUOTE);
6919 stmt->u.str = str;
6920 return stmt;
6921 }
6922
6923 static statement_t *make_statement_importlib(const char *str)
6924 {
6925 statement_t *stmt = make_statement(STMT_IMPORTLIB);
6926 stmt->u.str = str;
6927 return stmt;
6928 }
6929
6930 static statement_t *make_statement_import(const char *str)
6931 {
6932 statement_t *stmt = make_statement(STMT_IMPORT);
6933 stmt->u.str = str;
6934 return stmt;
6935 }
6936
6937 static statement_t *make_statement_module(type_t *type)
6938 {
6939 statement_t *stmt = make_statement(STMT_MODULE);
6940 stmt->u.type = type;
6941 return stmt;
6942 }
6943
6944 static statement_t *make_statement_typedef(declarator_list_t *decls)
6945 {
6946 declarator_t *decl, *next;
6947 statement_t *stmt;
6948 type_list_t **type_list;
6949
6950 if (!decls) return NULL;
6951
6952 stmt = make_statement(STMT_TYPEDEF);
6953 stmt->u.type_list = NULL;
6954 type_list = &stmt->u.type_list;
6955
6956 LIST_FOR_EACH_ENTRY_SAFE( decl, next, decls, declarator_t, entry )
6957 {
6958 var_t *var = decl->var;
6959 type_t *type = find_type_or_error(var->name, 0);
6960 *type_list = xmalloc(sizeof(type_list_t));
6961 (*type_list)->type = type;
6962 (*type_list)->next = NULL;
6963
6964 type_list = &(*type_list)->next;
6965 free(decl);
6966 free(var);
6967 }
6968
6969 return stmt;
6970 }
6971
6972 static statement_list_t *append_statements(statement_list_t *l1, statement_list_t *l2)
6973 {
6974 if (!l2) return l1;
6975 if (!l1 || l1 == l2) return l2;
6976 list_move_tail (l1, l2);
6977 return l1;
6978 }
6979
6980 static attr_list_t *append_attribs(attr_list_t *l1, attr_list_t *l2)
6981 {
6982 if (!l2) return l1;
6983 if (!l1 || l1 == l2) return l2;
6984 list_move_tail (l1, l2);
6985 return l1;
6986 }
6987
6988 static statement_list_t *append_statement(statement_list_t *list, statement_t *stmt)
6989 {
6990 if (!stmt) return list;
6991 if (!list)
6992 {
6993 list = xmalloc( sizeof(*list) );
6994 list_init( list );
6995 }
6996 list_add_tail( list, &stmt->entry );
6997 return list;
6998 }
6999
7000 void init_loc_info(loc_info_t *i)
7001 {
7002 i->input_name = input_name ? input_name : "stdin";
7003 i->line_number = line_number;
7004 i->near_text = parser_text;
7005 }
7006
7007 static void check_def(const type_t *t)
7008 {
7009 if (t->defined)
7010 error_loc("%s: redefinition error; original definition was at %s:%d\n",
7011 t->name, t->loc_info.input_name, t->loc_info.line_number);
7012 }