merge in Winehq changes to reduce noise
[reactos.git] / reactos / tools / widl / y.tab.c
1
2 /* A Bison parser, made from parser.y
3 by GNU Bison version 1.28 */
4
5 #define YYBISON 1 /* Identify Bison output. */
6
7 #define aIDENTIFIER 257
8 #define aKNOWNTYPE 258
9 #define aNUM 259
10 #define aHEXNUM 260
11 #define aSTRING 261
12 #define aUUID 262
13 #define aEOF 263
14 #define SHL 264
15 #define SHR 265
16 #define tAGGREGATABLE 266
17 #define tALLOCATE 267
18 #define tAPPOBJECT 268
19 #define tARRAYS 269
20 #define tASYNC 270
21 #define tASYNCUUID 271
22 #define tAUTOHANDLE 272
23 #define tBINDABLE 273
24 #define tBOOLEAN 274
25 #define tBROADCAST 275
26 #define tBYTE 276
27 #define tBYTECOUNT 277
28 #define tCALLAS 278
29 #define tCALLBACK 279
30 #define tCASE 280
31 #define tCDECL 281
32 #define tCHAR 282
33 #define tCOCLASS 283
34 #define tCODE 284
35 #define tCOMMSTATUS 285
36 #define tCONST 286
37 #define tCONTEXTHANDLE 287
38 #define tCONTEXTHANDLENOSERIALIZE 288
39 #define tCONTEXTHANDLESERIALIZE 289
40 #define tCONTROL 290
41 #define tCPPQUOTE 291
42 #define tDEFAULT 292
43 #define tDEFAULTVALUE 293
44 #define tDISPINTERFACE 294
45 #define tDLLNAME 295
46 #define tDOUBLE 296
47 #define tDUAL 297
48 #define tENDPOINT 298
49 #define tENTRY 299
50 #define tENUM 300
51 #define tERRORSTATUST 301
52 #define tEXPLICITHANDLE 302
53 #define tEXTERN 303
54 #define tFLOAT 304
55 #define tHANDLE 305
56 #define tHANDLET 306
57 #define tHELPCONTEXT 307
58 #define tHELPFILE 308
59 #define tHELPSTRING 309
60 #define tHELPSTRINGCONTEXT 310
61 #define tHELPSTRINGDLL 311
62 #define tHIDDEN 312
63 #define tHYPER 313
64 #define tID 314
65 #define tIDEMPOTENT 315
66 #define tIIDIS 316
67 #define tIMPLICITHANDLE 317
68 #define tIMPORT 318
69 #define tIMPORTLIB 319
70 #define tIN 320
71 #define tINCLUDE 321
72 #define tINLINE 322
73 #define tINPUTSYNC 323
74 #define tINT 324
75 #define tINT64 325
76 #define tINTERFACE 326
77 #define tLENGTHIS 327
78 #define tLIBRARY 328
79 #define tLOCAL 329
80 #define tLONG 330
81 #define tMETHODS 331
82 #define tMODULE 332
83 #define tNONCREATABLE 333
84 #define tOBJECT 334
85 #define tODL 335
86 #define tOLEAUTOMATION 336
87 #define tOPTIONAL 337
88 #define tOUT 338
89 #define tPOINTERDEFAULT 339
90 #define tPROPERTIES 340
91 #define tPROPGET 341
92 #define tPROPPUT 342
93 #define tPROPPUTREF 343
94 #define tPUBLIC 344
95 #define tREADONLY 345
96 #define tREF 346
97 #define tRESTRICTED 347
98 #define tRETVAL 348
99 #define tSHORT 349
100 #define tSIGNED 350
101 #define tSIZEIS 351
102 #define tSIZEOF 352
103 #define tSMALL 353
104 #define tSOURCE 354
105 #define tSTDCALL 355
106 #define tSTRING 356
107 #define tSTRUCT 357
108 #define tSWITCH 358
109 #define tSWITCHIS 359
110 #define tSWITCHTYPE 360
111 #define tTRANSMITAS 361
112 #define tTYPEDEF 362
113 #define tUNION 363
114 #define tUNIQUE 364
115 #define tUNSIGNED 365
116 #define tUUID 366
117 #define tV1ENUM 367
118 #define tVARARG 368
119 #define tVERSION 369
120 #define tVOID 370
121 #define tWCHAR 371
122 #define tWIREMARSHAL 372
123 #define tPOINTERTYPE 373
124 #define COND 374
125 #define CAST 375
126 #define PPTR 376
127 #define NEG 377
128
129 #line 1 "parser.y"
130
131 /*
132 * IDL Compiler
133 *
134 * Copyright 2002 Ove Kaaven
135 *
136 * This library is free software; you can redistribute it and/or
137 * modify it under the terms of the GNU Lesser General Public
138 * License as published by the Free Software Foundation; either
139 * version 2.1 of the License, or (at your option) any later version.
140 *
141 * This library is distributed in the hope that it will be useful,
142 * but WITHOUT ANY WARRANTY; without even the implied warranty of
143 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
144 * Lesser General Public License for more details.
145 *
146 * You should have received a copy of the GNU Lesser General Public
147 * License along with this library; if not, write to the Free Software
148 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
149 */
150
151 #include "config.h"
152
153 #include <stdio.h>
154 #include <stdlib.h>
155 #include <stdarg.h>
156 #include <assert.h>
157 #include <ctype.h>
158 #include <string.h>
159 #ifdef HAVE_ALLOCA_H
160 #include <alloca.h>
161 #endif
162
163 #include "widl.h"
164 #include "utils.h"
165 #include "parser.h"
166 #include "header.h"
167 #include "typelib.h"
168
169 #if defined(YYBYACC)
170 /* Berkeley yacc (byacc) doesn't seem to know about these */
171 /* Some *BSD supplied versions do define these though */
172 # ifndef YYEMPTY
173 # define YYEMPTY (-1) /* Empty lookahead value of yychar */
174 # endif
175 # ifndef YYLEX
176 # define YYLEX yylex()
177 # endif
178
179 #elif defined(YYBISON)
180 /* Bison was used for original development */
181 /* #define YYEMPTY -2 */
182 /* #define YYLEX yylex() */
183
184 #else
185 /* No yacc we know yet */
186 # if !defined(YYEMPTY) || !defined(YYLEX)
187 # error Yacc version/type unknown. This version needs to be verified for settings of YYEMPTY and YYLEX.
188 # elif defined(__GNUC__) /* gcc defines the #warning directive */
189 # warning Yacc version/type unknown. It defines YYEMPTY and YYLEX, but is not tested
190 /* #else we just take a chance that it works... */
191 # endif
192 #endif
193
194 static attr_t *make_attr(enum attr_type type);
195 static attr_t *make_attrv(enum attr_type type, unsigned long val);
196 static attr_t *make_attrp(enum attr_type type, void *val);
197 static expr_t *make_expr(enum expr_type type);
198 static expr_t *make_exprl(enum expr_type type, long val);
199 static expr_t *make_exprs(enum expr_type type, char *val);
200 static expr_t *make_exprt(enum expr_type type, typeref_t *tref, expr_t *expr);
201 static expr_t *make_expr1(enum expr_type type, expr_t *expr);
202 static expr_t *make_expr2(enum expr_type type, expr_t *exp1, expr_t *exp2);
203 static expr_t *make_expr3(enum expr_type type, expr_t *expr1, expr_t *expr2, expr_t *expr3);
204 static type_t *make_type(unsigned char type, type_t *ref);
205 static typeref_t *make_tref(char *name, type_t *ref);
206 static typeref_t *uniq_tref(typeref_t *ref);
207 static type_t *type_ref(typeref_t *ref);
208 static void set_type(var_t *v, typeref_t *ref, expr_t *arr);
209 static ifref_t *make_ifref(type_t *iface);
210 static var_t *make_var(char *name);
211 static func_t *make_func(var_t *def, var_t *args);
212 static class_t *make_class(char *name);
213
214 static type_t *reg_type(type_t *type, char *name, int t);
215 static type_t *reg_types(type_t *type, var_t *names, int t);
216 static type_t *find_type(char *name, int t);
217 static type_t *find_type2(char *name, int t);
218 static type_t *get_type(unsigned char type, char *name, int t);
219 static type_t *get_typev(unsigned char type, var_t *name, int t);
220 static int get_struct_type(var_t *fields);
221
222 static var_t *reg_const(var_t *var);
223 static var_t *find_const(char *name, int f);
224
225 #define tsENUM 1
226 #define tsSTRUCT 2
227 #define tsUNION 3
228
229 static type_t std_bool = { "boolean" };
230 static type_t std_int = { "int" };
231 static type_t std_int64 = { "__int64" };
232 static type_t std_uhyper = { "MIDL_uhyper" };
233
234
235 #line 109 "parser.y"
236 typedef union {
237 attr_t *attr;
238 expr_t *expr;
239 type_t *type;
240 typeref_t *tref;
241 var_t *var;
242 func_t *func;
243 ifref_t *ifref;
244 class_t *clas;
245 char *str;
246 UUID *uuid;
247 unsigned int num;
248 } YYSTYPE;
249 #include <stdio.h>
250
251 #ifndef __cplusplus
252 #ifndef __STDC__
253 #define const
254 #endif
255 #endif
256
257
258
259 #define YYFINAL 459
260 #define YYFLAG -32768
261 #define YYNTBASE 143
262
263 #define YYTRANSLATE(x) ((unsigned)(x) <= 377 ? yytranslate[x] : 215)
264
265 static const short yytranslate[] = { 0,
266 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
267 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
268 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
269 2, 2, 2, 2, 2, 2, 2, 123, 2, 133,
270 134, 126, 125, 120, 124, 142, 127, 2, 2, 2,
271 2, 2, 2, 2, 2, 2, 2, 139, 132, 2,
272 140, 2, 141, 2, 2, 2, 2, 2, 2, 2,
273 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
274 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
275 137, 2, 138, 2, 2, 2, 2, 2, 2, 2,
276 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
277 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
278 2, 2, 135, 122, 136, 128, 2, 2, 2, 2,
279 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
280 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
281 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
282 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
283 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
284 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
285 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
286 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
287 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
288 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
289 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
290 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
291 2, 2, 2, 2, 2, 1, 3, 4, 5, 6,
292 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
293 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
294 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
295 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
296 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
297 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
298 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
299 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
300 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
301 97, 98, 99, 100, 101, 102, 103, 104, 105, 106,
302 107, 108, 109, 110, 111, 112, 113, 114, 115, 116,
303 117, 118, 119, 121, 129, 130, 131
304 };
305
306 #if YYDEBUG != 0
307 static const short yyprhs[] = { 0,
308 0, 2, 3, 6, 9, 12, 15, 18, 21, 22,
309 25, 28, 31, 34, 37, 38, 42, 45, 47, 50,
310 52, 55, 58, 60, 63, 66, 69, 74, 78, 82,
311 85, 89, 93, 94, 96, 98, 100, 104, 106, 111,
312 115, 122, 128, 129, 133, 137, 139, 143, 148, 149,
313 151, 155, 157, 161, 166, 168, 170, 175, 180, 182,
314 184, 186, 188, 190, 195, 200, 205, 207, 212, 217,
315 222, 224, 226, 231, 236, 241, 246, 251, 253, 258,
316 260, 265, 271, 273, 275, 280, 282, 284, 286, 288,
317 290, 292, 294, 299, 301, 303, 305, 307, 309, 311,
318 313, 318, 320, 322, 327, 332, 337, 342, 344, 346,
319 351, 356, 358, 359, 361, 362, 365, 370, 374, 380,
320 381, 384, 386, 388, 392, 396, 398, 404, 406, 410,
321 411, 413, 415, 417, 419, 425, 429, 433, 437, 441,
322 445, 449, 453, 457, 460, 463, 466, 471, 476, 480,
323 482, 486, 488, 493, 494, 497, 500, 504, 507, 509,
324 514, 522, 523, 525, 526, 528, 530, 532, 534, 536,
325 538, 540, 542, 544, 546, 549, 552, 554, 556, 558,
326 560, 562, 563, 565, 567, 570, 573, 576, 579, 581,
327 583, 586, 589, 592, 597, 598, 601, 604, 607, 610,
328 613, 616, 620, 623, 627, 633, 634, 637, 640, 643,
329 646, 652, 660, 662, 665, 668, 671, 674, 677, 682,
330 685, 688, 690, 692, 696, 698, 702, 704, 706, 712,
331 714, 716, 718, 721, 723, 726, 728, 731, 733, 736,
332 741, 747, 758, 760
333 };
334
335 static const short yyrhs[] = { 144,
336 0, 0, 144, 202, 0, 144, 201, 0, 144, 190,
337 0, 144, 205, 0, 144, 153, 0, 144, 147, 0,
338 0, 145, 202, 0, 145, 201, 0, 145, 190, 0,
339 145, 205, 0, 145, 147, 0, 0, 146, 181, 132,
340 0, 146, 147, 0, 132, 0, 167, 132, 0, 148,
341 0, 171, 132, 0, 177, 132, 0, 150, 0, 210,
342 132, 0, 212, 132, 0, 213, 132, 0, 37, 133,
343 7, 134, 0, 64, 7, 132, 0, 149, 145, 9,
344 0, 74, 3, 0, 161, 151, 135, 0, 152, 145,
345 136, 0, 0, 156, 0, 116, 0, 157, 0, 156,
346 120, 157, 0, 155, 0, 161, 211, 207, 158, 0,
347 211, 207, 158, 0, 161, 211, 207, 133, 154, 134,
348 0, 211, 207, 133, 154, 134, 0, 0, 137, 159,
349 138, 0, 137, 126, 138, 0, 173, 0, 159, 120,
350 174, 0, 159, 138, 137, 174, 0, 0, 161, 0,
351 137, 162, 138, 0, 163, 0, 162, 120, 163, 0,
352 162, 138, 137, 163, 0, 16, 0, 18, 0, 24,
353 133, 184, 134, 0, 26, 133, 175, 134, 0, 33,
354 0, 34, 0, 35, 0, 36, 0, 38, 0, 39,
355 133, 176, 134, 0, 39, 133, 7, 134, 0, 41,
356 133, 7, 134, 0, 43, 0, 44, 133, 7, 134,
357 0, 45, 133, 7, 134, 0, 45, 133, 176, 134,
358 0, 48, 0, 51, 0, 53, 133, 176, 134, 0,
359 54, 133, 7, 134, 0, 55, 133, 7, 134, 0,
360 56, 133, 176, 134, 0, 57, 133, 7, 134, 0,
361 58, 0, 60, 133, 176, 134, 0, 61, 0, 62,
362 133, 184, 134, 0, 63, 133, 52, 3, 134, 0,
363 66, 0, 69, 0, 73, 133, 172, 134, 0, 75,
364 0, 79, 0, 80, 0, 81, 0, 82, 0, 83,
365 0, 84, 0, 85, 133, 209, 134, 0, 87, 0,
366 88, 0, 89, 0, 90, 0, 91, 0, 93, 0,
367 94, 0, 97, 133, 172, 134, 0, 100, 0, 102,
368 0, 105, 133, 174, 134, 0, 106, 133, 211, 134,
369 0, 107, 133, 211, 134, 0, 112, 133, 8, 134,
370 0, 113, 0, 114, 0, 115, 133, 214, 134, 0,
371 118, 133, 211, 134, 0, 209, 0, 0, 101, 0,
372 0, 165, 166, 0, 26, 174, 139, 179, 0, 38,
373 139, 179, 0, 32, 211, 184, 140, 176, 0, 0,
374 169, 120, 0, 169, 0, 170, 0, 169, 120, 170,
375 0, 184, 140, 176, 0, 184, 0, 46, 183, 135,
376 168, 136, 0, 173, 0, 172, 120, 173, 0, 0,
377 174, 0, 5, 0, 6, 0, 3, 0, 174, 141,
378 174, 139, 174, 0, 174, 122, 174, 0, 174, 123,
379 174, 0, 174, 125, 174, 0, 174, 124, 174, 0,
380 174, 126, 174, 0, 174, 127, 174, 0, 174, 10,
381 174, 0, 174, 11, 174, 0, 128, 174, 0, 124,
382 174, 0, 126, 174, 0, 133, 211, 134, 174, 0,
383 98, 133, 211, 134, 0, 133, 174, 134, 0, 176,
384 0, 175, 120, 176, 0, 174, 0, 49, 32, 211,
385 184, 0, 0, 178, 179, 0, 180, 132, 0, 160,
386 213, 132, 0, 161, 132, 0, 132, 0, 160, 211,
387 207, 158, 0, 160, 211, 164, 207, 133, 154, 134,
388 0, 0, 184, 0, 0, 3, 0, 4, 0, 3,
389 0, 4, 0, 60, 0, 94, 0, 115, 0, 22,
390 0, 117, 0, 187, 0, 96, 187, 0, 111, 187,
391 0, 50, 0, 42, 0, 20, 0, 47, 0, 52,
392 0, 0, 70, 0, 70, 0, 99, 186, 0, 95,
393 186, 0, 76, 186, 0, 59, 186, 0, 71, 0,
394 28, 0, 29, 3, 0, 29, 4, 0, 161, 188,
395 0, 189, 135, 191, 136, 0, 0, 191, 192, 0,
396 160, 202, 0, 40, 3, 0, 40, 4, 0, 161,
397 193, 0, 86, 139, 0, 195, 180, 132, 0, 77,
398 139, 0, 196, 181, 132, 0, 194, 135, 195, 196,
399 136, 0, 0, 139, 4, 0, 72, 3, 0, 72,
400 4, 0, 161, 199, 0, 200, 198, 135, 146, 136,
401 0, 200, 139, 3, 135, 150, 146, 136, 0, 197,
402 0, 199, 132, 0, 193, 132, 0, 78, 3, 0,
403 78, 4, 0, 161, 203, 0, 204, 135, 146, 136,
404 0, 126, 207, 0, 32, 206, 0, 184, 0, 206,
405 0, 133, 207, 134, 0, 207, 0, 208, 120, 207,
406 0, 92, 0, 110, 0, 103, 183, 135, 178, 136,
407 0, 116, 0, 4, 0, 185, 0, 32, 211, 0,
408 171, 0, 46, 3, 0, 210, 0, 103, 3, 0,
409 213, 0, 109, 3, 0, 108, 160, 211, 208, 0,
410 109, 183, 135, 178, 136, 0, 109, 183, 104, 133,
411 180, 134, 182, 135, 165, 136, 0, 5, 0, 5,
412 142, 5, 0
413 };
414
415 #endif
416
417 #if YYDEBUG != 0
418 static const short yyrline[] = { 0,
419 229, 232, 233, 234, 235, 236, 237, 238, 241, 242,
420 243, 244, 245, 246, 249, 250, 251, 254, 255, 256,
421 257, 258, 259, 260, 261, 262, 265, 267, 270, 273,
422 275, 277, 280, 281, 284, 287, 288, 289, 293, 297,
423 300, 306, 313, 314, 315, 318, 319, 320, 323, 324,
424 327, 331, 332, 333, 336, 338, 339, 340, 341, 342,
425 343, 344, 345, 346, 347, 348, 349, 350, 351, 352,
426 353, 354, 355, 356, 357, 358, 359, 360, 361, 362,
427 363, 364, 365, 366, 367, 368, 369, 370, 371, 372,
428 373, 374, 375, 376, 377, 378, 379, 380, 381, 382,
429 383, 384, 385, 386, 387, 388, 389, 390, 391, 392,
430 393, 394, 397, 398, 401, 402, 407, 411, 417, 424,
431 425, 426, 429, 430, 436, 441, 447, 455, 456, 469,
432 470, 473, 474, 475, 476, 477, 478, 479, 480, 481,
433 482, 483, 484, 485, 486, 487, 488, 489, 490, 493,
434 494, 497, 503, 508, 509, 514, 515, 516, 517, 520,
435 523, 534, 535, 538, 539, 540, 543, 545, 546, 547,
436 548, 551, 552, 553, 554, 555, 567, 568, 569, 570,
437 571, 574, 575, 578, 579, 580, 581, 582, 583, 584,
438 587, 588, 591, 597, 602, 603, 606, 610, 611, 614,
439 626, 627, 630, 631, 634, 649, 650, 653, 654, 657,
440 665, 673, 680, 683, 685, 688, 689, 692, 697, 703,
441 704, 707, 708, 709, 712, 714, 717, 719, 722, 732,
442 733, 734, 735, 736, 737, 738, 739, 740, 741, 744,
443 756, 760, 773, 775
444 };
445 #endif
446
447
448 #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
449
450 static const char * const yytname[] = { "$","error","$undefined.","aIDENTIFIER",
451 "aKNOWNTYPE","aNUM","aHEXNUM","aSTRING","aUUID","aEOF","SHL","SHR","tAGGREGATABLE",
452 "tALLOCATE","tAPPOBJECT","tARRAYS","tASYNC","tASYNCUUID","tAUTOHANDLE","tBINDABLE",
453 "tBOOLEAN","tBROADCAST","tBYTE","tBYTECOUNT","tCALLAS","tCALLBACK","tCASE","tCDECL",
454 "tCHAR","tCOCLASS","tCODE","tCOMMSTATUS","tCONST","tCONTEXTHANDLE","tCONTEXTHANDLENOSERIALIZE",
455 "tCONTEXTHANDLESERIALIZE","tCONTROL","tCPPQUOTE","tDEFAULT","tDEFAULTVALUE",
456 "tDISPINTERFACE","tDLLNAME","tDOUBLE","tDUAL","tENDPOINT","tENTRY","tENUM","tERRORSTATUST",
457 "tEXPLICITHANDLE","tEXTERN","tFLOAT","tHANDLE","tHANDLET","tHELPCONTEXT","tHELPFILE",
458 "tHELPSTRING","tHELPSTRINGCONTEXT","tHELPSTRINGDLL","tHIDDEN","tHYPER","tID",
459 "tIDEMPOTENT","tIIDIS","tIMPLICITHANDLE","tIMPORT","tIMPORTLIB","tIN","tINCLUDE",
460 "tINLINE","tINPUTSYNC","tINT","tINT64","tINTERFACE","tLENGTHIS","tLIBRARY","tLOCAL",
461 "tLONG","tMETHODS","tMODULE","tNONCREATABLE","tOBJECT","tODL","tOLEAUTOMATION",
462 "tOPTIONAL","tOUT","tPOINTERDEFAULT","tPROPERTIES","tPROPGET","tPROPPUT","tPROPPUTREF",
463 "tPUBLIC","tREADONLY","tREF","tRESTRICTED","tRETVAL","tSHORT","tSIGNED","tSIZEIS",
464 "tSIZEOF","tSMALL","tSOURCE","tSTDCALL","tSTRING","tSTRUCT","tSWITCH","tSWITCHIS",
465 "tSWITCHTYPE","tTRANSMITAS","tTYPEDEF","tUNION","tUNIQUE","tUNSIGNED","tUUID",
466 "tV1ENUM","tVARARG","tVERSION","tVOID","tWCHAR","tWIREMARSHAL","tPOINTERTYPE",
467 "','","COND","'|'","'&'","'-'","'+'","'*'","'/'","'~'","CAST","PPTR","NEG","';'",
468 "'('","')'","'{'","'}'","'['","']'","':'","'='","'?'","'.'","input","gbl_statements",
469 "imp_statements","int_statements","statement","cppquote","import_start","import",
470 "libraryhdr","library_start","librarydef","m_args","no_args","args","arg","array",
471 "array_list","m_attributes","attributes","attrib_list","attribute","callconv",
472 "cases","case","constdef","enums","enum_list","enum","enumdef","m_exprs","m_expr",
473 "expr","expr_list_const","expr_const","externdef","fields","field","s_field",
474 "funcdef","m_ident","t_ident","ident","base_type","m_int","int_std","coclass",
475 "coclasshdr","coclassdef","coclass_ints","coclass_int","dispinterface","dispinterfacehdr",
476 "dispint_props","dispint_meths","dispinterfacedef","inherit","interface","interfacehdr",
477 "interfacedef","interfacedec","module","modulehdr","moduledef","p_ident","pident",
478 "pident_list","pointer_type","structdef","type","typedef","uniondef","version", NULL
479 };
480 #endif
481
482 static const short yyr1[] = { 0,
483 143, 144, 144, 144, 144, 144, 144, 144, 145, 145,
484 145, 145, 145, 145, 146, 146, 146, 147, 147, 147,
485 147, 147, 147, 147, 147, 147, 148, 149, 150, 151,
486 152, 153, 154, 154, 155, 156, 156, 156, 157, 157,
487 157, 157, 158, 158, 158, 159, 159, 159, 160, 160,
488 161, 162, 162, 162, 163, 163, 163, 163, 163, 163,
489 163, 163, 163, 163, 163, 163, 163, 163, 163, 163,
490 163, 163, 163, 163, 163, 163, 163, 163, 163, 163,
491 163, 163, 163, 163, 163, 163, 163, 163, 163, 163,
492 163, 163, 163, 163, 163, 163, 163, 163, 163, 163,
493 163, 163, 163, 163, 163, 163, 163, 163, 163, 163,
494 163, 163, 164, 164, 165, 165, 166, 166, 167, 168,
495 168, 168, 169, 169, 170, 170, 171, 172, 172, 173,
496 173, 174, 174, 174, 174, 174, 174, 174, 174, 174,
497 174, 174, 174, 174, 174, 174, 174, 174, 174, 175,
498 175, 176, 177, 178, 178, 179, 179, 179, 179, 180,
499 181, 182, 182, 183, 183, 183, 184, 184, 184, 184,
500 184, 185, 185, 185, 185, 185, 185, 185, 185, 185,
501 185, 186, 186, 187, 187, 187, 187, 187, 187, 187,
502 188, 188, 189, 190, 191, 191, 192, 193, 193, 194,
503 195, 195, 196, 196, 197, 198, 198, 199, 199, 200,
504 201, 201, 201, 202, 202, 203, 203, 204, 205, 206,
505 206, 207, 207, 207, 208, 208, 209, 209, 210, 211,
506 211, 211, 211, 211, 211, 211, 211, 211, 211, 212,
507 213, 213, 214, 214
508 };
509
510 static const short yyr2[] = { 0,
511 1, 0, 2, 2, 2, 2, 2, 2, 0, 2,
512 2, 2, 2, 2, 0, 3, 2, 1, 2, 1,
513 2, 2, 1, 2, 2, 2, 4, 3, 3, 2,
514 3, 3, 0, 1, 1, 1, 3, 1, 4, 3,
515 6, 5, 0, 3, 3, 1, 3, 4, 0, 1,
516 3, 1, 3, 4, 1, 1, 4, 4, 1, 1,
517 1, 1, 1, 4, 4, 4, 1, 4, 4, 4,
518 1, 1, 4, 4, 4, 4, 4, 1, 4, 1,
519 4, 5, 1, 1, 4, 1, 1, 1, 1, 1,
520 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
521 4, 1, 1, 4, 4, 4, 4, 1, 1, 4,
522 4, 1, 0, 1, 0, 2, 4, 3, 5, 0,
523 2, 1, 1, 3, 3, 1, 5, 1, 3, 0,
524 1, 1, 1, 1, 5, 3, 3, 3, 3, 3,
525 3, 3, 3, 2, 2, 2, 4, 4, 3, 1,
526 3, 1, 4, 0, 2, 2, 3, 2, 1, 4,
527 7, 0, 1, 0, 1, 1, 1, 1, 1, 1,
528 1, 1, 1, 1, 2, 2, 1, 1, 1, 1,
529 1, 0, 1, 1, 2, 2, 2, 2, 1, 1,
530 2, 2, 2, 4, 0, 2, 2, 2, 2, 2,
531 2, 3, 2, 3, 5, 0, 2, 2, 2, 2,
532 5, 7, 1, 2, 2, 2, 2, 2, 4, 2,
533 2, 1, 1, 3, 1, 3, 1, 1, 5, 1,
534 1, 1, 2, 1, 2, 1, 2, 1, 2, 4,
535 5, 10, 1, 3
536 };
537
538 static const short yydefact[] = { 2,
539 1, 0, 0, 0, 164, 0, 0, 0, 164, 49,
540 164, 18, 0, 8, 20, 9, 23, 9, 7, 0,
541 0, 0, 0, 0, 5, 0, 0, 213, 0, 206,
542 4, 3, 0, 6, 0, 0, 0, 231, 179, 172,
543 190, 0, 178, 164, 180, 177, 181, 182, 184, 189,
544 182, 182, 0, 182, 164, 164, 0, 230, 173, 234,
545 232, 174, 236, 0, 238, 0, 198, 199, 165, 166,
546 0, 0, 0, 208, 209, 0, 0, 50, 0, 55,
547 56, 0, 0, 59, 60, 61, 62, 63, 0, 0,
548 67, 0, 0, 71, 72, 0, 0, 0, 0, 0,
549 78, 0, 80, 0, 0, 83, 84, 0, 86, 87,
550 88, 89, 90, 91, 92, 0, 94, 95, 96, 97,
551 98, 227, 99, 100, 0, 102, 103, 0, 0, 0,
552 228, 0, 108, 109, 0, 0, 0, 52, 112, 0,
553 0, 0, 0, 0, 0, 193, 200, 210, 218, 19,
554 21, 22, 195, 215, 0, 214, 0, 0, 15, 24,
555 25, 26, 233, 235, 183, 188, 187, 186, 175, 185,
556 237, 239, 176, 167, 168, 169, 170, 171, 0, 0,
557 120, 0, 28, 154, 0, 0, 154, 0, 0, 0,
558 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
559 0, 130, 0, 130, 0, 0, 0, 0, 0, 0,
560 0, 51, 29, 14, 0, 12, 11, 10, 13, 32,
561 191, 192, 30, 216, 217, 31, 49, 0, 49, 0,
562 207, 15, 49, 0, 27, 0, 122, 123, 126, 153,
563 49, 0, 0, 0, 222, 223, 225, 240, 49, 49,
564 0, 134, 132, 133, 0, 0, 0, 0, 0, 152,
565 0, 150, 0, 0, 0, 0, 0, 0, 0, 0,
566 0, 0, 0, 0, 0, 0, 0, 128, 131, 0,
567 0, 0, 0, 0, 0, 243, 0, 0, 53, 0,
568 194, 0, 196, 201, 0, 0, 0, 49, 0, 49,
569 219, 17, 0, 0, 119, 127, 121, 0, 159, 229,
570 0, 50, 155, 0, 221, 220, 0, 0, 0, 241,
571 57, 0, 145, 146, 144, 0, 0, 0, 0, 0,
572 0, 0, 0, 0, 0, 0, 0, 58, 65, 64,
573 66, 68, 69, 70, 73, 74, 75, 76, 77, 79,
574 81, 0, 130, 85, 93, 101, 104, 105, 106, 107,
575 0, 110, 111, 54, 197, 203, 0, 202, 205, 0,
576 15, 211, 113, 16, 124, 125, 238, 158, 156, 224,
577 226, 162, 0, 149, 0, 142, 143, 136, 137, 139,
578 138, 140, 141, 0, 151, 82, 129, 244, 43, 204,
579 49, 114, 0, 157, 0, 163, 148, 147, 0, 130,
580 160, 212, 0, 115, 135, 0, 0, 46, 33, 0,
581 45, 0, 44, 230, 0, 38, 34, 36, 0, 0,
582 0, 0, 242, 116, 47, 0, 161, 0, 0, 43,
583 0, 49, 48, 37, 43, 33, 40, 49, 118, 33,
584 39, 0, 117, 0, 42, 41, 0, 0, 0
585 };
586
587 static const short yydefgoto[] = { 457,
588 1, 140, 233, 302, 15, 16, 17, 145, 18, 19,
589 425, 426, 427, 428, 411, 417, 303, 78, 137, 138,
590 403, 420, 434, 21, 236, 237, 238, 60, 277, 278,
591 260, 261, 262, 23, 241, 313, 314, 304, 405, 71,
592 245, 61, 166, 62, 146, 24, 216, 227, 293, 26,
593 27, 229, 298, 28, 158, 29, 30, 217, 218, 149,
594 33, 219, 246, 247, 248, 139, 63, 430, 36, 65,
595 287
596 };
597
598 static const short yypact[] = {-32768,
599 609, 598, -98, 138, 144, 22, 30, 172, 144, -61,
600 144,-32768, 791,-32768,-32768,-32768,-32768,-32768,-32768, 35,
601 -49, -42, -32, -14,-32768, -24, -5,-32768, 32, -3,
602 -32768,-32768, 44,-32768, 49, 59, 68,-32768,-32768,-32768,
603 -32768, 598,-32768, 185,-32768,-32768,-32768, 63,-32768,-32768,
604 63, 63, 27, 63, 220, 260, 27,-32768,-32768,-32768,
605 -32768,-32768,-32768, 17,-32768, 176,-32768,-32768,-32768,-32768,
606 69, 598, 74,-32768,-32768, 85, 598,-32768, -73,-32768,
607 -32768, 53, 76,-32768,-32768,-32768,-32768,-32768, 102, 106,
608 -32768, 115, 118,-32768,-32768, 121, 124, 134, 136, 148,
609 -32768, 157,-32768, 158, 159,-32768,-32768, 160,-32768,-32768,
610 -32768,-32768,-32768,-32768,-32768, 161,-32768,-32768,-32768,-32768,
611 -32768,-32768,-32768,-32768, 162,-32768,-32768, 165, 169, 178,
612 -32768, 180,-32768,-32768, 182, 183, -87,-32768,-32768, 505,
613 587, 271, 234, 275, 174,-32768,-32768,-32768,-32768,-32768,
614 -32768,-32768,-32768,-32768, 231,-32768, 280, 186,-32768,-32768,
615 -32768,-32768,-32768, 187,-32768,-32768,-32768,-32768,-32768,-32768,
616 187, -72,-32768,-32768,-32768,-32768,-32768,-32768, 184, 194,
617 17, 17,-32768,-32768, 267, 197,-32768, 17, 389, 329,
618 311, 313, 337, 389, 324, 330, 389, 331, 389, 17,
619 293, 389, -58, 389, 389, 598, 598, 340, 344, 598,
620 791, 213,-32768,-32768, 51,-32768,-32768,-32768,-32768,-32768,
621 -32768,-32768,-32768,-32768,-32768,-32768, 149, 212, -50, 217,
622 -32768,-32768, 634, 389,-32768, 218, 233,-32768, 215,-32768,
623 -20, -6, 267, 267,-32768,-32768,-32768, 236, -61, 129,
624 223,-32768,-32768,-32768, 225, 389, 389, 389, 477, 104,
625 -90,-32768, 226, 232, 239, 240, 242, 244, 246, 247,
626 250, 251, 254, 255, 256, 361, -64,-32768, 104, 257,
627 -62, 71, 262, 264, 265, 237, 269, 274,-32768, 791,
628 -32768, -11,-32768,-32768, 270, 598, 278, 151, 301, 676,
629 -32768,-32768, 598, 281,-32768,-32768, 17, 389,-32768,-32768,
630 598, 283,-32768, 284,-32768,-32768, 294, 267, 295,-32768,
631 -32768, 598, 276, 276, 276, 91, 298, 389, 389, 389,
632 389, 389, 389, 389, 389, 389, 389,-32768,-32768,-32768,
633 -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
634 -32768, 299, 389,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
635 407,-32768,-32768,-32768,-32768,-32768, 267,-32768,-32768, 307,
636 -32768,-32768, 341,-32768,-32768,-32768, 312,-32768,-32768,-32768,
637 -32768, 17, 309,-32768, 389, 276, 276, 245, 36, 58,
638 58, 12, 12, 297,-32768,-32768,-32768,-32768, 315,-32768,
639 684,-32768, 267,-32768, 321,-32768,-32768, 276, 389, 483,
640 -32768,-32768, 326,-32768, 104, 54, -71,-32768, 230, -2,
641 -32768, 389, 323, -55, 314,-32768, 347,-32768, 598, 267,
642 389, 334,-32768,-32768, 104, 389,-32768, 355, 267, -45,
643 352, -66, 104,-32768, -27, 230,-32768, -66,-32768, 230,
644 -32768, 335,-32768, 350,-32768,-32768, 446, 468,-32768
645 };
646
647 static const short yypgoto[] = {-32768,
648 -32768, 467, -222, 18,-32768,-32768, 191,-32768,-32768,-32768,
649 -322,-32768,-32768, 56, -395,-32768, -8, -1,-32768, -186,
650 -32768,-32768,-32768,-32768,-32768,-32768, 188, 5, 292, -336,
651 -163,-32768, -181,-32768, 316, -343, -201, 200,-32768, 29,
652 -63,-32768, 103, 78,-32768,-32768, 499,-32768,-32768, -13,
653 -32768,-32768,-32768,-32768,-32768, -12,-32768, 500, 4,-32768,
654 -32768, 501, 266, -229,-32768, 303, 10, 1,-32768, 3,
655 -32768
656 };
657
658
659 #define YYLAST 909
660
661
662 static const short yytable[] = { 20,
663 179, 77, 64, 37, 32, 22, 147, 148, 264, 300,
664 35, 268, 269, 316, 317, 272, 397, 274, 14, 174,
665 175, 328, 329, 431, 289, 242, 295, 297, 4, 337,
666 186, -165, 211, 122, 66, 432, 73, 76, 279, 79,
667 279, 282, 163, 338, 447, 328, 329, 319, 422, 451,
668 212, 131, 305, 72, 41, 353, 252, 353, 253, 254,
669 8, 187, -165, 142, -35, 309, 423, 328, 329, 354,
670 13, 356, 182, 418, 4, 13, 176, 185, -35, 142,
671 328, 329, 150, 76, 79, 48, 13, 446, 381, 151,
672 4, 410, 323, 324, 325, 326, 49, 50, 449, 152,
673 328, 329, 51, 364, 453, 450, 8, 154, 143, 410,
674 177, 309, 144, 328, 329, 310, 13, 239, 240, 243,
675 153, 52, 8, 452, 251, 54, 376, 454, 144, 155,
676 169, 178, 165, 433, 173, 157, 275, 399, 215, 215,
677 67, 68, 37, 37, 22, 22, 69, 70, 401, 35,
678 35, 255, 336, 167, 168, 395, 170, 214, 214, 332,
679 333, 334, 335, 156, 386, 387, 388, 389, 390, 391,
680 392, 393, 394, 413, 74, 75, 336, 256, 159, 257,
681 160, 258, 180, 334, 335, 188, 259, 164, 70, 279,
682 161, 421, 330, 331, 332, 333, 334, 335, 336, 162,
683 440, 147, 148, 181, 357, 183, 283, 284, 189, 445,
684 288, 336, 330, 331, 332, 333, 334, 335, 292, 184,
685 296, 408, 171, 70, 384, 330, 331, 332, 333, 334,
686 335, 336, 311, 38, 190, 37, 223, 22, 191, 312,
687 296, 311, 35, 239, 336, 415, 279, 192, 312, 39,
688 193, 40, 324, 194, 328, 329, 195, 41, 435, 327,
689 309, 42, 172, 70, 320, 13, 196, 441, 197, 174,
690 175, 43, 443, 221, 222, 44, 45, 224, 225, 46,
691 198, 47, 230, 231, 291, 13, 369, 13, 48, 199,
692 200, 201, 202, 203, 204, 365, 367, 205, 242, 49,
693 50, 206, 37, 373, 22, 51, 328, 329, 226, 35,
694 207, 367, 208, 377, 209, 210, 228, 265, 406, 266,
695 232, -165, 383, 234, 52, 53, 176, 235, 54, 249,
696 270, 252, 55, 253, 254, 263, 271, 273, 56, 252,
697 57, 253, 254, 267, 276, 424, 59, 285, 286, 290,
698 294, 299, 307, 306, 308, 318, 321, 322, 38, 339,
699 177, 328, 329, 352, 7, 340, 13, 331, 332, 333,
700 334, 335, 341, 342, 39, 343, 40, 344, 361, 345,
701 346, 178, 41, 347, 348, 336, 42, 349, 350, 351,
702 355, 252, 243, 253, 254, 358, 43, 359, 360, 244,
703 44, 45, 362, 37, 46, 22, 47, 363, 366, 368,
704 35, 398, 374, 48, 378, 379, 336, 429, 330, 331,
705 332, 333, 334, 335, 49, 50, 255, 380, 382, 439,
706 51, 385, 396, 311, 255, 409, 429, 336, 400, 311,
707 312, 402, 407, 404, 429, 458, 312, 437, 429, 52,
708 53, 410, 256, 54, 257, 414, 258, 55, 419, 436,
709 256, 259, 257, 56, 258, 57, 438, 459, 455, 259,
710 58, 59, 442, 330, 331, 332, 333, 334, 335, 252,
711 38, 253, 254, 456, 141, 252, 255, 253, 254, 371,
712 448, 13, 336, 444, 375, 281, 39, 370, 40, 25,
713 31, 34, 250, 0, 41, 280, 0, 315, 42, 0,
714 0, 0, 256, 213, 257, 0, 258, 0, 43, 0,
715 0, 259, 44, 45, 0, 0, 46, 0, 47, 0,
716 0, 0, 0, 0, 0, 48, 2, 0, 0, 0,
717 0, 3, 0, 0, 4, 0, 49, 50, 0, 0,
718 5, 0, 51, 6, 0, 0, 0, 0, 0, 0,
719 0, 0, 0, 0, 0, 0, 0, 0, 7, 0,
720 0, 52, 53, 0, 255, 54, 8, 0, 0, 55,
721 255, 0, 0, 0, 0, 56, 0, 57, 0, 0,
722 0, 0, 58, 59, 0, 0, 0, 0, 0, 0,
723 256, 38, 257, 0, 258, 0, 256, 9, 416, 259,
724 258, 0, 10, 11, 0, 259, 0, 39, 2, 40,
725 0, 0, 0, 3, 0, 41, 4, 0, 0, 42,
726 0, 0, 5, 0, 0, 6, 12, 0, 0, 43,
727 2, 13, 0, 44, 45, 3, 0, 46, 4, 47,
728 7, 0, 0, 0, 5, 0, 48, 6, 8, 0,
729 0, 0, 0, 0, 0, 2, 0, 49, 50, 0,
730 3, 0, 7, 51, 0, 0, 0, 0, 0, 5,
731 8, 0, 6, 0, 0, 0, 0, 0, 0, 9,
732 0, 0, 52, 53, 10, 11, 54, 7, 0, 0,
733 55, 0, 0, 0, 0, 0, 56, 2, 57, 0,
734 0, 9, 3, 58, 59, 2, 10, 11, 12, 0,
735 3, 5, 220, 13, 6, 0, 0, 0, 0, 5,
736 0, 0, 6, 0, 0, 0, 9, 0, 0, 7,
737 12, 10, 11, 0, 0, 13, 0, 7, 0, 0,
738 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
739 0, 0, 0, 0, 0, 12, 0, 0, 0, 301,
740 13, 0, 0, 0, 0, 0, 0, 0, 9, 0,
741 0, 0, 0, 10, 11, 0, 9, 0, 0, 0,
742 0, 10, 11, 0, 0, 0, 0, 0, 0, 0,
743 0, 0, 0, 0, 0, 0, 80, 12, 81, 0,
744 0, 372, 13, 0, 82, 12, 83, 0, 0, 412,
745 13, 0, 0, 84, 85, 86, 87, 0, 88, 89,
746 0, 90, 0, 91, 92, 93, 0, 0, 94, 0,
747 0, 95, 0, 96, 97, 98, 99, 100, 101, 0,
748 102, 103, 104, 105, 0, 0, 106, 0, 0, 107,
749 0, 0, 0, 108, 0, 109, 0, 0, 0, 110,
750 111, 112, 113, 114, 115, 116, 0, 117, 118, 119,
751 120, 121, 122, 123, 124, 0, 0, 125, 0, 0,
752 126, 0, 127, 0, 0, 128, 129, 130, 0, 0,
753 131, 0, 132, 133, 134, 135, 0, 0, 136
754 };
755
756 static const short yycheck[] = { 1,
757 64, 10, 2, 1, 1, 1, 20, 20, 190, 232,
758 1, 193, 194, 243, 244, 197, 353, 199, 1, 3,
759 4, 10, 11, 26, 211, 32, 77, 229, 40, 120,
760 104, 104, 120, 92, 133, 38, 7, 9, 202, 11,
761 204, 205, 42, 134, 440, 10, 11, 249, 120, 445,
762 138, 110, 234, 32, 28, 120, 3, 120, 5, 6,
763 72, 135, 135, 29, 120, 132, 138, 10, 11, 134,
764 137, 134, 72, 410, 40, 137, 60, 77, 134, 29,
765 10, 11, 132, 55, 56, 59, 137, 133, 318, 132,
766 40, 137, 256, 257, 258, 259, 70, 71, 442, 132,
767 10, 11, 76, 290, 448, 133, 72, 132, 74, 137,
768 94, 132, 78, 10, 11, 136, 137, 181, 182, 126,
769 135, 95, 72, 446, 188, 99, 308, 450, 78, 135,
770 53, 115, 70, 136, 57, 139, 200, 367, 140, 141,
771 3, 4, 140, 141, 140, 141, 3, 4, 371, 140,
772 141, 98, 141, 51, 52, 337, 54, 140, 141, 124,
773 125, 126, 127, 132, 328, 329, 330, 331, 332, 333,
774 334, 335, 336, 403, 3, 4, 141, 124, 135, 126,
775 132, 128, 7, 126, 127, 133, 133, 3, 4, 353,
776 132, 138, 122, 123, 124, 125, 126, 127, 141, 132,
777 430, 215, 215, 135, 134, 132, 206, 207, 133, 439,
778 210, 141, 122, 123, 124, 125, 126, 127, 227, 135,
779 229, 385, 3, 4, 134, 122, 123, 124, 125, 126,
780 127, 141, 241, 4, 133, 233, 3, 233, 133, 241,
781 249, 250, 233, 307, 141, 409, 410, 133, 250, 20,
782 133, 22, 416, 133, 10, 11, 133, 28, 422, 259,
783 132, 32, 3, 4, 136, 137, 133, 431, 133, 3,
784 4, 42, 436, 3, 4, 46, 47, 3, 4, 50,
785 133, 52, 3, 4, 136, 137, 136, 137, 59, 133,
786 133, 133, 133, 133, 133, 292, 296, 133, 32, 70,
787 71, 133, 300, 303, 300, 76, 10, 11, 135, 300,
788 133, 311, 133, 311, 133, 133, 86, 7, 382, 7,
789 135, 135, 322, 140, 95, 96, 60, 134, 99, 133,
790 7, 3, 103, 5, 6, 7, 7, 7, 109, 3,
791 111, 5, 6, 7, 52, 116, 117, 8, 5, 137,
792 139, 135, 120, 136, 140, 120, 134, 133, 4, 134,
793 94, 10, 11, 3, 64, 134, 137, 123, 124, 125,
794 126, 127, 134, 134, 20, 134, 22, 134, 142, 134,
795 134, 115, 28, 134, 134, 141, 32, 134, 134, 134,
796 134, 3, 126, 5, 6, 134, 42, 134, 134, 133,
797 46, 47, 134, 401, 50, 401, 52, 134, 139, 132,
798 401, 5, 132, 59, 132, 132, 141, 419, 122, 123,
799 124, 125, 126, 127, 70, 71, 98, 134, 134, 429,
800 76, 134, 134, 442, 98, 139, 438, 141, 132, 448,
801 442, 101, 134, 132, 446, 0, 448, 134, 450, 95,
802 96, 137, 124, 99, 126, 135, 128, 103, 133, 137,
803 124, 133, 126, 109, 128, 111, 120, 0, 134, 133,
804 116, 117, 139, 122, 123, 124, 125, 126, 127, 3,
805 4, 5, 6, 134, 18, 3, 98, 5, 6, 299,
806 139, 137, 141, 438, 307, 204, 20, 298, 22, 1,
807 1, 1, 187, -1, 28, 203, -1, 242, 32, -1,
808 -1, -1, 124, 9, 126, -1, 128, -1, 42, -1,
809 -1, 133, 46, 47, -1, -1, 50, -1, 52, -1,
810 -1, -1, -1, -1, -1, 59, 32, -1, -1, -1,
811 -1, 37, -1, -1, 40, -1, 70, 71, -1, -1,
812 46, -1, 76, 49, -1, -1, -1, -1, -1, -1,
813 -1, -1, -1, -1, -1, -1, -1, -1, 64, -1,
814 -1, 95, 96, -1, 98, 99, 72, -1, -1, 103,
815 98, -1, -1, -1, -1, 109, -1, 111, -1, -1,
816 -1, -1, 116, 117, -1, -1, -1, -1, -1, -1,
817 124, 4, 126, -1, 128, -1, 124, 103, 126, 133,
818 128, -1, 108, 109, -1, 133, -1, 20, 32, 22,
819 -1, -1, -1, 37, -1, 28, 40, -1, -1, 32,
820 -1, -1, 46, -1, -1, 49, 132, -1, -1, 42,
821 32, 137, -1, 46, 47, 37, -1, 50, 40, 52,
822 64, -1, -1, -1, 46, -1, 59, 49, 72, -1,
823 -1, -1, -1, -1, -1, 32, -1, 70, 71, -1,
824 37, -1, 64, 76, -1, -1, -1, -1, -1, 46,
825 72, -1, 49, -1, -1, -1, -1, -1, -1, 103,
826 -1, -1, 95, 96, 108, 109, 99, 64, -1, -1,
827 103, -1, -1, -1, -1, -1, 109, 32, 111, -1,
828 -1, 103, 37, 116, 117, 32, 108, 109, 132, -1,
829 37, 46, 136, 137, 49, -1, -1, -1, -1, 46,
830 -1, -1, 49, -1, -1, -1, 103, -1, -1, 64,
831 132, 108, 109, -1, -1, 137, -1, 64, -1, -1,
832 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
833 -1, -1, -1, -1, -1, 132, -1, -1, -1, 136,
834 137, -1, -1, -1, -1, -1, -1, -1, 103, -1,
835 -1, -1, -1, 108, 109, -1, 103, -1, -1, -1,
836 -1, 108, 109, -1, -1, -1, -1, -1, -1, -1,
837 -1, -1, -1, -1, -1, -1, 16, 132, 18, -1,
838 -1, 136, 137, -1, 24, 132, 26, -1, -1, 136,
839 137, -1, -1, 33, 34, 35, 36, -1, 38, 39,
840 -1, 41, -1, 43, 44, 45, -1, -1, 48, -1,
841 -1, 51, -1, 53, 54, 55, 56, 57, 58, -1,
842 60, 61, 62, 63, -1, -1, 66, -1, -1, 69,
843 -1, -1, -1, 73, -1, 75, -1, -1, -1, 79,
844 80, 81, 82, 83, 84, 85, -1, 87, 88, 89,
845 90, 91, 92, 93, 94, -1, -1, 97, -1, -1,
846 100, -1, 102, -1, -1, 105, 106, 107, -1, -1,
847 110, -1, 112, 113, 114, 115, -1, -1, 118
848 };
849 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
850 #line 3 "/usr/share/bison.simple"
851 /* This file comes from bison-1.28. */
852
853 /* Skeleton output parser for bison,
854 Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
855
856 This program is free software; you can redistribute it and/or modify
857 it under the terms of the GNU General Public License as published by
858 the Free Software Foundation; either version 2, or (at your option)
859 any later version.
860
861 This program is distributed in the hope that it will be useful,
862 but WITHOUT ANY WARRANTY; without even the implied warranty of
863 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
864 GNU General Public License for more details.
865
866 You should have received a copy of the GNU General Public License
867 along with this program; if not, write to the Free Software
868 Foundation, Inc., 59 Temple Place - Suite 330,
869 Boston, MA 02111-1307, USA. */
870
871 /* As a special exception, when this file is copied by Bison into a
872 Bison output file, you may use that output file without restriction.
873 This special exception was added by the Free Software Foundation
874 in version 1.24 of Bison. */
875
876 /* This is the parser code that is written into each bison parser
877 when the %semantic_parser declaration is not specified in the grammar.
878 It was written by Richard Stallman by simplifying the hairy parser
879 used when %semantic_parser is specified. */
880
881 #ifndef YYSTACK_USE_ALLOCA
882 #ifdef alloca
883 #define YYSTACK_USE_ALLOCA
884 #else /* alloca not defined */
885 #ifdef __GNUC__
886 #define YYSTACK_USE_ALLOCA
887 #define alloca __builtin_alloca
888 #else /* not GNU C. */
889 #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
890 #define YYSTACK_USE_ALLOCA
891 #include <alloca.h>
892 #else /* not sparc */
893 /* We think this test detects Watcom and Microsoft C. */
894 /* This used to test MSDOS, but that is a bad idea
895 since that symbol is in the user namespace. */
896 #if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
897 #if 0 /* No need for malloc.h, which pollutes the namespace;
898 instead, just don't use alloca. */
899 #include <malloc.h>
900 #endif
901 #else /* not MSDOS, or __TURBOC__ */
902 #if defined(_AIX)
903 /* I don't know what this was needed for, but it pollutes the namespace.
904 So I turned it off. rms, 2 May 1997. */
905 /* #include <malloc.h> */
906 #pragma alloca
907 #define YYSTACK_USE_ALLOCA
908 #else /* not MSDOS, or __TURBOC__, or _AIX */
909 #if 0
910 #ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
911 and on HPUX 10. Eventually we can turn this on. */
912 #define YYSTACK_USE_ALLOCA
913 #define alloca __builtin_alloca
914 #endif /* __hpux */
915 #endif
916 #endif /* not _AIX */
917 #endif /* not MSDOS, or __TURBOC__ */
918 #endif /* not sparc */
919 #endif /* not GNU C */
920 #endif /* alloca not defined */
921 #endif /* YYSTACK_USE_ALLOCA not defined */
922
923 #ifdef YYSTACK_USE_ALLOCA
924 #define YYSTACK_ALLOC alloca
925 #else
926 #define YYSTACK_ALLOC malloc
927 #endif
928
929 /* Note: there must be only one dollar sign in this file.
930 It is replaced by the list of actions, each action
931 as one case of the switch. */
932
933 #define yyerrok (yyerrstatus = 0)
934 #define yyclearin (yychar = YYEMPTY)
935 #define YYEMPTY -2
936 #define YYEOF 0
937 #define YYACCEPT goto yyacceptlab
938 #define YYABORT goto yyabortlab
939 #define YYERROR goto yyerrlab1
940 /* Like YYERROR except do call yyerror.
941 This remains here temporarily to ease the
942 transition to the new meaning of YYERROR, for GCC.
943 Once GCC version 2 has supplanted version 1, this can go. */
944 #define YYFAIL goto yyerrlab
945 #define YYRECOVERING() (!!yyerrstatus)
946 #define YYBACKUP(token, value) \
947 do \
948 if (yychar == YYEMPTY && yylen == 1) \
949 { yychar = (token), yylval = (value); \
950 yychar1 = YYTRANSLATE (yychar); \
951 YYPOPSTACK; \
952 goto yybackup; \
953 } \
954 else \
955 { yyerror ("syntax error: cannot back up"); YYERROR; } \
956 while (0)
957
958 #define YYTERROR 1
959 #define YYERRCODE 256
960
961 #ifndef YYPURE
962 #define YYLEX yylex()
963 #endif
964
965 #ifdef YYPURE
966 #ifdef YYLSP_NEEDED
967 #ifdef YYLEX_PARAM
968 #define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
969 #else
970 #define YYLEX yylex(&yylval, &yylloc)
971 #endif
972 #else /* not YYLSP_NEEDED */
973 #ifdef YYLEX_PARAM
974 #define YYLEX yylex(&yylval, YYLEX_PARAM)
975 #else
976 #define YYLEX yylex(&yylval)
977 #endif
978 #endif /* not YYLSP_NEEDED */
979 #endif
980
981 /* If nonreentrant, generate the variables here */
982
983 #ifndef YYPURE
984
985 int yychar; /* the lookahead symbol */
986 YYSTYPE yylval; /* the semantic value of the */
987 /* lookahead symbol */
988
989 #ifdef YYLSP_NEEDED
990 YYLTYPE yylloc; /* location data for the lookahead */
991 /* symbol */
992 #endif
993
994 int yynerrs; /* number of parse errors so far */
995 #endif /* not YYPURE */
996
997 #if YYDEBUG != 0
998 int yydebug; /* nonzero means print parse trace */
999 /* Since this is uninitialized, it does not stop multiple parsers
1000 from coexisting. */
1001 #endif
1002
1003 /* YYINITDEPTH indicates the initial size of the parser's stacks */
1004
1005 #ifndef YYINITDEPTH
1006 #define YYINITDEPTH 200
1007 #endif
1008
1009 /* YYMAXDEPTH is the maximum size the stacks can grow to
1010 (effective only if the built-in stack extension method is used). */
1011
1012 #if YYMAXDEPTH == 0
1013 #undef YYMAXDEPTH
1014 #endif
1015
1016 #ifndef YYMAXDEPTH
1017 #define YYMAXDEPTH 10000
1018 #endif
1019 \f
1020 /* Define __yy_memcpy. Note that the size argument
1021 should be passed with type unsigned int, because that is what the non-GCC
1022 definitions require. With GCC, __builtin_memcpy takes an arg
1023 of type size_t, but it can handle unsigned int. */
1024
1025 #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
1026 #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
1027 #else /* not GNU C or C++ */
1028 #ifndef __cplusplus
1029
1030 /* This is the most reliable way to avoid incompatibilities
1031 in available built-in functions on various systems. */
1032 static void
1033 __yy_memcpy (to, from, count)
1034 char *to;
1035 char *from;
1036 unsigned int count;
1037 {
1038 register char *f = from;
1039 register char *t = to;
1040 register int i = count;
1041
1042 while (i-- > 0)
1043 *t++ = *f++;
1044 }
1045
1046 #else /* __cplusplus */
1047
1048 /* This is the most reliable way to avoid incompatibilities
1049 in available built-in functions on various systems. */
1050 static void
1051 __yy_memcpy (char *to, char *from, unsigned int count)
1052 {
1053 register char *t = to;
1054 register char *f = from;
1055 register int i = count;
1056
1057 while (i-- > 0)
1058 *t++ = *f++;
1059 }
1060
1061 #endif
1062 #endif
1063 \f
1064 #line 217 "/usr/share/bison.simple"
1065
1066 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
1067 into yyparse. The argument should have type void *.
1068 It should actually point to an object.
1069 Grammar actions can access the variable by casting it
1070 to the proper pointer type. */
1071
1072 #ifdef YYPARSE_PARAM
1073 #ifdef __cplusplus
1074 #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
1075 #define YYPARSE_PARAM_DECL
1076 #else /* not __cplusplus */
1077 #define YYPARSE_PARAM_ARG YYPARSE_PARAM
1078 #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
1079 #endif /* not __cplusplus */
1080 #else /* not YYPARSE_PARAM */
1081 #define YYPARSE_PARAM_ARG
1082 #define YYPARSE_PARAM_DECL
1083 #endif /* not YYPARSE_PARAM */
1084
1085 /* Prevent warning if -Wstrict-prototypes. */
1086 #ifdef __GNUC__
1087 #ifdef YYPARSE_PARAM
1088 int yyparse (void *);
1089 #else
1090 int yyparse (void);
1091 #endif
1092 #endif
1093
1094 int
1095 yyparse(YYPARSE_PARAM_ARG)
1096 YYPARSE_PARAM_DECL
1097 {
1098 register int yystate;
1099 register int yyn;
1100 register short *yyssp;
1101 register YYSTYPE *yyvsp;
1102 int yyerrstatus; /* number of tokens to shift before error messages enabled */
1103 int yychar1 = 0; /* lookahead token as an internal (translated) token number */
1104
1105 short yyssa[YYINITDEPTH]; /* the state stack */
1106 YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
1107
1108 short *yyss = yyssa; /* refer to the stacks thru separate pointers */
1109 YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
1110
1111 #ifdef YYLSP_NEEDED
1112 YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
1113 YYLTYPE *yyls = yylsa;
1114 YYLTYPE *yylsp;
1115
1116 #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
1117 #else
1118 #define YYPOPSTACK (yyvsp--, yyssp--)
1119 #endif
1120
1121 int yystacksize = YYINITDEPTH;
1122 int yyfree_stacks = 0;
1123
1124 #ifdef YYPURE
1125 int yychar;
1126 YYSTYPE yylval;
1127 int yynerrs;
1128 #ifdef YYLSP_NEEDED
1129 YYLTYPE yylloc;
1130 #endif
1131 #endif
1132
1133 YYSTYPE yyval; /* the variable used to return */
1134 /* semantic values from the action */
1135 /* routines */
1136
1137 int yylen;
1138
1139 #if YYDEBUG != 0
1140 if (yydebug)
1141 fprintf(stderr, "Starting parse\n");
1142 #endif
1143
1144 yystate = 0;
1145 yyerrstatus = 0;
1146 yynerrs = 0;
1147 yychar = YYEMPTY; /* Cause a token to be read. */
1148
1149 /* Initialize stack pointers.
1150 Waste one element of value and location stack
1151 so that they stay on the same level as the state stack.
1152 The wasted elements are never initialized. */
1153
1154 yyssp = yyss - 1;
1155 yyvsp = yyvs;
1156 #ifdef YYLSP_NEEDED
1157 yylsp = yyls;
1158 #endif
1159
1160 /* Push a new state, which is found in yystate . */
1161 /* In all cases, when you get here, the value and location stacks
1162 have just been pushed. so pushing a state here evens the stacks. */
1163 yynewstate:
1164
1165 *++yyssp = yystate;
1166
1167 if (yyssp >= yyss + yystacksize - 1)
1168 {
1169 /* Give user a chance to reallocate the stack */
1170 /* Use copies of these so that the &'s don't force the real ones into memory. */
1171 YYSTYPE *yyvs1 = yyvs;
1172 short *yyss1 = yyss;
1173 #ifdef YYLSP_NEEDED
1174 YYLTYPE *yyls1 = yyls;
1175 #endif
1176
1177 /* Get the current used size of the three stacks, in elements. */
1178 int size = yyssp - yyss + 1;
1179
1180 #ifdef yyoverflow
1181 /* Each stack pointer address is followed by the size of
1182 the data in use in that stack, in bytes. */
1183 #ifdef YYLSP_NEEDED
1184 /* This used to be a conditional around just the two extra args,
1185 but that might be undefined if yyoverflow is a macro. */
1186 yyoverflow("parser stack overflow",
1187 &yyss1, size * sizeof (*yyssp),
1188 &yyvs1, size * sizeof (*yyvsp),
1189 &yyls1, size * sizeof (*yylsp),
1190 &yystacksize);
1191 #else
1192 yyoverflow("parser stack overflow",
1193 &yyss1, size * sizeof (*yyssp),
1194 &yyvs1, size * sizeof (*yyvsp),
1195 &yystacksize);
1196 #endif
1197
1198 yyss = yyss1; yyvs = yyvs1;
1199 #ifdef YYLSP_NEEDED
1200 yyls = yyls1;
1201 #endif
1202 #else /* no yyoverflow */
1203 /* Extend the stack our own way. */
1204 if (yystacksize >= YYMAXDEPTH)
1205 {
1206 yyerror("parser stack overflow");
1207 if (yyfree_stacks)
1208 {
1209 free (yyss);
1210 free (yyvs);
1211 #ifdef YYLSP_NEEDED
1212 free (yyls);
1213 #endif
1214 }
1215 return 2;
1216 }
1217 yystacksize *= 2;
1218 if (yystacksize > YYMAXDEPTH)
1219 yystacksize = YYMAXDEPTH;
1220 #ifndef YYSTACK_USE_ALLOCA
1221 yyfree_stacks = 1;
1222 #endif
1223 yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
1224 __yy_memcpy ((char *)yyss, (char *)yyss1,
1225 size * (unsigned int) sizeof (*yyssp));
1226 yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
1227 __yy_memcpy ((char *)yyvs, (char *)yyvs1,
1228 size * (unsigned int) sizeof (*yyvsp));
1229 #ifdef YYLSP_NEEDED
1230 yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
1231 __yy_memcpy ((char *)yyls, (char *)yyls1,
1232 size * (unsigned int) sizeof (*yylsp));
1233 #endif
1234 #endif /* no yyoverflow */
1235
1236 yyssp = yyss + size - 1;
1237 yyvsp = yyvs + size - 1;
1238 #ifdef YYLSP_NEEDED
1239 yylsp = yyls + size - 1;
1240 #endif
1241
1242 #if YYDEBUG != 0
1243 if (yydebug)
1244 fprintf(stderr, "Stack size increased to %d\n", yystacksize);
1245 #endif
1246
1247 if (yyssp >= yyss + yystacksize - 1)
1248 YYABORT;
1249 }
1250
1251 #if YYDEBUG != 0
1252 if (yydebug)
1253 fprintf(stderr, "Entering state %d\n", yystate);
1254 #endif
1255
1256 goto yybackup;
1257 yybackup:
1258
1259 /* Do appropriate processing given the current state. */
1260 /* Read a lookahead token if we need one and don't already have one. */
1261 /* yyresume: */
1262
1263 /* First try to decide what to do without reference to lookahead token. */
1264
1265 yyn = yypact[yystate];
1266 if (yyn == YYFLAG)
1267 goto yydefault;
1268
1269 /* Not known => get a lookahead token if don't already have one. */
1270
1271 /* yychar is either YYEMPTY or YYEOF
1272 or a valid token in external form. */
1273
1274 if (yychar == YYEMPTY)
1275 {
1276 #if YYDEBUG != 0
1277 if (yydebug)
1278 fprintf(stderr, "Reading a token: ");
1279 #endif
1280 yychar = YYLEX;
1281 }
1282
1283 /* Convert token to internal form (in yychar1) for indexing tables with */
1284
1285 if (yychar <= 0) /* This means end of input. */
1286 {
1287 yychar1 = 0;
1288 yychar = YYEOF; /* Don't call YYLEX any more */
1289
1290 #if YYDEBUG != 0
1291 if (yydebug)
1292 fprintf(stderr, "Now at end of input.\n");
1293 #endif
1294 }
1295 else
1296 {
1297 yychar1 = YYTRANSLATE(yychar);
1298
1299 #if YYDEBUG != 0
1300 if (yydebug)
1301 {
1302 fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
1303 /* Give the individual parser a way to print the precise meaning
1304 of a token, for further debugging info. */
1305 #ifdef YYPRINT
1306 YYPRINT (stderr, yychar, yylval);
1307 #endif
1308 fprintf (stderr, ")\n");
1309 }
1310 #endif
1311 }
1312
1313 yyn += yychar1;
1314 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
1315 goto yydefault;
1316
1317 yyn = yytable[yyn];
1318
1319 /* yyn is what to do for this token type in this state.
1320 Negative => reduce, -yyn is rule number.
1321 Positive => shift, yyn is new state.
1322 New state is final state => don't bother to shift,
1323 just return success.
1324 0, or most negative number => error. */
1325
1326 if (yyn < 0)
1327 {
1328 if (yyn == YYFLAG)
1329 goto yyerrlab;
1330 yyn = -yyn;
1331 goto yyreduce;
1332 }
1333 else if (yyn == 0)
1334 goto yyerrlab;
1335
1336 if (yyn == YYFINAL)
1337 YYACCEPT;
1338
1339 /* Shift the lookahead token. */
1340
1341 #if YYDEBUG != 0
1342 if (yydebug)
1343 fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
1344 #endif
1345
1346 /* Discard the token being shifted unless it is eof. */
1347 if (yychar != YYEOF)
1348 yychar = YYEMPTY;
1349
1350 *++yyvsp = yylval;
1351 #ifdef YYLSP_NEEDED
1352 *++yylsp = yylloc;
1353 #endif
1354
1355 /* count tokens shifted since error; after three, turn off error status. */
1356 if (yyerrstatus) yyerrstatus--;
1357
1358 yystate = yyn;
1359 goto yynewstate;
1360
1361 /* Do the default action for the current state. */
1362 yydefault:
1363
1364 yyn = yydefact[yystate];
1365 if (yyn == 0)
1366 goto yyerrlab;
1367
1368 /* Do a reduction. yyn is the number of a rule to reduce with. */
1369 yyreduce:
1370 yylen = yyr2[yyn];
1371 if (yylen > 0)
1372 yyval = yyvsp[1-yylen]; /* implement default value of the action */
1373
1374 #if YYDEBUG != 0
1375 if (yydebug)
1376 {
1377 int i;
1378
1379 fprintf (stderr, "Reducing via rule %d (line %d), ",
1380 yyn, yyrline[yyn]);
1381
1382 /* Print the symbols being reduced, and their result. */
1383 for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
1384 fprintf (stderr, "%s ", yytname[yyrhs[i]]);
1385 fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
1386 }
1387 #endif
1388
1389
1390 switch (yyn) {
1391
1392 case 1:
1393 #line 229 "parser.y"
1394 { write_proxies(yyvsp[0].ifref); write_client(yyvsp[0].ifref); write_server(yyvsp[0].ifref); ;
1395 break;}
1396 case 2:
1397 #line 232 "parser.y"
1398 { yyval.ifref = NULL; ;
1399 break;}
1400 case 3:
1401 #line 233 "parser.y"
1402 { yyval.ifref = yyvsp[-1].ifref; ;
1403 break;}
1404 case 4:
1405 #line 234 "parser.y"
1406 { yyval.ifref = make_ifref(yyvsp[0].type); LINK(yyval.ifref, yyvsp[-1].ifref); ;
1407 break;}
1408 case 5:
1409 #line 235 "parser.y"
1410 { yyval.ifref = yyvsp[-1].ifref; add_coclass(yyvsp[0].clas); ;
1411 break;}
1412 case 6:
1413 #line 236 "parser.y"
1414 { yyval.ifref = yyvsp[-1].ifref; add_module(yyvsp[0].type); ;
1415 break;}
1416 case 7:
1417 #line 237 "parser.y"
1418 { yyval.ifref = yyvsp[-1].ifref; ;
1419 break;}
1420 case 8:
1421 #line 238 "parser.y"
1422 { yyval.ifref = yyvsp[-1].ifref; ;
1423 break;}
1424 case 9:
1425 #line 241 "parser.y"
1426 {;
1427 break;}
1428 case 10:
1429 #line 242 "parser.y"
1430 { if (!parse_only) add_interface(yyvsp[0].type); ;
1431 break;}
1432 case 11:
1433 #line 243 "parser.y"
1434 { if (!parse_only) add_interface(yyvsp[0].type); ;
1435 break;}
1436 case 12:
1437 #line 244 "parser.y"
1438 { if (!parse_only) add_coclass(yyvsp[0].clas); ;
1439 break;}
1440 case 13:
1441 #line 245 "parser.y"
1442 { if (!parse_only) add_module(yyvsp[0].type); ;
1443 break;}
1444 case 14:
1445 #line 246 "parser.y"
1446 {;
1447 break;}
1448 case 15:
1449 #line 249 "parser.y"
1450 { yyval.func = NULL; ;
1451 break;}
1452 case 16:
1453 #line 250 "parser.y"
1454 { yyval.func = yyvsp[-1].func; LINK(yyval.func, yyvsp[-2].func); ;
1455 break;}
1456 case 17:
1457 #line 251 "parser.y"
1458 { yyval.func = yyvsp[-1].func; ;
1459 break;}
1460 case 18:
1461 #line 254 "parser.y"
1462 {;
1463 break;}
1464 case 19:
1465 #line 255 "parser.y"
1466 { if (!parse_only && do_header) { write_constdef(yyvsp[-1].var); } ;
1467 break;}
1468 case 20:
1469 #line 256 "parser.y"
1470 {;
1471 break;}
1472 case 21:
1473 #line 257 "parser.y"
1474 { if (!parse_only && do_header) { write_type(header, yyvsp[-1].type, NULL, NULL); fprintf(header, ";\n\n"); } ;
1475 break;}
1476 case 22:
1477 #line 258 "parser.y"
1478 { if (!parse_only && do_header) { write_externdef(yyvsp[-1].var); } ;
1479 break;}
1480 case 23:
1481 #line 259 "parser.y"
1482 {;
1483 break;}
1484 case 24:
1485 #line 260 "parser.y"
1486 { if (!parse_only && do_header) { write_type(header, yyvsp[-1].type, NULL, NULL); fprintf(header, ";\n\n"); } ;
1487 break;}
1488 case 25:
1489 #line 261 "parser.y"
1490 {;
1491 break;}
1492 case 26:
1493 #line 262 "parser.y"
1494 { if (!parse_only && do_header) { write_type(header, yyvsp[-1].type, NULL, NULL); fprintf(header, ";\n\n"); } ;
1495 break;}
1496 case 27:
1497 #line 265 "parser.y"
1498 { if (!parse_only && do_header) fprintf(header, "%s\n", yyvsp[-1].str); ;
1499 break;}
1500 case 28:
1501 #line 267 "parser.y"
1502 { assert(yychar == YYEMPTY);
1503 if (!do_import(yyvsp[-1].str)) yychar = aEOF; ;
1504 break;}
1505 case 29:
1506 #line 270 "parser.y"
1507 {;
1508 break;}
1509 case 30:
1510 #line 273 "parser.y"
1511 { yyval.str = yyvsp[0].str; ;
1512 break;}
1513 case 31:
1514 #line 275 "parser.y"
1515 { start_typelib(yyvsp[-1].str, yyvsp[-2].attr); ;
1516 break;}
1517 case 32:
1518 #line 277 "parser.y"
1519 { end_typelib(); ;
1520 break;}
1521 case 33:
1522 #line 280 "parser.y"
1523 { yyval.var = NULL; ;
1524 break;}
1525 case 35:
1526 #line 284 "parser.y"
1527 { yyval.var = NULL; ;
1528 break;}
1529 case 37:
1530 #line 288 "parser.y"
1531 { LINK(yyvsp[0].var, yyvsp[-2].var); yyval.var = yyvsp[0].var; ;
1532 break;}
1533 case 39:
1534 #line 293 "parser.y"
1535 { yyval.var = yyvsp[-1].var;
1536 set_type(yyval.var, yyvsp[-2].tref, yyvsp[0].expr);
1537 yyval.var->attrs = yyvsp[-3].attr;
1538 ;
1539 break;}
1540 case 40:
1541 #line 297 "parser.y"
1542 { yyval.var = yyvsp[-1].var;
1543 set_type(yyval.var, yyvsp[-2].tref, yyvsp[0].expr);
1544 ;
1545 break;}
1546 case 41:
1547 #line 300 "parser.y"
1548 { yyval.var = yyvsp[-3].var;
1549 yyval.var->ptr_level--;
1550 set_type(yyval.var, yyvsp[-4].tref, NULL);
1551 yyval.var->attrs = yyvsp[-5].attr;
1552 yyval.var->args = yyvsp[-1].var;
1553 ;
1554 break;}
1555 case 42:
1556 #line 306 "parser.y"
1557 { yyval.var = yyvsp[-3].var;
1558 yyval.var->ptr_level--;
1559 set_type(yyval.var, yyvsp[-4].tref, NULL);
1560 yyval.var->args = yyvsp[-1].var;
1561 ;
1562 break;}
1563 case 43:
1564 #line 313 "parser.y"
1565 { yyval.expr = NULL; ;
1566 break;}
1567 case 44:
1568 #line 314 "parser.y"
1569 { yyval.expr = yyvsp[-1].expr; ;
1570 break;}
1571 case 45:
1572 #line 315 "parser.y"
1573 { yyval.expr = make_expr(EXPR_VOID); ;
1574 break;}
1575 case 47:
1576 #line 319 "parser.y"
1577 { LINK(yyvsp[0].expr, yyvsp[-2].expr); yyval.expr = yyvsp[0].expr; ;
1578 break;}
1579 case 48:
1580 #line 320 "parser.y"
1581 { LINK(yyvsp[0].expr, yyvsp[-3].expr); yyval.expr = yyvsp[0].expr; ;
1582 break;}
1583 case 49:
1584 #line 323 "parser.y"
1585 { yyval.attr = NULL; ;
1586 break;}
1587 case 51:
1588 #line 328 "parser.y"
1589 { yyval.attr = yyvsp[-1].attr; ;
1590 break;}
1591 case 53:
1592 #line 332 "parser.y"
1593 { LINK(yyvsp[0].attr, yyvsp[-2].attr); yyval.attr = yyvsp[0].attr; ;
1594 break;}
1595 case 54:
1596 #line 333 "parser.y"
1597 { LINK(yyvsp[0].attr, yyvsp[-3].attr); yyval.attr = yyvsp[0].attr; ;
1598 break;}
1599 case 55:
1600 #line 337 "parser.y"
1601 { yyval.attr = make_attr(ATTR_ASYNC); ;
1602 break;}
1603 case 56:
1604 #line 338 "parser.y"
1605 { yyval.attr = make_attr(ATTR_AUTO_HANDLE); ;
1606 break;}
1607 case 57:
1608 #line 339 "parser.y"
1609 { yyval.attr = make_attrp(ATTR_CALLAS, yyvsp[-1].var); ;
1610 break;}
1611 case 58:
1612 #line 340 "parser.y"
1613 { yyval.attr = make_attrp(ATTR_CASE, yyvsp[-1].expr); ;
1614 break;}
1615 case 59:
1616 #line 341 "parser.y"
1617 { yyval.attr = make_attrv(ATTR_CONTEXTHANDLE, 0); ;
1618 break;}
1619 case 60:
1620 #line 342 "parser.y"
1621 { yyval.attr = make_attrv(ATTR_CONTEXTHANDLE, 0); /* RPC_CONTEXT_HANDLE_DONT_SERIALIZE */ ;
1622 break;}
1623 case 61:
1624 #line 343 "parser.y"
1625 { yyval.attr = make_attrv(ATTR_CONTEXTHANDLE, 0); /* RPC_CONTEXT_HANDLE_SERIALIZE */ ;
1626 break;}
1627 case 62:
1628 #line 344 "parser.y"
1629 { yyval.attr = make_attr(ATTR_CONTROL); ;
1630 break;}
1631 case 63:
1632 #line 345 "parser.y"
1633 { yyval.attr = make_attr(ATTR_DEFAULT); ;
1634 break;}
1635 case 64:
1636 #line 346 "parser.y"
1637 { yyval.attr = make_attrp(ATTR_DEFAULTVALUE_EXPR, yyvsp[-1].expr); ;
1638 break;}
1639 case 65:
1640 #line 347 "parser.y"
1641 { yyval.attr = make_attrp(ATTR_DEFAULTVALUE_STRING, yyvsp[-1].str); ;
1642 break;}
1643 case 66:
1644 #line 348 "parser.y"
1645 { yyval.attr = make_attrp(ATTR_DLLNAME, yyvsp[-1].str); ;
1646 break;}
1647 case 67:
1648 #line 349 "parser.y"
1649 { yyval.attr = make_attr(ATTR_DUAL); ;
1650 break;}
1651 case 68:
1652 #line 350 "parser.y"
1653 { yyval.attr = make_attrp(ATTR_ENDPOINT, yyvsp[-1].str); ;
1654 break;}
1655 case 69:
1656 #line 351 "parser.y"
1657 { yyval.attr = make_attrp(ATTR_ENTRY_STRING, yyvsp[-1].str); ;
1658 break;}
1659 case 70:
1660 #line 352 "parser.y"
1661 { yyval.attr = make_attrp(ATTR_ENTRY_ORDINAL, yyvsp[-1].expr); ;
1662 break;}
1663 case 71:
1664 #line 353 "parser.y"
1665 { yyval.attr = make_attr(ATTR_EXPLICIT_HANDLE); ;
1666 break;}
1667 case 72:
1668 #line 354 "parser.y"
1669 { yyval.attr = make_attr(ATTR_HANDLE); ;
1670 break;}
1671 case 73:
1672 #line 355 "parser.y"
1673 { yyval.attr = make_attrp(ATTR_HELPCONTEXT, yyvsp[-1].expr); ;
1674 break;}
1675 case 74:
1676 #line 356 "parser.y"
1677 { yyval.attr = make_attrp(ATTR_HELPFILE, yyvsp[-1].str); ;
1678 break;}
1679 case 75:
1680 #line 357 "parser.y"
1681 { yyval.attr = make_attrp(ATTR_HELPSTRING, yyvsp[-1].str); ;
1682 break;}
1683 case 76:
1684 #line 358 "parser.y"
1685 { yyval.attr = make_attrp(ATTR_HELPSTRINGCONTEXT, yyvsp[-1].expr); ;
1686 break;}
1687 case 77:
1688 #line 359 "parser.y"
1689 { yyval.attr = make_attrp(ATTR_HELPSTRINGDLL, yyvsp[-1].str); ;
1690 break;}
1691 case 78:
1692 #line 360 "parser.y"
1693 { yyval.attr = make_attr(ATTR_HIDDEN); ;
1694 break;}
1695 case 79:
1696 #line 361 "parser.y"
1697 { yyval.attr = make_attrp(ATTR_ID, yyvsp[-1].expr); ;
1698 break;}
1699 case 80:
1700 #line 362 "parser.y"
1701 { yyval.attr = make_attr(ATTR_IDEMPOTENT); ;
1702 break;}
1703 case 81:
1704 #line 363 "parser.y"
1705 { yyval.attr = make_attrp(ATTR_IIDIS, yyvsp[-1].var); ;
1706 break;}
1707 case 82:
1708 #line 364 "parser.y"
1709 { yyval.attr = make_attrp(ATTR_IMPLICIT_HANDLE, yyvsp[-1].str); ;
1710 break;}
1711 case 83:
1712 #line 365 "parser.y"
1713 { yyval.attr = make_attr(ATTR_IN); ;
1714 break;}
1715 case 84:
1716 #line 366 "parser.y"
1717 { yyval.attr = make_attr(ATTR_INPUTSYNC); ;
1718 break;}
1719 case 85:
1720 #line 367 "parser.y"
1721 { yyval.attr = make_attrp(ATTR_LENGTHIS, yyvsp[-1].expr); ;
1722 break;}
1723 case 86:
1724 #line 368 "parser.y"
1725 { yyval.attr = make_attr(ATTR_LOCAL); ;
1726 break;}
1727 case 87:
1728 #line 369 "parser.y"
1729 { yyval.attr = make_attr(ATTR_NONCREATABLE); ;
1730 break;}
1731 case 88:
1732 #line 370 "parser.y"
1733 { yyval.attr = make_attr(ATTR_OBJECT); ;
1734 break;}
1735 case 89:
1736 #line 371 "parser.y"
1737 { yyval.attr = make_attr(ATTR_ODL); ;
1738 break;}
1739 case 90:
1740 #line 372 "parser.y"
1741 { yyval.attr = make_attr(ATTR_OLEAUTOMATION); ;
1742 break;}
1743 case 91:
1744 #line 373 "parser.y"
1745 { yyval.attr = make_attr(ATTR_OPTIONAL); ;
1746 break;}
1747 case 92:
1748 #line 374 "parser.y"
1749 { yyval.attr = make_attr(ATTR_OUT); ;
1750 break;}
1751 case 93:
1752 #line 375 "parser.y"
1753 { yyval.attr = make_attrv(ATTR_POINTERDEFAULT, yyvsp[-1].num); ;
1754 break;}
1755 case 94:
1756 #line 376 "parser.y"
1757 { yyval.attr = make_attr(ATTR_PROPGET); ;
1758 break;}
1759 case 95:
1760 #line 377 "parser.y"
1761 { yyval.attr = make_attr(ATTR_PROPPUT); ;
1762 break;}
1763 case 96:
1764 #line 378 "parser.y"
1765 { yyval.attr = make_attr(ATTR_PROPPUTREF); ;
1766 break;}
1767 case 97:
1768 #line 379 "parser.y"
1769 { yyval.attr = make_attr(ATTR_PUBLIC); ;
1770 break;}
1771 case 98:
1772 #line 380 "parser.y"
1773 { yyval.attr = make_attr(ATTR_READONLY); ;
1774 break;}
1775 case 99:
1776 #line 381 "parser.y"
1777 { yyval.attr = make_attr(ATTR_RESTRICTED); ;
1778 break;}
1779 case 100:
1780 #line 382 "parser.y"
1781 { yyval.attr = make_attr(ATTR_RETVAL); ;
1782 break;}
1783 case 101:
1784 #line 383 "parser.y"
1785 { yyval.attr = make_attrp(ATTR_SIZEIS, yyvsp[-1].expr); ;
1786 break;}
1787 case 102:
1788 #line 384 "parser.y"
1789 { yyval.attr = make_attr(ATTR_SOURCE); ;
1790 break;}
1791 case 103:
1792 #line 385 "parser.y"
1793 { yyval.attr = make_attr(ATTR_STRING); ;
1794 break;}
1795 case 104:
1796 #line 386 "parser.y"
1797 { yyval.attr = make_attrp(ATTR_SWITCHIS, yyvsp[-1].expr); ;
1798 break;}
1799 case 105:
1800 #line 387 "parser.y"
1801 { yyval.attr = make_attrp(ATTR_SWITCHTYPE, type_ref(yyvsp[-1].tref)); ;
1802 break;}
1803 case 106:
1804 #line 388 "parser.y"
1805 { yyval.attr = make_attrp(ATTR_TRANSMITAS, type_ref(yyvsp[-1].tref)); ;
1806 break;}
1807 case 107:
1808 #line 389 "parser.y"
1809 { yyval.attr = make_attrp(ATTR_UUID, yyvsp[-1].uuid); ;
1810 break;}
1811 case 108:
1812 #line 390 "parser.y"
1813 { yyval.attr = make_attr(ATTR_V1ENUM); ;
1814 break;}
1815 case 109:
1816 #line 391 "parser.y"
1817 { yyval.attr = make_attr(ATTR_VARARG); ;
1818 break;}
1819 case 110:
1820 #line 392 "parser.y"
1821 { yyval.attr = make_attrv(ATTR_VERSION, yyvsp[-1].num); ;
1822 break;}
1823 case 111:
1824 #line 393 "parser.y"
1825 { yyval.attr = make_attrp(ATTR_WIREMARSHAL, type_ref(yyvsp[-1].tref)); ;
1826 break;}
1827 case 112:
1828 #line 394 "parser.y"
1829 { yyval.attr = make_attrv(ATTR_POINTERTYPE, yyvsp[0].num); ;
1830 break;}
1831 case 115:
1832 #line 401 "parser.y"
1833 { yyval.var = NULL; ;
1834 break;}
1835 case 116:
1836 #line 402 "parser.y"
1837 { if (yyvsp[0].var) { LINK(yyvsp[0].var, yyvsp[-1].var); yyval.var = yyvsp[0].var; }
1838 else { yyval.var = yyvsp[-1].var; }
1839 ;
1840 break;}
1841 case 117:
1842 #line 407 "parser.y"
1843 { attr_t *a = make_attrp(ATTR_CASE, yyvsp[-2].expr);
1844 yyval.var = yyvsp[0].var; if (!yyval.var) yyval.var = make_var(NULL);
1845 LINK(a, yyval.var->attrs); yyval.var->attrs = a;
1846 ;
1847 break;}
1848 case 118:
1849 #line 411 "parser.y"
1850 { attr_t *a = make_attr(ATTR_DEFAULT);
1851 yyval.var = yyvsp[0].var; if (!yyval.var) yyval.var = make_var(NULL);
1852 LINK(a, yyval.var->attrs); yyval.var->attrs = a;
1853 ;
1854 break;}
1855 case 119:
1856 #line 417 "parser.y"
1857 { yyval.var = reg_const(yyvsp[-2].var);
1858 set_type(yyval.var, yyvsp[-3].tref, NULL);
1859 yyval.var->eval = yyvsp[0].expr;
1860 yyval.var->lval = yyvsp[0].expr->cval;
1861 ;
1862 break;}
1863 case 120:
1864 #line 424 "parser.y"
1865 { yyval.var = NULL; ;
1866 break;}
1867 case 121:
1868 #line 425 "parser.y"
1869 { yyval.var = yyvsp[-1].var; ;
1870 break;}
1871 case 124:
1872 #line 430 "parser.y"
1873 { LINK(yyvsp[0].var, yyvsp[-2].var); yyval.var = yyvsp[0].var;
1874 if (yyvsp[-2].var && !yyvsp[0].var->eval)
1875 yyvsp[0].var->lval = yyvsp[-2].var->lval + 1;
1876 ;
1877 break;}
1878 case 125:
1879 #line 436 "parser.y"
1880 { yyval.var = reg_const(yyvsp[-2].var);
1881 yyval.var->eval = yyvsp[0].expr;
1882 yyval.var->lval = yyvsp[0].expr->cval;
1883 yyval.var->type = make_type(RPC_FC_LONG, &std_int);
1884 ;
1885 break;}
1886 case 126:
1887 #line 441 "parser.y"
1888 { yyval.var = reg_const(yyvsp[0].var);
1889 yyval.var->lval = 0; /* default for first enum entry */
1890 yyval.var->type = make_type(RPC_FC_LONG, &std_int);
1891 ;
1892 break;}
1893 case 127:
1894 #line 447 "parser.y"
1895 { yyval.type = get_typev(RPC_FC_ENUM16, yyvsp[-3].var, tsENUM);
1896 yyval.type->fields = yyvsp[-1].var;
1897 yyval.type->defined = TRUE;
1898 if(in_typelib)
1899 add_enum(yyval.type);
1900 ;
1901 break;}
1902 case 129:
1903 #line 456 "parser.y"
1904 { LINK(yyvsp[0].expr, yyvsp[-2].expr); yyval.expr = yyvsp[0].expr; ;
1905 break;}
1906 case 130:
1907 #line 469 "parser.y"
1908 { yyval.expr = make_expr(EXPR_VOID); ;
1909 break;}
1910 case 132:
1911 #line 473 "parser.y"
1912 { yyval.expr = make_exprl(EXPR_NUM, yyvsp[0].num); ;
1913 break;}
1914 case 133:
1915 #line 474 "parser.y"
1916 { yyval.expr = make_exprl(EXPR_HEXNUM, yyvsp[0].num); ;
1917 break;}
1918 case 134:
1919 #line 475 "parser.y"
1920 { yyval.expr = make_exprs(EXPR_IDENTIFIER, yyvsp[0].str); ;
1921 break;}
1922 case 135:
1923 #line 476 "parser.y"
1924 { yyval.expr = make_expr3(EXPR_COND, yyvsp[-4].expr, yyvsp[-2].expr, yyvsp[0].expr); ;
1925 break;}
1926 case 136:
1927 #line 477 "parser.y"
1928 { yyval.expr = make_expr2(EXPR_OR , yyvsp[-2].expr, yyvsp[0].expr); ;
1929 break;}
1930 case 137:
1931 #line 478 "parser.y"
1932 { yyval.expr = make_expr2(EXPR_AND, yyvsp[-2].expr, yyvsp[0].expr); ;
1933 break;}
1934 case 138:
1935 #line 479 "parser.y"
1936 { yyval.expr = make_expr2(EXPR_ADD, yyvsp[-2].expr, yyvsp[0].expr); ;
1937 break;}
1938 case 139:
1939 #line 480 "parser.y"
1940 { yyval.expr = make_expr2(EXPR_SUB, yyvsp[-2].expr, yyvsp[0].expr); ;
1941 break;}
1942 case 140:
1943 #line 481 "parser.y"
1944 { yyval.expr = make_expr2(EXPR_MUL, yyvsp[-2].expr, yyvsp[0].expr); ;
1945 break;}
1946 case 141:
1947 #line 482 "parser.y"
1948 { yyval.expr = make_expr2(EXPR_DIV, yyvsp[-2].expr, yyvsp[0].expr); ;
1949 break;}
1950 case 142:
1951 #line 483 "parser.y"
1952 { yyval.expr = make_expr2(EXPR_SHL, yyvsp[-2].expr, yyvsp[0].expr); ;
1953 break;}
1954 case 143:
1955 #line 484 "parser.y"
1956 { yyval.expr = make_expr2(EXPR_SHR, yyvsp[-2].expr, yyvsp[0].expr); ;
1957 break;}
1958 case 144:
1959 #line 485 "parser.y"
1960 { yyval.expr = make_expr1(EXPR_NOT, yyvsp[0].expr); ;
1961 break;}
1962 case 145:
1963 #line 486 "parser.y"
1964 { yyval.expr = make_expr1(EXPR_NEG, yyvsp[0].expr); ;
1965 break;}
1966 case 146:
1967 #line 487 "parser.y"
1968 { yyval.expr = make_expr1(EXPR_PPTR, yyvsp[0].expr); ;
1969 break;}
1970 case 147:
1971 #line 488 "parser.y"
1972 { yyval.expr = make_exprt(EXPR_CAST, yyvsp[-2].tref, yyvsp[0].expr); ;
1973 break;}
1974 case 148:
1975 #line 489 "parser.y"
1976 { yyval.expr = make_exprt(EXPR_SIZEOF, yyvsp[-1].tref, NULL); ;
1977 break;}
1978 case 149:
1979 #line 490 "parser.y"
1980 { yyval.expr = yyvsp[-1].expr; ;
1981 break;}
1982 case 151:
1983 #line 494 "parser.y"
1984 { LINK(yyvsp[0].expr, yyvsp[-2].expr); yyval.expr = yyvsp[0].expr; ;
1985 break;}
1986 case 152:
1987 #line 497 "parser.y"
1988 { yyval.expr = yyvsp[0].expr;
1989 if (!yyval.expr->is_const)
1990 yyerror("expression is not constant\n");
1991 ;
1992 break;}
1993 case 153:
1994 #line 503 "parser.y"
1995 { yyval.var = yyvsp[0].var;
1996 set_type(yyval.var, yyvsp[-1].tref, NULL);
1997 ;
1998 break;}
1999 case 154:
2000 #line 508 "parser.y"
2001 { yyval.var = NULL; ;
2002 break;}
2003 case 155:
2004 #line 509 "parser.y"
2005 { if (yyvsp[0].var) { LINK(yyvsp[0].var, yyvsp[-1].var); yyval.var = yyvsp[0].var; }
2006 else { yyval.var = yyvsp[-1].var; }
2007 ;
2008 break;}
2009 case 156:
2010 #line 514 "parser.y"
2011 { yyval.var = yyvsp[-1].var; ;
2012 break;}
2013 case 157:
2014 #line 515 "parser.y"
2015 { yyval.var = make_var(NULL); yyval.var->type = yyvsp[-1].type; yyval.var->attrs = yyvsp[-2].attr; ;
2016 break;}
2017 case 158:
2018 #line 516 "parser.y"
2019 { yyval.var = make_var(NULL); yyval.var->attrs = yyvsp[-1].attr; ;
2020 break;}
2021 case 159:
2022 #line 517 "parser.y"
2023 { yyval.var = NULL; ;
2024 break;}
2025 case 160:
2026 #line 520 "parser.y"
2027 { yyval.var = yyvsp[-1].var; set_type(yyval.var, yyvsp[-2].tref, yyvsp[0].expr); yyval.var->attrs = yyvsp[-3].attr; ;
2028 break;}
2029 case 161:
2030 #line 525 "parser.y"
2031 { set_type(yyvsp[-3].var, yyvsp[-5].tref, NULL);
2032 yyvsp[-3].var->attrs = yyvsp[-6].attr;
2033 yyval.func = make_func(yyvsp[-3].var, yyvsp[-1].var);
2034 if (is_attr(yyvsp[-3].var->attrs, ATTR_IN)) {
2035 yyerror("Inapplicable attribute");
2036 }
2037 ;
2038 break;}
2039 case 162:
2040 #line 534 "parser.y"
2041 { yyval.var = NULL; ;
2042 break;}
2043 case 164:
2044 #line 538 "parser.y"
2045 { yyval.var = NULL; ;
2046 break;}
2047 case 165:
2048 #line 539 "parser.y"
2049 { yyval.var = make_var(yyvsp[0].str); ;
2050 break;}
2051 case 166:
2052 #line 540 "parser.y"
2053 { yyval.var = make_var(yyvsp[0].str); ;
2054 break;}
2055 case 167:
2056 #line 543 "parser.y"
2057 { yyval.var = make_var(yyvsp[0].str); ;
2058 break;}
2059 case 168:
2060 #line 545 "parser.y"
2061 { yyval.var = make_var(yyvsp[0].str); ;
2062 break;}
2063 case 169:
2064 #line 546 "parser.y"
2065 { yyval.var = make_var(yyvsp[0].str); ;
2066 break;}
2067 case 170:
2068 #line 547 "parser.y"
2069 { yyval.var = make_var(yyvsp[0].str); ;
2070 break;}
2071 case 171:
2072 #line 548 "parser.y"
2073 { yyval.var = make_var(yyvsp[0].str); ;
2074 break;}
2075 case 172:
2076 #line 551 "parser.y"
2077 { yyval.type = make_type(RPC_FC_BYTE, NULL); ;
2078 break;}
2079 case 173:
2080 #line 552 "parser.y"
2081 { yyval.type = make_type(RPC_FC_WCHAR, NULL); ;
2082 break;}
2083 case 175:
2084 #line 554 "parser.y"
2085 { yyval.type = yyvsp[0].type; yyval.type->sign = 1; ;
2086 break;}
2087 case 176:
2088 #line 555 "parser.y"
2089 { yyval.type = yyvsp[0].type; yyval.type->sign = -1;
2090 switch (yyval.type->type) {
2091 case RPC_FC_CHAR: break;
2092 case RPC_FC_SMALL: yyval.type->type = RPC_FC_USMALL; break;
2093 case RPC_FC_SHORT: yyval.type->type = RPC_FC_USHORT; break;
2094 case RPC_FC_LONG: yyval.type->type = RPC_FC_ULONG; break;
2095 case RPC_FC_HYPER:
2096 if (!yyval.type->ref) { yyval.type->ref = &std_uhyper; yyval.type->sign = 0; }
2097 break;
2098 default: break;
2099 }
2100 ;
2101 break;}
2102 case 177:
2103 #line 567 "parser.y"
2104 { yyval.type = make_type(RPC_FC_FLOAT, NULL); ;
2105 break;}
2106 case 178:
2107 #line 568 "parser.y"
2108 { yyval.type = make_type(RPC_FC_DOUBLE, NULL); ;
2109 break;}
2110 case 179:
2111 #line 569 "parser.y"
2112 { yyval.type = make_type(RPC_FC_SMALL, &std_bool); ;
2113 break;}
2114 case 180:
2115 #line 570 "parser.y"
2116 { yyval.type = make_type(RPC_FC_ERROR_STATUS_T, NULL); ;
2117 break;}
2118 case 181:
2119 #line 571 "parser.y"
2120 { yyval.type = make_type(RPC_FC_IGNORE, NULL); ;
2121 break;}
2122 case 184:
2123 #line 578 "parser.y"
2124 { yyval.type = make_type(RPC_FC_LONG, &std_int); ;
2125 break;}
2126 case 185:
2127 #line 579 "parser.y"
2128 { yyval.type = make_type(RPC_FC_SMALL, NULL); ;
2129 break;}
2130 case 186:
2131 #line 580 "parser.y"
2132 { yyval.type = make_type(RPC_FC_SHORT, NULL); ;
2133 break;}
2134 case 187:
2135 #line 581 "parser.y"
2136 { yyval.type = make_type(RPC_FC_LONG, NULL); ;
2137 break;}
2138 case 188:
2139 #line 582 "parser.y"
2140 { yyval.type = make_type(RPC_FC_HYPER, NULL); ;
2141 break;}
2142 case 189:
2143 #line 583 "parser.y"
2144 { yyval.type = make_type(RPC_FC_HYPER, &std_int64); ;
2145 break;}
2146 case 190:
2147 #line 584 "parser.y"
2148 { yyval.type = make_type(RPC_FC_CHAR, NULL); ;
2149 break;}
2150 case 191:
2151 #line 587 "parser.y"
2152 { yyval.clas = make_class(yyvsp[0].str); ;
2153 break;}
2154 case 192:
2155 #line 588 "parser.y"
2156 { yyval.clas = make_class(yyvsp[0].str); ;
2157 break;}
2158 case 193:
2159 #line 591 "parser.y"
2160 { yyval.clas = yyvsp[0].clas;
2161 yyval.clas->attrs = yyvsp[-1].attr;
2162 if (!parse_only && do_header) write_coclass(yyval.clas);
2163 ;
2164 break;}
2165 case 194:
2166 #line 597 "parser.y"
2167 { yyval.clas = yyvsp[-3].clas;
2168 yyval.clas->ifaces = yyvsp[-1].ifref;
2169 ;
2170 break;}
2171 case 195:
2172 #line 602 "parser.y"
2173 { yyval.ifref = NULL; ;
2174 break;}
2175 case 196:
2176 #line 603 "parser.y"
2177 { LINK(yyvsp[0].ifref, yyvsp[-1].ifref); yyval.ifref = yyvsp[0].ifref; ;
2178 break;}
2179 case 197:
2180 #line 607 "parser.y"
2181 { yyval.ifref = make_ifref(yyvsp[0].type); yyval.ifref->attrs = yyvsp[-1].attr; ;
2182 break;}
2183 case 198:
2184 #line 610 "parser.y"
2185 { yyval.type = get_type(0, yyvsp[0].str, 0); ;
2186 break;}
2187 case 199:
2188 #line 611 "parser.y"
2189 { yyval.type = get_type(0, yyvsp[0].str, 0); ;
2190 break;}
2191 case 200:
2192 #line 614 "parser.y"
2193 { yyval.type = yyvsp[0].type;
2194 if (yyval.type->defined) yyerror("multiple definition error\n");
2195 yyval.type->attrs = yyvsp[-1].attr;
2196 yyval.type->attrs = make_attr(ATTR_DISPINTERFACE);
2197 LINK(yyval.type->attrs, yyvsp[-1].attr);
2198 yyval.type->ref = find_type("IDispatch", 0);
2199 if (!yyval.type->ref) yyerror("IDispatch is undefined\n");
2200 yyval.type->defined = TRUE;
2201 if (!parse_only && do_header) write_forward(yyval.type);
2202 ;
2203 break;}
2204 case 201:
2205 #line 626 "parser.y"
2206 { yyval.var = NULL; ;
2207 break;}
2208 case 202:
2209 #line 627 "parser.y"
2210 { LINK(yyvsp[-1].var, yyvsp[-2].var); yyval.var = yyvsp[-1].var; ;
2211 break;}
2212 case 203:
2213 #line 630 "parser.y"
2214 { yyval.func = NULL; ;
2215 break;}
2216 case 204:
2217 #line 631 "parser.y"
2218 { LINK(yyvsp[-1].func, yyvsp[-2].func); yyval.func = yyvsp[-1].func; ;
2219 break;}
2220 case 205:
2221 #line 637 "parser.y"
2222 { yyval.type = yyvsp[-4].type;
2223 yyval.type->fields = yyvsp[-2].var;
2224 yyval.type->funcs = yyvsp[-1].func;
2225 if (!parse_only && do_header) write_dispinterface(yyval.type);
2226 ;
2227 break;}
2228 case 206:
2229 #line 649 "parser.y"
2230 { yyval.type = NULL; ;
2231 break;}
2232 case 207:
2233 #line 650 "parser.y"
2234 { yyval.type = find_type2(yyvsp[0].str, 0); ;
2235 break;}
2236 case 208:
2237 #line 653 "parser.y"
2238 { yyval.type = get_type(RPC_FC_IP, yyvsp[0].str, 0); ;
2239 break;}
2240 case 209:
2241 #line 654 "parser.y"
2242 { yyval.type = get_type(RPC_FC_IP, yyvsp[0].str, 0); ;
2243 break;}
2244 case 210:
2245 #line 657 "parser.y"
2246 { yyval.type = yyvsp[0].type;
2247 if (yyval.type->defined) yyerror("multiple definition error\n");
2248 yyval.type->attrs = yyvsp[-1].attr;
2249 yyval.type->defined = TRUE;
2250 if (!parse_only && do_header) write_forward(yyval.type);
2251 ;
2252 break;}
2253 case 211:
2254 #line 666 "parser.y"
2255 { yyval.type = yyvsp[-4].type;
2256 yyval.type->ref = yyvsp[-3].type;
2257 yyval.type->funcs = yyvsp[-1].func;
2258 if (!parse_only && do_header) write_interface(yyval.type);
2259 ;
2260 break;}
2261 case 212:
2262 #line 674 "parser.y"
2263 { yyval.type = yyvsp[-6].type;
2264 yyval.type->ref = find_type2(yyvsp[-4].str, 0);
2265 if (!yyval.type->ref) yyerror("base class %s not found in import\n", yyvsp[-4].str);
2266 yyval.type->funcs = yyvsp[-1].func;
2267 if (!parse_only && do_header) write_interface(yyval.type);
2268 ;
2269 break;}
2270 case 213:
2271 #line 680 "parser.y"
2272 { yyval.type = yyvsp[0].type; ;
2273 break;}
2274 case 214:
2275 #line 684 "parser.y"
2276 { yyval.type = yyvsp[-1].type; if (!parse_only && do_header) write_forward(yyval.type); ;
2277 break;}
2278 case 215:
2279 #line 685 "parser.y"
2280 { yyval.type = yyvsp[-1].type; if (!parse_only && do_header) write_forward(yyval.type); ;
2281 break;}
2282 case 216:
2283 #line 688 "parser.y"
2284 { yyval.type = make_type(0, NULL); yyval.type->name = yyvsp[0].str; ;
2285 break;}
2286 case 217:
2287 #line 689 "parser.y"
2288 { yyval.type = make_type(0, NULL); yyval.type->name = yyvsp[0].str; ;
2289 break;}
2290 case 218:
2291 #line 692 "parser.y"
2292 { yyval.type = yyvsp[0].type;
2293 yyval.type->attrs = yyvsp[-1].attr;
2294 ;
2295 break;}
2296 case 219:
2297 #line 697 "parser.y"
2298 { yyval.type = yyvsp[-3].type;
2299 yyval.type->funcs = yyvsp[-1].func;
2300 /* FIXME: if (!parse_only && do_header) write_module($$); */
2301 ;
2302 break;}
2303 case 220:
2304 #line 703 "parser.y"
2305 { yyval.var = yyvsp[0].var; yyval.var->ptr_level++; ;
2306 break;}
2307 case 221:
2308 #line 704 "parser.y"
2309 { yyval.var = yyvsp[0].var; /* FIXME */ ;
2310 break;}
2311 case 224:
2312 #line 709 "parser.y"
2313 { yyval.var = yyvsp[-1].var; ;
2314 break;}
2315 case 226:
2316 #line 714 "parser.y"
2317 { LINK(yyvsp[0].var, yyvsp[-2].var); yyval.var = yyvsp[0].var; ;
2318 break;}
2319 case 227:
2320 #line 718 "parser.y"
2321 { yyval.num = RPC_FC_RP; ;
2322 break;}
2323 case 228:
2324 #line 719 "parser.y"
2325 { yyval.num = RPC_FC_UP; ;
2326 break;}
2327 case 229:
2328 #line 722 "parser.y"
2329 { yyval.type = get_typev(RPC_FC_STRUCT, yyvsp[-3].var, tsSTRUCT);
2330 /* overwrite RPC_FC_STRUCT with a more exact type */
2331 yyval.type->type = get_struct_type( yyvsp[-1].var );
2332 yyval.type->fields = yyvsp[-1].var;
2333 yyval.type->defined = TRUE;
2334 if(in_typelib)
2335 add_struct(yyval.type);
2336 ;
2337 break;}
2338 case 230:
2339 #line 732 "parser.y"
2340 { yyval.tref = make_tref(NULL, make_type(0, NULL)); ;
2341 break;}
2342 case 231:
2343 #line 733 "parser.y"
2344 { yyval.tref = make_tref(yyvsp[0].str, find_type(yyvsp[0].str, 0)); ;
2345 break;}
2346 case 232:
2347 #line 734 "parser.y"
2348 { yyval.tref = make_tref(NULL, yyvsp[0].type); ;
2349 break;}
2350 case 233:
2351 #line 735 "parser.y"
2352 { yyval.tref = uniq_tref(yyvsp[0].tref); yyval.tref->ref->is_const = TRUE; ;
2353 break;}
2354 case 234:
2355 #line 736 "parser.y"
2356 { yyval.tref = make_tref(NULL, yyvsp[0].type); ;
2357 break;}
2358 case 235:
2359 #line 737 "parser.y"
2360 { yyval.tref = make_tref(NULL, find_type2(yyvsp[0].str, tsENUM)); ;
2361 break;}
2362 case 236:
2363 #line 738 "parser.y"
2364 { yyval.tref = make_tref(NULL, yyvsp[0].type); ;
2365 break;}
2366 case 237:
2367 #line 739 "parser.y"
2368 { yyval.tref = make_tref(NULL, get_type(RPC_FC_STRUCT, yyvsp[0].str, tsSTRUCT)); ;
2369 break;}
2370 case 238:
2371 #line 740 "parser.y"
2372 { yyval.tref = make_tref(NULL, yyvsp[0].type); ;
2373 break;}
2374 case 239:
2375 #line 741 "parser.y"
2376 { yyval.tref = make_tref(NULL, find_type2(yyvsp[0].str, tsUNION)); ;
2377 break;}
2378 case 240:
2379 #line 744 "parser.y"
2380 { typeref_t *tref = uniq_tref(yyvsp[-1].tref);
2381 yyvsp[0].var->tname = tref->name;
2382 tref->name = NULL;
2383 yyval.type = type_ref(tref);
2384 yyval.type->attrs = yyvsp[-2].attr;
2385 if (!parse_only && do_header) write_typedef(yyval.type, yyvsp[0].var);
2386 if (in_typelib && yyval.type->attrs)
2387 add_typedef(yyval.type, yyvsp[0].var);
2388 reg_types(yyval.type, yyvsp[0].var, 0);
2389 ;
2390 break;}
2391 case 241:
2392 #line 756 "parser.y"
2393 { yyval.type = get_typev(RPC_FC_NON_ENCAPSULATED_UNION, yyvsp[-3].var, tsUNION);
2394 yyval.type->fields = yyvsp[-1].var;
2395 yyval.type->defined = TRUE;
2396 ;
2397 break;}
2398 case 242:
2399 #line 762 "parser.y"
2400 { var_t *u = yyvsp[-3].var;
2401 yyval.type = get_typev(RPC_FC_ENCAPSULATED_UNION, yyvsp[-8].var, tsUNION);
2402 if (!u) u = make_var("tagged_union");
2403 u->type = make_type(RPC_FC_NON_ENCAPSULATED_UNION, NULL);
2404 u->type->fields = yyvsp[-1].var;
2405 u->type->defined = TRUE;
2406 LINK(u, yyvsp[-5].var); yyval.type->fields = u;
2407 yyval.type->defined = TRUE;
2408 ;
2409 break;}
2410 case 243:
2411 #line 774 "parser.y"
2412 { yyval.num = MAKELONG(yyvsp[0].num, 0); ;
2413 break;}
2414 case 244:
2415 #line 775 "parser.y"
2416 { yyval.num = MAKELONG(yyvsp[-2].num, yyvsp[0].num); ;
2417 break;}
2418 }
2419 /* the action file gets copied in in place of this dollarsign */
2420 #line 543 "/usr/share/bison.simple"
2421 \f
2422 yyvsp -= yylen;
2423 yyssp -= yylen;
2424 #ifdef YYLSP_NEEDED
2425 yylsp -= yylen;
2426 #endif
2427
2428 #if YYDEBUG != 0
2429 if (yydebug)
2430 {
2431 short *ssp1 = yyss - 1;
2432 fprintf (stderr, "state stack now");
2433 while (ssp1 != yyssp)
2434 fprintf (stderr, " %d", *++ssp1);
2435 fprintf (stderr, "\n");
2436 }
2437 #endif
2438
2439 *++yyvsp = yyval;
2440
2441 #ifdef YYLSP_NEEDED
2442 yylsp++;
2443 if (yylen == 0)
2444 {
2445 yylsp->first_line = yylloc.first_line;
2446 yylsp->first_column = yylloc.first_column;
2447 yylsp->last_line = (yylsp-1)->last_line;
2448 yylsp->last_column = (yylsp-1)->last_column;
2449 yylsp->text = 0;
2450 }
2451 else
2452 {
2453 yylsp->last_line = (yylsp+yylen-1)->last_line;
2454 yylsp->last_column = (yylsp+yylen-1)->last_column;
2455 }
2456 #endif
2457
2458 /* Now "shift" the result of the reduction.
2459 Determine what state that goes to,
2460 based on the state we popped back to
2461 and the rule number reduced by. */
2462
2463 yyn = yyr1[yyn];
2464
2465 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
2466 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2467 yystate = yytable[yystate];
2468 else
2469 yystate = yydefgoto[yyn - YYNTBASE];
2470
2471 goto yynewstate;
2472
2473 yyerrlab: /* here on detecting error */
2474
2475 if (! yyerrstatus)
2476 /* If not already recovering from an error, report this error. */
2477 {
2478 ++yynerrs;
2479
2480 #ifdef YYERROR_VERBOSE
2481 yyn = yypact[yystate];
2482
2483 if (yyn > YYFLAG && yyn < YYLAST)
2484 {
2485 int size = 0;
2486 char *msg;
2487 int x, count;
2488
2489 count = 0;
2490 /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
2491 for (x = (yyn < 0 ? -yyn : 0);
2492 x < (sizeof(yytname) / sizeof(char *)); x++)
2493 if (yycheck[x + yyn] == x)
2494 size += strlen(yytname[x]) + 15, count++;
2495 msg = (char *) malloc(size + 15);
2496 if (msg != 0)
2497 {
2498 strcpy(msg, "parse error");
2499
2500 if (count < 5)
2501 {
2502 count = 0;
2503 for (x = (yyn < 0 ? -yyn : 0);
2504 x < (sizeof(yytname) / sizeof(char *)); x++)
2505 if (yycheck[x + yyn] == x)
2506 {
2507 strcat(msg, count == 0 ? ", expecting `" : " or `");
2508 strcat(msg, yytname[x]);
2509 strcat(msg, "'");
2510 count++;
2511 }
2512 }
2513 yyerror(msg);
2514 free(msg);
2515 }
2516 else
2517 yyerror ("parse error; also virtual memory exceeded");
2518 }
2519 else
2520 #endif /* YYERROR_VERBOSE */
2521 yyerror("parse error");
2522 }
2523
2524 goto yyerrlab1;
2525 yyerrlab1: /* here on error raised explicitly by an action */
2526
2527 if (yyerrstatus == 3)
2528 {
2529 /* if just tried and failed to reuse lookahead token after an error, discard it. */
2530
2531 /* return failure if at end of input */
2532 if (yychar == YYEOF)
2533 YYABORT;
2534
2535 #if YYDEBUG != 0
2536 if (yydebug)
2537 fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
2538 #endif
2539
2540 yychar = YYEMPTY;
2541 }
2542
2543 /* Else will try to reuse lookahead token
2544 after shifting the error token. */
2545
2546 yyerrstatus = 3; /* Each real token shifted decrements this */
2547
2548 goto yyerrhandle;
2549
2550 yyerrdefault: /* current state does not do anything special for the error token. */
2551
2552 #if 0
2553 /* This is wrong; only states that explicitly want error tokens
2554 should shift them. */
2555 yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
2556 if (yyn) goto yydefault;
2557 #endif
2558
2559 yyerrpop: /* pop the current state because it cannot handle the error token */
2560
2561 if (yyssp == yyss) YYABORT;
2562 yyvsp--;
2563 yystate = *--yyssp;
2564 #ifdef YYLSP_NEEDED
2565 yylsp--;
2566 #endif
2567
2568 #if YYDEBUG != 0
2569 if (yydebug)
2570 {
2571 short *ssp1 = yyss - 1;
2572 fprintf (stderr, "Error: state stack now");
2573 while (ssp1 != yyssp)
2574 fprintf (stderr, " %d", *++ssp1);
2575 fprintf (stderr, "\n");
2576 }
2577 #endif
2578
2579 yyerrhandle:
2580
2581 yyn = yypact[yystate];
2582 if (yyn == YYFLAG)
2583 goto yyerrdefault;
2584
2585 yyn += YYTERROR;
2586 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
2587 goto yyerrdefault;
2588
2589 yyn = yytable[yyn];
2590 if (yyn < 0)
2591 {
2592 if (yyn == YYFLAG)
2593 goto yyerrpop;
2594 yyn = -yyn;
2595 goto yyreduce;
2596 }
2597 else if (yyn == 0)
2598 goto yyerrpop;
2599
2600 if (yyn == YYFINAL)
2601 YYACCEPT;
2602
2603 #if YYDEBUG != 0
2604 if (yydebug)
2605 fprintf(stderr, "Shifting error token, ");
2606 #endif
2607
2608 *++yyvsp = yylval;
2609 #ifdef YYLSP_NEEDED
2610 *++yylsp = yylloc;
2611 #endif
2612
2613 yystate = yyn;
2614 goto yynewstate;
2615
2616 yyacceptlab:
2617 /* YYACCEPT comes here. */
2618 if (yyfree_stacks)
2619 {
2620 free (yyss);
2621 free (yyvs);
2622 #ifdef YYLSP_NEEDED
2623 free (yyls);
2624 #endif
2625 }
2626 return 0;
2627
2628 yyabortlab:
2629 /* YYABORT comes here. */
2630 if (yyfree_stacks)
2631 {
2632 free (yyss);
2633 free (yyvs);
2634 #ifdef YYLSP_NEEDED
2635 free (yyls);
2636 #endif
2637 }
2638 return 1;
2639 }
2640 #line 778 "parser.y"
2641
2642
2643 static attr_t *make_attr(enum attr_type type)
2644 {
2645 attr_t *a = xmalloc(sizeof(attr_t));
2646 a->type = type;
2647 a->u.ival = 0;
2648 INIT_LINK(a);
2649 return a;
2650 }
2651
2652 static attr_t *make_attrv(enum attr_type type, unsigned long val)
2653 {
2654 attr_t *a = xmalloc(sizeof(attr_t));
2655 a->type = type;
2656 a->u.ival = val;
2657 INIT_LINK(a);
2658 return a;
2659 }
2660
2661 static attr_t *make_attrp(enum attr_type type, void *val)
2662 {
2663 attr_t *a = xmalloc(sizeof(attr_t));
2664 a->type = type;
2665 a->u.pval = val;
2666 INIT_LINK(a);
2667 return a;
2668 }
2669
2670 static expr_t *make_expr(enum expr_type type)
2671 {
2672 expr_t *e = xmalloc(sizeof(expr_t));
2673 e->type = type;
2674 e->ref = NULL;
2675 e->u.lval = 0;
2676 e->is_const = FALSE;
2677 INIT_LINK(e);
2678 return e;
2679 }
2680
2681 static expr_t *make_exprl(enum expr_type type, long val)
2682 {
2683 expr_t *e = xmalloc(sizeof(expr_t));
2684 e->type = type;
2685 e->ref = NULL;
2686 e->u.lval = val;
2687 e->is_const = FALSE;
2688 INIT_LINK(e);
2689 /* check for numeric constant */
2690 if (type == EXPR_NUM || type == EXPR_HEXNUM) {
2691 e->is_const = TRUE;
2692 e->cval = val;
2693 }
2694 return e;
2695 }
2696
2697 static expr_t *make_exprs(enum expr_type type, char *val)
2698 {
2699 expr_t *e;
2700 e = xmalloc(sizeof(expr_t));
2701 e->type = type;
2702 e->ref = NULL;
2703 e->u.sval = val;
2704 e->is_const = FALSE;
2705 INIT_LINK(e);
2706 /* check for predefined constants */
2707 if (type == EXPR_IDENTIFIER) {
2708 var_t *c = find_const(val, 0);
2709 if (c) {
2710 e->u.sval = c->name;
2711 free(val);
2712 e->is_const = TRUE;
2713 e->cval = c->lval;
2714 }
2715 }
2716 return e;
2717 }
2718
2719 static expr_t *make_exprt(enum expr_type type, typeref_t *tref, expr_t *expr)
2720 {
2721 expr_t *e;
2722 e = xmalloc(sizeof(expr_t));
2723 e->type = type;
2724 e->ref = expr;
2725 e->u.tref = tref;
2726 e->is_const = FALSE;
2727 INIT_LINK(e);
2728 /* check for cast of constant expression */
2729 if (type == EXPR_CAST && expr->is_const) {
2730 e->is_const = TRUE;
2731 e->cval = expr->cval;
2732 }
2733 return e;
2734 }
2735
2736 static expr_t *make_expr1(enum expr_type type, expr_t *expr)
2737 {
2738 expr_t *e;
2739 e = xmalloc(sizeof(expr_t));
2740 e->type = type;
2741 e->ref = expr;
2742 e->u.lval = 0;
2743 e->is_const = FALSE;
2744 INIT_LINK(e);
2745 /* check for compile-time optimization */
2746 if (expr->is_const) {
2747 e->is_const = TRUE;
2748 switch (type) {
2749 case EXPR_NEG:
2750 e->cval = -expr->cval;
2751 break;
2752 case EXPR_NOT:
2753 e->cval = ~expr->cval;
2754 break;
2755 default:
2756 e->is_const = FALSE;
2757 break;
2758 }
2759 }
2760 return e;
2761 }
2762
2763 static expr_t *make_expr2(enum expr_type type, expr_t *expr1, expr_t *expr2)
2764 {
2765 expr_t *e;
2766 e = xmalloc(sizeof(expr_t));
2767 e->type = type;
2768 e->ref = expr1;
2769 e->u.ext = expr2;
2770 e->is_const = FALSE;
2771 INIT_LINK(e);
2772 /* check for compile-time optimization */
2773 if (expr1->is_const && expr2->is_const) {
2774 e->is_const = TRUE;
2775 switch (type) {
2776 case EXPR_ADD:
2777 e->cval = expr1->cval + expr2->cval;
2778 break;
2779 case EXPR_SUB:
2780 e->cval = expr1->cval - expr2->cval;
2781 break;
2782 case EXPR_MUL:
2783 e->cval = expr1->cval * expr2->cval;
2784 break;
2785 case EXPR_DIV:
2786 e->cval = expr1->cval / expr2->cval;
2787 break;
2788 case EXPR_OR:
2789 e->cval = expr1->cval | expr2->cval;
2790 break;
2791 case EXPR_AND:
2792 e->cval = expr1->cval & expr2->cval;
2793 break;
2794 case EXPR_SHL:
2795 e->cval = expr1->cval << expr2->cval;
2796 break;
2797 case EXPR_SHR:
2798 e->cval = expr1->cval >> expr2->cval;
2799 break;
2800 default:
2801 e->is_const = FALSE;
2802 break;
2803 }
2804 }
2805 return e;
2806 }
2807
2808 static expr_t *make_expr3(enum expr_type type, expr_t *expr1, expr_t *expr2, expr_t *expr3)
2809 {
2810 expr_t *e;
2811 e = xmalloc(sizeof(expr_t));
2812 e->type = type;
2813 e->ref = expr1;
2814 e->u.ext = expr2;
2815 e->ext2 = expr3;
2816 e->is_const = FALSE;
2817 INIT_LINK(e);
2818 /* check for compile-time optimization */
2819 if (expr1->is_const && expr2->is_const && expr3->is_const) {
2820 e->is_const = TRUE;
2821 switch (type) {
2822 case EXPR_COND:
2823 e->cval = expr1->cval ? expr2->cval : expr3->cval;
2824 break;
2825 default:
2826 e->is_const = FALSE;
2827 break;
2828 }
2829 }
2830 return e;
2831 }
2832
2833 static type_t *make_type(unsigned char type, type_t *ref)
2834 {
2835 type_t *t = xmalloc(sizeof(type_t));
2836 t->name = NULL;
2837 t->type = type;
2838 t->ref = ref;
2839 t->rname = NULL;
2840 t->attrs = NULL;
2841 t->funcs = NULL;
2842 t->fields = NULL;
2843 t->ignore = parse_only;
2844 t->is_const = FALSE;
2845 t->sign = 0;
2846 t->defined = FALSE;
2847 t->written = FALSE;
2848 t->typelib_idx = -1;
2849 INIT_LINK(t);
2850 return t;
2851 }
2852
2853 static typeref_t *make_tref(char *name, type_t *ref)
2854 {
2855 typeref_t *t = xmalloc(sizeof(typeref_t));
2856 t->name = name;
2857 t->ref = ref;
2858 t->uniq = ref ? 0 : 1;
2859 return t;
2860 }
2861
2862 static typeref_t *uniq_tref(typeref_t *ref)
2863 {
2864 typeref_t *t = ref;
2865 type_t *tp;
2866 if (t->uniq) return t;
2867 tp = make_type(0, t->ref);
2868 tp->name = t->name;
2869 t->name = NULL;
2870 t->ref = tp;
2871 t->uniq = 1;
2872 return t;
2873 }
2874
2875 static type_t *type_ref(typeref_t *ref)
2876 {
2877 type_t *t = ref->ref;
2878 if (ref->name) free(ref->name);
2879 free(ref);
2880 return t;
2881 }
2882
2883 static void set_type(var_t *v, typeref_t *ref, expr_t *arr)
2884 {
2885 v->type = ref->ref;
2886 v->tname = ref->name;
2887 ref->name = NULL;
2888 free(ref);
2889 v->array = arr;
2890 }
2891
2892 static ifref_t *make_ifref(type_t *iface)
2893 {
2894 ifref_t *l = xmalloc(sizeof(ifref_t));
2895 l->iface = iface;
2896 l->attrs = NULL;
2897 INIT_LINK(l);
2898 return l;
2899 }
2900
2901 static var_t *make_var(char *name)
2902 {
2903 var_t *v = xmalloc(sizeof(var_t));
2904 v->name = name;
2905 v->ptr_level = 0;
2906 v->type = NULL;
2907 v->tname = NULL;
2908 v->attrs = NULL;
2909 v->array = NULL;
2910 v->eval = NULL;
2911 v->lval = 0;
2912 INIT_LINK(v);
2913 return v;
2914 }
2915
2916 static func_t *make_func(var_t *def, var_t *args)
2917 {
2918 func_t *f = xmalloc(sizeof(func_t));
2919 f->def = def;
2920 f->args = args;
2921 f->ignore = parse_only;
2922 f->idx = -1;
2923 INIT_LINK(f);
2924 return f;
2925 }
2926
2927 static class_t *make_class(char *name)
2928 {
2929 class_t *c = xmalloc(sizeof(class_t));
2930 c->name = name;
2931 c->attrs = NULL;
2932 c->ifaces = NULL;
2933 INIT_LINK(c);
2934 return c;
2935 }
2936
2937 #define HASHMAX 64
2938
2939 static int hash_ident(const char *name)
2940 {
2941 const char *p = name;
2942 int sum = 0;
2943 /* a simple sum hash is probably good enough */
2944 while (*p) {
2945 sum += *p;
2946 p++;
2947 }
2948 return sum & (HASHMAX-1);
2949 }
2950
2951 /***** type repository *****/
2952
2953 struct rtype {
2954 char *name;
2955 type_t *type;
2956 int t;
2957 struct rtype *next;
2958 };
2959
2960 struct rtype *type_hash[HASHMAX];
2961
2962 static type_t *reg_type(type_t *type, char *name, int t)
2963 {
2964 struct rtype *nt;
2965 int hash;
2966 if (!name) {
2967 yyerror("registering named type without name\n");
2968 return type;
2969 }
2970 hash = hash_ident(name);
2971 nt = xmalloc(sizeof(struct rtype));
2972 nt->name = name;
2973 nt->type = type;
2974 nt->t = t;
2975 nt->next = type_hash[hash];
2976 type_hash[hash] = nt;
2977 return type;
2978 }
2979
2980 /* determine pointer type from attrs */
2981 static unsigned char get_pointer_type( type_t *type )
2982 {
2983 int t;
2984 if (is_attr( type->attrs, ATTR_STRING ))
2985 {
2986 type_t *t = type;
2987 while( t->type == 0 && t->ref )
2988 t = t->ref;
2989 switch( t->type )
2990 {
2991 case RPC_FC_CHAR:
2992 return RPC_FC_C_CSTRING;
2993 case RPC_FC_WCHAR:
2994 return RPC_FC_C_WSTRING;
2995 }
2996 }
2997 t = get_attrv( type->attrs, ATTR_POINTERTYPE );
2998 if (t) return t;
2999 return RPC_FC_FP;
3000 }
3001
3002 static type_t *reg_types(type_t *type, var_t *names, int t)
3003 {
3004 type_t *ptr = type;
3005 int ptrc = 0;
3006
3007 while (names) {
3008 var_t *next = NEXT_LINK(names);
3009 if (names->name) {
3010 type_t *cur = ptr;
3011 int cptr = names->ptr_level;
3012 if (cptr > ptrc) {
3013 while (cptr > ptrc) {
3014 int t = get_pointer_type( cur );
3015 cur = ptr = make_type(t, cur);
3016 ptrc++;
3017 }
3018 } else {
3019 while (cptr < ptrc) {
3020 cur = cur->ref;
3021 cptr++;
3022 }
3023 }
3024 reg_type(cur, names->name, t);
3025 }
3026 free(names);
3027 names = next;
3028 }
3029 return type;
3030 }
3031
3032 static type_t *find_type(char *name, int t)
3033 {
3034 struct rtype *cur = type_hash[hash_ident(name)];
3035 while (cur && (cur->t != t || strcmp(cur->name, name)))
3036 cur = cur->next;
3037 if (!cur) {
3038 yyerror("type %s not found\n", name);
3039 return NULL;
3040 }
3041 return cur->type;
3042 }
3043
3044 static type_t *find_type2(char *name, int t)
3045 {
3046 type_t *tp = find_type(name, t);
3047 free(name);
3048 return tp;
3049 }
3050
3051 int is_type(const char *name)
3052 {
3053 struct rtype *cur = type_hash[hash_ident(name)];
3054 while (cur && (cur->t || strcmp(cur->name, name)))
3055 cur = cur->next;
3056 if (cur) return TRUE;
3057 return FALSE;
3058 }
3059
3060 static type_t *get_type(unsigned char type, char *name, int t)
3061 {
3062 struct rtype *cur = NULL;
3063 type_t *tp;
3064 if (name) {
3065 cur = type_hash[hash_ident(name)];
3066 while (cur && (cur->t != t || strcmp(cur->name, name)))
3067 cur = cur->next;
3068 }
3069 if (cur) {
3070 free(name);
3071 return cur->type;
3072 }
3073 tp = make_type(type, NULL);
3074 tp->name = name;
3075 if (!name) return tp;
3076 return reg_type(tp, name, t);
3077 }
3078
3079 static type_t *get_typev(unsigned char type, var_t *name, int t)
3080 {
3081 char *sname = NULL;
3082 if (name) {
3083 sname = name->name;
3084 free(name);
3085 }
3086 return get_type(type, sname, t);
3087 }
3088
3089 static int get_struct_type(var_t *field)
3090 {
3091 int has_pointer = 0;
3092 int has_conformant_array = 0;
3093 int has_conformant_string = 0;
3094
3095 while (field)
3096 {
3097 type_t *t = field->type;
3098
3099 /* get the base type */
3100 while( (t->type == 0) && t->ref )
3101 t = t->ref;
3102
3103 switch (t->type)
3104 {
3105 /*
3106 * RPC_FC_BYTE, RPC_FC_STRUCT, etc
3107 * Simple types don't effect the type of struct.
3108 * A struct containing a simple struct is still a simple struct.
3109 * So long as we can block copy the data, we return RPC_FC_STRUCT.
3110 */
3111 case 0: /* void pointer */
3112 case RPC_FC_BYTE:
3113 case RPC_FC_CHAR:
3114 case RPC_FC_SMALL:
3115 case RPC_FC_USMALL:
3116 case RPC_FC_WCHAR:
3117 case RPC_FC_SHORT:
3118 case RPC_FC_USHORT:
3119 case RPC_FC_LONG:
3120 case RPC_FC_ULONG:
3121 case RPC_FC_INT3264:
3122 case RPC_FC_UINT3264:
3123 case RPC_FC_HYPER:
3124 case RPC_FC_FLOAT:
3125 case RPC_FC_DOUBLE:
3126 case RPC_FC_STRUCT:
3127 case RPC_FC_ENUM16:
3128 case RPC_FC_ENUM32:
3129 break;
3130
3131 case RPC_FC_UP:
3132 case RPC_FC_FP:
3133 has_pointer = 1;
3134 break;
3135 case RPC_FC_CARRAY:
3136 has_conformant_array = 1;
3137 break;
3138 case RPC_FC_C_CSTRING:
3139 case RPC_FC_C_WSTRING:
3140 has_conformant_string = 1;
3141 break;
3142
3143 /*
3144 * Propagate member attributes
3145 * a struct should be at least as complex as its member
3146 */
3147 case RPC_FC_CVSTRUCT:
3148 has_conformant_string = 1;
3149 has_pointer = 1;
3150 break;
3151
3152 case RPC_FC_CPSTRUCT:
3153 has_conformant_array = 1;
3154 has_pointer = 1;
3155 break;
3156
3157 case RPC_FC_CSTRUCT:
3158 has_conformant_array = 1;
3159 break;
3160
3161 case RPC_FC_PSTRUCT:
3162 has_pointer = 1;
3163 break;
3164
3165 default:
3166 fprintf(stderr,"Unknown struct member %s with type (0x%02x)\n",
3167 field->name, t->type);
3168 /* fallthru - treat it as complex */
3169
3170 /* as soon as we see one of these these members, it's bogus... */
3171 case RPC_FC_IP:
3172 case RPC_FC_ENCAPSULATED_UNION:
3173 case RPC_FC_NON_ENCAPSULATED_UNION:
3174 case RPC_FC_TRANSMIT_AS:
3175 case RPC_FC_REPRESENT_AS:
3176 case RPC_FC_PAD:
3177 case RPC_FC_EMBEDDED_COMPLEX:
3178 case RPC_FC_BOGUS_STRUCT:
3179 return RPC_FC_BOGUS_STRUCT;
3180 }
3181 field = NEXT_LINK(field);
3182 }
3183
3184 if( has_conformant_string && has_pointer )
3185 return RPC_FC_CVSTRUCT;
3186 if( has_conformant_array && has_pointer )
3187 return RPC_FC_CPSTRUCT;
3188 if( has_conformant_array )
3189 return RPC_FC_CSTRUCT;
3190 if( has_pointer )
3191 return RPC_FC_PSTRUCT;
3192 return RPC_FC_STRUCT;
3193 }
3194
3195 /***** constant repository *****/
3196
3197 struct rconst {
3198 char *name;
3199 var_t *var;
3200 struct rconst *next;
3201 };
3202
3203 struct rconst *const_hash[HASHMAX];
3204
3205 static var_t *reg_const(var_t *var)
3206 {
3207 struct rconst *nc;
3208 int hash;
3209 if (!var->name) {
3210 yyerror("registering constant without name\n");
3211 return var;
3212 }
3213 hash = hash_ident(var->name);
3214 nc = xmalloc(sizeof(struct rconst));
3215 nc->name = var->name;
3216 nc->var = var;
3217 nc->next = const_hash[hash];
3218 const_hash[hash] = nc;
3219 return var;
3220 }
3221
3222 static var_t *find_const(char *name, int f)
3223 {
3224 struct rconst *cur = const_hash[hash_ident(name)];
3225 while (cur && strcmp(cur->name, name))
3226 cur = cur->next;
3227 if (!cur) {
3228 if (f) yyerror("constant %s not found\n", name);
3229 return NULL;
3230 }
3231 return cur->var;
3232 }